{"id":33269,"date":"2020-06-03T20:34:27","date_gmt":"2020-06-03T12:34:27","guid":{"rendered":"\/blog\/?p=33269"},"modified":"2020-06-28T10:10:13","modified_gmt":"2020-06-28T02:10:13","slug":"accelerate-yolov4-real-time-object-detection-on-jetson-nano","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/","title":{"rendered":"Improve YOLOv4 real time object detection on Jetson Nano"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1030\" height=\"674\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png\" alt=\"\" class=\"wp-image-33317\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-8-300x196.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-8-768x502.png 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-8-1024x670.png 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-8.png 1099w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><\/figure>\n\n\n\n<p>YOLOv4 was released at the end of April. It soon gained popularity among the machine learning community. You can check it out with following link.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>YOLO v4 essay\uff1a<a href=\"https:\/\/arxiv.org\/abs\/2004.10934\">https:\/\/arxiv.org\/abs\/2004.10934<\/a><\/li><li>YOLO v4 code\uff1a<a href=\"https:\/\/github.com\/AlexeyAB\/darknet\">https:\/\/github.com\/AlexeyAB\/darknet<\/a><\/li><\/ul>\n\n\n\n<p>Compared with YOLOv3, YOLOv4&#8217;s AP has increased by 10%, while its FPS has increased by 12%. But can Jetson Nano handle YOLOv4? If you have tried YOLOv3 (darknet version) on Jetson Nano to perform real-time object detection, especially using the darknet version, you know what I&#8217;m saying. Usually, Jetson can only run the detection at around 1 FPS. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"731\" height=\"429\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-9.png\" alt=\"\" class=\"wp-image-33318\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-9.png 731w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-9-300x176.png 300w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><figcaption>YOLOv3 Performance (darknet version)<\/figcaption><\/figure>\n\n\n\n<p>But with YOLOv4, Jetson Nano can run detection at more than 2 FPS. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1030\" height=\"353\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-10-1030x353.png\" alt=\"\" class=\"wp-image-33319\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-10-1030x353.png 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-10-300x103.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-10-768x263.png 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-10-1024x351.png 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-10.png 1193w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><figcaption>YOLOv4 Performace (darknet version)<\/figcaption><\/figure>\n\n\n\n<p>Although YOLOv4 runs 167 layers of neural network, which is about 50% more than YOLOv3, 2 FPS is still too low. Now let&#8217;s try to accelerate it with PyTorch.<\/p>\n\n\n\n<p>Run the following command<\/p>\n\n\n\n<div style=\"background: #f8f8f8;overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em\"><table><tbody><tr><td><pre style=\"margin: 0;line-height: 125%\">1\n2\n3\n4\n5<\/pre><\/td><td><pre style=\"margin: 0;line-height: 125%\">git clone https:\/\/github.com\/ultralytics\/yolov3 <span style=\"color: #666666\">&amp;&amp;<\/span> <span style=\"color: #AA22FF\">cd <\/span>yolov3\n<span style=\"color: #008800;font-style: italic\">#down load yolov4 pre-trained weights<\/span>\nwget https:\/\/github.com\/AlexeyAB\/darknet\/releases\/download\/darknet_yolo_v3_optimal\/yolov4.weights\n<span style=\"color: #008800;font-style: italic\">#convert darknet cfg\/weights to pytorch model<\/span>\npython3  -c <span style=\"color: #BB4444\">\"from models import *; convert('cfg\/yolov4.cfg', 'yolov4.weights')\"<\/span>\n<\/pre><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>When success, you can run the YOLOv4 PyTorch model by using the following command<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f8f8f8;overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em\"><table><tr><td><pre style=\"margin: 0;line-height: 125%\">1<\/pre><\/td><td><pre style=\"margin: 0;line-height: 125%\">python3 detect.py --cfg cfg\/yolov4.cfg --weights weights\/yolov4.pt --source 0\n<\/pre><\/td><\/tr><\/table><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1030\" height=\"579\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-12-1030x579.png\" alt=\"\" class=\"wp-image-33342\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12-1030x579.png 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12-300x169.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12-768x432.png 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12-1536x864.png 1536w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12-1024x576.png 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-12.png 1920w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><figcaption>YOLOv4 Performance<\/figcaption><\/figure>\n\n\n\n<p>Although the accuracy has been improved, FPS is still not satisfying. But fortunately, YOLOv5 is now available. For more information about YOLOv5, please check my next blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>YOLOv4 was released at the end of April. It soon gained popularity among the machine<\/p>\n","protected":false},"author":3485,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[1340,2249,1608],"class_list":["post-33269","post","type-post","status-publish","format-standard","hentry","category-news","tag-jetson-nano","tag-jetson-nano-ai","tag-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"YOLOv4 was released at the end of April. It soon gained popularity among the machine\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-03T12:34:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-28T02:10:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png\" \/>\n<meta name=\"author\" content=\"ericyu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ericyu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/\",\"name\":\"Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png\",\"datePublished\":\"2020-06-03T12:34:27+00:00\",\"dateModified\":\"2020-06-28T02:10:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c1f0264a6ad9ba995b2367e06fd70ec9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage\",\"url\":\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png\",\"contentUrl\":\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improve YOLOv4 real time object detection on Jetson Nano\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c1f0264a6ad9ba995b2367e06fd70ec9\",\"name\":\"ericyu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eb22f677db332dc286108258a6b7f324?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eb22f677db332dc286108258a6b7f324?s=96&r=g\",\"caption\":\"ericyu\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/ericyu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/","og_locale":"en_US","og_type":"article","og_title":"Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio","og_description":"YOLOv4 was released at the end of April. It soon gained popularity among the machine","og_url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2020-06-03T12:34:27+00:00","article_modified_time":"2020-06-28T02:10:13+00:00","og_image":[{"url":"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png","type":"","width":"","height":""}],"author":"ericyu","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ericyu","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/","url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/","name":"Improve YOLOv4 real time object detection on Jetson Nano - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png","datePublished":"2020-06-03T12:34:27+00:00","dateModified":"2020-06-28T02:10:13+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c1f0264a6ad9ba995b2367e06fd70ec9"},"breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#primaryimage","url":"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png","contentUrl":"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-8-1030x674.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/03\/accelerate-yolov4-real-time-object-detection-on-jetson-nano\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Improve YOLOv4 real time object detection on Jetson Nano"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c1f0264a6ad9ba995b2367e06fd70ec9","name":"ericyu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eb22f677db332dc286108258a6b7f324?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eb22f677db332dc286108258a6b7f324?s=96&r=g","caption":"ericyu"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/ericyu\/"}]}},"modified_by":"ericyu","views":24780,"featured_image_urls":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":"","visody_icon":"","magazine-7-slider-full":"","magazine-7-slider-center":"","magazine-7-featured":"","magazine-7-medium":"","magazine-7-medium-square":""},"author_info":{"display_name":"ericyu","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/ericyu\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"3","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/3485"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=33269"}],"version-history":[{"count":4,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33269\/revisions"}],"predecessor-version":[{"id":34179,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33269\/revisions\/34179"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=33269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=33269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=33269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}