未验证 提交 1bc50816 编写于 作者: W wangguanzhong 提交者: GitHub

fix camera id in pphuman (#5555)

上级 482eb6fe
...@@ -400,7 +400,11 @@ class PipePredictor(object): ...@@ -400,7 +400,11 @@ class PipePredictor(object):
cpu_threads, enable_mkldnn) cpu_threads, enable_mkldnn)
def set_file_name(self, path): def set_file_name(self, path):
if path is not None:
self.file_name = os.path.split(path)[-1] self.file_name = os.path.split(path)[-1]
else:
# use camera id
self.file_name = None
def get_result(self): def get_result(self):
return self.collector.get_res() return self.collector.get_res()
...@@ -533,6 +537,11 @@ class PipePredictor(object): ...@@ -533,6 +537,11 @@ class PipePredictor(object):
im = self.visualize_video(frame, mot_res, frame_id, im = self.visualize_video(frame, mot_res, frame_id,
fps) # visualize fps) # visualize
writer.write(im) writer.write(im)
if self.file_name is None: # use camera_id
cv2.imshow('PPHuman', im)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
continue continue
self.pipeline_res.update(mot_res, 'mot') self.pipeline_res.update(mot_res, 'mot')
...@@ -619,6 +628,10 @@ class PipePredictor(object): ...@@ -619,6 +628,10 @@ class PipePredictor(object):
fps, entrance, records, fps, entrance, records,
center_traj) # visualize center_traj) # visualize
writer.write(im) writer.write(im)
if self.file_name is None: # use camera_id
cv2.imshow('PPHuman', im)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
writer.release() writer.release()
print('save result to {}'.format(out_path)) print('save result to {}'.format(out_path))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册