longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.55k stars 420 forks source link

yolo_to_bbox function discards bounding boxes #50

Open aelnouby opened 6 years ago

aelnouby commented 6 years ago

Hi,

When I try the demo I always get Traceback (most recent call last): File "demo.py", line 63, in <module> bbox_pred, iou_pred, prob_pred, image.shape, cfg, thresh) File "/export/mlrg/aelnouby/projects/3rdParty/yolo2-pytorch/utils/yolo.py", line 108, in postprocess num_classes = cfg.num_classes IndexError: index 571 is out of bounds for axis 0 with size 500

When I started debugging I found that yolo_to_bbox function call discards bounding boxes, while the input shape is (1, 165, 5, 4) , the output shape is (1, 100, 5, 4), which causes an out of index error as shown above. How to fix this issue ?

hadikazemi commented 6 years ago

Same issue here ... any solution?

aelnouby commented 6 years ago

Try to change This W, H = cfg.multi_scale_out_size[size_index]

To that W, H = cfg.out_size