204 lines
5.2 KiB
JSON
204 lines
5.2 KiB
JSON
{
|
|
"queue": {
|
|
"size": 8,
|
|
"strategy": "drop_oldest"
|
|
},
|
|
"graphs": [
|
|
{
|
|
"name": "sample_region_behavior_full",
|
|
"nodes": [
|
|
{
|
|
"id": "in",
|
|
"type": "input_rtsp",
|
|
"role": "source",
|
|
"enable": true,
|
|
"url": "rtsp://127.0.0.1/live",
|
|
"fps": 25,
|
|
"width": 1920,
|
|
"height": 1080,
|
|
"use_ffmpeg": true,
|
|
"use_mpp": false,
|
|
"force_tcp": true
|
|
},
|
|
{
|
|
"id": "pre",
|
|
"type": "preprocess",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"dst_w": 1920,
|
|
"dst_h": 1080,
|
|
"dst_format": "rgb",
|
|
"dst_packed": true,
|
|
"resize_mode": "stretch",
|
|
"use_rga": true
|
|
},
|
|
{
|
|
"id": "person_det",
|
|
"type": "ai_yolo",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"model_path": "./models/object_det_yolov8n_coco_640_rk3588.rknn",
|
|
"model_version": "v8",
|
|
"model_w": 640,
|
|
"model_h": 640,
|
|
"num_classes": 80,
|
|
"class_filter": [0],
|
|
"conf": 0.35,
|
|
"nms": 0.45
|
|
},
|
|
{
|
|
"id": "trk",
|
|
"type": "tracker",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"mode": "bytetrack_lite",
|
|
"per_class": true,
|
|
"track_classes": [0],
|
|
"high_th": 0.55,
|
|
"low_th": 0.10,
|
|
"iou_th": 0.30,
|
|
"max_age_ms": 1200,
|
|
"min_hits": 2
|
|
},
|
|
{
|
|
"id": "region_evt",
|
|
"type": "region_event",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"events": [
|
|
{
|
|
"type": "intrusion",
|
|
"region_id": "zone_a",
|
|
"roi": { "x": 0.08, "y": 0.12, "w": 0.30, "h": 0.42 },
|
|
"min_duration_ms": 1000
|
|
},
|
|
{
|
|
"type": "climb",
|
|
"region_id": "fence_1",
|
|
"line": { "x1": 0.20, "y1": 0.40, "x2": 0.80, "y2": 0.40 },
|
|
"min_duration_ms": 300,
|
|
"min_vertical_motion": 50
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "action_evt",
|
|
"type": "action_recog",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"events": [
|
|
{
|
|
"type": "fall",
|
|
"window_ms": 1500,
|
|
"min_drop_pixels": 120,
|
|
"min_aspect_ratio_delta": 0.35,
|
|
"activate_duration_ms": 300
|
|
},
|
|
{
|
|
"type": "fight",
|
|
"window_ms": 1200,
|
|
"proximity_pixels": 220,
|
|
"min_motion_pixels": 90,
|
|
"activate_duration_ms": 200
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "fusion",
|
|
"type": "event_fusion",
|
|
"role": "filter",
|
|
"enable": true
|
|
},
|
|
{
|
|
"id": "osd",
|
|
"type": "osd",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"draw_bbox": true,
|
|
"draw_text": true,
|
|
"labels": ["person"]
|
|
},
|
|
{
|
|
"id": "post",
|
|
"type": "preprocess",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"dst_w": 1920,
|
|
"dst_h": 1080,
|
|
"dst_format": "nv12",
|
|
"resize_mode": "stretch",
|
|
"use_rga": true
|
|
},
|
|
{
|
|
"id": "pub",
|
|
"type": "publish",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"codec": "h264",
|
|
"fps": 25,
|
|
"bitrate_kbps": 2000,
|
|
"outputs": [
|
|
{ "proto": "rtsp_server", "port": 8555, "path": "/live/behavior_full" }
|
|
]
|
|
},
|
|
{
|
|
"id": "alarm",
|
|
"type": "alarm",
|
|
"role": "sink",
|
|
"enable": true,
|
|
"rules": [
|
|
{
|
|
"name": "intrusion_zone_a",
|
|
"use_behavior_events": true,
|
|
"event_types": ["intrusion"],
|
|
"region_ids": ["zone_a"],
|
|
"min_duration_ms": 1000,
|
|
"cooldown_ms": 10000
|
|
},
|
|
{
|
|
"name": "climb_fence_1",
|
|
"use_behavior_events": true,
|
|
"event_types": ["climb"],
|
|
"region_ids": ["fence_1"],
|
|
"min_duration_ms": 300,
|
|
"cooldown_ms": 8000
|
|
},
|
|
{
|
|
"name": "fall_detected",
|
|
"use_behavior_events": true,
|
|
"event_types": ["fall"],
|
|
"min_duration_ms": 300,
|
|
"cooldown_ms": 12000
|
|
},
|
|
{
|
|
"name": "fight_detected",
|
|
"use_behavior_events": true,
|
|
"event_types": ["fight"],
|
|
"min_duration_ms": 200,
|
|
"cooldown_ms": 12000
|
|
}
|
|
],
|
|
"actions": {
|
|
"log": {
|
|
"enable": true,
|
|
"level": "info"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
["in", "pre"],
|
|
["pre", "person_det"],
|
|
["person_det", "trk"],
|
|
["trk", "region_evt"],
|
|
["region_evt", "action_evt"],
|
|
["action_evt", "fusion"],
|
|
["fusion", "osd"],
|
|
["osd", "post"],
|
|
["post", "pub"],
|
|
["pub", "alarm"]
|
|
]
|
|
}
|
|
]
|
|
}
|