annotation/README.md

115 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 边缘设备标注服务
## API
### 获取目录文件列表
- 访问地址
```
POST /api/directory/list
```
- 请求头参数
Content-Type : application/json
- 请求参数
```
{
"path":"/home/goroot/hpds_annotation/logs/"
}
```
- 返回值
主题包含的字段result 中的数据结构体,当前返回的是数组类型
| 序号 | 字段名称 | 数据类型 | 说明 |
|-----|--------|---------|------|
| 1 | name | string | 文件名 |
| 2 | path | string | 文件所在的路径 |
| 3 | isDir | bool | 是否文件夹 |
| 4 | size | int | 文件大小 |
| 5 | modTime | int | 文件最后修改日期 |
### 获取目录文件详情
- 访问地址
```
POST /api/directory/info
```
- 请求头参数
Content-Type : application/json
- 请求参数
```
{
"path":"/home/goroot/hpds_annotation/logs/hpds-edge-web-error.log"
}
```
- 返回值
主题包含的字段result 中的数据结构体,当前返回的是对象
| 序号 | 字段名称 | 数据类型 | 说明 |
|-----|--------|---------|------|
| 1 | name | string | 文件名 |
| 2 | path | string | 文件所在的路径 |
| 3 | isDir | bool | 是否文件夹 |
| 4 | size | int | 文件大小 |
| 5 | modTime | int | 文件最后修改日期 |
| 6 | contentBase | string | 文件内容用base64进行编码 |
| 7 | labelStatus | int | 标注状态0:未进行标注1:有病害;2:无病害; |
### 提交标注数据
- 访问地址
```
POST /api/label/submit
```
- 请求头参数
Content-Type : application/json
- 请求参数
```
{
"fileList": ["/home/data/bridge_capture/crack/0001.tif", "/home/data/bridge_capture/crack/0002.tif"],
"labelStatus": true,
"trainingSet": "5月10日隧道数据标注集",
"bizType": 3
}
```
+ 说明
| 序号 | 字段名称 | 数据类型 | 说明 |
|-----|--------|-------|-------------------------------------|
| 1 | fileList | 字符串数组 | 文件的全路径组成的数组 |
| 2 | labelStatus | 布尔值 | 标注状态true: 有病害; false: 无病害 |
| 3 | trainingSet | 字符串 | 训练集名称,上传到云端的训练集名称,如果云端已经存在,将合并训练集操作 |
| 4 | bizType | 整型 | 1: 道路; 2: 桥梁; 3: 隧道; 4: 边坡; |
- 返回值
```
{
"code": 200,
"message": "成功",
"type": "OK"
}
```