Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -207,14 +207,13 @@ def draw_boxes(image, bounds, color='blue', width=1):
|
|
207 |
return image
|
208 |
|
209 |
def detect(img, target_lang,target_lang2=None):
|
210 |
-
if target_lang2 != None:
|
211 |
lang=f"{lang_id[target_lang]}"
|
212 |
lang2=f"{lang_id[target_lang2]}"
|
213 |
-
|
214 |
lang=[lang,lang2]
|
215 |
else:
|
216 |
lang=[f"{lang_id[target_lang]}"]
|
217 |
-
|
218 |
|
219 |
reader = easyocr.Reader(lang)
|
220 |
bounds = reader.readtext(img)
|
|
|
207 |
return image
|
208 |
|
209 |
def detect(img, target_lang,target_lang2=None):
|
210 |
+
if target_lang2 != None and target_lang2 != "":
|
211 |
lang=f"{lang_id[target_lang]}"
|
212 |
lang2=f"{lang_id[target_lang2]}"
|
|
|
213 |
lang=[lang,lang2]
|
214 |
else:
|
215 |
lang=[f"{lang_id[target_lang]}"]
|
216 |
+
pass
|
217 |
|
218 |
reader = easyocr.Reader(lang)
|
219 |
bounds = reader.readtext(img)
|