Coder Social home page Coder Social logo

deepocrzh's Introduction

中文光学字符辨识(OCR)

步骤

安装需要的环境: Python 3.7.13 CUDA 11.x

pip install -r requirement.txt

detectron2 (推荐)

!pip install layoutparser torchvision && pip install "git+https://github.com/facebookresearch/[email protected]#egg=detectron2"

efficientnet

!pip install "layoutparser[effdet]"

paddle

!pip install "layoutparser[paddledetection]"

使用detectron2可能存在的兼容问题

环境中包含tools, 解决paddleocr安装包兼容问题(PaddlePaddle/PaddleOCR#1024) 5.31 Efficient和paddle环境不存在上述问题

将paddle中.tools替换成paddleocr.tools

mv replace_paddleocr.py pathToYourPaddleOCR/paddleocr.py

colab

mv replace_paddleocr.py /usr/local/lib/python3.7/dist-packages/paddleocr/paddleocr.py

Run the code

先运行extract_image.py将pdf中的每一页存成图片

python extract_image.py

Layout Analysis

python layout_analysis.py

---------------------------- 文字信息抽取 -------------------------- 之后下载模型

python3 image2text.py

可视化(Optional)

python3 visualization.py

deepocrzh's People

Contributors

anonymousdestroyer avatar pengbohua avatar

Watchers

 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.