Giter VIP home page Giter VIP logo

idcard_ocr's Introduction

基于PaddleOCR OpenCV FastApi的 身份证信息识别 和 身份证头像提取 工具

Docker使用

文件描述

  1. gunicorn.config.py:
    • gunicorn配置文件,可更改进程数,默认5。 在构建镜像前更改可生效。
  2. Dockerfile:
    • Docker镜像的描述文件。

使用流程

自行构建镜像(有更改进程数等需求)

#构建镜像
docker build -t fastapi_ocr:1.2 .

#创建容器
docker run -d --name IDCard_OCR -p 8000:8000 fastapi_ocr:1.2

使用现有镜像(镜像有点大,如果需要可以在Issues中提)

#load镜像
docker load -i images.tar

#创建容器
docker run -d --name IDCard_OCR -p 8000:8000 fastapi_ocr:1.2

api文档地址

http://ip:8000/docs

本机安装

1.安装依赖(Python 3.7)

1.1 安装PaddlePaddle

python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

1.2 安装requirements.txt

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

2. 启动服务

#port:9999
nohup gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:9999 &

3. 接口列表

the information on the front of the IDCard

3.1.1 请求参数(post)

  • file: [身份证正面图片]

3.1.2 返回参数

  • { "code": 200 "message": "Success" "data": "the information on the front of the IDCard" }
    • "data":
      • 身份证正面信息
      • base64 of 头像.jpg
  • { "code": 400 "message": "Error message" "data": "null" }
    • "message":
      • 图片上传错误

the information on the back of the IDCard

3.2.1 请求参数(post)

  • file: [身份证背面图片]

3.2.2 返回参数

  • { "code": 200 "message": "Success" "data": "the information on the back of the IDCard" }
  • "data":
    • 身份证背面信息
  • { "code": 400 "message": "Error message" "data": "null" }
    • "message":
      • 图片上传错误

the information of the IDCard

3.3.1 请求参数(post)

  • files: [身份证正面图片,身份证反面图片]

3.3.2 返回参数

  • { "code": 200 "message": "Success" "data": "the information of the IDCard" }
  • "data":
    • 身份证正面信息
    • 身份证反面信息
    • base64 of 头像.jpg
  • { "code": 400 "message": "Error message" "data": "null" }
    • "message":
      • 图片上传错误

4. TODO

  • 增加ocr大模型的api接口,提高精准度但会降低识别效率。

idcard_ocr's People

Contributors

ajdx3906 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

idcard_ocr's Issues

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.