Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,14 @@ from pix2tex.cli import LatexOCR
|
|
| 4 |
import sympy as sp
|
| 5 |
from sympy.parsing.latex import parse_latex
|
| 6 |
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Preprocessing for handwritten image
|
| 9 |
def preprocess_handwritten_image(pil_img):
|
|
|
|
| 4 |
import sympy as sp
|
| 5 |
from sympy.parsing.latex import parse_latex
|
| 6 |
import re
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# Trigger data download only once
|
| 10 |
+
if not os.path.exists("dataset/train"):
|
| 11 |
+
print("🚀 Running data preparation scripts...")
|
| 12 |
+
os.system("python download_data.py")
|
| 13 |
+
os.system("python generate_csv.py")
|
| 14 |
+
|
| 15 |
|
| 16 |
# Preprocessing for handwritten image
|
| 17 |
def preprocess_handwritten_image(pil_img):
|