This project utilizes the YOLO (You Only Look Once) object detection model and SORT (Simple Online and Realtime Tracking) to detect and track vehicles in a video stream. It calculates the speed of detected vehicles and estimates the time to collision with the vehicle containing the camera.
- Overview
- Code Explanation Video Link
- PPT And Documentation Link
- DataSetUsed
- Models And Video Link
- Features
- Customization
- Dependencies
- Contributing
This project aims to:
- Detect and track vehicles in a video stream.
- Calculate the speed of each detected vehicle.
- Estimate the time to collision with the vehicle containing the camera, based on relative speeds.
- IDD temporal dataset used for indian road
- Real-Time Vehicle Detection and Tracking: Uses YOLOv8 for object detection and SORT for tracking.
- Speed Calculation: Computes the speed of each detected vehicle.
- Collision Estimation: Calculates the time to collision based on the relative speeds of the vehicles.
- Change the video source: Update the
vdovariable to point to your desired video file. - Adjust your car's speed: Modify the
v1variable to match your vehicle's speed form the sensors used or API calls for the camera fit car. - Calibration: Adjust the
real_distance_meterscalculation factor to match the scale of your video(depends on the camera used).
- OpenCV
- YOLOv8
- cvzone
- numpy
- sort
- math
Install all dependencies using:
pip install -r requirements.txtContributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push to your branch.
- Create a pull request.