From 51193f88206a035dec17d9503686495ab86ef789 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Tue, 6 Jul 2021 14:02:25 +0800 Subject: [PATCH] fix bug of inference --- deploy/hubserving/readme.md | 2 +- deploy/hubserving/readme_en.md | 2 +- tools/infer/predict_det.py | 8 ++++---- tools/infer/predict_system.py | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deploy/hubserving/readme.md b/deploy/hubserving/readme.md index a39ac5a4..9351fa8d 100755 --- a/deploy/hubserving/readme.md +++ b/deploy/hubserving/readme.md @@ -29,7 +29,7 @@ deploy/hubserving/ocr_system/ ### 1. 准备环境 ```shell # 安装paddlehub -pip3 install paddlehub==1.8.3 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple +pip3 install paddlehub==2.1.0 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple ``` ### 2. 下载推理模型 diff --git a/deploy/hubserving/readme_en.md b/deploy/hubserving/readme_en.md index 7d9a8629..98ffcad6 100755 --- a/deploy/hubserving/readme_en.md +++ b/deploy/hubserving/readme_en.md @@ -30,7 +30,7 @@ The following steps take the 2-stage series service as an example. If only the d ### 1. Prepare the environment ```shell # Install paddlehub -pip3 install paddlehub==1.8.3 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple +pip3 install paddlehub==2.1.0 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple ``` ### 2. Download inference model diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py index bbf3659c..6a45f81e 100755 --- a/tools/infer/predict_det.py +++ b/tools/infer/predict_det.py @@ -175,7 +175,7 @@ class TextDetector(object): st = time.time() - if args.benchmark: + if self.args.benchmark: self.autolog.times.start() data = transform(data, self.preprocess_op) @@ -186,7 +186,7 @@ class TextDetector(object): shape_list = np.expand_dims(shape_list, axis=0) img = img.copy() - if args.benchmark: + if self.args.benchmark: self.autolog.times.stamp() self.input_tensor.copy_from_cpu(img) @@ -195,7 +195,7 @@ class TextDetector(object): for output_tensor in self.output_tensors: output = output_tensor.copy_to_cpu() outputs.append(output) - if args.benchmark: + if self.args.benchmark: self.autolog.times.stamp() preds = {} @@ -220,7 +220,7 @@ class TextDetector(object): else: dt_boxes = self.filter_tag_det_res(dt_boxes, ori_im.shape) - if args.benchmark: + if self.args.benchmark: self.autolog.times.end(stamp=True) et = time.time() return dt_boxes, et - st diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index 715bd3fa..eae0e27c 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -174,8 +174,6 @@ def main(args): logger.info("The predict total time is {}".format(time.time() - _st)) logger.info("\nThe predict total time is {}".format(total_time)) - img_num = text_sys.text_detector.det_times.img_num - if __name__ == "__main__": args = utility.parse_args() -- GitLab