{"id":150,"date":"2021-12-12T10:56:19","date_gmt":"2021-12-12T07:26:19","guid":{"rendered":"https:\/\/haghiri75.com\/en\/?p=150"},"modified":"2021-12-12T10:56:19","modified_gmt":"2021-12-12T07:26:19","slug":"why-i-love-yolov5","status":"publish","type":"post","link":"https:\/\/haghiri75.com\/en\/why-i-love-yolov5\/","title":{"rendered":"Why I love YOLOv5?"},"content":{"rendered":"<p>I am a big fan of Nicholas Renotte&#8217;s channel on YouTube. I also love computer vision and its combination with deep learning. A few months ago, Nicholas posted <a href=\"https:\/\/www.youtube.com\/watch?v=tFNJGim3FXw\">this video<\/a>, which is about YOLOv5. I usually am too lazy to watch videos which are longer than 15 minutes and I watch them in a few episodes. But this video made me sit behind the laptop screen for over an hour and I&#8217;m sure I won&#8217;t regret it.<\/p>\n<p>So let&#8217;s start the article and see where this story begins. As I mentioned earlier, I love computer vision specially when it&#8217;s combined with deep learning. I believe it can help us solve very complex problems of our projects with ease. My journey in world of these <em>YOLO<\/em> models have started almost a year ago, when I wanted to develop a simple object detection for detecting street signs.<\/p>\n<p>Firstly, I found a lot of tutorials on <a href=\"https:\/\/github.com\/pjreddie\/darknet\">darknet<\/a> based training but l did not manage to get it to the work, specially since I have a mac, it could be a very realistic nightmare. So I guess YOLOv5 was a miracle. In this article, I am going to explain why I love YOLOv5 and why I prefer it to other YOLO versions.<\/p>\n<p><img data-attachment-id=\"151\" data-permalink=\"https:\/\/haghiri75.com\/en\/why-i-love-yolov5\/splash\/\" data-orig-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash.jpg\" data-orig-size=\"2480,1640\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"Why I love YOLOv5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-300x198.jpg\" data-large-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-1024x677.jpg\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-151\" src=\"http:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-1024x677.jpg\" alt=\"\" width=\"525\" height=\"347\" srcset=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-1024x677.jpg 1024w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-300x198.jpg 300w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-768x508.jpg 768w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-1536x1016.jpg 1536w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/splash-2048x1354.jpg 2048w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/p>\n<h2>What is YOLOv5?<\/h2>\n<p>According to <a href=\"https:\/\/github.com\/ultralytics\/yolov5\">their github repository<\/a>, YOLOv5 is a family of deep learning models which is essentially trained on Microsoft&#8217;s <a href=\"https:\/\/cocodataset.org\/\">COCO dataset<\/a>. This makes it a very very general-purpose object detection tool which is fine for basic research and fun projects.<\/p>\n<p>But I also needed to have my own models because I wanted to develop some domain-specific object detection software. So I realized they also provide a python script which helps you fine-tune and train your own version of YOLOv5.<\/p>\n<p>So I basically fell in love with this new thing I have discovered. In the next sections, I will explain why I love YOLOv5!<\/p>\n<p><img data-attachment-id=\"154\" data-permalink=\"https:\/\/haghiri75.com\/en\/why-i-love-yolov5\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83\/\" data-orig-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83.png\" data-orig-size=\"1280,720\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Why I love YOLOv5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-300x169.png\" data-large-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-1024x576.png\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-154\" src=\"http:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-1024x576.png\" alt=\"\" width=\"525\" height=\"295\" srcset=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-1024x576.png 1024w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-300x169.png 300w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83-768x432.png 768w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/114868289-08cb7800-9df6-11eb-85ca-58545cf45a83.png 1280w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/p>\n<h2>Why I love YOLOv5?<\/h2>\n<p>Firstly, I invite you to see this chart, which shows the comparison of YOLOv5 with other commonly used object detection models:<\/p>\n<p><img data-attachment-id=\"155\" data-permalink=\"https:\/\/haghiri75.com\/en\/why-i-love-yolov5\/image-54\/\" data-orig-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54.png\" data-orig-size=\"597,368\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Why I love YOLOv5?\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54-300x185.png\" data-large-file=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54.png\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-155\" src=\"http:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54.png\" alt=\"\" width=\"597\" height=\"368\" srcset=\"https:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54.png 597w, https:\/\/haghiri75.com\/en\/wp-content\/uploads\/image-54-300x185.png 300w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><\/p>\n<p>And since there&#8217;s been a controversy about YOLOv5 claims about training time, inference time, model storage size, etc. I highly recommend you read <a href=\"https:\/\/blog.roboflow.com\/yolov4-versus-yolov5\/\">this article<\/a> on Roboflow&#8217;s blog.<\/p>\n<p>So we can conclude the very first thing which made me happy is the speed and that&#8217;s right. The second thing by the way is the fact I am lazy. Yes, I am lazy and I know it.<\/p>\n<p>I always tried to compile darknet and use it for having a YOLOv4 model and make my projects on top of YOLOv4 but when I saw how hard it can get and since I have a mac and I didn&#8217;t really want to fire-up an old computer for these projects, I was looking for something which does everything with a bunch of python scripts.<\/p>\n<p>Since I discovered the YOLOv5, I started working with it and the very first project I have done was this <em>pedestrian detection<\/em> for a <em>self-driving car<\/em>.<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/ywvD5Xu6vo0\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Then, I started doing a lot of research and asking about what I can do with YOLOv5. I find out I can do pretty much anything I want with ease as they provided a lot of stuff themselves. Isn&#8217;t that good enough? Fine. Let me show you another youtube video of mine which I solved my <em>crop<\/em> problem with their internal functions.<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/50R0BY7rE5w\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>If you&#8217;re not convinced yet, I have to tell you there is a great method which is called <em>pandas<\/em> in this family of models.<\/p>\n<p>As the name tells us, it really outputs a pandas dataframe which you can easily use data from that dataframe. Let me set a better example for you. Considering we want to find out which plants are afflicted and which ones are not in a drone footage.<\/p>\n<p>By using this method, we can simply make an algorithm which counts the amount of afflicted ones in a single frame, so we can easily find out how many afflicted plants we have in a certain area. The whole point here is that we have statistically right data for most of our researches.<\/p>\n<p>The other example would be the same as my pedestrian detection system. We can command the car to get data first from the cameras to make sure we&#8217;re dealing with pedestrians and second get data from distance measurement system (which can be an Ultrasonic or LiDAR) to make sure when it should send braking command.<\/p>\n<h2>Conclusion<\/h2>\n<p>Let&#8217;s make a conclusion on the whole article. I love YOLOv5 because it made life easier for me, as a computer vision enthusiast. It provided the tools I wanted and honestly, I am really thankful to <a href=\"https:\/\/github.com\/ultralytics\">Ultralytics<\/a> for this great opportunity they have provided for us.<\/p>\n<p>In general I always prefer easy-to-use tools and YOLOv5 was this for me. I need to focus on the goal I have instead of making a whole object detection algorithm or model from scratch.<\/p>\n<p>I finally can conclude that having a fast, easy-to-use and all-python tool for object detection was what I was always seeking and YOLOv5 was my answer.<\/p>\n<p>I am glad to have you as a reader on my blog and I have to say thank you for the time you&#8217;ve spent on my blog reading this article. Stay safe!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am a big fan of Nicholas Renotte&#8217;s channel on YouTube. I also love computer vision and its combination with deep learning. A few months ago, Nicholas posted this video, which is about YOLOv5. I usually am too lazy to watch videos which are longer than 15 minutes and I watch them in a few &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/haghiri75.com\/en\/why-i-love-yolov5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Why I love YOLOv5?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[2],"tags":[11,52,22,6,5,12,53,25,40,54,55,56,49],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8BkKn-2q","jetpack-related-posts":[{"id":161,"url":"https:\/\/haghiri75.com\/en\/analyzing-components-of-an-electric-circuit-with-yolov5\/","url_meta":{"origin":150,"position":0},"title":"Analyzing components of an electric circuit with YOLOv5","author":"prp-e","date":"January 14, 2022","format":false,"excerpt":"In past recent weeks, I did a lot with YOLOv5. A few weeks prior to this article, I wrote an article on why I love YOLOv5 and later, I did a project with YOLOv5 which was somehow a try for making something like symbolab or similar software. I explained that\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"Electric Circuit component analysis using YOLOv5","src":"https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/Screen-Shot-2022-01-13-at-1.05.41-AM-1024x583.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/Screen-Shot-2022-01-13-at-1.05.41-AM-1024x583.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/Screen-Shot-2022-01-13-at-1.05.41-AM-1024x583.png?resize=525%2C300 1.5x"},"classes":[]},{"id":97,"url":"https:\/\/haghiri75.com\/en\/how-to-be-a-hardware-engineer\/","url_meta":{"origin":150,"position":1},"title":"How to be a hardware engineer","author":"prp-e","date":"October 4, 2017","format":false,"excerpt":"A computer, is made up of hardware and software. Lots of people like to write and develop software, so the internet is full of topics like \"How to be a software engineer\" or \"how to write a computer program\" and also, there is a lot of great and free tutorials\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16,"url":"https:\/\/haghiri75.com\/en\/microcontrollers-design-and-implementation-released\/","url_meta":{"origin":150,"position":2},"title":"Microcontrollers, Design and Implementation released!","author":"prp-e","date":"April 4, 2017","format":false,"excerpt":"It was about two years I started serious study on computer architecture. In these years, I learned a lot and I could simulate and implement a microprocessor, similar to real ones. In Summer 2016, I decided to share my experience with others. Then, I started writing this book. This book\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":86,"url":"https:\/\/haghiri75.com\/en\/importance-of-iot\/","url_meta":{"origin":150,"position":3},"title":"Importance of IoT","author":"prp-e","date":"August 23, 2017","format":false,"excerpt":"For the last 25 years, a ghost is flying over our world, it's the ghost of \"Internet\". From 80's, internet became one of the most used tools for international communications, such as knowledge sharing. So, a lot of people started using internet to share knowledge, to do research or even\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29,"url":"https:\/\/haghiri75.com\/en\/how-to-make-a-computer-program\/","url_meta":{"origin":150,"position":4},"title":"How to make a computer program","author":"prp-e","date":"April 12, 2017","format":false,"excerpt":"This is a clich\u00e9 in IT and computer related blogs. You can find at least one topic on How to make a computer program in every blog written by a computer expert (scientist, engineer or experimental expert). So, I also decided to write about it. In this topic, I'm going\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":202,"url":"https:\/\/haghiri75.com\/en\/severus-does-the-magic\/","url_meta":{"origin":150,"position":5},"title":"Severus does the magic","author":"prp-e","date":"September 11, 2022","format":false,"excerpt":"It is not too long after I told you that I was too cheap to pay $10 a month for github copilot and I came up with the idea for Severus, my own AI pair programmer. It was something that went boom. My blog usually doesn't have more than 20\u2026","rel":"","context":"In &quot;Computer Architecture &amp; Programming&quot;","block_context":{"text":"Computer Architecture &amp; Programming","link":"https:\/\/haghiri75.com\/en\/category\/computer\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/warforged_wizard_by_captdiablo_de2mwm8-pre-1024x724.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/warforged_wizard_by_captdiablo_de2mwm8-pre-1024x724.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/haghiri75.com\/en\/wp-content\/uploads\/warforged_wizard_by_captdiablo_de2mwm8-pre-1024x724.jpg?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/posts\/150"}],"collection":[{"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":5,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/posts\/150\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haghiri75.com\/en\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}