YOLO for object detection

In the object_detection_opencv_yolo_darknet.py script, object detection is carried out using YOLO v3. YOLO v3 uses a few tricks to improve training and increase performance, including multi-scale predictions and a better backbone classifier, among others.

The output of this script can be seen in the following screenshot:

As shown in the previous screenshot, all objects but one (the sheep) were correctly detected with high accuracy. Therefore, you have to download the yolov3.weights file before running the script.

It should be noted that the yolov3.weights file is not included in the repository of this book because ...

Get Mastering OpenCV 4 with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.