Update full pipeline to face plus two-stage workshoe flow

This commit is contained in:
tian 2026-03-15 21:10:18 +08:00
parent ce5e0dcc43
commit fb901e2802

View File

@ -6,6 +6,10 @@
"graphs": [
{
"name": "cam1_full_pipeline",
"executor": {
"batch_size": 2,
"run_budget": 8
},
"nodes": [
{
"id": "in_cam1",
@ -16,24 +20,25 @@
"fps": 30,
"width": 1920,
"height": 1080,
"use_mpp": true,
"use_ffmpeg": false,
"use_ffmpeg": true,
"use_mpp": false,
"force_tcp": true,
"reconnect_sec": 5,
"reconnect_backoff_max_sec": 30
},
{
"id": "pre_face",
"id": "pre_rgb",
"type": "preprocess",
"role": "filter",
"enable": true,
"cpu_affinity": [2],
"dst_w": 1920,
"dst_h": 1080,
"dst_format": "rgb",
"dst_packed": true,
"resize_mode": "stretch",
"keep_ratio": false,
"rga_gate": "ppe_detection",
"rga_gate": "full_pipeline_1080p",
"use_rga": true
},
{
@ -41,6 +46,7 @@
"type": "ai_scrfd_sliding",
"role": "filter",
"enable": true,
"cpu_affinity": [4],
"infer_fps": 5,
"model_path": "./models/scrfd_500m_640.rknn",
"model_w": 640,
@ -62,6 +68,7 @@
"type": "ai_face_recog",
"role": "filter",
"enable": true,
"cpu_affinity": [4],
"model_path": "./models/mobilefacenet_arcface.rknn",
"align": true,
"emit_embedding": false,
@ -81,83 +88,146 @@
}
},
{
"id": "pre_yolo",
"type": "preprocess",
"role": "filter",
"enable": true,
"dst_w": 768,
"dst_h": 768,
"dst_format": "rgb",
"dst_packed": true,
"resize_mode": "stretch",
"keep_ratio": false,
"rga_gate": "ppe_detection",
"use_rga": true
},
{
"id": "yolo_ppe",
"id": "person_det",
"type": "ai_yolo",
"role": "filter",
"enable": true,
"infer_fps": 5,
"model_path": "./models/best-768.rknn",
"cpu_affinity": [5],
"use_rga": true,
"rga_gate": "full_pipeline_1080p",
"rga_max_inflight": 4,
"dst_packed": true,
"use_dma_input": true,
"infer_fps": 2,
"infer_phase_ms": 0,
"model_path": "./models/yolov8n-640.rknn",
"model_version": "v8",
"model_w": 768,
"model_h": 768,
"num_classes": 11,
"model_w": 640,
"model_h": 640,
"num_classes": 80,
"conf": 0.35,
"nms": 0.45,
"class_filter": [0],
"bbox_expand": {
"enable": true,
"class_id": 0,
"left": 0.06,
"right": 0.06,
"top": 0.04,
"bottom": 0.16
},
"debug": {
"stats": true,
"stats_interval": 30,
"detections": true
},
"class_filter": [3, 6, 10]
"detections": false
}
},
{
"id": "tracker",
"id": "person_trk",
"type": "tracker",
"role": "filter",
"enable": true,
"cpu_affinity": [5],
"mode": "bytetrack_lite",
"per_class": true,
"state_key": "ppe_detection",
"track_classes": [3, 6, 10],
"state_key": "full_pipeline_1080p_workshoe",
"track_classes": [0],
"ignore_classes": [],
"allowed_models": ["yolov8"],
"high_th": 0.5,
"low_th": 0.1,
"high_th": 0.55,
"low_th": 0.10,
"iou_th": 0.3,
"max_age_ms": 1500,
"max_age_ms": 900,
"min_hits": 2,
"max_tracks": 128
},
{
"id": "logic_boots",
"id": "shoe_det",
"type": "ai_shoe_det",
"role": "filter",
"enable": true,
"cpu_affinity": [6],
"use_rga": true,
"rga_gate": "full_pipeline_1080p",
"rga_max_inflight": 4,
"dst_packed": true,
"use_dma_input": false,
"infer_fps": 2,
"infer_phase_ms": 150,
"model_path": "./models/yolov8s_shoe_640-rk3588.rknn",
"model_w": 640,
"model_h": 640,
"conf": 0.22,
"nms": 0.45,
"v8_box_format": "cxcywh",
"append_detections": true,
"dynamic_roi": {
"enable": true,
"person_class_id": 0,
"shoe_class_id": 1,
"debug_roi_class_id": -1,
"max_rois": 3,
"min_person_height": 60,
"max_box_area_ratio": 0.60,
"x_offset": -0.24,
"y_offset": 0.64,
"width_scale": 1.48,
"height_scale": 0.58
}
},
{
"id": "shoe_assoc",
"type": "logic_gate",
"role": "filter",
"enable": true,
"cpu_affinity": [6],
"mode": "person_shoe_check",
"debug": false,
"person_shoe_check": {
"person_class": 0,
"shoe_class": 1,
"violation_class": 2,
"min_person_score": 0.30,
"min_shoe_score": 0.22,
"require_person_track_id": true,
"attach_person_track_to_shoe": true,
"emit_missing_violation": false,
"foot_region": {
"x_offset": -0.24,
"y_offset": 0.64,
"width_scale": 1.48,
"height_scale": 0.58
}
}
},
{
"id": "shoe_color",
"type": "logic_gate",
"role": "filter",
"enable": true,
"cpu_affinity": [6],
"mode": "ppe_boots_check",
"anchor_class": 6,
"boots_class": 3,
"anchor_class": 0,
"boots_class": 1,
"violation_class": 2,
"debug": false,
"color_check": {
"enable": false,
"method": "hsv",
"dark_threshold": 80,
"enable": true,
"method": "brightness",
"dark_threshold": 90,
"roi_expand": 1.0
},
"debug": false
}
},
{
"id": "pre_osd",
"type": "preprocess",
"role": "filter",
"enable": true,
"cpu_affinity": [7],
"dst_w": 1920,
"dst_h": 1080,
"dst_format": "nv12",
"resize_mode": "stretch",
"rga_gate": "ppe_detection",
"rga_gate": "full_pipeline_1080p",
"use_rga": true
},
{
@ -165,6 +235,7 @@
"type": "osd",
"role": "filter",
"enable": true,
"cpu_affinity": [7],
"draw_bbox": true,
"draw_text": true,
"draw_face_det": true,
@ -173,18 +244,21 @@
"line_width": 1.0,
"font_scale": 0.5,
"use_rga_bbox": false,
"labels": ["helmet", "gloves", "vest", "boots", "goggles", "none", "Person", "no_helmet", "no_goggle", "no_gloves", "no_boots", "violation"]
"labels": ["person", "shoe", "non_black_shoe"]
},
{
"id": "publish",
"type": "publish",
"role": "filter",
"enable": true,
"cpu_affinity": [3],
"queue": {"size": 2, "policy": "drop_oldest"},
"codec": "h264",
"fps": 30,
"gop": 60,
"bitrate_kbps": 4000,
"mpp_output_timeout_ms": 50,
"mpp_packet_wait_ms": 10,
"use_mpp": true,
"use_ffmpeg_mux": true,
"outputs": [
@ -205,21 +279,21 @@
"type": "alarm",
"role": "sink",
"enable": true,
"eval_fps": 10,
"labels": ["helmet", "gloves", "vest", "boots", "goggles", "none", "Person", "no_helmet", "no_goggle", "no_gloves", "no_boots", "violation"],
"eval_fps": 2,
"labels": ["person", "shoe", "non_black_shoe"],
"rules": [
{
"name": "non_compliant_boots",
"class_ids": [10],
"name": "non_compliant_workshoe",
"class_ids": [2],
"roi": {"x": 0.0, "y": 0.0, "w": 1.0, "h": 1.0},
"min_score": 0.3,
"min_box_area_ratio": 0.01,
"require_track_id": true,
"min_score": 0.40,
"min_box_area_ratio": 0.0,
"require_track_id": false,
"min_duration_ms": 800,
"min_hits": 2,
"hit_window_ms": 1000,
"cooldown_ms": 5000,
"per_track_cooldown_ms": 5000
"hit_window_ms": 2000,
"cooldown_ms": 15000,
"per_track_cooldown_ms": 0
}
],
"face_rules": [
@ -249,7 +323,9 @@
"actions": {
"log": {
"enable": true,
"level": "info"
"level": "info",
"include_detections": true,
"min_interval_ms": 2000
},
"snapshot": {
"enable": true,
@ -295,17 +371,18 @@
}
],
"edges": [
["in_cam1", "pre_face"],
["pre_face", "face_det"],
["in_cam1", "pre_rgb"],
["pre_rgb", "face_det"],
["face_det", "face_recog"],
["face_recog", "pre_yolo"],
["pre_yolo", "yolo_ppe"],
["yolo_ppe", "tracker"],
["tracker", "logic_boots"],
["logic_boots", "osd"],
["osd", "pre_osd"],
["pre_osd", "publish"],
["publish", "alarm"]
["face_recog", "person_det"],
["person_det", "person_trk"],
["person_trk", "shoe_det", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
["shoe_det", "shoe_assoc", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
["shoe_assoc", "shoe_color", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
["shoe_color", "osd", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
["osd", "pre_osd", {"queue": {"size": 32, "strategy": "drop_oldest"}}],
["pre_osd", "publish", {"queue": {"size": 64, "strategy": "drop_oldest"}}],
["publish", "alarm", {"queue": {"size": 64, "strategy": "drop_oldest"}}]
]
}
]