A vehicle detection and counting system using YOLOv11 and Ultralytics' ObjectCounter solution. This project includes a Streamlit web app for uploading and analyzing video/image input, along with standalone Python scripts for video and image processing.
- Real-time vehicle detection and counting using YOLOv11
- Streamlit web interface for user-friendly interaction
- Support for both video and image inputs
- Standalone scripts for batch processing of media files
- Visual representation of detection and counting results
Vehicle-Detection-And-Counting/
├── assets/ # Directory for storing assets like images or icons
├── app.py # Streamlit web application script
├── image_counting.py # Script for processing and counting vehicles in images
├── video_counting.py # Script for processing and counting vehicles in videos
├── requirements.txt # Python dependencies
├── short_clip.mp4 # Sample video for testing
├── yolo11n.pt # Pre-trained YOLOv11 model weights
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/Badaszz/Vehicle-Detection-And-Counting.git cd Vehicle-Detection-And-Counting -
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
Launch the web application using Streamlit:
streamlit run app.pyThis will open a web interface where you can upload images or videos for vehicle detection and counting.
-
Process an image:
python image_counting.py --image_path path_to_image.jpg
-
Process a video:
python video_counting.py --video_path path_to_video.mp4
Replace path_to_image.jpg and path_to_video.mp4 with the actual paths to your media files.
The project employs YOLOv11, a state-of-the-art object detection model, in conjunction with Ultralytics' ObjectCounter for accurate vehicle detection and counting. The pre-trained model weights (yolo11n.pt) are included in the repository.
Sample outputs can be found in the assets folder
Contributions are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request.
For any inquiries or feedback, please contact [[email protected]].