This project demonstrates object detection using YOLOv5. The model is trained on a custom dataset and can detect objects in new images. YOLOv5 is a state-of-the-art object detection model known for its speed and accuracy, making it suitable for real-time applications.
You can use any dataset that follows the YOLO format. For this project, we assume the dataset is organized as follows:
You can download a sample dataset from Roboflow's Public Object Detection Datasets. Extract the dataset into the data/
directory.
YOLOv5 is a convolutional neural network (CNN) designed for object detection. It divides the image into a grid and predicts bounding boxes and class probabilities for each grid cell.
-
Clone the repository:
git clone https://github.com/SreeEswaran/Object-Detection-YOLOv5.git cd Object-Detection-YOLOv5
-
Install the required dependencies:
pip install -r requirements.txt
-
Download and preprocess the dataset as described above.
To train the model, run:
python scripts/train.py --config config.yaml
python scripts/evaluate.py --config config.yaml
python scripts/infer.py --image_path path/to/your/image.jpg --model_path models/yolov5_model.pth