From 585dbc3016791e5ab333eebdbed010d2d182453d Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Tue, 7 Dec 2021 10:20:58 +0000 Subject: [PATCH] fix image shape in infer --- ppstructure/vqa/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ppstructure/vqa/utils.py b/ppstructure/vqa/utils.py index b49ea315..0af180ad 100644 --- a/ppstructure/vqa/utils.py +++ b/ppstructure/vqa/utils.py @@ -211,8 +211,7 @@ def preprocess( height = ori_img.shape[0] width = ori_img.shape[1] - img = cv2.resize(ori_img, - (224, 224)).transpose([2, 0, 1]).astype(np.float32) + img = cv2.resize(ori_img, img_size).transpose([2, 0, 1]).astype(np.float32) segment_offset_id = [] words_list = [] -- GitLab