Skip to content

YOLO模型调用API

通过restful接口,使用YOLO模型的能力

YOLO模型调用

接口功能:使用yolo模型识别
请求方式:POST
请求地址:http://{IP地址}:{端口}/detect

  • 请求参数
名称位置类型必选说明
image_base64form-datastring图片base64编码
conf_thresform-datadouble置信度阈值,允许为空,默认0.25
iou_thresform-datadouble交并比,允许为空,默认0.45
  • 请求示例
shell
curl --location --request POST 'http://ip:port/detect' \
--form 'image_base64="/9j/4AAQSkZJxxxxx"' \
--form 'conf_thres="0.25"' \
--form 'iou_thres="0.45"'
  • 响应参数
名称类型说明
successboolean调用结果,true成功false失败
detectionsobject识别结果,详情见detection
annotated_base64string结果图片base编码

detection

名称类型说明
labelstring识别标签,如fire、smoke
confidenceobject识别结果
  • 响应示例
json
{
    "success": true,
    "detections": [
        {
            "label": "fire",
            "confidence": 0.9047
        },
        {
            "label": "smoke",
            "confidence": 0.8467
        }
    ],
    "annotated_base64": "/9j/4AAQSkZJRgABAQAAAQAxxxxxxxxxx"
}

最后更新于: