图像resize取整会导致x和y方向的scale不一致问题
Created by: lxastro
具体见: https://github.com/PaddlePaddle/PaddleDetection/blob/02700af911596857e9183ba0bf02a0f29f180a90/ppdet/data/transform/operators.py#L287-L292 resize_w和resize_y取整后,im_scale_x和im_scale_y不一定是im_scale。 需要改为:
im_scale_x = selected_size / float(im_shape[1])
im_scale_y = selected_size / float(im_shape[0])
im_info = [resize_h, resize_w, im_scale_x, im_scale_y]
其他使用了im_info的op要进行对应修改。 此外,在不使用cv2时,在 https://github.com/PaddlePaddle/PaddleDetection/blob/02700af911596857e9183ba0bf02a0f29f180a90/ppdet/data/transform/operators.py#L315 之前,要取整
resize_w = int(resize_w)
resize_h = int(resize_h)