face prison biz新增参数
This commit is contained in:
@@ -879,7 +879,8 @@ def sync_videofaceprisonbiz_params():
|
|||||||
"face.similarity_threshold": "similarity_threshold",
|
"face.similarity_threshold": "similarity_threshold",
|
||||||
"face.detection_window_seconds": "detection_window_seconds",
|
"face.detection_window_seconds": "detection_window_seconds",
|
||||||
"face.min_match_count": "min_match_count",
|
"face.min_match_count": "min_match_count",
|
||||||
"face.cooldown_seconds": "cooldown_seconds"
|
"face.cooldown_seconds": "cooldown_seconds",
|
||||||
|
"face.prison_escort_window_hours": "escort_window_hours"
|
||||||
}
|
}
|
||||||
|
|
||||||
updated_count = 0
|
updated_count = 0
|
||||||
@@ -949,6 +950,13 @@ def sync_videofaceprisonbiz_params():
|
|||||||
updated_count += 1
|
updated_count += 1
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.error(f"无效的冷却时间: {config_value}")
|
logger.error(f"无效的冷却时间: {config_value}")
|
||||||
|
elif param_name == "escort_window_hours":
|
||||||
|
try:
|
||||||
|
escort_hours = int(config_value)
|
||||||
|
video_face_prison_biz.set_escort_window_hours(escort_hours)
|
||||||
|
updated_count += 1
|
||||||
|
except ValueError:
|
||||||
|
logger.error(f"无效的犯人带出窗口时间: {config_value}")
|
||||||
|
|
||||||
logger.info(f"✅ 同步VideoFacePrisonBiz参数完成,更新了 {updated_count} 个参数(配置组ID: {prison_config.config_group_id})")
|
logger.info(f"✅ 同步VideoFacePrisonBiz参数完成,更新了 {updated_count} 个参数(配置组ID: {prison_config.config_group_id})")
|
||||||
return updated_count
|
return updated_count
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class VideoFacePrisonBiz(BaseFaceBiz):
|
|||||||
self.detection_window_seconds = 2.0 # 检测窗口时间(秒)
|
self.detection_window_seconds = 2.0 # 检测窗口时间(秒)
|
||||||
self.min_match_count = 5 # 最小匹配次数
|
self.min_match_count = 5 # 最小匹配次数
|
||||||
self.cooldown_seconds = 30 # 冷却时间(秒)
|
self.cooldown_seconds = 30 # 冷却时间(秒)
|
||||||
|
self.escort_window_hours = 72 # 犯人带出窗口时间(小时)
|
||||||
|
|
||||||
# 跟踪数据结构
|
# 跟踪数据结构
|
||||||
self.person_tracking = {} # {person_id: [timestamp1, timestamp2, ...]}
|
self.person_tracking = {} # {person_id: [timestamp1, timestamp2, ...]}
|
||||||
@@ -142,6 +143,24 @@ class VideoFacePrisonBiz(BaseFaceBiz):
|
|||||||
"""
|
"""
|
||||||
return self.cooldown_seconds
|
return self.cooldown_seconds
|
||||||
|
|
||||||
|
def set_escort_window_hours(self, escort_window_hours: int):
|
||||||
|
"""
|
||||||
|
设置犯人带出窗口时间
|
||||||
|
|
||||||
|
参数:
|
||||||
|
escort_window_hours: 犯人带出窗口时间(小时)
|
||||||
|
"""
|
||||||
|
self.escort_window_hours = escort_window_hours
|
||||||
|
|
||||||
|
def get_escort_window_hours(self) -> int:
|
||||||
|
"""
|
||||||
|
获取犯人带出窗口时间
|
||||||
|
|
||||||
|
返回:
|
||||||
|
犯人带出窗口时间(小时)
|
||||||
|
"""
|
||||||
|
return self.escort_window_hours
|
||||||
|
|
||||||
def _cleanup_old_records(self, current_time: float):
|
def _cleanup_old_records(self, current_time: float):
|
||||||
"""
|
"""
|
||||||
清理过期的跟踪记录
|
清理过期的跟踪记录
|
||||||
|
|||||||
Reference in New Issue
Block a user