We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f45451 commit 47f6bf3Copy full SHA for 47f6bf3
1 file changed
utils/utils.py
@@ -66,8 +66,8 @@ def aspectaware_resize_padding(image, width, height, interpolation=None, means=N
66
67
68
def preprocess(*image_path, max_size=512, mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)):
69
- ori_imgs = [cv2.imread(img_path)[..., ::-1] for img_path in image_path]
70
- normalized_imgs = [(img / 255 - mean) / std for img in ori_imgs]
+ ori_imgs = [cv2.imread(img_path) for img_path in image_path]
+ normalized_imgs = [(img[..., ::-1] / 255 - mean) / std for img in ori_imgs]
71
imgs_meta = [aspectaware_resize_padding(img, max_size, max_size,
72
means=None) for img in normalized_imgs]
73
framed_imgs = [img_meta[0] for img_meta in imgs_meta]
0 commit comments