单人单检和无人在场的警告只发生在有车的时候;删除了单人单检和无人在场在视频上弹出的警告
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user