This project leverages YOLOv8 for object detection and Deep SORT for object tracking to monitor vehicle movements in traffic intersection videos. The application detects various types of vehicles and tracks their trajectories, providing insightful data for traffic analysis.
- Python 3.8 or higher
-
Clone the repository:
git clone https://github.com/louiecasula/VehicleDetection.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have a video file you wish to process.
-
Execute the application:
python main.py
-
The GUI will prompt you to select a video file for processing.
- The application will detect and track vehicles within the selected video.
- The center points of detected vehicles are used to calculate their direction of travel.
- As each vehicle moves, its center point is tracked, and the direction is determined based on these points' movement across frames.
- Each tracked vehicle's data is saved into a CSV file, capturing:
- Track ID
- Class/Object type
- Coordinates mapped to the corresponding frame
- OpenCV is utilized extensively for various video processing tasks, including video file reading, frame extraction, and displaying the processed video with overlayed tracking information.
- YOLOv8: Employed for real-time object detection, providing bounding boxes and class labels for detected vehicles.
- Deep SORT: Utilized for object tracking, assigning unique IDs to detected objects and maintaining their identities across frames, even when temporarily occluded.
- The implementation of YOLOv8 and Deep SORT is based on guidance from this repository.
- Modifications were made to the Deep SORT implementation from this repository, including updates to the
Detections
object and import statements to ensure compatibility with the current setup.
- Graphical Representation of Vehicle Paths: Enhancing the application to visually represent the center coordinates of each vehicle, illustrating their traveled paths.
- Custom Model Training: Exploring the training of custom models to enhance detection accuracy.
- Alternative Detectors: Investigating the use of other object detection models for comparative analysis and potential improvement in tracking performance.