def run(self):
stop = False
_, im = self.cam.read()
while 1:
if not self.video_stat.is_drug and not stop:
_, im = self.cam.read()
self.video_stat.update(im)
self.box_saver.save(im,self.video_stat.frame_id,self.video_stat.get_boxes())
else:
if self.video_stat.is_drug:
self.video_stat.draw_update(im, self.label_stat.get_label_name())
chr=cv2.waitKey(1) & 0xFF
if chr==ord(' '): # press space to stop the frame
stop= not stop
if chr==27: # Esc key to exit
break
评论列表
文章目录