百度的这个接口一定是 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
}
php
为码农摸鱼事业而奋斗
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 8

这返回,是实习生干的吧,图像识别相关的,很多的都是用 python 写的吧

4年前 评论

@BradStevens
一般ai项目分engine server和app server,因为权限控制流量控制等业务逻辑在app server做起来更便捷可靠

4年前 评论

腾讯的身份证识别返回数据格式也形似这种

4年前 评论

@Kamicloud 恩,没想那么远了,应该是一种语言调用另外的接口进行转换,获取结果了在处理一下返回。不过楼主怎么判断的是php写的?

4年前 评论

@松园

去看了眼,不是
{
    "ret": 0,
    "msg": "ok",
    "data": {
        "name": "李明",
        "sex": "男",
        "nation": "汉",
        "birth": "1987/1/1",
        "address": "北京市石景山区高新技术园腾讯大楼",
        "id": "440524198701010014",
        "frontimage": "/9j/...",
        "authority": "",
        "valid_date": "",
        "backimage": "",
    }
}
4年前 评论

@BradStevens 我不信你年轻的时候没给前端这样的数据过{"1":"test","2":"test"}

4年前 评论

:joy: PHP写接口一时爽,一直写一直爽

4年前 评论
Bin

嗯?隐约感觉 PHP 被黑了一把。

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!