diff --git a/scripts/deploy/relax-alarms.py b/scripts/deploy/relax-alarms.py index db3be63..70f9a05 100644 --- a/scripts/deploy/relax-alarms.py +++ b/scripts/deploy/relax-alarms.py @@ -13,23 +13,15 @@ nodes = body['template']['nodes'] for n in nodes: if n.get('id') != 'alarm_violation': continue - cfg = n['config'] - cfg['cooldown_ms'] = 60000 - cfg['min_score'] = 0.5 - cfg['min_duration_ms'] = 1500 - cfg['min_hits'] = 3 - cfg['hit_window_ms'] = 3000 - # 劳保鞋 - for r in cfg.get('rules', []): + for r in n.get('rules', []): if r['name'] == 'non_compliant_workshoe': r['min_score'] = 0.5 r['cooldown_ms'] = 60000 r['min_hits'] = 3 r['min_duration_ms'] = 1500 - # 陌生人脸 - for r in cfg.get('face_rules', []): + for r in n.get('face_rules', []): if r['name'] == 'unknown_face': r['cooldown_ms'] = 30000 r['max_known_sim'] = 0.2