提交 0e1c7fc6 编写于 作者: Z zhiboniu 提交者: zhiboniu

run reid every 10 frames

上级 eade68e0
......@@ -35,6 +35,9 @@ class Result(object):
return self.res_dict[name]
return None
def clear(self, name):
self.res_dict[name].clear()
class DataCollector(object):
"""
......@@ -80,7 +83,6 @@ class DataCollector(object):
ids = int(mot_item[0])
if ids not in self.collector:
self.collector[ids] = copy.deepcopy(self.mots)
self.collector[ids]["frames"].append(frameid)
self.collector[ids]["rects"].append([mot_item[2:]])
if attr_res:
......
......@@ -297,10 +297,9 @@ def distill_idfeat(mot_res):
feature_new = feature_list
#if available frames number is more than 200, take one frame data per 20 frames
if len(qualities_new) > 200:
skipf = 20
else:
skipf = max(10, len(qualities_new) // 10)
skipf = 1
if len(qualities_new) > 20:
skipf = 2
quality_skip = np.array(qualities_new[::skipf])
feature_skip = np.array(feature_new[::skipf])
......
......@@ -587,7 +587,7 @@ class PipePredictor(object):
if self.cfg['visual']:
self.action_visual_helper.update(action_res)
if self.with_mtmct:
if self.with_mtmct and frame_id % 10 == 0:
crop_input, img_qualities, rects = self.reid_predictor.crop_image_with_mot(
frame, mot_res)
if frame_id > self.warmup_frame:
......@@ -603,6 +603,8 @@ class PipePredictor(object):
"rects": rects
}
self.pipeline_res.update(reid_res_dict, 'reid')
else:
self.pipeline_res.clear('reid')
self.collector.append(frame_id, self.pipeline_res)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册