From 541a7859559bd8849053d4bc13fab264eef84bae Mon Sep 17 00:00:00 2001 From: zhangpengju Date: Thu, 6 Mar 2025 11:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20API=5FDocs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API_Docs/围界入侵检测接口文档.md | 115 +++++++++++++++++++++++++ API_Docs/安检行为检测接口文档 .md | 138 ++++++++++++++++++++++++++++++ 2 files changed, 253 insertions(+) create mode 100644 API_Docs/围界入侵检测接口文档.md create mode 100644 API_Docs/安检行为检测接口文档 .md diff --git a/API_Docs/围界入侵检测接口文档.md b/API_Docs/围界入侵检测接口文档.md new file mode 100644 index 0000000..dc69158 --- /dev/null +++ b/API_Docs/围界入侵检测接口文档.md @@ -0,0 +1,115 @@ +# 围界入侵检测接口文档 + +## 一、接口概述 + +本接口用于对视频文件或 RTSP 流进行围界入侵检测,可指定检测的时间范围。通过输入摄像头 ID 来关联特定的监控设备,同时提供入侵方向、风险区域延长等信息,还设有预留的`info`字段用于传递额外的信息,如模型参数等。 + +## 二、接口信息 + +### 1. 接口地址 + +`http://{ip:port}/perimeter_intrusion_detection` + +### 2. 请求方法 + +`POST` + +### 3. 请求头 + +``` +Content-Type: application/json +``` + +## 三、请求参数 + +| 参数名 | 类型 | 是否必填 | 描述 | +| --------------------- | ------- | -------- | ------------------------------------------------------------ | +| input\_type | String | 是 | 输入类型,取值为`mp4`或`rtsp` | +| input\_data | String | 是 | 若`input_type`为`mp4`,则为视频文件的本地路径或 URL;若为`rtsp`,则为 RTSP 流地址 | +| camera\_id | String | 是 | 摄像头的唯一标识符,用于关联特定的监控设备 | +| start\_time | String | 是 | 检测起始时间,格式为`YYYY-MM-DD HH:MM:SS` | +| intrusion\_direction | Integer | 是 | 入侵方向,0 代表`右至左`,1 代表`上至下`,2 代表`左至右`,3 代表`下至上` | +| risk\_area\_extension | Integer | 是 | 风险区域延长基准数值,默认为 100 像素点 | +| info | Object | 否 | 预留字段,用于传递额外信息,如模型参数等,以字典形式存储 | + +### 请求参数示例 + +```markdown +{ + "input_type": "rtsp", + "input_data": "rtsp://example.com/stream", + "camera_id": "CAM001", + "start_time": "2024-10-01 08:00:00", + "intrusion_direction": 1, + "risk_area_extension": 100, + "info": { + "detection_threshold": 0.8 + } +} +``` + +## 四、响应参数 + +| 参数名 | 类型 | 描述 | +| ------------------- | ------- | ------------------------------------------------------------ | +| status | Integer | 响应状态码,200 表示成功,其他表示失败 | +| message | String | 状态描述信息 | +| is_intrusion | String | 是否存在围界入侵,取值为true或false | +| intrusion_timestamp | String | 入侵发生的时间戳,格式为YYYY-MM-DD HH:MM:SS。当is_intrusion为false时,该字段可不填 | + +### 响应参数示例 + +```markdown +{ + "status": 200, + "message": "检测成功", + "data": {} +} +``` + + + +## 五、错误处理 + +| 状态码 | 描述 | +| --- | ----------------------- | +| 400 | 输入参数错误,如参数缺失、格式不正确等 | +| 404 | 未找到指定的视频文件或无法连接到 RTSP 流 | +| 500 | 服务器内部错误,如模型加载失败、计算资源不足等 | + +### 错误响应示例 + +```markdown +{ + "status": 400, + "message": "输入参数错误:intrusion_direction应输入0、1、2、3中的一个整数", +} +``` + +## 六、结果写入(待定) + +存在入侵情况 + +``` +{ + "status": 200, + "message": "检测成功", + "data": { + "is_intrusion": true, + "intrusion_timestamp": "2024-01-01 10:02:30" + } +} +``` + +不存在入侵情况 + +``` +{ + "status": 200, + "message": "检测成功", + "data": { + "is_intrusion": false + } +} +``` + diff --git a/API_Docs/安检行为检测接口文档 .md b/API_Docs/安检行为检测接口文档 .md new file mode 100644 index 0000000..32d96d8 --- /dev/null +++ b/API_Docs/安检行为检测接口文档 .md @@ -0,0 +1,138 @@ +# 安检行为检测接口文档 + +## 一、接口概述 + +本接口旨在对视频源进行安检行为检测,可精准定位检测时间与空间范围,明确需检测的行为种类及相关量化阈值,同时支持模型参数调整,以适配不同应用场景的安检需求。 + +## 二、接口信息 + +### 1. 接口地址 + +`http://{ip:port}/security_inspection_behavior_detection` + +### 2. 请求方法 + +`POST` + +### 3. 请求头 + + + +``` +Content-Type: application/json +``` + +## 三、请求参数 + + + +| 参数名 | 类型 | 是否必填 | 描述 | +| ----------- | ------ | -------- | ------------------------------------------------------------ | +| input\_type | String | 是 | 输入类型,取值为`mp4、`rtsp | +| input\_data | String | 是 | 若`input_type`为`mp4`,则为视频文件的本地路径或 URL;若为`rtsp`,则为 RTSP 流地址 | +| camera\_id | String | 是 | 摄像头的唯一标识符,用于关联特定的监控设备 | +| start\_time | String | 是 | 检测起始时间,格式为`YYYY-MM-DD HH:MM:SS` | +| info | Object | 否 | 预留字段,用于传递额外信息,如模型参数等,以字典形式存储 | + +### 请求参数示例 + + + +```markdown +{ + "input_type": "rtsp", + "input_data": "rtsp://security_camera_01.com/stream", + "camera_id": "SEC_CAM_001", + "start_time": "2024-10-01 08:00:00", + "info": { + "detection_threshold": 0.8 + } +} +``` + +## 四、响应参数 + + + +| 参数名 | 类型 | 描述 | +| ------------------------ | ------- | ------------------------------------------------------------ | +| status | Integer | 响应状态码,200 表示成功,其他表示失败 | +| message | String | 状态描述信息,如 "Success" 或 "Input parameter error" | +| total\_inspected\_people | Integer | 安检总人数 | +| inspection\_details | Array | 每个人的安检详细信息列表,每个元素包含以下内容: - `person_id`: 人员唯一标识 -`front_*_inspected`和`back_*_inspected`身体正反面的各部位 是否经过安检,经过安检为true,未安检为false | + +### 响应参数示例 + + + +```markdown +{ + "status": 200, + "message": "检测成功", + "data":{} +} +``` + +## 五、错误处理 + + + +| 状态码 | 描述 | +| --- | -------------------------------------------------- | +| 400 | 输入参数错误,如参数缺失、格式不正确、`behavior_types`中行为类型不存在于预定义列表等 | +| 404 | 未找到指定的视频文件、无法连接到 RTSP 流或摄像头设备 | +| 500 | 服务器内部错误,如模型加载失败、计算资源不足、检测过程中出现异常 | + +### 错误响应示例 + + + +```markdown +{ + "status": 400, + "message": "输入参数错误:start_time格式不正确,应为YYYY-MM-DD HH:MM:SS", +} +``` + +## 六、结果写入(待定) + +```markdown +{ + "status": 200, + "message": "检测成功", + "data":{ + "total_inspected_people": 10, + "inspection_details": [ + { + "person_id": 1, + "front_head_inspected": true, + "front_upper_body_inspected": true, + "front_arms_inspected": true, + "front_legs_inspected": true, + "front_shoes_inspected": true, + "back_head_inspected": true, + "back_upper_body_inspected": true, + "back_arms_inspected": true, + "back_legs_inspected": true, + "back_shoes_inspected": true + }, + { + "person_id": 2, + "front_head_inspected": true, + "front_upper_body_inspected": true, + "front_arms_inspected": false, + "front_legs_inspected": false, + "front_shoes_inspected": true, + "back_head_inspected": true, + "back_upper_body_inspected": true, + "back_arms_inspected": false, + "back_legs_inspected": false, + "back_shoes_inspected": true + }, + // 其他人员的安检信息 + ] + } + +} +``` +