Skip to content

How to generate html representation from cropped table image using table-transformer

Notifications You must be signed in to change notification settings

shuheik/html_with_tatr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

html_with_tatr

Setup

table-transformerとpaddleOCRのインストール

git clone https://github.com/microsoft/table-transformer.git
cd table-transformer
conda env create -f environment.yml
conda activate tables-detr
pip install paddlepaddle-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install paddleocr

https://github.com/microsoft/table-transformer からモデルをダウンロード(保存先は一例)

mkdir model
wget -P model https://huggingface.co/bsmock/TATR-v1.1-Pub/resolve/main/TATR-v1.1-Pub-msft.pth

table-transformer/src内にocr_and_infer.pyを置いて実行

cd src
python ocr_and_infer.py --structure_config_path structure_config.json --structure_model_path /path/to/TATR-v1.1-Pub-msft.pth --structure_device cuda --image_dir /path/to/image_dir --out_dir /path/to/output_dir

Evaluation

table-transformerはPubTables-1M(画像はjpg形式)、PaddleOCRはPubTabNet(画像はpng形式)で学習しているため以下は参考程度

Model Text Test Data TEDS TEDS-struct
TATR-v1.1-Pub PaddleOCR PubTables-1M/val 0.9019 0.9767
PPStructureV2 PaddleOCR PubTables-1M/val 0.7234 0.8073
TATR-v1.1-Pub PaddleOCR PubTabNet/val 0.7196 0.7812
PPStructureV2 PaddleOCR PubTabNet/val 0.8769 0.9731

About

How to generate html representation from cropped table image using table-transformer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages