Giter Club home page Giter Club logo

firfly / characterrecognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenguanyou/characterrecognition

0.0 2.0 0.0 739 KB

百度文字识别api,Python3,包含了(通用文字识别,通用文字识别(含位置信息版),通用文字识别(高精度版),通用文字识别(高精度含位置版),网络图片文字识别,身份证识别,银行卡识别,驾驶证识别,行驶证识别,营业执照识别,车牌识别,表格文字识别-提交请求,通用票据识别,手写文字识别,增值税发票识别,数字识别,欢迎使用!

Python 100.00%

characterrecognition's Introduction

百度文字识别

百度文字识别api,Python3,包含了(通用文字识别,通用文字识别(含位置信息版),通用文字识别(高精度版),通用文字识别(高精度含位置版),网络图片文字识别,身份证识别,银行卡识别,驾驶证识别,行驶证识别,营业执照识别,车牌识别,表格文字识别-提交请求,通用票据识别,手写文字识别,增值税发票识别,数字识别,欢迎使用!

测试使用

1、在shitu_api/confing.py里配置您的AK,SK。 2、运行python3 shitu_api/bin/CharacterRecognition/test.py 文件即可测试

以下为运行结果

通用文字识别本地: {'log_id': 8911898719824284850, 'words_result_num': 3, 'words_result': [{'words': 'No'}, {'words': 'Date'}, {'words': '驰中璃'}]}
通用文字识别url:  {'log_id': 4504083923706946204, 'words_result_num': 1, 'words_result': [{'words': 'Badu百度'}]}
通用文字识别(含位置信息版)本地: {'log_id': 7387187009098454613, 'words_result_num': 3, 'words_result': [{'location': {'width': 53, 'top': 29, 'left': 795, 'height': 28}, 'words': 'No'}, {'location': {'width': 70, 'top': 83, 'left': 802, 'height': 30}, 'words': 'Date'}, {'location': {'width': 386, 'top': 153, 'left': 327, 'height': 104}, 'words': '驰中璃'}]}
通用文字识别(含位置信息版)url:  {'log_id': 6048778326879637828, 'words_result_num': 1, 'words_result': [{'location': {'width': 434, 'top': 146, 'left': 57, 'height': 92}, 'words': 'Badu百度'}]}
通用文字识别(高精度含位置版)本地: {'log_id': 1230484358870674894, 'words_result_num': 4, 'words_result': [{'words': ' No.'}, {'words': ' Date'}, {'words': '辞死申请'}, {'words': '对不起,家迁了赔了1个亿'}]}
通用文字识别(高精度含位置版)本地: {'log_id': 6822944841781944477, 'words_result_num': 4, 'words_result': [{'location': {'width': 52, 'top': 26, 'left': 795, 'height': 33}, 'words': ' No.'}, {'location': {'width': 67, 'top': 83, 'left': 802, 'height': 29}, 'words': ' Date'}, {'location': {'width': 387, 'top': 155, 'left': 335, 'height': 94}, 'words': '辞死申请'}, {'location': {'width': 1046, 'top': 326, 'left': 0, 'height': 140}, 'words': '对不起,家迁了赔了1个亿'}]}
web本地: {'log_id': 9148128230550219841, 'words_result_num': 4, 'words_result': [{'words': 'No'}, {'words': 'Date'}, {'words': '辞职申遗'}, {'words': '不起,我家迁3,赐了1个亿'}]}
weburl:  {'log_id': 8373372777845912863, 'words_result_num': 1, 'words_result': [{'words': 'Baidu百度'}]}
身份证: {'direction': 0, 'log_id': 1679192525842608188, 'words_result_num': 5, 'words_result': {'公民身份号码': {'location': {'width': 0, 'top': 0, 'height': 0, 'left': 0}, 'words': ''}, '性别': {'location': {'width': 16, 'top': 80, 'height': 19, 'left': 97}, 'words': '男'}, '民族': {'location': {'width': 13, 'top': 78, 'height': 17, 'left': 197}, 'words': '满'}, '姓名': {'location': {'width': 161, 'top': 37, 'height': 22, 'left': 90}, 'words': '爱新觉罗·玄烨'}, '住址': {'location': {'width': 223, 'top': 159, 'height': 50, 'left': 91}, 'words': '北京市东城区景山前街4号紫禁城乾清宫'}}, 'image_status': 'unknown', 'risk_type': 'unknown'}
银行卡: {'log_id': 1440876454456245444, 'result': {'bank_card_number': '6217 0038 1002 6896 707', 'valid_date': '07/24', 'bank_card_type': 1, 'bank_name': '建设银行'}}
驾驶证: {'log_id': 8624655835603054336, 'direction': -1, 'words_result_num': 10, 'words_result': {'证号': {'words': '440882199407247218'}, '有效期限': {'words': '20131112'}, '准驾车型': {'words': 'C1'}, '住址': {'words': '广东省州市乌石镇吴宅村55号'}, '至': {'words': '20191112'}, '姓名': {'words': '吴伟文'}, '国籍': {'words': '**'}, '出生日期': {'words': '19940724'}, '性别': {'words': '男'}, '初次领证日期': {'words': '20131112'}}}
行驶证: {'log_id': 5772662817136643296, 'direction': 0, 'words_result_num': 10, 'words_result': {'品牌型号': {'words': '奇瑞牌SQR7160T116'}, '发证日期': {'words': '20140413'}, '使用性质': {'words': '非营运'}, '发动机号码': {'words': 'FF9G13703'}, '号牌号码': {'words': '鄂A8HB57'}, '所有人': {'words': '白敏强'}, '住址': {'words': '武汉市青山区渝金30街6017号'}, '注册日期': {'words': '20090413'}, '车辆识别代号': {'words': 'LVVDB11B89D122246'}, '车辆类型': {'words': '小型轿车'}}}
车牌号: {'log_id': 8534290405426141750, 'words_result': [{'color': 'blue', 'number': '鲁M58A29', 'probability': [1.0, 1.0, 0.9999994039535522, 0.9999943971633911, 0.9998718500137329, 0.9999961853027344, 0.9999995231628418], 'vertexes_location': [{'y': 273, 'x': 53}, {'y': 263, 'x': 424}, {'y': 352, 'x': 425}, {'y': 362, 'x': 54}]}, {'color': 'blue', 'number': '鲁MKW650', 'probability': [1.0, 0.9999959468841553, 0.9999834299087524, 1.0, 0.9999781847000122, 0.9999847412109375, 0.9998950958251953], 'vertexes_location': [{'y': 35, 'x': 60}, {'y': 31, 'x': 405}, {'y': 144, 'x': 406}, {'y': 148, 'x': 61}]}]}
营业执照识别: {'log_id': 7247668428961781403, 'direction': 0, 'words_result_num': 8, 'words_result': {'注册资本': {'location': {'width': 66, 'top': 540, 'height': 19, 'left': 301}, 'words': '1200万元'}, '社会信用代码': {'location': {'width': 151, 'top': 393, 'height': 14, 'left': 403}, 'words': '91441900398127238U'}, '单位名称': {'location': {'width': 198, 'top': 432, 'height': 18, 'left': 252}, 'words': '东莞能者机电科技有限公司'}, '法人': {'location': {'width': 45, 'top': 512, 'height': 18, 'left': 252}, 'words': '颜安山'}, '证件编号': {'location': {'width': 0, 'top': 0, 'height': 0, 'left': 0}, 'words': '无'}, '成立日期': {'location': {'width': 120, 'top': 564, 'height': 18, 'left': 249}, 'words': '2014年07月10日'}, '地址': {'location': {'width': 370, 'top': 485, 'height': 19, 'left': 251}, 'words': '东莞市南城街道蛤地草塘工业区宝鼎科}技园A栋三楼'}, '有效期': {'location': {'width': 31, 'top': 592, 'height': 18, 'left': 252}, 'words': '长期'}}}
表格文字识别:  {'log_id': 5000775083217690477, 'words_result_num': 21, 'words_result': [{'location': {'width': 372, 'top': 81, 'left': 77, 'height': 24}, 'words': '中华人民共和国外交部请各国军政机关对持照人予以通行'}, {'location': {'width': 137, 'top': 100, 'left': 48, 'height': 18}, 'words': '的便利和必要的协助'}, {'location': {'width': 384, 'top': 129, 'left': 65, 'height': 23}, 'words': "The Ministry of Foreign Affairs of the People's Republic of china"}, {'location': {'width': 405, 'top': 150, 'left': 45, 'height': 19}, 'words': 'requests all civil and military authorities of foreign countries to allow the'}, {'location': {'width': 382, 'top': 169, 'left': 44, 'height': 19}, 'words': 'bearerof this passport to pass freely andafford assistance in cmse of nedd.'}, {'location': {'width': 257, 'top': 366, 'left': 150, 'height': 18}, 'words': '类型/T国家码/ Countr Cod护照号/Pa'}, {'location': {'width': 57, 'top': 382, 'left': 41, 'height': 10}, 'words': 'PASSPORT'}, {'location': {'width': 103, 'top': 382, 'left': 350, 'height': 19}, 'words': 'G37401825'}, {'location': {'width': 57, 'top': 424, 'left': 159, 'height': 16}, 'words': '崔/cUI'}, {'location': {'width': 70, 'top': 458, 'left': 157, 'height': 17}, 'words': '震/zHEN'}, {'location': {'width': 88, 'top': 481, 'left': 288, 'height': 10}, 'words': '出生地点/ aa hirth'}, {'location': {'width': 35, 'top': 492, 'left': 157, 'height': 16}, 'words': '男/N'}, {'location': {'width': 124, 'top': 490, 'left': 287, 'height': 21}, 'words': '山东/ SHANDONG'}, {'location': {'width': 90, 'top': 511, 'left': 147, 'height': 11}, 'words': '出生目/ Dat w hirth'}, {'location': {'width': 252, 'top': 521, 'left': 155, 'height': 21}, 'words': '07DEc1989山东/ SHANDON6'}, {'location': {'width': 82, 'top': 542, 'left': 146, 'height': 14}, 'words': '签发日期/ Iaea isa'}, {'location': {'width': 266, 'top': 553, 'left': 154, 'height': 20}, 'words': '23sEP200922sEP2019'}, {'location': {'width': 292, 'top': 578, 'left': 161, 'height': 31}, 'words': '公安部出入境管理局E对& Entry Administration'}, {'location': {'width': 153, 'top': 599, 'left': 291, 'height': 21}, 'words': 'Ministry of Public Security'}, {'location': {'width': 453, 'top': 638, 'left': 14, 'height': 21}, 'words': 'POCHNCUI<<ZHEN<<<<<<<<<<<<<<<<<<<<<<<<<<<<'}, {'location': {'width': 454, 'top': 663, 'left': 13, 'height': 25}, 'words': '6374018254cHN8912075M190922519203701<<<<<<50'}]}
通用票据识别测试:  {'log_id': 7841470070396786193, 'direction': 0, 'words_result_num': 32, 'words_result': [{'location': {'width': 94, 'top': 62, 'height': 22, 'left': 240}, 'words': '2015年底'}, {'location': {'width': 327, 'top': 83, 'height': 40, 'left': 26}, 'words': '台盟市名称通用机场情况'}, {'location': {'width': 261, 'top': 76, 'height': 29, 'left': 468}, 'words': '2016-2020年建成通用机场'}, {'location': {'width': 317, 'top': 70, 'height': 34, 'left': 811}, 'words': '2020年底“十三五”期间争取'}, {'location': {'width': 89, 'top': 104, 'height': 22, 'left': 821}, 'words': '通用机场'}, {'location': {'width': 176, 'top': 95, 'height': 27, 'left': 951}, 'words': '开工建设通用机场'}, {'location': {'width': 238, 'top': 123, 'height': 30, 'left': 198}, 'words': '个数地个数'}, {'location': {'width': 215, 'top': 129, 'height': 28, 'left': 522}, 'words': '拟建地'}, {'location': {'width': 67, 'top': 127, 'height': 22, 'left': 830}, 'words': '个数'}, {'location': {'width': 211, 'top': 133, 'height': 30, 'left': 915}, 'words': '个数拟建地点'}, {'location': {'width': 303, 'top': 177, 'height': 45, 'left': 76}, 'words': '锡林郭勒盟1锡林浩特巴'}, {'location': {'width': 91, 'top': 204, 'height': 26, 'left': 251}, 'words': '彦宝力格'}, {'location': {'width': 185, 'top': 195, 'height': 29, 'left': 398}, 'words': '2西乌旗、镶黄旗'}, {'location': {'width': 192, 'top': 181, 'height': 27, 'left': 972}, 'words': '多伦县、苏尼特左'}, {'location': {'width': 193, 'top': 203, 'height': 28, 'left': 971}, 'words': '旗、太仆寺旗、乌拉'}, {'location': {'width': 26, 'top': 229, 'height': 23, 'left': 973}, 'words': '盖'}, {'location': {'width': 110, 'top': 268, 'height': 26, 'left': 77}, 'words': '乌兰察布市'}, {'location': {'width': 277, 'top': 273, 'height': 30, 'left': 398}, 'words': '3凉城县、四子王旗、化县'}, {'location': {'width': 204, 'top': 281, 'height': 28, 'left': 929}, 'words': '2察右中旗、兴和县'}, {'location': {'width': 110, 'top': 345, 'height': 28, 'left': 76}, 'words': '鄂尔多斯市'}, {'location': {'width': 393, 'top': 351, 'height': 31, 'left': 397}, 'words': '4杭锦旗、鄂托克前旗、乌审旗、鄂托克旗'}, {'location': {'width': 201, 'top': 331, 'height': 34, 'left': 963}, 'words': '东胜区、准格尔旗、'}, {'location': {'width': 200, 'top': 352, 'height': 38, 'left': 965}, 'words': '达拉特旗、鄂托克前'}, {'location': {'width': 68, 'top': 383, 'height': 27, 'left': 969}, 'words': '旗城川'}, {'location': {'width': 476, 'top': 411, 'height': 38, 'left': 74}, 'words': '巴彦淖尔市1乌拉特中旗1乌拉特后旗'}, {'location': {'width': 225, 'top': 427, 'height': 28, 'left': 927}, 'words': '2乌拉特前旗、磴口县'}, {'location': {'width': 111, 'top': 455, 'height': 27, 'left': 74}, 'words': '乌海市'}, {'location': {'width': 108, 'top': 460, 'height': 26, 'left': 396}, 'words': '1乌海湖'}, {'location': {'width': 110, 'top': 507, 'height': 27, 'left': 73}, 'words': '阿拉善盟'}, {'location': {'width': 255, 'top': 510, 'height': 31, 'left': 395}, 'words': '1阿拉善左旗乌力吉口岸'}, {'location': {'width': 236, 'top': 509, 'height': 35, 'left': 925}, 'words': '1阿拉善右旗巴丹吉'}, {'location': {'width': 74, 'top': 533, 'height': 29, 'left': 962}, 'words': '林沙漠'}]}
增值税发票识别:  {'log_id': 8547317327986724729, 'words_result_num': 30, 'words_result': {'InvoiceNum': '02550485', 'SellerName': '**石化销售有限公司湖南长沙石油分公司', 'CommodityTaxRate': [{'word': '17%', 'row': '1'}], 'SellerBank': '**银行湖南省分行营业部5820601685', 'Checker': '陈华', 'TotalAmount': '10545.43', 'CommodityAmount': [{'word': '4958.76', 'row': '1'}], 'InvoiceDate': '2018年01月15日', 'CommodityTax': [{'word': '842.90', 'row': '1'}], 'PurchaserName': '中启行物联科技(北京)有限公司', 'CommodityNum': [{'word': '899.49', 'row': '1'}], 'PurchaserBank': '招商银行股份有限公司北京上地支行110917823410701', 'Remarks': '5363607小测长》', 'Password': '司乙司司数司', 'SellerAddress': '湖南省长沙市芙蓉北路388号0731-84205588', 'PurchaserAddress': '北京市西城区广安门内岳峰园3区1号京安友情馆80010-6267878', 'InvoiceCode': '4300171130', 'CommodityUnit': [{'word': '升', 'row': '1'}], 'Payee': '李芳', 'PurchaserRegisterNum': '911101023513172379', 'CommodityPrice': [{'word': '5.5128572858', 'row': '1'}], 'NoteDrawer': '柳涛', 'AmountInWords': '壹万贰仟叁佰叁拾捌圆壹角伍分', 'AmountInFiguers': '12338.15', 'TotalTax': '1792.72', 'InvoiceType': '专用发票', 'SellerRegisterNum': '91430100717079385', 'CommodityName': [{'word': '*石油制品*车用油', 'row': '1'}], 'CommodityType': [{'word': '0号车用柴油V', 'row': '1'}], 'CheckCode': ''}}
数字识别: {'log_id': 1034048616686499719, 'words_result_num': 3, 'words_result': [{'location': {'width': 649, 'top': 0, 'left': 0, 'height': 151}, 'words': '01234'}, {'location': {'width': 644, 'top': 139, 'left': 0, 'height': 162}, 'words': '56789'}, {'location': {'width': 240, 'top': 315, 'left': 29, 'height': 22}, 'words': '3000'}]}
手写文字识别: {'log_id': 642631150503957694, 'words_result_num': 4, 'words_result': [{'location': {'width': 53, 'top': 29, 'left': 795, 'height': 28}, 'words': 'No.'}, {'location': {'width': 70, 'top': 83, 'left': 802, 'height': 30}, 'words': 'Date'}, {'location': {'width': 386, 'top': 153, 'left': 327, 'height': 104}, 'words': '辞职申请。'}, {'location': {'width': 1051, 'top': 321, 'left': 0, 'height': 151}, 'words': '对不起,家抵迁了,赔了1个亿'}]}

characterrecognition's People

Contributors

chenguanyou avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.