This project implements YOLOv3 (You Only Look Once, Version 3) for object detection and counting in Python. YOLOv3 is a state-of-the-art, real-time object detection system. This repository provides the code to run YOLOv3 using the pre-trained weights, enabling you to detect and count objects in images and videos.
- Introduction
- Features
- Installation
- Usage
- Model Download
- Dependencies
- Recommendations
- Acknowledgements
- License
YOLOv3 is a popular object detection model known for its speed and accuracy. This project provides a simple and efficient implementation of YOLOv3 in Python, allowing you to perform object detection tasks with ease.
- Real-time object detection and counting
- Supports detection in images and videos
- Easy-to-use graphical user interface (GUI)
- Pre-trained YOLOv3 weights
- USB camera support
- Tested on M1 Pro Apple Silicon, runs smoothly
-
Clone this repository:
git clone https://github.com/your-username/yolov3-object-detection.git cd yolov3-object-detection
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Download the YOLOv3 weights:
You can download the pre-trained YOLOv3 weights from one of the following links and save it in the
weights
directory:
To run this project, execute Gui_Image_Detection.py
. The GUI allows you to select an image or video for object detection and counting. You can also choose to use a USB camera by updating the camera number mentioned in the file.
-
Run the GUI script:
python Gui_Image_Detection.py
-
In the GUI, select whether you want to detect objects in an image or a video.
-
Follow the prompts to select the image or video file.
-
If using a USB camera, make sure to update the camera number in the script.
-
Connect your USB camera.
-
Update the camera number in the script
Gui_Image_Detection.py
. -
Run the GUI script:
python Gui_Image_Detection.py
Download the pre-trained YOLOv3 weights from one of the following links and save it in the weights
directory:
- Python 3.7+
- OpenCV
- NumPy
- Pillow
You can install all dependencies using:
pip install -r requirements.txt