Spaces:
Runtime error
Runtime error
Commit
Β·
06c0e28
1
Parent(s):
0507c14
add flags
Browse files
README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
---
|
| 2 |
title: LaTeX OCR Demo
|
| 3 |
emoji: πβοΈβ π’
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 3.1.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: afl-3.0
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
title: LaTeX OCR Demo
|
| 3 |
emoji: πβοΈβ π’
|
| 4 |
+
colorFrom: yellow
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 3.1.4b5
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: afl-3.0
|
| 11 |
+
python_version: 3.8.13
|
| 12 |
---
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -9,8 +9,8 @@ from pix2tex import cli as pix2tex
|
|
| 9 |
model = pix2tex.LatexOCR()
|
| 10 |
|
| 11 |
|
| 12 |
-
def inference(
|
| 13 |
-
|
| 14 |
output = model(img)
|
| 15 |
print("Model output:", output)
|
| 16 |
return output
|
|
@@ -29,7 +29,7 @@ demo = gr.Interface(
|
|
| 29 |
description=description,
|
| 30 |
article=article,
|
| 31 |
inputs=gr.inputs.Image(
|
| 32 |
-
type="
|
| 33 |
),
|
| 34 |
outputs=gr.outputs.Textbox(type="text", label="Output: Converted LaTeX code."),
|
| 35 |
examples=["./eqn1.png", "./eqn2.png", "./eqn3.png"],
|
|
@@ -37,4 +37,4 @@ demo = gr.Interface(
|
|
| 37 |
analytics_enabled=False,
|
| 38 |
)
|
| 39 |
|
| 40 |
-
demo.launch(enable_queue=True)
|
|
|
|
| 9 |
model = pix2tex.LatexOCR()
|
| 10 |
|
| 11 |
|
| 12 |
+
def inference(path):
|
| 13 |
+
img = Image.open(path)
|
| 14 |
output = model(img)
|
| 15 |
print("Model output:", output)
|
| 16 |
return output
|
|
|
|
| 29 |
description=description,
|
| 30 |
article=article,
|
| 31 |
inputs=gr.inputs.Image(
|
| 32 |
+
type="filepath", label="Input: Image of your equation you want to covert."
|
| 33 |
),
|
| 34 |
outputs=gr.outputs.Textbox(type="text", label="Output: Converted LaTeX code."),
|
| 35 |
examples=["./eqn1.png", "./eqn2.png", "./eqn3.png"],
|
|
|
|
| 37 |
analytics_enabled=False,
|
| 38 |
)
|
| 39 |
|
| 40 |
+
demo.launch(debug=True, enable_queue=True)
|