From 1ed8597c17152097bff205d343acbf391e3f70ef Mon Sep 17 00:00:00 2001 From: Qinchuanqi <2254943770@qq.com> Date: Thu, 5 Mar 2026 11:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BA=BA=E5=8D=95=E6=A3=80=E5=92=8C?= =?UTF-8?q?=E6=97=A0=E4=BA=BA=E5=9C=A8=E5=9C=BA=E7=9A=84=E8=AD=A6=E5=91=8A?= =?UTF-8?q?=E5=8F=AA=E5=8F=91=E7=94=9F=E5=9C=A8=E6=9C=89=E8=BD=A6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99;=E5=88=A0=E9=99=A4=E4=BA=86=E5=8D=95?= =?UTF-8?q?=E4=BA=BA=E5=8D=95=E6=A3=80=E5=92=8C=E6=97=A0=E4=BA=BA=E5=9C=A8?= =?UTF-8?q?=E5=9C=BA=E5=9C=A8=E8=A7=86=E9=A2=91=E4=B8=8A=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biz/checkpoint/checkpoint_biz.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) 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 {