[AI39-1] 外观防侵权检索-提交工作流任务提交图片并创建异步检索任务。提供单图 url/target_image_base64,或多图 image_urls/image_base64s;两种模式不能混用,多图两种列表也不能同时提供。单图 URL 与 Base64 同时提供时优先 URL。
多图先识别主辅图,再按需识别 LOC;手动 loc_items 优先。自动 LOC 仅在 auto_loc_enabled=true 且 description 非空、手动 LOC 为空时执行。提交前处理会增加响应耗时;返回 task_id 后,仍使用原状态和阶段结果接口,后续流程自动执行。
自动 LOC 失败或无结果时不增加自动 LOC 过滤,继续按其他条件检索,请检查 preprocessing.auto_loc.status。多图识别全部失败时仅用第一张,不把其余图片补为辅助图。参数校验失败不创建任务;其他提交失败不保证任务记录不存在。
输入示例(单图 URL、手动 LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"lang": "cn",
"country": [
"CN",
"EU"
],
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
],
"apply_start_time": "20200101",
"apply_end_time": "20260917",
"simple_legal_status": "1,2",
"auto_loc_enabled": false
}
```
输入示例(单图 Base64):
```json
{
"target_image_base64": "<BASE64_ENCODED_IMAGE>",
"description": "目标产品描述",
"lang": "cn"
}
```
输入示例(自动 LOC,不传手动 LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
输入示例(多图 URL、自动 LOC):
```json
{
"image_urls": [
"https://static-open.zhihuiya.com/sample/common_demo.png",
"https://example.com/product-side.png"
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
输入示例(多图 Base64、自动 LOC):
```json
{
"image_base64s": [
"<BASE64_ENCODED_IMAGE_1>",
"<BASE64_ENCODED_IMAGE_2>"
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
成功响应示例(原有单图):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true
}
```
成功响应示例(多图识别、自动 LOC 均完成):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true,
"preprocessing": {
"multi_view": {
"can_use_single_product_multi_view": true,
"main_image_index": 1,
"auxiliary_image_indexes": [
0
],
"excluded_image_indexes": [],
"reason": "同一产品的不同视角"
},
"auto_loc": {
"status": "completed",
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
]
}
}
}
```
失败响应示例:
```json
{
"code": 1,
"success": false,
"task_id": null,
"message": "提交工作流失败: 图片读取失败",
"status": false
}
```
参数校验失败示例(HTTP 422):
```json
{
"detail": [
{
"loc": [
"body",
"country"
],
"msg": "Input should be a valid list",
"type": "list_type",
"input": "EU"
}
],
"code": 1,
"status": false,
"success": false
}
```
示例中额外视角的 example.com 地址、任务 ID 和 Base64 占位符需替换为真实数据;不同图片输入方式的示例需分别使用,不能合并成同一个请求。示例 message 为接口文本示意,不保证随 lang 翻译。