- Python 3
- OpenCV 4
- Numpy
- YOLOv3 pre-trained models:
- YOLOv3 config: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3.cfg
- YOLOv3 weights: https://pjreddie.com/media/files/yolov3.weights
- Class names: https://github.com/pjreddie/darknet/blob/master/data/coco.names
Copy the above config, weights and class names files into the same folder as this source code.
To detect object in image, just run:
python yolo_detect_image.py --image name_of_your_image_here
For example, with this input image:
The output will be:
Similarly, to detect object in video, just run:
python yolo_detect_video.py --video name_of_your_video_here
An video example can be seen below:
Please feel free to adjust CONF_THRESHOLD and NMS_THRESHOLD constants to suit your needs.
Full tutorial is available at http://dangminhthang.com/computer-vision/object-detection-and-recognition-using-yolo/