🔌 API 调用示例
curl http://localhost:5001/api/tools/yolo-detect/health
{
"status": "ok",
"model": "yolov8-ballast",
"classes": {
"0": "工具",
"1": "石块",
"2": "塑料制品",
"3": "金属异物",
"4": "其他异物"
}
}
curl -X POST http://localhost:5001/api/tools/yolo-detect \
-F "image=@test.jpg" \
-F "conf=0.25"
{
"success": true,
"count": 3,
"detections": [
{
"class_id": 1,
"class_name": "石块",
"confidence": 0.92,
"bbox": {"x1": 120, "y1": 80, "x2": 180, "y2": 140}
},
...
],
"annotated_image_b64": "...(base64)"
}