|
| 1 | +# Lab 1: Understand YOLOv5 |
| 2 | + |
| 3 | +Estimated Time: 10 minutes |
| 4 | + |
| 5 | +## Overview - What is YOLOv5? |
| 6 | + |
| 7 | +In this lab, I want you to grasp how [YOLOv5](https://github.com/ultralytics/yolov5), a specific Transfer Learning Model, and a Computer Vision framework, can help us solve the problem of trying to detect correct / incorrect mask placement in images. |
| 8 | + |
| 9 | + |
| 10 | +YOLO (You Only Look Once) is a popular real-time object detection system developed by Joseph Redmon and Ali Farhadi. It's one of the latest versions of the YOLO system and was released in 2021. |
| 11 | + |
| 12 | +Like other versions of YOLO, [YOLOv5](https://github.com/ultralytics/yolov5) is designed for fast, accurate, **real-time** object detection. It uses a _single_ convolutional neural network (CNN) to predict bounding boxes and class probabilities for objects in an image or video. The model is trained to predict the locations of objects in an input image and assign them to predefined categories, such as "car," "person," or "building." |
| 13 | + |
| 14 | +In my personal experience -- and even though YOLOv5 isn't the newest detection system -- it's the one with the *lowest open issue to closed issue ratio*, which means that, for each open issue, more than 25 issues have already been closed. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +YOLOv5 improves upon previous versions by using more efficient network architectures and optimization techniques, resulting in faster and more accurate object detection. It also includes the ability to run on lower-power devices. |
| 19 | + |
| 20 | + |
| 21 | +> **Note**: this is a figure detailing the performance and accuracy of YOLOv5 compared to EfficientDet, and the [different variations of YOLOv5](https://github.com/ultralytics/yolov5#why-yolov5) (these are different checkpoints). |
| 22 | +
|
| 23 | +YOLOv5 has been widely adopted and is used in a variety of applications, including self-driving cars, robotics, and security systems, which is why I decided to start with this detection system rather than any others. |
| 24 | + |
| 25 | +And you may ask yourself: "why YOLOv5 and not others?" Well, I compared YOLOv5 to YOLOv7, which was developed during this year (2022) and is more recent than YOLOv5. However, it currently has an open/closed issue ratio of [3.59](https://github.com/WongKinYiu/yolov7/issues), *87 times higher than YOLOv5*!. Therefore, I recommend YOLOv5 for getting started, as it's complete and the open-source community is more on top of this project. |
| 26 | +> **Note**: YOLOv8 was released very recently and I'm personally planning on making the switch between YOLOv5 and YOLOv8 in the upcoming months. Code is very similar, at least from the programmer's perspective, so making the change is something you can even do in this project if you're interested. |
| 27 | +
|
| 28 | +## Task 1: Why Custom Models? |
| 29 | + |
| 30 | +Custom-detection machine learning (ML) models can provide numerous benefits in various applications. |
| 31 | + |
| 32 | +- One major benefit is **increased accuracy and performance** when we compare these models to **general** models. Custom detection models are tailored specifically to the task and data at hand, allowing them to learn and adapt to the specific characteristics and patterns in the data. This can lead to higher accuracy and better performance than the previously-mentioned general models, which are not as tailored to the task. |
| 33 | +- Also, a custom detection model will require a smaller number of resources to **train** it, as well as when making predictions with the model once it's been trained. |
| 34 | +- Finally, there isn't a general-purpose model that's previously been trained to detect mask placement, so we have no other choice than to go with the custom model. |
| 35 | + |
| 36 | +Here's an example of the final result of this workshop being run against my web camera feed. Since there are no pre-trained models that predict correct mask placement, achieving this isn't possible if we don't create a **custom model**: |
| 37 | + |
| 38 | + |
| 39 | +So, now that we understand the **need** to create a custom YOLOv5 model, let's get straight into it. |
| 40 | + |
| 41 | +You may now [proceed to the next lab](#next). |
| 42 | + |
| 43 | + |
| 44 | +## Acknowledgements |
| 45 | + |
| 46 | +* **Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel |
| 47 | +* **Last Updated By/Date** - February 28th, 2023 |
0 commit comments