Object Detection with YOLOV3

Sijuade Oguntayo
Analytics Vidhya
Published in
2 min readJul 23, 2021

Simple detection on a custom dataset

This is a much shorter article than I’m typically used to writing. I’ve recently been taking the Extensive Vision course with TheSchoolOfAI.

I worked on two small projects using YOLOV3. The first was to run inference on an image of me holding an item present in the coco dataset using pre-trained weights.

Myself holding a bottle

For the second, I collected and annotated 100 images containing hard hats, vests, boots and masks, and trained YOLO on them. The image annotation was done using this neat annotation tool.

The model was trained for 13 epochs achieving a mAP@0.5 of 0.54. Here are some of the model predictions.

Afterwards, I collected a 12s video from youtube containing many of the objects mentioned above and converted them into frames using ffmeg.

I ran the objection detection model on the extracted frames, and converted them back into video-

I also explored how to generate anchor boxes using K-Means clustering, you may find that in this repo.

Link to OpenCV-YOLO repo.

Link to the training & inference repo.

References

Sergio Canu yolo object detection using opencv with python https://pysource.com/2019/06/27/yolo-object-detection-using-opencv-with-python/

Redmon, Joseph and Farhadi, Ali 2018 YOLOv3: An Incremental Improvement https://pjreddie.com/darknet/yolo/

https://github.com/miki998/YoloV3_Annotation_Tool

--

--