yolov7 icon indicating copy to clipboard operation
yolov7 copied to clipboard

How does --img-size impact accuracy of detect.py outcome?

Open ar4development opened this issue 2 years ago • 3 comments

Could you fellas explain the meaning of --img-size for detect.py script? Particularly I'm wondering how do I use it for tuning detection accuracy?

For example I have a video of 1920x1080 and YOLOv7-D6 pretrained model. I would assume that --img-size is resolution of the video but why wouldn't the script just pick that from video metadata?

So another guess is that I'm changing that parameter in order to reduce computational cost of the inference so that I'm paying the accuracy (since some details could be lost on image scaling) for the speed.

However I'm not sure if that is correct? Could you please explain how would I use that parameter in my case?

ar4development avatar Jan 02 '23 10:01 ar4development

The metrics does change when the testing image size change. However that's not a yolo issue. That will happen for any object detection cnn model.

sipie800 avatar Jan 03 '23 04:01 sipie800

I am using yolov7-tiny to train license plate data. I see in my dataset that img-size 128 has a much worse result than img-size 256, even though the input image has been resized to 128x128 first. This made me realize the problem is that maybe the yolov7 network with img-size 128 is not intelligent enough complexity to solve the problem, as img-size increases the computation increases, making the network smarter , learned more features even though it's still the same yolov7

damvantai avatar Feb 01 '23 15:02 damvantai

Hi everybody, I am also unsure about this paramter. When I have a model trained on 608608 images, can I just run detection on bigger images (up to 20002000 in my case) by just using detect and setting --img-size to 608*608? Or would tiling the bigger images and running inference on the tiles be much more accurate? Thank you for any suggestions.

DarwinsFinch avatar Feb 02 '24 10:02 DarwinsFinch