This project implements real-time object detection using YOLOv5 (You Only Look Once version 5). The model detects multiple objects in an image or video stream with high accuracy and speed.
The project was developed as part of an AI/ML internship, where the goal was to build an efficient real-time detection system using deep learning techniques.
- Real-time object detection from webcam or video feed.
- YOLOv5 pre-trained models for high-speed, accurate detection.
- Supports multiple classes (e.g., persons, vehicles, animals, objects).
- Integration with OpenCV for video processing.
- Custom dataset training (optional) for specific object detection.
git clone https://github.com/your-username/real-time-object-detection.git
cd real-time-object-detectionMake sure Python is installed, then install the required libraries:
pip install torch torchvision opencv-python numpy matplotlibgit clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txtpython detect.py --source image.jpg --weights yolov5s.pt --conf 0.5python detect.py --source 0 --weights yolov5s.pt --conf 0.5(0 represents the default webcam, change to video path for custom input.)
If you want to train YOLOv5 on a custom dataset:
python train.py --img 640 --batch 16 --epochs 50 --data custom_data.yaml --weights yolov5s.pt- The model can detect and classify objects in real-time.
- Performance depends on the hardware (GPU recommended).
- Custom datasets can improve detection for specific use cases.
- YOLOv5 GitHub Repository: Ultralytics YOLOv5
- YOLOv5 Documentation: Ultralytics Docs
- Understanding Object Detection: Towards Data Science Article
- PyTorch Installation Guide: PyTorch Official Site
- OpenCV Python Tutorials: OpenCV Docs
- Python 3.x
- OpenCV
- PyTorch
- YOLOv5
- NumPy
- Soham Lamb
- GitHub: https://github.com/SohamAI99