Dashcam Analyzer leverages advanced computer vision technologies to dynamically track and analyze vehicular and pedestrian traffic through dashcam footage. Utilizing the powerful YOLOv8 model, this project provides insights into urban mobility patterns by distinguishing between parked and moving vehicles as well as monitoring pedestrian flow.
- Real-time Tracking: Identify and track cars and pedestrians and show the processing frames in real-time while writing the annotated video to the desired output.
- Traffic Analysis: Analyze traffic patterns to determine the popularity of different regions and the availability of parking spaces.
- Flexible Output Options: Customize the output to display real-time analytics or save the processed video for further analysis.
The system captures video data from dashcams, and processes the video frame-by-frame to detect and classify objects using the ObjectTracker module, which relies on the YOLOv8 object detection model. Each frame is annotated with tracking information, and the analysis can be viewed in real-time or output to a file for subsequent review.
- Python
- OpenCV for video processing
- PyTorch and YOLOv8 for object detection and tracking
Set up the analyzer with the desired video input and output paths, model parameters, and view options. Start the analysis and watch as the system processes the video, providing insightful metrics and visualizations.
video_paths = ["sample1.mp4", "sample2.mp4"]
output_paths = ["sample1_output.mp4", "sample2_output.mp4"]
for video_path, output_path in zip(video_paths, output_paths):
analyzer = DashcamAnalyzer(video_path, output_path)
analyzer.analyze()
(The next step for this project is to enable cli options with click
module to allow for cli usage to specify input/output and on/off for real-time annotation display, etc)