-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About image resize problem #82
Comments
Indeed, cv2.resize() does not keep aspect ratio. Normally, object detection models are trained with random aspect-ratioed crops of the original images. That is, we expect the trained object detection model capable of handling aspect-ratio distortions up to certain range. For example, check out source code of tensorflow object detection API: https://github.com/tensorflow/models/blob/master/research/object_detection/protos/preprocessor.proto#L153 By default, the tensorflow ssd or faster_rcnn models are all trained by input image crops with random aspect ratios in the range of 0.75~1.33. That's why, at inference time, we usually don't preserve aspect ratio and just resize the input images directly. I haven't studied whether the YOLOv3 model is trained with varying aspect ratios, though. If you do find presevring aspect ratio is helpful (producing better mAP), feel free to modify the preprocessing and postprocessing code to handle that. |
@jkjung-avt Thanks your suggestion In pjreddie's darknet For me, AlexeyAB's darknet has better performance ( mAP ) But I have another question Appreciat !!! |
For a modified YOLOv3 network with only 2 yolo layers, I think you'd need to:
|
@jkjung-avt |
Hi @jkjung-avt
I read the issue about image resize : AlexeyAB/darknet#232
I realize it will affect performance ( accuracy )
So I check the _preprocess_yolov3 function in yolov3.py
In my perception, cv2.resize is without keeping aspect ratio and same as AlexeyAB version
But I'm not sure ...
Can you give me some suggestion and confirm with me ?
Appreciat ~
The text was updated successfully, but these errors were encountered: