Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,6 @@ def solve_math_problem(image):
|
|
10 |
# Convert image to grayscale for better OCR performance
|
11 |
image = image.convert("L")
|
12 |
|
13 |
-
# Preprocess the image (optional enhancements can be added here)
|
14 |
-
# For example, image = image.point(lambda x: 0 if x < 140 else 255, '1')
|
15 |
-
|
16 |
# Use pytesseract to extract text from the image
|
17 |
problem_text = pytesseract.image_to_string(image, config='--psm 7')
|
18 |
|
@@ -51,7 +48,6 @@ demo = gr.Interface(
|
|
51 |
["example_algebra.jpg"]
|
52 |
],
|
53 |
allow_flagging="never",
|
54 |
-
webpage_title="Handwritten Math Solver",
|
55 |
theme="soft"
|
56 |
)
|
57 |
|
|
|
10 |
# Convert image to grayscale for better OCR performance
|
11 |
image = image.convert("L")
|
12 |
|
|
|
|
|
|
|
13 |
# Use pytesseract to extract text from the image
|
14 |
problem_text = pytesseract.image_to_string(image, config='--psm 7')
|
15 |
|
|
|
48 |
["example_algebra.jpg"]
|
49 |
],
|
50 |
allow_flagging="never",
|
|
|
51 |
theme="soft"
|
52 |
)
|
53 |
|