直接上传图片文件进行识别,无需Base64转换(推荐前端使用)
完整 URL
http://8.148.151.8:4001/api/process_image_file分类
| 字段名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| workpiece_image | file | 是 | 工件图片文件 | - |
| document_number | string | 是 | 批次号 | DOC20250117001 |
| material_codes | array | 是 | 物料编码数组 | ["8884X-120","8886X-120"] |
| theoretical_quantities | array | 是 | 理论数量数组 | [100,50] |
| simple_images | array | 是 | 草图文件数组 | ["file1.jpg","file2.jpg"] |
{
"success": true,
"code": 200,
"message": "图像识别完成,结果已保存",
"data": {
"documentNumber": "DOC20250117001",
"visualizationImagePath": "out_imgs/visualization/1.jpg",
"processedResults": [
{
"materialCode": "8884X-120",
"theoreticalQuantity": 100,
"actualQuantity": 95
}
]
}
}// POST 请求示例
const response = await fetch('http://8.148.151.8:4001/api/process_image_file', {
method: 'POST'
});
const data = await response.json();
console.log(data);