This project demonstrates vehicle counting and classification using OpenCV and the YOLOv3(You Only Look Once) object detection model. It can analyze both real-time video streams to count and classify vehicles.
- Python 3.x
- OpenCV
- NumPy
- YOLOv3 model configuration and weights files(YOLOv3-320 cfg and weights) (Download from YOLO website)
- 'coco.names' file containing the class names
- Place the video file in the video_file folder or update the video file path in the code.
- Ensure you have the required model files and 'coco.names' file.
- Run the
realTime()function in the provided Python script. - Press 'q' to exit the real-time analysis.
-
main: The main Python script for vehicle counting and classification. -
Utility:
- tracker.py: The Euclidean Distance Tracker module for object tracking.
- counting_vehicles.py: Function for counting vehicles
- detected_objects.py: Function for finding the detected objects from the network output
- find_center.py: finding center of bounding boxes
-
model_config
yolov3-320.cfgandyolov3-320.weights: YOLOv3 model configuration and weights files.
-
video_file
video.mp4: Sample video file for real-time analysis.
-
coco_class_index
coco.names: File containing COCO dataset class names.
This project is licensed under the MIT License - see the LICENSE file for details.