Skip to content

Commit 3e610fd

Browse files
committed
small update
ensure int for bbox lukas-blecher#122
1 parent b3a31f3 commit 3e610fd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pix2tex - LaTeX OCR
22

3-
[![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)
3+
[![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)
44

55
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.
66

@@ -15,7 +15,7 @@ Install the package `pix2tex`:
1515
pip install pix2tex
1616
```
1717

18-
Model checkpoints will be automatically downloaded.
18+
Model checkpoints will be downloaded automatically.
1919

2020
There are two ways to get a prediction from an image.
2121
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.
@@ -33,7 +33,7 @@ The model works best with images of smaller resolution. That's why I added a pre
3333

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

36-
## 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)
36+
## 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)
3737

3838
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
3939

pix2tex/gui.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ def mouseReleaseEvent(self, event):
280280
startPos = self.startPos
281281
endPos = self.mouse.position
282282

283-
x1 = min(startPos[0], endPos[0])
284-
y1 = min(startPos[1], endPos[1])
285-
x2 = max(startPos[0], endPos[0])
286-
y2 = max(startPos[1], endPos[1])
283+
x1 = int(min(startPos[0], endPos[0]))
284+
y1 = int(min(startPos[1], endPos[1]))
285+
x2 = int(max(startPos[0], endPos[0]))
286+
y2 = int(max(startPos[1], endPos[1]))
287287

288288
self.repaint()
289289
QApplication.processEvents()

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
setuptools.setup(
1111
name='pix2tex',
12-
version='0.0.8',
12+
version='0.0.10',
1313
description="pix2tex: Using a ViT to convert images of equations into LaTeX code.",
1414
long_description=long_description,
1515
long_description_content_type='text/markdown',
1616
author='Lukas Blecher',
1717
author_email='luk.blecher@gmail.com',
18-
url='https://lukas-blecher.github.io/LaTeX-OCR/',
18+
url='https://github.com/lukas-blecher/LaTeX-OCR/',
1919
license='MIT',
2020
keywords=[
2121
'artificial intelligence',

0 commit comments

Comments
 (0)