in this video, We will learn how to train a horse race classes , even though we do not have a dataset. . The pipeline includes video frame extraction, object detection model training, and displaying the results with bounding boxes and labels. Here’s an overview of what each part of the code does:
1. **Frame Extraction from Video**: The first part of the code extracts frames from a horse race video at regular intervals. These frames are saved as images to be used later for training and testing the YOLOv8 model. OpenCV and Supervision libraries are used to handle video frame extraction.
2. **Image Grid Visualization**: This section of the code helps visualize a sample grid of images that were extracted. The images are arranged in a grid layout, and titles are displayed for easy identification. This helps the user visually inspect the quality of the extracted frames.
3. **Automatic Annotations with GroundingDINO and Autodistill**: The third part automates the annotation process using GroundingDINO from the Autodistill library. It labels the images by detecting objects such as "horse" and "horse race" based on the defined ontology. The annotations are stored in YOLO format to be used for training the model.
4. **Visualizing Annotations**: The next section of the code displays random images from the dataset along with their annotations (bounding boxes). The YOLO format annotations are converted into pixel coordinates, and bounding boxes are drawn on the images, providing a visual representation of the labeled data.
5. **Training the YOLOv8 Model**: This part of the code loads a YOLOv8 model and trains it on the annotated horse race images. The model is configured using a data.yaml file that defines the dataset paths and classes. Training is performed over multiple epochs with the results and checkpoints saved to a specified directory.
6. **Running Object Detection on a Video**: Finally, the code loads the trained YOLOv8 model and applies it to a test video. The model performs object detection on each frame of the video, drawing bounding boxes and labels around detected objects. The processed video is displayed in real-time, allowing the user to see the model’s predictions.
Overall, this code demonstrates the full process of building an object detection model using YOLOv8, from data preparation to model training and testing on new video data. It leverages powerful tools like Supervision, GroundingDINO, and Autodistill to automate and streamline the workflow.
Link for the full post : https://eranfeit.net/automatic-image-...
Code for the tutorial : https://eranfeit.lemonsqueezy.com/buy... or here : https://ko-fi.com/s/553a125fa6
Link for the videos and the model weights : https://ko-fi.com/s/6582caa90f
Link for Medium users : / automatic-image-annotation-with-autodistil...
You can find more computer vision tutorials in my blog page : https://eranfeit.net/blog/
You can find more projects and tutorials in this playlist : • Best Object Detection models
~~~~~~~~~~~~~~~ recommended courses and books ~~~~~~~~~~~~~~~
🚀 Want to get started with Computer Vision or take your skills to the next level ?
If you’re just beginning, I recommend this step-by-step course designed to introduce you to the foundations of Computer Vision : https://trk.udemy.com/9LoE7E
If you’re already experienced and looking for more advanced techniques, check out this deep-dive course : https://trk.udemy.com/EEDyMD
I also recommend this book, https://amzn.to/44GnlLW : "Make Your Own Neural Network - An In-depth Visual Introduction For Beginners ".
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
☕ Buy me a coffee - https://ko-fi.com/eranfeit
🖥️ Email : [email protected]
🌐 https://eranfeit.net
🤝 Fiverr : https://www.fiverr.com/s/mB3Pbb
🐦 Twitter - / eran_feit
📸 Instagram - / eran_feit
▶️ Subscribe - / @eranfeit
🐙 Facebook - / 3080601358933585
📝 Medium - / feitgemel
~~~~~~~~~~~~~~ SUPPORT ME 🙏~~~~~~~~~~~~~~
🅿 Patreon - / eranfeit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:00 Introduction & Demo
02:15 Installation
04:42 Generate the dataset
12:30 Automatic dataset annotation
31:03 Train a model
39:46 Test the mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#EranFeit #objectdetection #yolo
~~~~~~~~~~~~~~ Credits ~~~~~~~~~~~~~
Music by Vincent Rubinetti
Download the music on Bandcamp: https://vincerubinetti.bandcamp.com/a...
Stream the music on Spotify: https://open.spotify.com/album/1dVyjw...