1、产品简介
基于价签识别与多模态大模型定位构建的陈列价签检测产品。产品提取价签对应的商品信息、售价、原价及位置,并补充纸质价签、电子价签和促销价格牌的可见框,适用于门店价格采集、价签巡检与业务侧价格核对。
2、适用场景
门店价格采集:读取识别到的价签售价和可用原价。
价格执行核查:将识别价格与业务侧价格清单比对。
价签人工复核:定位纸质、电子和促销价签,便于回看原图。
3、功能介绍
结构化价格输出:逐条返回商品名称、编码、价格和位置;价格保持字符串形式。
多类型价签定位:覆盖普通纸质价签、电子价签及带明确售价的促销牌。
原文与位置辅助复核:定位文字优先摘录清晰售价,读不清时为空;补充定位不根据位置推断价签必然对应某个 SKU。
支持单张 HTTPS 图片输入;补充定位最多返回 12 个目标,每个目标包含类别、位置框和最多 24 字的可见文字,并通过 coverage 标明定位是否完整。
4、开发指南
本文请求和响应字段遵循对应搭建文档的实际大小写及结构。示例为业务工作流输入输出,不额外假设平台网关封装;对外调用地址、鉴权方式和网关封装应以实际发布接口为准。
4.1 请求参数
参数名 | 类型 | 必填 | 说明 |
imageUrl | String | 是 | 待识别原图的 HTTPS 地址;须可访问,不含空白或 URL 用户名密码 |
4.2 请求示例
{
"imageUrl": "https://example.com/images/api-07.jpg"
}示例图片地址和知识库标识(如有)为占位值,调用时替换为实际资源。
4.3 响应参数
通用字段:
字段路径 | 类型 | 说明 |
success | Boolean | 调用是否成功;有效业务结论不等于审核通过 |
errorCode | String | 成功为空字符串;失败为错误码 |
errorMessage | String | 成功为空字符串;失败为具体错误说明 |
result | Object | 业务结果;失败时为空对象 |
usageMap | Object | 成功为 {"ProcessingCount":1};失败为空对象 |
usageMap.ProcessingCount | Integer | 成功处理计数为 1;失败时该字段不返回 |
业务字段:
字段路径 | 类型 | 说明 |
result.type | String | 固定为 priceTag |
result.priceTags | Array | 价签列表;正常未识别到价签时可为空数组 |
| result.priceTags[ ].skuName | String | 关联商品名称;未识别到时为空字符串 |
| result.priceTags[ ].skuCode | String | 关联商品编码;未识别到时为空字符串 |
| result.priceTags[ ].price | String | 售价,保留字符串;未识别到时为空字符串 |
| result.priceTags[ ].originalPrice | String | 原价;未提供时为空字符串 |
| result.priceTags[ ].location | Object | 价签位置 |
| result.priceTags[ ].location.Left / Top / Right / Bottom | Integer | 左、上、右、下坐标,范围 0–1000 |
补充定位字段:
字段路径 | 类型 | 说明 |
result.grounding | Object | 补充元素定位结果 |
result.grounding.coverage | String | complete:相关可见目标完整;partial:仅部分目标有效或可辨认;空字符串:未获得有效补充定位结果 |
result.grounding.regions | Array | 目标数组,最多 12 项;没有相关目标时可为空 |
| result.grounding.regions[ ].label | String | 目标类别,枚举见下表 |
| result.grounding.regions[ ].bbox_2d | Integer[4] | [左上x,左上y,右下x,右下y];0–1000;左<右,上<下 |
| result.grounding.regions[ ].text | String | 最多 24 字的可确认短名称或文字;看不清时为空字符串 |
目标类别:
label | 含义 |
price_tag | 普通纸质价签 |
electronic_price_tag | 电子价签 |
promotion_price_sign | 带明确售价的促销价格牌 |
坐标换算:横坐标像素值 = 横坐标 × 原图宽度 / 1000;纵坐标像素值 = 纵坐标 × 原图高度 / 1000。
定位仅有部分结果时可返回 success=true、coverage=partial。发生截断时,仅保留已完整解析的合法目标;删除无效框、去重、截短文字或超出目标数量限制也会标记 partial。补充定位未发现相关目标时可返回合法空 regions;正常无价签时,priceTags 也允许为空数组。主业务识别成功后,补充定位失败不影响整体成功:grounding.coverage 返回空字符串,grounding.regions 返回空数组,ProcessingCount 仍为 1。主业务识别失败时,整体返回失败。
正常未识别到价签时返回 success=true、priceTags=[ ]。价格或关联商品信息为空时,仍保留有效位置框;非法或越界位置记录会被跳过,同一场景内完全重复的价签会去重。存在有效价签时保留其结果;仅在所有记录被丢弃且存在异常记录时返回失败。返回结构不合法也会失败。priceTags 与 grounding.regions 为不同来源的结果,不承诺逐项对应。
4.4 响应示例
以下均为结构示例,非实测结果。
1)成功响应
{
"success": true,
"errorCode": "",
"errorMessage": "",
"result": {
"type": "priceTag",
"priceTags": [
{
"skuName": "sku_test",
"skuCode": "001",
"price": "5.50",
"originalPrice": "6",
"location": {
"Left": 100,
"Top": 200,
"Right": 300,
"Bottom": 400
}
}
],
"grounding": {
"coverage": "complete",
"regions": [
{
"label": "price_tag",
"bbox_2d": [
100,
200,
300,
400
],
"text": "5.50"
}
]
}
},
"usageMap": {
"ProcessingCount": 1
}
}2)补充定位仅返回部分结果
{
"success": true,
"errorCode": "",
"errorMessage": "",
"result": {
"type": "priceTag",
"priceTags": [
{
"skuName": "sku_test",
"skuCode": "001",
"price": "5.50",
"originalPrice": "6",
"location": {
"Left": 100,
"Top": 200,
"Right": 300,
"Bottom": 400
}
}
],
"grounding": {
"coverage": "partial",
"regions": [
{
"label": "price_tag",
"bbox_2d": [
100,
200,
300,
400
],
"text": ""
}
]
}
},
"usageMap": {
"ProcessingCount": 1
}
}主业务成功,补充定位不可用
{
"success": true,
"errorCode": "",
"errorMessage": "",
"result": {
"type": "priceTag",
"priceTags": [
{
"skuName": "sku_test",
"skuCode": "001",
"price": "5.50",
"originalPrice": "6",
"location": {
"Left": 100,
"Top": 200,
"Right": 300,
"Bottom": 400
}
}
],
"grounding": {
"coverage": "",
"regions": [ ]
}
},
"usageMap": {
"ProcessingCount": 1
}
}正常未识别到价签
{
"success": true,
"errorCode": "",
"errorMessage": "",
"result": {
"type": "priceTag",
"priceTags": [ ],
"grounding": {
"coverage": "complete",
"regions": [ ]
}
},
"usageMap": {
"ProcessingCount": 1
}
}价签位置有效,价格及商品信息未识别到
{
"success": true,
"errorCode": "",
"errorMessage": "",
"result": {
"type": "priceTag",
"priceTags": [
{
"skuName": "",
"skuCode": "",
"price": "",
"originalPrice": "",
"location": {
"Left": 100,
"Top": 200,
"Right": 300,
"Bottom": 400
}
}
],
"grounding": {
"coverage": "complete",
"regions": [
{
"label": "price_tag",
"bbox_2d": [
100,
200,
300,
400
],
"text": ""
}
]
}
},
"usageMap": {
"ProcessingCount": 1
}
}参数错误响应
{
"success": false,
"errorCode": "InvalidParameter",
"errorMessage": "imageUrl 必须为有效的 HTTPS 图片地址",
"usageMap": {},
"result": {}
}处理失败响应
{
"success": false,
"errorCode": "DownstreamUnavailable",
"errorMessage": "返回包含异常记录,未能提取有效价签",
"usageMap": {},
"result": {}
}4.5 错误码
错误码 | 含义 | 处理建议 |
InvalidParameter | 输入不合法或识别服务明确返回业务错误 | 根据 errorMessage 修正参数或业务输入后重新调用 |
DownstreamUnavailable | 鉴权、限流、超时、空响应、缺字段或解析等处理异常 | 根据 errorMessage 检查资源与服务状态;临时故障可稍后重试 |
应结合 success、errorCode、errorMessage 判断结果。源搭建文档未约定每类业务错误对应的 HTTP 状态码。平台公共错误码可参考错误码,本接口工作流错误码以上表为准。