From c090b5ee68268b8ef6d13a57eee6f84caa7f1ae4 Mon Sep 17 00:00:00 2001 From: zhiboniu <31800336+zhiboniu@users.noreply.github.com> Date: Tue, 11 Oct 2022 15:20:40 +0800 Subject: [PATCH] fix time count while less than warmupframe (#7092) --- deploy/pipeline/pipeline.py | 1 + deploy/python/visualize.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/pipeline/pipeline.py b/deploy/pipeline/pipeline.py index e13afeb0a..54bbc78e5 100644 --- a/deploy/pipeline/pipeline.py +++ b/deploy/pipeline/pipeline.py @@ -495,6 +495,7 @@ class PipePredictor(object): # det -> attr batch_loop_cnt = math.ceil( float(len(input)) / self.det_predictor.batch_size) + self.warmup_frame = min(10, len(input)//2) - 1 for i in range(batch_loop_cnt): start_index = i * self.det_predictor.batch_size end_index = min((i + 1) * self.det_predictor.batch_size, len(input)) diff --git a/deploy/python/visualize.py b/deploy/python/visualize.py index 4bc2e1783..120b85d16 100644 --- a/deploy/python/visualize.py +++ b/deploy/python/visualize.py @@ -378,7 +378,7 @@ def visualize_action(im, im = cv2.imread(im) if isinstance(im, str) else im im_h, im_w = im.shape[:2] - text_scale = max(1, im.shape[1] / 1600.) + text_scale = max(1, im.shape[1] / 400.) text_thickness = 2 if action_visual_collector: @@ -418,7 +418,7 @@ def visualize_vehicleplate(im, results, boxes=None): im = np.ascontiguousarray(np.copy(im)) im_h, im_w = im.shape[:2] - text_scale = max(1.0, im.shape[0] / 1600.) + text_scale = max(1.0, im.shape[0] / 400.) text_thickness = 2 line_inter = im.shape[0] / 40. -- GitLab