POST

工件识别 - 文件上传版本 ⭐推荐

⭐ 推荐使用

直接上传图片文件进行识别,无需Base64转换(推荐前端使用)

在线测试
填写参数并测试此接口,查看实时响应

请求体参数

工件图片文件

批次号

物料编码数组

理论数量数组

草图文件数组

接口地址

完整 URL

http://8.148.151.8:4001/api/process_image_file

分类

核心功能
请求体
Content-Type: multipart/form-data
字段名类型必填说明示例
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
      }
    ]
  }
}
代码示例
JavaScript / Fetch API
// 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);