This project performs real-time vehicle detection and tracking using YOLOv5 for object detection and DeepSort for multi-object tracking.
It detects vehicles from live video or webcam streams and assigns persistent IDs for each vehicle moving through the frame.
- Python π
- YOLOv5 π (Ultralytics)
- DeepSort π (Tracking)
- OpenCV π₯
- Torch / CUDA π₯
# Clone the repository
git clone https://github.com/surya077-mj/Real-Time-Vehicle-Detection.git
cd Real-Time-Vehicle-Detection
# Install dependencies
pip install -r requirements.txt
# Download YOLOv5 weights
wget https://github.com/ultralytics/yolov5/releases/download/v6.0/yolov5s.pt
π Usage
bash
Copy
Edit
# Run on webcam
python track.py --source 0 --yolo_model yolov5s.pt --img 640
# Run on video file
python track.py --source path/to/video.mp4 --yolo_model yolov5s.pt --img 640
--source: Input source (0 = webcam, or path to video)
--img: Input image size (default = 640)
##π Acknowledgements
Ultralytics YOLOv5
nwojke/deep_sort