# 提交图片识别
接口说明:商品图片识别接口为异步接口,提交图片识别与查询图片识别结果配合使用。该接口为提交照片到勤策后台识别,建议调用接口并发数不超过2QPS。
请求方式: POST(HTTPS)
请求地址: https://{region}/api/openai/v1/submitAiCognition/{clientid}/{timestamp}/{digest}/{msg_id}
在线调试
请求示例:
参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
bizId | Long | 是 | 业务ID,不允许重复,且必须为Long类型,不能超过19位;提交图片后可根据该id查询识别结果 |
recapture | CHAR(1) | 否 | 0:不开启虚假照片识别API识别,1:开启虚假照片识别API识别。 |
isPriceCheck | CHAR(1) | 否 | 代表是否需要识别价签; 0:不开启;1:开启;不传,按照0处理。 |
cmId | VARCHAR(200) | 否 | 客户id(用于判断计分项是否有效) |
scoreRuleName | VARCHAR(200) | 否 | 计分规则名称 |
scoreItemName | VARCHAR(200) | 否 | 计分项名称 |
images | 是 | 图片列表,一组照片最多不超过10张 | |
images.imageType | CHAR(1) | 是 | 0:表示不传入陈列类型,由勤策AI服务器自动识别照片返回照片的陈列类型 1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,22:店招,23:地堆(系统支持传1张/2张照片识别地堆,不能超过2张。建议1张照片识别拍摄地堆对角线。2张照片识别分别拍摄正面、侧面),24:割箱,25:挂架,26:侧柜,27:挂网 低温拍照:传入低温拍照,AI服务器识别出是冷风柜、单开门冰箱、双开门冰箱、卧柜 勤策AI服务器按照传入的陈列类型识别返回对应的结果 |
images.imageUrl | VARCHAR(200) | 是 | 图片URL地址,可以直接访问的图片地址。相同图片url不会重复识别。如果url和base64同时填写,优先级:imagesBase64.imageBase64Str>images.imageUrl |
imagesBase64 | 是 | 图片信息 | |
imagesBase64.imageType | CHAR(1) | 是 | 0:表示不传入陈列类型,由勤策AI服务器自动识别照片返回照片的陈列类型 1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,22:店招,23:地堆(系统支持传1张/2张照片识别地堆,不能超过2张。建议1张照片识别拍摄地堆对角线。2张照片识别分别拍摄正面、侧面),24:割箱,25:挂架,26:侧柜,27:挂网 低温拍照:传入低温拍照,AI服务器识别出是冷风柜、单开门冰箱、双开门冰箱、卧柜 勤策AI服务器按照传入的陈列类型识别返回对应的结果 |
imagesBase64.imageBase64Str | TEXT | 是 | 图片base64编码字符串。如果url和base64同时填写,优先级:imagesBase64.imageBase64Str>images.imageUrl |
响应示例:
{
"return_code": "0",
"return_msg": "响应信息",
"msg_id": "{ msg_id }",
"response_data": "<<DATA>>"
}
数据DATA示例:
{
"bizId": 5122096114208480004,
"images": [{
"imageId": 6604454490876496254,
"imageUrl": "http://image.third.com/5164504684863877680/user_defined/201906/20190625133915796_4bba710b_CAMERA_11001999244.jpg"
}]
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
bizId | Long | 业务ID,不允许重复,且必须为Long类型,不能超过19位;提交图片后可根据该id查询识别结果 |
images | 识别结果 | |
images.imageId | Long | 勤策图片ID |
images.imageUrl | VARCHAR(200) | 图片URL地址 |
# 查询图片识别结果
接口说明:商品图片识别接口为异步接口,查询图片识别结果与提交图片识别配合使用,客户可调用该接口获取图片的识别结果。在提交图片的并发数为2QPS条件下(照片数为2张),勤策AI在接受到客户的完整无损图像后,算法侧3秒内完成SKU识别。
请求方式: POST(HTTPS)
请求地址: https://{region}/api/openai/v1/queryAiResult/{clientid}/{timestamp}/{digest}/{msg_id}
在线调试
请求示例:
参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
bizId | Long | 是 | 业务ID |
createTime | VARCHAR | 否 | 业务创建时间,不传会查近30天的数据,传了会查创建时间前后三天内的数据 |
响应示例:
{
"return_code": "0",
"return_msg": "响应信息",
"msg_id": "{ msg_id }",
"response_data": "<<DATA>>"
}
数据DATA示例:
{
"aiResults": [{
"imageId": 6178387348536236660,
"imageLayout": 1,
"imageType": "23",
"imageUrl": "https://image.third.com/7570161533259730386/user_defined/6296816947687725256/202203/20220302153031473_4513adc0_CAMERA_21002005284.jpg",
"state": "1",
"units": [{
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"originalPrice": "19.5",
"discountPrice": "18.5",
"score": 0.997,
"serial_num": 18,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 689,
"x2": 945,
"y1": 971,
"y2": 1038
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.996,
"originalPrice": "19.5",
"discountPrice":"18.5",
"serial_num": 9,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 445,
"x2": 689,
"y1": 974,
"y2": 1039
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.998,
"serial_num": 19,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 690,
"x2": 951,
"y1": 1039,
"y2": 1110
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.997,
"serial_num": 7,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 442,
"x2": 691,
"y1": 1040,
"y2": 1110
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.998,
"serial_num": 20,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 693,
"x2": 954,
"y1": 1111,
"y2": 1176
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.998,
"serial_num": 6,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 441,
"x2": 691,
"y1": 1112,
"y2": 1177
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.998,
"serial_num": 21,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 696,
"x2": 954,
"y1": 1177,
"y2": 1229
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.998,
"serial_num": 10,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 445,
"x2": 695,
"y1": 1178,
"y2": 1232
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.997,
"serial_num": 22,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 699,
"x2": 954,
"y1": 1230,
"y2": 1282
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.997,
"serial_num": 15,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 455,
"x2": 699,
"y1": 1233,
"y2": 1285
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.982,
"serial_num": 16,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 458,
"x2": 700,
"y1": 1285,
"y2": 1336
}, {
"isBottom": 0,
"layer": 1,
"prd_code": "6928471323821",
"prd_name": "舒客红花清火牙膏180克-V01",
"repeat": 0,
"score": 0.994,
"serial_num": 23,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "7864468815629682996",
"x1": 699,
"x2": 963,
"y1": 1283,
"y2": 1337
}
]
}, {
"imageId": 4887566802691025601,
"imageLayout": 1,
"imageType": "23",
"imageUrl": "https://image.third.com/7570161533259730386/user_defined/6296816947687725256/202203/20220302153024136_4513adc0_CAMERA_21001005281.jpg",
"state": "1",
"recaptureScore": "1.0",
"units": [{
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.946,
"serial_num": 17,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 485,
"x2": 639,
"y1": 838,
"y2": 893
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.952,
"serial_num": 5,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 323,
"x2": 465,
"y1": 866,
"y2": 916
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.982,
"serial_num": 14,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 454,
"x2": 629,
"y1": 894,
"y2": 945
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.992,
"serial_num": 1,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 306,
"x2": 443,
"y1": 914,
"y2": 961
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.994,
"serial_num": 8,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 443,
"x2": 608,
"y1": 945,
"y2": 995
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.989,
"serial_num": 2,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 309,
"x2": 442,
"y1": 960,
"y2": 1003
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.981,
"serial_num": 11,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 445,
"x2": 609,
"y1": 995,
"y2": 1039
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.95,
"serial_num": 4,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 313,
"x2": 445,
"y1": 1003,
"y2": 1045
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.941,
"serial_num": 13,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 447,
"x2": 612,
"y1": 1040,
"y2": 1081
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.726,
"serial_num": 3,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 312,
"x2": 448,
"y1": 1043,
"y2": 1085
}, {
"isBottom": 0,
"layer": 1,
"repeat": 1,
"score": 0.791,
"serial_num": 12,
"skuId": "shuke_honghuaqinghuo_180g",
"waiqin365_product_id": "-1",
"x1": 446,
"x2": 628,
"y1": 1081,
"y2": 1127
}
],
"priceTags": [
{
"x1": 589,
"x2": 845,
"y1": 871,
"y2": 938,
"originalPrice": "13.1",
"discountPrice": "12.2",
"prd_code": "6928471323821",
"prd_x1": 689,
"prd_x2": 945,
"prd_y1": 971,
"prd_y2": 1038,
"extengInfo": ""
}
]
}
],
"bizId": 4966589240925711233,
"groundProductNum": 132,
"imageArea": 8.80,
"imageLength": 3.10,
"imageWidth": 2.84,
"state": "1",
"dataScore": 11.0,
"maxScore": 12.0
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
bizId | Long | 业务ID,提交识别时传的第三方业务ID |
state | CHAR(1) | 识别状态。1:已处理,0:处理中。一组照片全部识别完成就返回已处理,只要有一张照片没有识别完成就是处理中 |
recaptureScore | VARCHAR(20) | 该张照片的翻拍可能性,为0到1之间的小数,数值越大,翻拍的可能性越大。请求参数recapture必须传1,recaptureScore才会有值,值为-1时为虚假照片识别API欠费 |
imageLength | Long | 地堆的长,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数 |
dataScore | Double | 陈列标准总分。计分项里配置的总分 |
maxScore | Double | 陈列得分。匹配的计分项的识别结果得分 |
imageWidth | Long | 地堆的宽,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数 |
imageArea | Long | 地堆的面积,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数 |
groundProductNum | Long | 地堆的商品数量,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数。这个数量并不是识别的商品数量之和 |
aiResults | 一组照片中每张照片的识别结果 | |
aiResults.state | CHAR(1) | 图片识别状态。0:识别失败,1:识别成功,2:识别中 |
aiResults.imageId | Long | 勤策图片ID |
aiResults.imageUrl | VARCHAR(200) | 图片URL地址 |
aiResults.imageType | CHAR(1) | 陈列类型。1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,22:店招,24:割箱,25:挂架,26:侧柜,27:挂网 |
aiResults.imageLayout | CHAR(1) | 总层数。陈列类型为货架、端架、冰箱时才有返回值 |
aiResults.product_purity | VARCHAR(20) | 本品纯净度=本品排面数/(本品排面数+竞品排面数+未识别排面数)。陈列类型为冰箱的时候才有返回值 |
aiResults.product_proportion | VARCHAR(20) | 本品冰箱占比=本品排面数/(本品排面数+竞品排面数+未识别排面数+空位数)。陈列类型为冰箱的时候才有返回值 |
aiResults.fridge_fullness | VARCHAR(20) | 冰箱饱满度=(本品排面数+竞品排面数+未识别排面数)/(本品排面数+竞品排面数+未识别排面数+空位数)。陈列类型为冰箱的时候才有返回值 |
aiResults.fridge_door_struc | CHAR(1) | 0:单开门,1:多开门,2:其他。陈列类型为冰箱的时候才有返回值 |
aiResults.column_num | INT | 列的数量。陈列类型为割箱的时候才有返回值 |
aiResults.height | INT | 所有列中最高列的高度;陈列类型为割箱的时候才有返回值 |
aiResults.units | 识别出的SKU集合,为空时返回空数组[] | |
aiResults.units.waiqin365_product_id | VARCHAR(20) | 勤策商品ID |
aiResults.units.prd_code | VARCHAR(200) | 勤策商品编码 |
aiResults.units.prd_name | VARCHAR(200) | 勤策商品名称 |
aiResults.units.serial_num | INT | SKU的序号:一张照片从左到右从上到下进行排序;序号可以帮助还原SKU在图片中的相对位置;标注序号的范围包括本品、竞品、未识别、空位;陈列类型为货架、端架、冰箱时才有返回值 |
aiResults.units.layer | INT | SKU所在层数;陈列类型为货架、端架、冰箱时才有返回值 |
aiResults.units.repeat | INT | 0:不和其他照片重复的SKU,1:和其他照片重复的SKU。对于货架的陈列场景,勤策把一组照片中两两去重,找出和其他照片重复的SKU,企业可以根据该返回值实现货架拼接去重 |
aiResults.units.skuId | VARCHAR(20) | SKU识别码。NULL_SKU:表示空位,ALL_SKU:表示未识别 |
aiResults.units.isBottom | INT | 0:在底部,1:不在底部,表示叠放在一个或者多个商品上面。说明:仅陈列场景为货架、端架、冰箱时才计算 |
aiResults.units.score | FLOAT | 识别SKU可信度。越接近1可信度越高 |
aiResults.units.originalPrice | VARCHAR(20) | 零售价格 |
aiResults.units.discountPrice | VARCHAR(20) | 促销价格 |
aiResults.units.x1 | INT | SKU的左上角顶点横坐标X1。对角线的两个顶点可以确定一个矩形 |
aiResults.units.y1 | INT | SKU的左上角顶点纵坐标Y1 |
aiResults.units.x2 | INT | SKU的右下角顶点横坐标X2 |
aiResults.units.y2 | INT | SKU的右下角顶点纵坐标Y2 |
aiResults.priceTags.x1 | INT | 价签的左上角顶点横坐标X1。对角线的两个顶点可以确定一个矩形 |
aiResults.priceTags.y1 | INT | 价签的左上角顶点纵坐标Y1 |
aiResults.priceTags.x2 | INT | 价签的右下角顶点横坐标X2 |
aiResults.priceTags.y2 | INT | 价签的右下角顶点纵坐标Y2 |
aiResults.priceTags.originalPrice | VARCHAR(100) | 原价 |
aiResults.priceTags.discountPrice | VARCHAR(100) | 折扣价 |
aiResults.priceTags.prd_code | VARCHAR(100) | 关联商品编码 |
aiResults.priceTags.prd_x1 | INT | 价签关联商品的左上角顶点横坐标X1。对角线的两个顶点可以确定一个矩形 |
aiResults.priceTags.prd_y1 | INT | 价签关联商品的左上角顶点纵坐标Y1 |
aiResults.priceTags.prd_x2 | INT | 价签关联商品的右下角顶点横坐标X2 |
aiResults.priceTags.prd_y2 | INT | 价签关联商品的右下角顶点纵坐标Y2 |