What is the best way to deal with image sizes in object detection using YOLO v. 4?
I seem to have figured it out now. When using darknet.detect_image, it calls predict_image which in turn is network_predict_image. The latter resizes the image if it is not already the same size as the network's input layer.
If you instead call darknet detector test from the command line, as I have seen examples do as mentioned in my original question, the &quot;chain of command&quot; goes through test_detector which resizes the image if it is not already the size of the network's input layer.
So, in any case it seems that images get resized to fit the network's input layer along the way and I do not have to do anything in particular to handle it.