From 2d05d7c69962af89b1dc750017f9318ac04cea8a Mon Sep 17 00:00:00 2001 From: MissPenguin Date: Mon, 26 Apr 2021 02:16:28 +0000 Subject: [PATCH] Modify the resize operation to be consistent with the python version --- tools/infer/predict_det.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py index f5ea0504..82492abc 100755 --- a/tools/infer/predict_det.py +++ b/tools/infer/predict_det.py @@ -39,7 +39,10 @@ class TextDetector(object): self.args = args self.det_algorithm = args.det_algorithm pre_process_list = [{ - 'DetResizeForTest': None + 'DetResizeForTest': { + 'limit_side_len': args.det_limit_side_len, + 'limit_type': args.det_limit_type + } }, { 'NormalizeImage': { 'std': [0.229, 0.224, 0.225], @@ -159,7 +162,7 @@ class TextDetector(object): shape_list = np.expand_dims(shape_list, axis=0) img = img.copy() starttime = time.time() - + print(img.shape) self.input_tensor.copy_from_cpu(img) self.predictor.run() outputs = [] -- GitLab