From 4c52e3857d0a328aa15a43de70687b5452cc6361 Mon Sep 17 00:00:00 2001 From: Double_V Date: Thu, 24 Jun 2021 17:48:36 +0800 Subject: [PATCH 1/2] Update predict_det.py --- tools/infer/predict_det.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py index bf0735b7..5c6d6d42 100755 --- a/tools/infer/predict_det.py +++ b/tools/infer/predict_det.py @@ -101,21 +101,22 @@ class TextDetector(object): self.predictor, self.input_tensor, self.output_tensors, self.config = utility.create_predictor( args, 'det', logger) - pid = os.getpid() - self.autolog = auto_log.AutoLogger( - model_name="det", - model_precision="fp32", - batch_size=1, - data_shape="dynamic", - save_path="./output/auto_log.lpg", - inference_config=self.config, - pids=pid, - process_name=None, - gpu_ids=0, - time_keys=[ - 'preprocess_time', 'inference_time', 'postprocess_time' - ], - warmup=10) + if args.benchmark: + pid = os.getpid() + self.autolog = auto_log.AutoLogger( + model_name="det", + model_precision=args.precision, + batch_size=1, + data_shape="dynamic", + save_path="./output/auto_log.lpg", + inference_config=self.config, + pids=pid, + process_name=None, + gpu_ids=0, + time_keys=[ + 'preprocess_time', 'inference_time', 'postprocess_time' + ], + warmup=10) def order_points_clockwise(self, pts): """ From f8441cffa4219dddb9bea07bed558e1c13878832 Mon Sep 17 00:00:00 2001 From: Double_V Date: Thu, 24 Jun 2021 17:48:58 +0800 Subject: [PATCH 2/2] Update predict_det.py --- tools/infer/predict_det.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py index 5c6d6d42..c6bdbf5c 100755 --- a/tools/infer/predict_det.py +++ b/tools/infer/predict_det.py @@ -34,7 +34,6 @@ from ppocr.postprocess import build_post_process # import tools.infer.benchmark_utils as benchmark_utils logger = get_logger() -import auto_log class TextDetector(object): @@ -102,6 +101,7 @@ class TextDetector(object): args, 'det', logger) if args.benchmark: + import auto_log pid = os.getpid() self.autolog = auto_log.AutoLogger( model_name="det",