Skip to main content

a sdk ocr for xfyun

Project description

xfyunsdkocr

xfyunsdkocr是讯飞开放平台图像识别相关API的Python SDK,提供银行卡识别intsig名片识别intsig指尖文字识别印刷文字识别手写文字识别营业执照识别intsig出租车发票识别火车票识别增值税发票识别intsig身份证识别intsig印刷文字识别intsig通用文字识别intsig票据卡证识别公式识别拍照速算识别驾驶证识别车牌识别行驶证识别图片还原文档场景识别物体识别场所识别等功能的客户端实现。

功能特点

  • 银行卡识别:识别银行卡信息
  • 名片识别:识别名片信息
  • 指尖文字识别:图片中用户手指出的内容识别
  • 文字识别:印刷文字识别和手写文字识别
  • 通用文字识别:营业执照识别、出租车发票识别、火车票识别、增值税发票识别、身份证识别、多语种文字识别、通用文字识别
  • 通用文字识别Intsig:身份证识别、营业执照识别、增值税发票识别、印刷文字识别(多语种)、通用文本识别(多语种)
  • 票据卡证识别:国内通用票证识别sinosecu、票据卡证识别
  • 数学识别:拍照速算识别、公式识别
  • 车相关识别:行驶证识别、驾驶证识别、车牌识别
  • 图片还原文档:识别图片 , 还原成文档
  • 场地识别:场景识别、物体识别、场所识别

安装方法

pip install xfyunsdkocr

依赖说明

  • xfyunsdkcore>=0.1.0: 核心SDK依赖
  • python-dotenv: 环境变量管理

快速开始

同声传译

from xfyunsdkocr.pd_rec_client import PDRecClient

        # 获取识别文件路径
        file_path = os.path.join(os.path.dirname(__file__), 'resources', 'pdrec.jpg')
        with open(file_path, "rb") as file:
            encoded_string = base64.b64encode(file.read())

    # 初始化客户端
    client = PDRecClient(
        app_id=os.getenv('APP_ID'),  # 替换为你的应用ID
        api_key=os.getenv('API_KEY'),  # 替换为你的API密钥
        api_secret=os.getenv('API_SECRET'),  # 替换为你的API密钥
    )

# 发送请求
        resp = client.generate(encoded_string.decode("utf-8"), "1", "jpg")
        # 保存文件
        save_byte_to_file(resp, "123.docx")

更多示例见demo

核心客户端

BankCardClient

对银行卡进行识别,返回银行卡原件上的银行卡卡号、有效日期、发卡行、卡片类型(借记卡&信用卡)、持卡人姓名(限信用卡)等信息

BusinessCardClient

纸质名片进行识别,返回名片上的姓名、手机、电话、公司、部门、职位、传真、邮箱、网站、地址等关键信息

FingerOCRClient

指尖文字识别,可检测图片中指尖位置,将指尖处文字转化为计算机可编码的文字

WordOCRClient

基于深度神经网络模型的端到端文字识别系统和讯飞自研的行业先进的光学字符识别技术,将图片(来源如扫描仪或数码相机)中的印刷/手写字体,支持扫描体以及复杂自然场景下的文字识别,直接转换为可编辑文本

ImageWordOCRClient

通用文字识别 , 见功能特点介绍

IntsigOCRClient

通用文字识别Intsig , 见功能特点介绍

InvoiceOCRClient

票据卡证识别, 见功能特点介绍

ItrOCRClient

数学识别, 见功能特点介绍

JDOCRClient

车相关识别, 见功能特点介绍

PDRecClient

基于深度神经网络模型的端到端文档重建技术,可以识别文档、合同等形式的图片,生成保留内容格式的docx、pptx或xlsx文档

RecOCRClient

场地识别, 见功能特点介绍

许可证

请参见LICENSE文件

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xfyunsdkocr-0.0.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xfyunsdkocr-0.0.1-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file xfyunsdkocr-0.0.1.tar.gz.

File metadata

  • Download URL: xfyunsdkocr-0.0.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for xfyunsdkocr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8977423c64947a4f417936be7cdfa7f26a9adbe76f0c47d64574ab9edcac21b5
MD5 e9d593ac5bcf0e28ad4373200daab0b2
BLAKE2b-256 49009fad5e2d3bbab58440b4d3ae7f179a68acbca9701d8c6f97e56551782bf0

See more details on using hashes here.

File details

Details for the file xfyunsdkocr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xfyunsdkocr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for xfyunsdkocr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa0512551c41a7180300d5933e8237e06e821a965e1d83ac34bd8819c056c11
MD5 d9bf1026055d80187a144e4fb3613122
BLAKE2b-256 b885b240e6a8b054d1a5cc86559e5dfc6fad537698b77a195108dbc9bdaf2d8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page