未验证 提交 de39e703 编写于 作者: L LokeZhou 提交者: GitHub

pipeline.py add tracking module time info (#7627)

* pipeline.py add tracking module time
fix infer_cfg_vehicle_violation.yml for examples

* pipeline examples infer_cfg_vehicle_violation.yml delete irrelevant config

* fix infer_cfg_vehicle_violation.yml enable
上级 f6bdcab0
......@@ -24,7 +24,8 @@ VEHICLE_RETROGRADE:
frame_len: 8
sample_freq: 7
enable: True
filter_horizontal_flag: False
deviation: 23
filter_horizontal_flag: True
keep_right_flag: True
deviation: 45
move_scale: 0.01
fence_line: [] #[x1,y1,x2,y2] y2>y1.
fence_line: [570, 163, 1030, 752] #[x1,y1,x2,y2] y2>y1.
# config of tracker for MOT SDE Detector, use 'JDETracker' as default.
# config of tracker for MOT SDE Detector, use 'OCSORTTracker' as default, 'JDETracker' here is just BYTETracker.
# The tracker of MOT JDE Detector (such as FairMOT) is exported together with the model.
# Here 'min_box_area' and 'vertical_ratio' are set for pedestrian, you can modify for other objects tracking.
type: OCSORTTracker # choose one tracker in ['JDETracker', 'OCSORTTracker']
type: BOTSORTTracker # choose one tracker in ['JDETracker', 'OCSORTTracker', 'DeepSORTTracker','BOTSORTTracker']
# When using for MTMCT(Multi-Target Multi-Camera Tracking), you should modify to 'DeepSORTTracker'
# BYTETracker
# just as BYTETracker, used for FairMOT in PP-Tracking project and for ByteTrack in PP-Humanv1 project
JDETracker:
use_byte: True
det_thresh: 0.3
......@@ -16,6 +17,7 @@ JDETracker:
vertical_ratio: 0 # 1.6 for pedestrian
# used for OC-SORT in PP-Humanv2 project and PP-Vehicle project
OCSORTTracker:
det_thresh: 0.4
max_age: 30
......@@ -23,6 +25,31 @@ OCSORTTracker:
iou_threshold: 0.3
delta_t: 3
inertia: 0.2
vertical_ratio: 0
min_box_area: 0
vertical_ratio: 0
use_byte: False
use_angle_cost: False
# used for DeepSORT and MTMCT in PP-Tracking project
DeepSORTTracker:
input_size: [64, 192] # An unique operation to scale the sub-image of the selected detected boxes to a fixed size
min_box_area: 0
vertical_ratio: -1
budget: 100
max_age: 70
n_init: 3
metric_type: cosine
matching_threshold: 0.2
max_iou_distance: 0.9
BOTSORTTracker:
track_high_thresh: 0.3
track_low_thresh: 0.2
new_track_thresh: 0.4
match_thresh: 0.7
track_buffer: 30
min_box_area: 0
camera_motion: False
cmc_method: 'sparseOptFlow' # only camera_motion is True,
# sparseOptFlow | files (Vidstab GMC) | orb | ecc
......@@ -530,6 +530,7 @@ class PipePredictor(object):
else:
self.predict_image(input)
self.pipe_timer.info()
self.mot_predictor.det_times.tracking_info(average=True)
def predict_image(self, input):
# det
......@@ -747,7 +748,8 @@ class PipePredictor(object):
res = self.mot_predictor.predict_image(
[copy.deepcopy(frame_rgb)],
visual=False,
reuse_det_result=reuse_det_result)
reuse_det_result=reuse_det_result,
frame_count=frame_id)
# mot output format: id, class, score, xmin, ymin, xmax, ymax
mot_res = parse_mot_res(res)
......
......@@ -271,6 +271,40 @@ class Timer(Times):
format(preprocess_time * 1000, inference_time * 1000,
postprocess_time * 1000))
def tracking_info(self, average=True):
pre_time = self.preprocess_time_s.value()
infer_time = self.inference_time_s.value()
post_time = self.postprocess_time_s.value()
track_time = self.tracking_time_s.value()
total_time = pre_time + infer_time + post_time
if self.with_tracker:
total_time = total_time + track_time
total_time = round(total_time, 4)
print(
"------------------ Tracking Module Time Info ----------------------"
)
preprocess_time = round(pre_time / max(1, self.img_num),
4) if average else pre_time
postprocess_time = round(post_time / max(1, self.img_num),
4) if average else post_time
inference_time = round(infer_time / max(1, self.img_num),
4) if average else infer_time
tracking_time = round(track_time / max(1, self.img_num),
4) if average else track_time
if self.with_tracker:
print(
"preprocess_time(ms): {:.2f}, inference_time(ms): {:.2f}, postprocess_time(ms): {:.2f}, tracking_time(ms): {:.2f}".
format(preprocess_time * 1000, inference_time * 1000,
postprocess_time * 1000, tracking_time * 1000))
else:
print(
"preprocess_time(ms): {:.2f}, inference_time(ms): {:.2f}, postprocess_time(ms): {:.2f}".
format(preprocess_time * 1000, inference_time * 1000,
postprocess_time * 1000))
def report(self, average=False):
dic = {}
pre_time = self.preprocess_time_s.value()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册