Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -10,10 +10,10 @@
|
|
10 |
#pip install gradio
|
11 |
|
12 |
#importing required libraries
|
13 |
-
import os
|
14 |
-
os.system('apt-get install tesseract-ocr')
|
15 |
#os.system('pip install -q pytesseract')
|
16 |
-
os.system('pip install pytesseract')
|
17 |
#sudo apt-get install tesseract-ocr
|
18 |
|
19 |
import pytesseract
|
@@ -131,7 +131,7 @@ def translate_image(im, language):
|
|
131 |
#Extract text, translate in your language and format it
|
132 |
extracted_text = text_extract(im)
|
133 |
#font select -- Getting Unicode Text
|
134 |
-
title_font = ImageFont.truetype('/content/gdrive/My Drive/sample_images/arial-unicode-ms.ttf',30)
|
135 |
#text to write on image #Example in hindi - Unicode text u"आप जीवन में मिलता हर मौका ले लो, क्योंकि कुछ चीजें केवल एक बार होती हैं. शुभ सुबह"
|
136 |
txt = format_text(language,extracted_text)
|
137 |
|
|
|
10 |
#pip install gradio
|
11 |
|
12 |
#importing required libraries
|
13 |
+
#import os
|
14 |
+
#os.system('apt-get install tesseract-ocr')
|
15 |
#os.system('pip install -q pytesseract')
|
16 |
+
#os.system('pip install pytesseract')
|
17 |
#sudo apt-get install tesseract-ocr
|
18 |
|
19 |
import pytesseract
|
|
|
131 |
#Extract text, translate in your language and format it
|
132 |
extracted_text = text_extract(im)
|
133 |
#font select -- Getting Unicode Text
|
134 |
+
title_font = ImageFont.truetype('./') #('/content/gdrive/My Drive/sample_images/arial-unicode-ms.ttf',30)
|
135 |
#text to write on image #Example in hindi - Unicode text u"आप जीवन में मिलता हर मौका ले लो, क्योंकि कुछ चीजें केवल एक बार होती हैं. शुभ सुबह"
|
136 |
txt = format_text(language,extracted_text)
|
137 |
|