detection.py 952 B

1234567891011121314151617181920212223242526272829303132
  1. """
  2. 检测配置
  3. """
  4. # 检测配置
  5. DETECTION_CONFIG = {
  6. 'target_classes': ['person'], # 检测目标类别
  7. 'confidence_threshold': 0.5, # 置信度阈值
  8. 'detection_interval': 0.1, # 检测间隔(秒)
  9. }
  10. # 安全检测模型配置
  11. SAFETY_DETECTION_CONFIG = {
  12. 'model_path': '/home/wen/dsh/yolo/yolo11m_safety.pt', # 安全检测模型路径
  13. 'use_gpu': True, # 是否使用 GPU
  14. 'conf_threshold': 0.5, # 一般物品置信度阈值 (安全帽、反光衣)
  15. 'person_threshold': 0.8, # 人员检测置信度阈值
  16. # 检测类别映射
  17. 'class_map': {
  18. 0: '安全帽',
  19. 3: '人',
  20. 4: '反光衣'
  21. },
  22. # 检测间隔
  23. 'detection_interval': 0.1, # 检测间隔(秒)
  24. # 告警控制
  25. 'alert_cooldown': 3.0, # 同一目标告警冷却时间(秒)
  26. 'max_alerts_per_minute': 10, # 每分钟最大告警数
  27. }