From 83e9e08fbf891d1bc7213a52fa4396061dfff381 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Thu, 17 Dec 2020 13:08:31 +0800 Subject: [PATCH] fix im_info in solov2 deploy infer (#1910) --- deploy/python/preprocess.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/python/preprocess.py b/deploy/python/preprocess.py index d04da50fa..a4fe7caec 100644 --- a/deploy/python/preprocess.py +++ b/deploy/python/preprocess.py @@ -86,6 +86,9 @@ class Resize(object): """ im_channel = im.shape[2] im_scale_x, im_scale_y = self.generate_scale(im) + im_info['resize_shape'] = [ + im_scale_x * float(im.shape[0]), im_scale_y * float(im.shape[1]) + ] if self.use_cv2: im = cv2.resize( im, @@ -115,7 +118,6 @@ class Resize(object): im = padding_im im_info['scale'] = [im_scale_x, im_scale_y] - im_info['resize_shape'] = im.shape[:2] return im, im_info def generate_scale(self, im): -- GitLab