Skip to main content

LaTeX and markdown OCR powered by texify, without bloated dependencies like torch or transformers.

Project description

texifast Python Version from PEP 621 TOML PyPI - Version GitHub Actions Workflow Status

LaTeX and markdown OCR powered by texify, without bloated dependencies like torch or transformers.

Features

  • Minimal dependency graph
  • Compared to Optimum, texifast is faster (~20%) and has a smaller memory footprint (~20%). For details, see benchmark.
  • Supports IOBinding features of ONNXRuntime and optimizes for CUDAExecutionProvider.
  • Supports quantized/mixed precision models.

Installation

You must implicitly specify the required dependencies.

pip install texifast[cpu]
# or if you want to use CUDAExecutionProvider
pip install texifast[gpu]

⚠️⚠️⚠️

Do not install with pip install texifast !!!

Quickstart

This quick start use the image in test folder, you can use whatever you like.

from texifast.model import TxfModel
from texifast.pipeline import TxfPipeline

model = TxfModel(
    encoder_model_path="./encoder_model_quantized.onnx",
    decoder_model_path="./decoder_model_merged_quantized.onnx",
)
texifast = TxfPipeline(model=model, tokenizer="./tokenizer.json")
print(texifast("./latex.png"))

You can download the quantized ONNX model here and the FP16 ONNX model here.

API

The full Python API documentation can be found here.

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

texifast-0.1.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

texifast-0.1.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file texifast-0.1.3.tar.gz.

File metadata

  • Download URL: texifast-0.1.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for texifast-0.1.3.tar.gz
Algorithm Hash digest
SHA256 df0692a107fc1276548e0abf0ef7951d57384494e72d1aba9c79f2a580139122
MD5 548b3d62e2d70b935ecf12263e1a94cc
BLAKE2b-256 db7fda084054871dbc6ba3a11fa2b04fdf17dad4c0cfc82e1d465d4011a7834a

See more details on using hashes here.

File details

Details for the file texifast-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: texifast-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for texifast-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cafae98c418d0b378de1f455b8fe8c0b406ea43e509de087445e0bf134b29b15
MD5 99873f22bbb292be8bd4600804ba41e5
BLAKE2b-256 58115ca14b72277692375b53dfa4e3c9e552628344ee31ecf1c1d1145bb5bc89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page