百度的这个接口一定是 PHP 写的
业务需要用到身份证识别,然后选了百度的服务,在文档里发现了这样蛋疼的返回数据。
给大家分享一下
文档地址 http://ai.baidu.com/docs#/OCR-API/7e4792c7
{
"log_id": 2648325511,
"direction": 0,
"image_status": "normal",
"idcard_type": "normal",
"edit_tool": "Adobe Photoshop CS3 Windows",
"words_result": {
"住址": {
"location": {
"left": 267,
"top": 453,
"width": 459,
"height": 99
},
"words": "南京市江宁区弘景大道3889号"
},
"公民身份号码": {
"location": {
"left": 443,
"top": 681,
"width": 589,
"height": 45
},
"words": "330881199904173914"
},
"出生": {
"location": {
"left": 270,
"top": 355,
"width": 357,
"height": 45
},
"words": "19990417"
},
"姓名": {
"location": {
"left": 267,
"top": 176,
"width": 152,
"height": 50
},
"words": "伍云龙"
},
"性别": {
"location": {
"left": 269,
"top": 262,
"width": 33,
"height": 52
},
"words": "男"
},
"民族": {
"location": {
"left": 492,
"top": 279,
"width": 30,
"height": 37
},
"words": "汉"
}
},
"words_result_num": 6
}
这返回,是实习生干的吧,图像识别相关的,很多的都是用 python 写的吧
@BradStevens
一般ai项目分engine server和app server,因为权限控制流量控制等业务逻辑在app server做起来更便捷可靠
腾讯的身份证识别返回数据格式也形似这种
@Kamicloud 恩,没想那么远了,应该是一种语言调用另外的接口进行转换,获取结果了在处理一下返回。不过楼主怎么判断的是php写的?
@松园
@BradStevens 我不信你年轻的时候没给前端这样的数据过{"1":"test","2":"test"}
:joy: PHP写接口一时爽,一直写一直爽
嗯?隐约感觉 PHP 被黑了一把。