thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.09k forks source link

tiny yolo predict a lot of bounding boxes for one class problem #1194

Closed mahmoudalbardan closed 3 years ago

mahmoudalbardan commented 3 years ago

I am trying to detect people in video ... downloaded pre-trained weights then trained the net on own dataset (one class) using VOC dataset (see this link) .. however when using the model to make predictions on each frame of the video using

from darkflow.net.build import TFNet
options = {"model": "darkflow-master/cfg/tiny-yolo-voc-1c.cfg",
           "metaLoad": 'darkflow-master/ckpt/tiny-yolo-voc-1c-3500', 
           "threshold": 0.4999}
tfnet = TFNet(options)

cap = cv2.VideoCapture(video_name)
while True:
    result = tfnet.return_predict(frame)

I got a result with a lot (around 200) bounding boxes for each frame knowing that I have on person that appears in each frame. note: changing the threshold did not help.. someone have a idea?? maybe a training problem? Also, anyone have an idea on how I can increase prediction speed with tiny yolo?

thanks

mahmoudalbardan commented 3 years ago

Resolved. I replaced 'metaload' by 'load'