kaylode / vietnamese-ocr-toolbox

A toolbox for Vietnamese Optical Character Recognition.
Apache License 2.0
102 stars 29 forks source link
character-recognition idcard-ocr invoices object-detection ocr text-detection toolbox vietnamese-ocr

An OCR Toolbox for Vietnamese Documents

CodeFactor

This toolbox provides a pipeline to do OCR in Vietnamese documents (such as receipts, personal id, licenses,...). The project also support flexibility for adaptation.

:bookmark_tabs: More infomation:


Invoice (from SROIE19 dataset)

Alt text

Personal ID (image from internet)

Alt text

Pipeline in detail:

  1. Use Canny Edge Detector and then detect contours.
  2. Extract receipt from image and normalize.
  3. Use Pixel Agreation Network (PAN) to detect text regions from extracted receipt, then crop these regions.
  4. Use VietOCR to extract texts from regions, then perform word correction.
  5. Retrieve information

Notebooks

Pipeline

Main Pipeline

Alt Text

Process Flow Block

Alt Text

There are two stages (can also run in second stage only):

Datasets

screen screen screen
screen screen screen

Pretrained weights

Model Image Size Weights MAP@0.5 Pixel accuracy IOU
PAN (baseline) 640 x 640 link 0.71 0.95 0.91
PAN (rotation) 640 x 640 link 0.66 0.93 0.88
Model Weights Accuracy (full seq) Accuracy (per char)
Transformer OCR link 0.890 0.981
Model Weights Accuracy (train) Accuracy (val)
PhoBERT link 0.978 0.924

Inference

References