ayooshkathuria / YOLO_v3_tutorial_from_scratch

Accompanying code for Paperspace tutorial series "How to Implement YOLO v3 Object Detector from Scratch"
https://blog.paperspace.com/how-to-implement-a-yolo-object-detector-in-pytorch/
2.32k stars 724 forks source link

Hard coded resolution in video.py and detect.py lead to wrong bounding boxes #43

Open Oleffa opened 5 years ago

Oleffa commented 5 years ago

Hi,

first of all thanks for the great tutorial!

I think in video.py, line 134 and detect.py, lin 164: scaling_factor = torch.min(416/im_dim,1)[0].view(-1,1) is using a hard coded value for the image resolution (See standard value for the resolution parameter).

When I was using this implementation with my own yolov3 net the bounding boxes were not drawn in the proper locations since i set the parameter for resolution to 960.

Changing the lines to: scaling_factor = torch.min(int(args.reso)/im_dim,1)[0].view(-1,1) solved the problem for me.

Best Regards,

Oliver