tfyolo
tfyolo copied to clipboard
detect wrong
After finishing train 100 epoch with voc dataset,I detect the train sample.but It's find nothing . the Loss about 500.
I have the same issue. I train without any problem with loss around 200 but when I run detect.py it shows the message no box detected which means there is not bbox detected. Were you able to figure this out @LongxingTan ?
I had the same issue, using the pre-trained model (converted from pytorch). In the detect.py, there might be something wrong with pred_bbox. I am debugging now.
Figured it out. It seems that the detect.py has some bugs there. The model was yolo5s, converted from the Ultralytics yolo5. What I did are following:
- comment out the next two lines. If you check the function batch_non_max_suppression(). Those variable definitions are not consistent.
pred_bbix = [tf.reshape(x , ...]
pred_bbox = tf.concat(pred_bbox, ...)
- The predictions of bbox are [0, 1]. We need to re-scale back to the image input size, for example, 640x640 (depending on your training model). I added two lines before calling the resize_back(). bboxes[:, [0,2]] = bboxes[:, [0,2]] *640 bboxes[:, [1,3]] = bboxes[:, [1,3]] *640
Then it fixed the problem of no box detected
. Hopefully, this is helpful.