Skip to content

Convert LORE model from torch format to ONNX format.

License

Notifications You must be signed in to change notification settings

narc1ssus1/ConvertLOREToONNX

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert LORE to ONNX

This repo is used to convert LORE to ONNX format.

1. Clone the source code.

git clone https://github.com/SWHL/ConvertLaTeXOCRToONNX.git

2. Install env.

conda install --yes --file requirements.txt

3. Run the demo, and the converted model is located in the moodels directory.

python main.py

4. Install lineless_table_rec

pip install lineless_table_rec

5. Use

from pathlib import Path

from lineless_table_rec import LinelessTableRecognition

detect_path = "models/lore_detect.onnx"
process_path = "models/lore_process.onnx"
engine = LinelessTableRecognition(
    detect_model_path=detect_path, process_model_path=process_path
)

img_path = "images/lineless_table_recognition.jpg"
table_str, elapse = engine(img_path)

print(table_str)
print(elapse)

with open(f"{Path(img_path).stem}.html", "w", encoding="utf-8") as f:
    f.write(table_str)

print("ok")

About

Convert LORE model from torch format to ONNX format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.7%
  • Other 1.3%