提交 c417c1dd 编写于 作者: Z zhiboniu 提交者: zhiboniu

run reid every 10 frames

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