This repository provides Python programs and instructions to create a custom object detection model using YOLOv5,
a popular deep learning framework for real-time object detection. The model can be trained on your own dataset and
used to detect and localize objects of interest in images or videos. The programs included here will help you
in the following tasks:
1. Dataset Creation: Use the dataset_creation.py program to create a custom dataset for training your object detection
model. The program allows you to capture images from a camera, annotate the objects of interest, and save the
dataset in the required format for YOLOv5.
1. Model Training: Train the YOLOv5 model on the custom dataset using the training_dataset.py program. This program
will take care of configuring the model architecture, loading the dataset, setting hyperparameters, and saving the
trained model weights.
3. Object Detection: Utilize the detection.py program to perform object detection on images or videos
using the trained model. The program takes an input image or video file, applies the object detection algorithm, and
displays the results with bounding boxes and labels around the detected objects.
Before Using These Programs, Ensure That You Have The Following Prerequisites Installed :
- Python 3.6 or later
- PyTorch 1.7 or later
- OpenCV
- Clone this repository to your local machine.
- Install the required dependencied by running
pip install -r requirements.txtin your terminal or command prompt - Run the
dataset_creation.pyprogram and select the Region Of Interest where the object is. - Start the training process by running the
dataset_training.pyprogram. Monitor the training progress and save the trained weights oncce the desired performance is achieved. - To perform object detection on new images or videos, use the
detection.pyprogram. Provide path to the weight made by thedataset_training.py
Feel Free to modify and adapt these programs according to your specific requirements
Contributions to this repository are welcome! If you encounter any issues or have suggestions for improvements, please submit an issue or create a pull request. Your feedback and contributions will help make this project better for everyone.
I would like to express our gratitude to the creators and contributors of the YOLOv5 project for their remarkable work, which served as the foundation for this custom object detection solution.
- YOLOv5 GitHub repository: https://github.com/ultralytics/yolov5
- YOLOv5 Documentation: https://ultralytics.com/yolov5
If there any known bugs found or run into any issues please let me know. Please enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Email: midlaj4n@gmail.com Thank you!