Skip to content
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

pytorch_object_detection/yolov3_spp/build_utils/img_utils.py中letterbox()函数有错误❌ #758

Open
Xu-Nan opened this issue Nov 11, 2023 · 1 comment

Comments

@Xu-Nan
Copy link

Xu-Nan commented Nov 11, 2023

auto模式中的取余操作会使最终cv2.copyMakeBorder后的图片大小不为512x512或指定(img_size,img_size)
即按长边等比缩放之后,短边的填充不能填满,由于取余操作,所以只能填充对64或者32取余后的大小
例如:应该填充dw和dh(由于长边等比缩放了,所以二者有一个肯定是0),却只能填充np.mod(dw, 64)和np.mod(dh, 64)。所以结果并不能缩放到512x512,只能缩放到512x小于512的某个值(具体多少需要看输入图片的尺寸,因为ratio不同)

@learning-art
Copy link

learning-art commented Nov 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants