Skip to content

Commit 3e00b5c

Browse files
committed
[add] add Fast API
1 parent e56ce08 commit 3e00b5c

5 files changed

Lines changed: 1038 additions & 268 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,50 @@ sudo docker run --rm --privileged --net=host \
122122

123123
---
124124

125+
## 🔌 API 接口文档
126+
127+
本项目提供了兼容 Ultralytics Cloud API 标准的 RESTful 接口,支持通过 HTTP POST 请求上传图片进行目标检测。
128+
129+
### 1. 模型推理接口 (Predict)
130+
131+
**Endpoint:** `POST /api/models/yolo11/predict`
132+
133+
#### 请求参数 (Multipart/Form-Data):
134+
- `file`: (必填) 待检测的图片文件。
135+
- `conf`: (可选) 置信度阈值,范围 0.0-1.0。若未提供,则使用系统默认值。
136+
- `iou`: (可选) NMS IOU 阈值,范围 0.0-1.0。若未提供,则使用系统默认值。
137+
138+
#### Curl 示例:
139+
```bash
140+
curl -X POST "http://<开发板IP>:8000/api/models/yolo11/predict" \
141+
-F "file=@/path/to/your/image.jpg" \
142+
-F "conf=0.25" \
143+
-F "iou=0.45"
144+
```
145+
146+
#### 响应格式 (JSON):
147+
```json
148+
{
149+
"success": true,
150+
"predictions": [
151+
{
152+
"class": "person",
153+
"confidence": 0.89,
154+
"box": {
155+
"x1": 100,
156+
"y1": 150,
157+
"x2": 400,
158+
"y2": 600
159+
}
160+
}
161+
],
162+
"image": {
163+
"width": 1920,
164+
"height": 1080
165+
}
166+
}
167+
```
168+
125169
## 平台详细文档
126170

127171
- [RK3588 使用指南](src/rk3588/README.md)

0 commit comments

Comments
 (0)