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.
Code for the tutorial : [ Ссылка ]
Link for the videos and the model weights : [ Ссылка ]
You can find more computer vision tutorials in my blog page : [ Ссылка ]
You can find more projects and tutorials in this playlist : [ Ссылка ]
~~~~~~~~~~~~~~~ recommended courses and books ~~~~~~~~~~~~~~~
A perfect course for learning modern Computer Vision with deep dive in TensorFlow , Keras and Pytorch . You can find it here : [ Ссылка ]
I also recommend this book, [ Ссылка ] : "Make Your Own Neural Network - An In-depth Visual Introduction For Beginners ".
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
☕ Buy me a coffee - [ Ссылка ]
🖥️ Email : feitgemel@gmail.com
🌐 [ Ссылка ]
🤝 Fiverr : [ Ссылка ]
🐦 Twitter - [ Ссылка ]
📸 Instagram - [ Ссылка ]
▶️ Subscribe - youtube.com/@eranfeit?sub_confirmation=1
🐙 Facebook - [ Ссылка ]
📝 Medium - [ Ссылка ]
~~~~~~~~~~~~~~ SUPPORT ME 🙏~~~~~~~~~~~~~~
🅿 Patreon - [ Ссылка ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: [ Ссылка ]
Stream the music on Spotify: [ Ссылка ]
Ещё видео!