This repo is used to convert LORE to ONNX format.
git clone https://github.com/SWHL/ConvertLaTeXOCRToONNX.git
conda install --yes --file requirements.txt
python main.py
pip install lineless_table_rec
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")