# 提交图片识别

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/ai/v1/submitAiCognition/{openid}/{timestamp}/{digest}/{msg_id} 在线调试
请求示例:


{

 "bizId": 5122096114208480004,
 "instant":"0",
 "recapture":"0",
 "isPriceCheck":"1",
 "images": 
  [{
  "imageType": "2",
  "imageUrl": "http://image.third.com/5164504684863877680/user_defined/201906/20190625133915796_4bba710b_CAMERA_11001999244.jpg"
   },
  {
     "imageType": "2",
     "imageUrl": "http://image.third.com/7570161533259730386/user_defined/7339661220474119472/202203/20220324090553188_49b30725_CAMERA_11001999263.jpg"
  }],
 "imagesBase64": [{
  "imageType": "2",
  "imageBase64Str": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1sAAAKKCAYAAADLKUE7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAP+lSURBVHhe7N0FXBTp48dxfv/T6+7w+vQ8W1RsEREVsFuxO7ETUbALu4NOxdazu/Ds7rM7z+v8/ueZ3YHZ5VlYetAvr9f7BTszz+wAzv3m83tmFwenbqvwr..."
 }]
} 
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
bizId Long 业务ID,不允许重复,且必须为Long类型,不能超过19位;提交图片后可根据该id查询识别结果
instant CHAR(1) 0:实时识别,1:非实时识别。传空表示实时返回结果。注:利用AI服务器的空闲算力进行商品识别
recapture CHAR(1) 0:不开启翻拍API识别,1:开启翻拍API识别。
isPriceCheck CHAR(1) 代表是否需要识别价签; 0:不开启;1:开启;不传,按照0处理。
images 图片列表,一组照片最多不超过10张
images.imageType CHAR(1) 0:表示不传入陈列类型,由勤策(原外勤365)AI服务器自动识别照片返回照片的陈列类型
1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,23:地堆(系统控制了只能传2张照片,不能多也不能少),24:割箱,25:挂架,26:侧柜,27:挂网
低温拍照:传入低温拍照,AI服务器识别出是冷风柜、单开门冰箱、双开门冰箱、卧柜
勤策(原外勤365)AI服务器按照传入的陈列类型识别返回对应的结果
images.imageUrl VARCHAR(200) 图片URL地址,可以直接访问的图片地址。如果ur和base64同时填写,优先级:imagesBase64.imageBase64Str>images.imageUrl
imagesBase64 图片信息
imagesBase64.imageType CHAR(1) 0:表示不传入陈列类型,由勤策(原外勤365)AI服务器自动识别照片返回照片的陈列类型
1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,23:地堆(系统控制了只能传2张照片,不能多也不能少),24:割箱,25:挂架,26:侧柜,27:挂网
低温拍照:传入低温拍照,AI服务器识别出是冷风柜、单开门冰箱、双开门冰箱、卧柜
勤策(原外勤365)AI服务器按照传入的陈列类型识别返回对应的结果
imagesBase64.imageBase64Str TEXT 图片base64编码字符串。如果ur和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 勤策(原外勤365)图片ID
images.imageUrl VARCHAR(200) 图片URL地址

# 实时查询识别结果

接口说明: 如果您选择的是“实时识别”,则可以立即查询识别结果;如果您选择的是“非实时识别”,最晚24小时可查询识别结果。

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/ai/v1/queryAiResult/{openid}/{timestamp}/{digest}/{msg_id} 在线调试
请求示例:

{
    "bizId": 4966589240925711233,
    "createTime": "2022-04-11 00:00:00"
} 
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
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
                }
            ]
        }
    ],
    "bizId": 4966589240925711233,
    "groundProductNum": 132,
    "imageArea": 8.80,
    "imageLength": 3.10,
    "imageWidth": 2.84,
    "state": "1"
}

参数说明:

参数 类型 必填 说明
bizId Long 业务ID
state CHAR(1) 识别状态。1:已处理,0:处理中。一组照片全部识别完成就返回已处理,只要有一张照片没有识别完成就是处理中
recaptureScore VARCHAR(20) 该张照片的翻拍可能性,为0到1之间的小数,数值越大,翻拍的可能性越大。请求参数recapture必须传1,recaptureScore才会有值,值为-1时为翻拍API欠费
imageLength Long 地堆的长,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数
imageWidth Long 地堆的宽,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数
imageArea Long 地堆的面积,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数
groundProductNum Long 地堆的商品数量,只有地堆的识别结果才会有这个出参值,其他类型的识别结果没有这个参数。这个数量并不是识别的商品数量之和
aiResults 一组照片中每张照片的识别结果
aiResults.state CHAR(1) 图片识别状态。0:识别失败,1:识别成功,2:识别中
aiResults.imageId Long 勤策(原外勤365)图片ID
aiResults.imageUrl VARCHAR(200) 图片URL地址
aiResults.imageType CHAR(1) 陈列类型。1:低温拍照,2:货架,3:堆头,4:端架,5:收银台,6:形象化陈列,7:冷风柜,8:单开门冰箱,9:双开门冰箱,10:卧柜,21:暖柜,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) 勤策(原外勤365)商品ID
aiResults.units.prd_code VARCHAR(200) 勤策(原外勤365)商品编码
aiResults.units.prd_name VARCHAR(200) 勤策(原外勤365)商品名称
aiResults.units.serial_num INT SKU的序号:一张照片从左到右从上到下进行排序;序号可以帮助还原SKU在图片中的相对位置;标注序号的范围包括本品、竞品、未识别、空位;陈列类型为货架、端架、冰箱时才有返回值
aiResults.units.layer INT SKU所在层数;陈列类型为货架、端架、冰箱时才有返回值
aiResults.units.repeat INT 0:不和其他照片重复的SKU,1:和其他照片重复的SKU。对于货架的陈列场景,勤策(原外勤365)把一组照片中两两去重,找出和其他照片重复的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