{"id":420,"date":"2018-08-31T01:22:00","date_gmt":"2018-08-31T01:22:00","guid":{"rendered":"https:\/\/khanhcode.com\/?p=420"},"modified":"2020-12-20T01:37:05","modified_gmt":"2020-12-20T01:37:05","slug":"multiple-cards-9-a-object-detection-with-tensorflow-gpu","status":"publish","type":"post","link":"https:\/\/khanhcode.com\/?p=420","title":{"rendered":"Multiple Cards 9-A Object Detection with TensorFlow (GPU)"},"content":{"rendered":"\n<p><strong>Project Link:<\/strong> <a href=\"https:\/\/github.com\/Insignite\/TensorFlow-Object-Detection-API\" data-type=\"URL\" data-id=\"https:\/\/github.com\/Insignite\/TensorFlow-Object-Detection-API\">https:\/\/github.com\/Insignite\/TensorFlow-Object-Detection-API<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>This repository is a personal project aiming to understand and learn TensorFlow&#8217;s Object Detection API by training an object detection classifier for multiple objects detection on Windows (This was test on Windows 10). The repository contain both project code for card detection under &#8220;.\/workspace\/training_demo\/&#8221; directory and the entire TensorFlow Object Detection API. Beause card dataset was used in the training process, the frozen tensor graph will only detect card that similar in the dataset. However, you can import your own dataset and retrain the SSD_Inception_v2 model to recognize whatever your dataset contained.<\/p>\n\n\n\n<p>Througout the tutorial, I have a lot of trouble getting environment variable path right in order for TensorFlow to run. Here are some datapath that might fix the problem (not include the required CUDA path):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>N:\\TensorFlow\\models\\research\\object_detection\nN:\\TensorFlow\\models\\research\\object_detection\\utils\nN:\\TensorFlow\\models\\research\\slim\nN:\\TensorFlow\\models\\research\\slim\\datasets\nN:\\TensorFlow\\models\\research\\slim\\deployment\nN:\\TensorFlow\\models\\research\\slim\\nets\nN:\\TensorFlow\\models\\research\\slim\\preprocessing\nN:\\TensorFlow\\models\\research\\slim\\scripts\nC:\\Program Files\\Google Protobuf\\bin\n\n<\/code><\/pre>\n\n\n\n<p><strong>Dataset and project idea credit to:<\/strong>&nbsp;<a href=\"https:\/\/github.com\/EdjeElectronics\/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10\"><em>EdjeElectronics<\/em><\/a><\/p>\n\n\n\n<p><strong>Step by step tutorial that I follow:<\/strong>\u00a0<a href=\"https:\/\/tensorflow-object-detection-api-tutorial.readthedocs.io\/en\/latest\/\"><em>TensorFlow Object Detection API tutorial<\/em><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Result<\/strong><\/h2>\n\n\n\n<p>This is the final result achieving after 35,000 steps and takes roughly 13 hours to train. SSD models has decent speed recognition but the trade-off is accuracy. The model has an easy time recognize 9, 10, A, and Jack, as the result below shows. It clearly shows that the model doesn&#8217;t have low enough loss to define between Jack, Queen, and king even with 35,000 steps.\u00a0<em>Real-time recognition<\/em>\u00a0is also available by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(Activate tensorflow_gpu if you has yet to do so and nagivate to __.\\workspace\\training_demo__ folder)\npython webcamDetection.py<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Image Detection<\/strong><a href=\"https:\/\/github.com\/Insignite\/TensorFlow-Object-Detection-API#result\"><\/a><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/raw.githubusercontent.com\/Insignite\/TensorFlow-Object-Detection-API\/master\/workspace\/training_demo\/resultDisplay\/pictureDetectionResult.PNG?ssl=1\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Video Detection<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"600\" height=\"338\" src=\"https:\/\/i0.wp.com\/khanhcode.com\/wp-content\/uploads\/2020\/12\/VideoDetectionGIF.gif?resize=600%2C338&#038;ssl=1\" alt=\"\" class=\"wp-image-422\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Project Link: https:\/\/github.com\/Insignite\/TensorFlow-Object-Detection-API Summary This repository is a personal project aiming to understand and learn TensorFlow&#8217;s Object Detection API by training an object detection classifier for multiple objects detection on Windows (This was test on Windows 10). The repository contain both project code for card detection under &#8220;.\/workspace\/training_demo\/&#8221; directory and the entire TensorFlow Object Detection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":421,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-420","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/khanhcode.com\/wp-content\/uploads\/2020\/12\/pictureDetectionResult.png?fit=1008%2C792&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/posts\/420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/khanhcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=420"}],"version-history":[{"count":1,"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/posts\/420\/revisions"}],"predecessor-version":[{"id":423,"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/posts\/420\/revisions\/423"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/khanhcode.com\/index.php?rest_route=\/wp\/v2\/media\/421"}],"wp:attachment":[{"href":"https:\/\/khanhcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/khanhcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/khanhcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}