diff --git a/biz/checkpoint/checkpoint_biz.py b/biz/checkpoint/checkpoint_biz.py index f61ccd2..13d88b9 100644 --- a/biz/checkpoint/checkpoint_biz.py +++ b/biz/checkpoint/checkpoint_biz.py @@ -455,13 +455,17 @@ class KadianDetector: for k in expired_only_one: del self.only_one_alerts[k] - # 更新累计帧数 - if effective_police_count == 0: - self.nobody_frames += 1 - self.only_one_frames = 0 - elif effective_police_count == 1: - self.only_one_frames += 1 - self.nobody_frames = 0 + if effective_car_count > 0: + # 更新累计帧数 + if effective_police_count == 0: + self.nobody_frames += 1 + self.only_one_frames = 0 + elif effective_police_count == 1: + self.only_one_frames += 1 + self.nobody_frames = 0 + else: + self.nobody_frames = 0 + self.only_one_frames = 0 else: self.nobody_frames = 0 self.only_one_frames = 0 @@ -474,7 +478,7 @@ class KadianDetector: 'time': current_time_sec, 'action': "Nobody", }) - self.draw_alert(frame, alert_text, (0, 0, 255), offset_y=alert_offset) + # self.draw_alert(frame, alert_text, (0, 0, 255), offset_y=alert_offset) alert_offset += 100 elif effective_police_count == 1 and self.only_one_frames >= self.frame_thresh_only_one: alert_text = "Only One" @@ -484,7 +488,7 @@ class KadianDetector: 'time': current_time_sec, 'action': "Only One", }) - self.draw_alert(frame, alert_text, (255, 165, 0), offset_y=alert_offset) + # self.draw_alert(frame, alert_text, (255, 165, 0), offset_y=alert_offset) alert_offset += 100 return {