From 5968e8f7900657ae5730ebc42d6488b1c39f79fc Mon Sep 17 00:00:00 2001 From: haotian <2421912570@qq.com> Date: Mon, 2 Mar 2026 10:39:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/production_4ch.json | 2 +- configs/sample_cam1_ppe12.json | 67 ++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/configs/production_4ch.json b/configs/production_4ch.json index 85166f1..0cf7c70 100644 --- a/configs/production_4ch.json +++ b/configs/production_4ch.json @@ -41,7 +41,7 @@ "type": "ai_yolo", "role": "filter", "enable": true, - "infer_fps": 10, + "infer_fps": 5, "model_path": "./models/best-768.rknn", "model_version": "v8", "model_w": 768, diff --git a/configs/sample_cam1_ppe12.json b/configs/sample_cam1_ppe12.json index 13bed39..07d349c 100644 --- a/configs/sample_cam1_ppe12.json +++ b/configs/sample_cam1_ppe12.json @@ -90,6 +90,41 @@ }, "debug": true }, + { + "id": "face_det_cam1", + "type": "ai_face_det", + "role": "filter", + "enable": true, + "model_path": "./models/RetinaFace_mobile320.rknn", + "conf": 0.7, + "nms": 0.4, + "max_faces": 10, + "output_landmarks": true, + "input_format": "rgb" + }, + { + "id": "face_recog_cam1", + "type": "ai_face_recog", + "role": "filter", + "enable": true, + "model_path": "./models/mobilefacenet_arcface.rknn", + "align": true, + "emit_embedding": false, + "max_faces": 10, + "input_format": "rgb", + "input_dtype": "uint8", + "threshold": { + "accept": 0.45, + "margin": 0.05 + }, + "gallery": { + "backend": "sqlite", + "path": "./models/face_gallery.db", + "load_on_start": true, + "expected_dim": 512, + "dtype": "auto" + } + }, { "id": "osd_cam1", "type": "osd", @@ -97,8 +132,8 @@ "enable": true, "draw_bbox": true, "draw_text": true, - "draw_face_det": false, - "draw_face_bbox": false, + "draw_face_det": true, + "draw_face_bbox": true, "line_width": 2, "font_scale": 1, "use_rga_bbox": false, @@ -163,6 +198,30 @@ "per_track_cooldown_ms": 5000 } ], + "face_rules": [ + { + "name": "unknown_face", + "type": "unknown", + "cooldown_ms": 7000, + "min_sim": 0.35, + "min_hits": 2, + "hit_window_ms": 1500, + "min_face_area_ratio": 0.01, + "min_face_aspect": 0.6, + "max_face_aspect": 1.6 + }, + { + "name": "known_person", + "type": "person", + "cooldown_ms": 7000, + "min_sim": 0.6, + "min_hits": 2, + "hit_window_ms": 1500, + "min_face_area_ratio": 0.01, + "min_face_aspect": 0.6, + "max_face_aspect": 1.6 + } + ], "actions": { "log": { "enable": true, @@ -216,7 +275,9 @@ ["pre_cam1", "yolo_cam1"], ["yolo_cam1", "trk_cam1"], ["trk_cam1", "logic_cam1"], - ["logic_cam1", "osd_cam1"], + ["logic_cam1", "face_det_cam1"], + ["face_det_cam1", "face_recog_cam1"], + ["face_recog_cam1", "osd_cam1"], ["osd_cam1", "post_cam1"], ["post_cam1", "pub_cam1"], ["pub_cam1", "alarm_cam1"]