Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -32,7 +32,11 @@ async def ocr(
|
|
32 |
print("[3]",os.popen(f'apt search tesseract').read())
|
33 |
content = await image.read()
|
34 |
image = Image.open(BytesIO(content))
|
35 |
-
print("[
|
|
|
|
|
|
|
|
|
36 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
37 |
# text = pytesseract.image_to_string(image, lang = 'eng')
|
38 |
except Exception as e:
|
|
|
32 |
print("[3]",os.popen(f'apt search tesseract').read())
|
33 |
content = await image.read()
|
34 |
image = Image.open(BytesIO(content))
|
35 |
+
print("[image]",image)
|
36 |
+
if hasattr(pytesseract, "image_to_string"):
|
37 |
+
print("Image to string function is available")
|
38 |
+
else:
|
39 |
+
print("Image to string function is not available")
|
40 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
41 |
# text = pytesseract.image_to_string(image, lang = 'eng')
|
42 |
except Exception as e:
|