Metadata-Version: 2.1
Name: latex-ocr-server
Version: 0.1.0
Summary: Turn image files into LaTeX equations with protocol buffers
Project-URL: Documentation, https://github.com/lucasvanmol/latex-ocr-server#readme
Project-URL: Issues, https://github.com/lucasvanmol/latex-ocr-server/issues
Project-URL: Source, https://github.com/lucasvanmol/latex-ocr-server
Author: Lucas Van Mol
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Requires-Dist: google-api-python-client~=2.107.0
Requires-Dist: grpcio~=1.59.2
Requires-Dist: pillow~=10.1.0
Requires-Dist: torch~=2.1.0
Requires-Dist: transformers~=4.35.1
Description-Content-Type: text/markdown

# Latex OCR Server

A protobuf-based service to generate latex equations from image files.

See the [`.proto` file](https://github.com/lucasvanmol/latex-ocr-server/blob/0.1.0/src/latex_ocr_server/protos/latex_ocr.proto) for the interface.

## Installation

```
pip install https://github.com/lucasvanmol/latex-ocr-server/releases/download/0.1.0/latex_ocr_server-0.1.0-py3-none-any.whl
```

Installation directly from pypi will be available as soon as I'm able to [make an account](https://status.python.org/incidents/0th66lc1l8by)

## Usage

```
usage: python -m latex_ocr_server start [-h] [--port PORT] [-d] [--cache_dir CACHE_DIR] [--cpu]

optional arguments:
  -h, --help            show this help message and exit
  --port PORT
  -d, --download        download model if needed without asking for confirmation
  --cache_dir CACHE_DIR
                        path to model cache. Defaults to ~/.cache/huggingface
  --cpu                 use cpu, otherwise uses gpu if available
```

## GPU support

`pytorch` must be installed with CUDA support. See https://pytorch.org/get-started/locally/.

You can check if gpu support is working with 
```
latex_ocr_server info --gpu-available
```

# Development 

## Build

```
hatch build
```

## Locall Install

```
pip install ./dist/latex_ocr_server-0.1.0.tar.gz
```
