Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,11 @@ from PIL import Image
|
|
| 2 |
import pytesseract
|
| 3 |
import gradio as gr
|
| 4 |
from io import BytesIO
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
# Set the tesseract command to its path
|
| 7 |
-
# pytesseract.pytesseract.tesseract_cmd = '/usr/bin/tesseract' # Change this if the path is different
|
| 8 |
# OCR processing function
|
| 9 |
def extract_text_from_image(image):
|
| 10 |
try:
|
|
|
|
| 2 |
import pytesseract
|
| 3 |
import gradio as gr
|
| 4 |
from io import BytesIO
|
| 5 |
+
import os
|
| 6 |
+
## install PyTesseract
|
| 7 |
+
os.system('sudo apt-get install tesseract-ocr')
|
| 8 |
+
os.system('pip install -q pytesseract')
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# OCR processing function
|
| 11 |
def extract_text_from_image(image):
|
| 12 |
try:
|