Search code examples
imageboxboundingdarkflow

darkflow bounding boxes bad even in standard example


The neural network on Darkflow is not training correctly.

At first I thought I did not have enough images, or maybe a bad starting network. So I tried a standard example such as https://github.com/deep-diver/Soccer-Ball-Detection-YOLOv2/blob/master/YOLOv2-Train.ipynb but even then I had the exact same issue (see error image).

I can test with a pre-trained network just fine. It is only when I try to train on a network that I get nonsense. Yet at the end of 100 epochs I have:

step 1100 - loss 1.004814863204956 - moving ave loss 1.1848642304486146 Finish 100 epoch(es)

I am training with:

flow --model cfg/yolo_custom.cfg    \
     --load bin/yolo.weights         \
     --train                          \
     --annotation labelImg/annotations \
     --dataset labelImg/images          \
     --epoch 100                         \
     --gpu 1.0

and testing with:

flow --model cfg/yolo_custom.cfg \
     --load bin/yolo.weights      \
     --demo test_video.mp4         \
     --saveVideo

(which one can find at that website)

He shows the images he gets on that website. I instead get:

https://i.sstatic.net/chQGV.jpg


Solution

  • Figured it out. There were 2 things:
    1. I needed to tell it to load a particular checkpoint of that configuration with "--load 21000" (or whatever number was most recent)
    2. I needed to overfit it on 3-5 images first, then let it train on the rest of the images.