SpeedVision is an AI-powered tool designed to calculate the speed of vehicles from video footage using advanced computer vision techniques. By processing video frames, SpeedVision accurately detects, tracks, and analyzes the speed of vehicles, making it a powerful tool for traffic monitoring, speed enforcement, and vehicle analytics.
2024-09-21.15-20-36.mp4
- 🏎️ Real-Time Vehicle Speed Calculation: Detect and calculate the speed of vehicles directly from videos.
- 🎯 YOLOv8 Object Detection: Leverages YOLO-based detection to accurately identify vehicles in each frame.
- 🔄 Frame-by-Frame Vehicle Tracking: Tracks vehicles across frames to measure speed based on their movement.
- 📽️ Supports Various Video Formats: Works seamlessly with multiple video formats (MP4, AVI, MOV, etc.).
- 💡 Preprocessing Pipeline: Enhances video frames for better detection and speed measurement.
- 📊 Scalable for Traffic Analysis: Handle different video angles and scenarios with ease.
test1.1.mp4
- Python 3.7+ 🐍
- OpenCV: For video processing, install it via
pip:pip install opencv-python
- YOLOv8: Object detection model. Ensure all dependencies are installed using the
requirements.txtfile.
git clone https://github.com/yourusername/speedvision.git
cd speedvisionpip install -r requirements.txtTo calculate the speed of vehicles from a video, follow these steps:
-
Prepare Your Video: Place your video file in the
input/directory. -
Run Speed Calculation Script:
python speedvision.py --video input/your-video-file.mp4
-
Output: The tool will display the estimated speed of the detected vehicles and save the processed video.
python speedvision.py --video input/highway_footage.mp4Output:
Vehicle Speed: 65.3 km/h
speedvision/
│
├── input/ # Directory for input videos
├── output/ # Directory for processed video output
├── speedvision.py # Main script for speed calculation
├── preprocessing.py # Preprocessing functions for better detection
├── tracker.py # Vehicle tracking script (SORT or DeepSORT)
├── requirements.txt # List of Python dependencies
└── demo/ # Demo files showcasing the project's functionality
- You can adjust the frame rate analysis or tracking algorithm by editing
speedvision.pyandtracker.py. - The accuracy of speed calculations can be fine-tuned through calibration by specifying the real-world distance covered by the vehicles (e.g., meters per pixel).
To obtain precise speed measurements, calibrate the tool by defining the distance covered by vehicles in the real world, relative to pixel measurements in the video.
- 📱 Mobile App Integration: Develop a mobile app to allow video uploads and real-time speed analysis.
- 🎥 Live Video Stream Support: Extend functionality to process live video feeds for continuous monitoring.
- 🧠 Improved Detection Models: Incorporate deep learning models for more accurate vehicle detection and fewer false positives.
- 📊 Traffic Analytics: Expand SpeedVision to analyze traffic flow, detect congestion, and provide detailed reports.
We welcome contributions! If you'd like to contribute to SpeedVision, feel free to fork this repository, submit a pull request, or open an issue.
This project is licensed under the MIT License - see the LICENSE file for more details.
If you have any questions, issues, or suggestions, feel free to contact the project maintainer:
Atharv Gupta
Email: atharvg06@gmail.com