- Download and Install Python 3: [Windows: Python OR Anaconda] [Ubuntu: Already Installed]
- Install Required Dependencies:
pip3 install numpy pip3 install opencv-contrib-python
- Clone this repository and make it the current working directory:
git clone https://github.com/Tinker-Twins/YOLO-OpenCV-Python.git cd YOLO-OpenCV-Python
- Download the weights to the working directory:
cd YOLO-OpenCV-Python wget -c https://pjreddie.com/media/files/yolov2.weights wget -c https://pjreddie.com/media/files/yolov2-tiny.weights wget -c https://pjreddie.com/media/files/yolov3.weights wget -c https://pjreddie.com/media/files/yolov3-tiny.weights
- Move to the local clone of this repository:
cd YOLO-OpenCV-Python
Note: Select appropriate
weights
andcfg
files inobject_detection.py
before execution to use the respective YOLO model. - Execute the
object_detection.py
Python script:python3 object_detection.py
Note: To terminate the execution, press the
ESC
key while theObject Detection
window is selected.