Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
ensure int for bbox lukas-blecher#122
  • Loading branch information
lukas-blecher committed Apr 14, 2022
1 parent b3a31f3 commit 3e610fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pix2tex - LaTeX OCR

[![GitHub](https://img.shields.io/github/license/lukas-blecher/LaTeX-OCR)](https://github.com/lukas-blecher/LaTeX-OCR) [![PyPI](https://img.shields.io/pypi/v/pix2tex?logo=pypi)](https://pypi.org/project/pix2tex) [![PyPI - Downloads](https://img.shields.io/pypi/dm/pix2tex?logo=pypi)](https://pypi.org/project/pix2tex) [![GitHub all releases](https://img.shields.io/github/downloads/lukas-blecher/LaTeX-OCR/total?color=blue&logo=github)](https://github.com/lukas-blecher/LaTeX-OCR/releases) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lukas-blecher/LaTeX-OCR/blob/master/notebooks/LaTeX_OCR_test.ipynb)
[![GitHub](https://img.shields.io/github/license/lukas-blecher/LaTeX-OCR)](https://github.com/lukas-blecher/LaTeX-OCR) [![PyPI](https://img.shields.io/pypi/v/pix2tex?logo=pypi)](https://pypi.org/project/pix2tex) [![PyPI - Downloads](https://img.shields.io/pypi/dm/pix2tex?logo=pypi)](https://pypi.org/project/pix2tex) [![GitHub all releases](https://img.shields.io/github/downloads/lukas-blecher/LaTeX-OCR/total?color=blue&logo=github)](https://github.com/lukas-blecher/LaTeX-OCR/releases) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lukas-blecher/LaTeX-OCR/blob/main/notebooks/LaTeX_OCR_test.ipynb)

The goal of this project is to create a learning based system that takes an image of a math formula and returns corresponding LaTeX code.

Expand All @@ -15,7 +15,7 @@ Install the package `pix2tex`:
pip install pix2tex
```

Model checkpoints will be automatically downloaded.
Model checkpoints will be downloaded automatically.

There are two ways to get a prediction from an image.
1. You can use the command line tool by calling `pix2tex_cli`. Here you can parse already existing images from the disk and images in your clipboard.
Expand All @@ -33,7 +33,7 @@ The model works best with images of smaller resolution. That's why I added a pre

Always double check the result carefully. You can try to redo the prediction with an other resolution if the answer was wrong.

## Training the model [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lukas-blecher/LaTeX-OCR/blob/master/notebooks/LaTeX_OCR_training.ipynb)
## Training the model [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lukas-blecher/LaTeX-OCR/blob/main/notebooks/LaTeX_OCR_training.ipynb)

1. First we need to combine the images with their ground truth labels. I wrote a dataset class (which needs further improving) that saves the relative paths to the images with the LaTeX code they were rendered with. To generate the dataset pickle file run

Expand Down
8 changes: 4 additions & 4 deletions pix2tex/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ def mouseReleaseEvent(self, event):
startPos = self.startPos
endPos = self.mouse.position

x1 = min(startPos[0], endPos[0])
y1 = min(startPos[1], endPos[1])
x2 = max(startPos[0], endPos[0])
y2 = max(startPos[1], endPos[1])
x1 = int(min(startPos[0], endPos[0]))
y1 = int(min(startPos[1], endPos[1]))
x2 = int(max(startPos[0], endPos[0]))
y2 = int(max(startPos[1], endPos[1]))

self.repaint()
QApplication.processEvents()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

setuptools.setup(
name='pix2tex',
version='0.0.8',
version='0.0.10',
description="pix2tex: Using a ViT to convert images of equations into LaTeX code.",
long_description=long_description,
long_description_content_type='text/markdown',
author='Lukas Blecher',
author_email='[email protected]',
url='https://lukas-blecher.github.io/LaTeX-OCR/',
url='https://github.com/lukas-blecher/LaTeX-OCR/',
license='MIT',
keywords=[
'artificial intelligence',
Expand Down

0 comments on commit 3e610fd

Please sign in to comment.