Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pytesseract
|
|
|
|
| 3 |
|
| 4 |
def process(image, lang):
|
| 5 |
try:
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
except Exception as e:
|
| 8 |
return str(e)
|
| 9 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pytesseract
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
def process(image, lang):
|
| 6 |
try:
|
| 7 |
+
result = pytesseract.image_to_string(image, lang=lang)
|
| 8 |
+
os.remove(image)
|
| 9 |
+
return result
|
| 10 |
except Exception as e:
|
| 11 |
return str(e)
|
| 12 |
|