Giter Site home page Giter Site logo

sunxingxingtf / table-ocr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rid7/table-ocr

0.0 2.0 0.0 76.99 MB

Recognize tables from images and restore them into word.

License: GNU General Public License v3.0

Python 27.84% Makefile 0.04% C++ 72.02% Objective-C 0.02% CMake 0.06% Shell 0.02%

table-ocr's Introduction

TableRecognition

Recognize tables from images and restore them into word/crnn single character coordinates
从图像还原表格并以word形式保存/crnn单字坐标提取(解决文字跨表格单元格识别)

Demo

origin_image single_char_position
Final .docx file in word directory

Model weights

Maybe one of the best open weights of document text detection and recognition.
也许是最好的开源印刷体文档文本检测和识别权值之一
Google drive link
PSE weight
CRNN weight
Unet weight
pkl for edit distance

How to run

1. python server.py
Load the unet model to extract table lines from the input image
2. python test.py
Feed the input image
(Table line detection model is not very robust, but I will reserve the related files maybe I will update it later. 开源的表格线检测模型泛化能力不够强,暂时搁置。保留之前的代码和模型,仅作参考)

  1. Edit PSE/config/config.py, crnn/config/config.py to set use GPU/CPU and model path.
    修改PSE/config/config.py, crnn/config/config.py这两个文件配置文件,配置运行设备和模型地址
  2. python image2word.py
    Restore table use opencv & python-docx, text detection: psenet, text recognition: crnn & edit distance
    采用opencv和python-docx还原表格, 文本检测部分采用psenet, 文本识别部分采用resnet18-bilstm-ctc加编辑距离校正

Tips

Step 1 & 2 are not necessary if you have quite neat PDF images, meanwhile this project can't deal with some complex samples like tortuous and colorful receipts, I am still working on it.

To do

I am handling complex table recognition, struggling with dataset. Optimistically, there could be a radical change in weeks. If you are researching page layout and table recognition, please contact me.[email protected]

Reference and some useful projects

  1. https://github.com/chineseocr/table-ocr.git
  2. https://github.com/weidafeng/TableCell.git
  3. 腾讯表格识别方案简述
  4. OpenCV-检测并提取表格
  5. 文本检测:PSENet.pytorch
  6. 文本识别:CRNN

table-ocr's People

Contributors

rid7 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.