Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -40,10 +40,10 @@ async def ocr(
|
|
40 |
image: UploadFile = File(...),
|
41 |
# languages: list = Body(["eng"])
|
42 |
):
|
|
|
43 |
try:
|
44 |
content = await image.read()
|
45 |
image = Image.open(BytesIO(content))
|
46 |
-
print("[image]",image)
|
47 |
text = pytesseract.image_to_string(image, lang = 'eng')
|
48 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
49 |
except Exception as e:
|
|
|
40 |
image: UploadFile = File(...),
|
41 |
# languages: list = Body(["eng"])
|
42 |
):
|
43 |
+
print("[image]",Image.open(BytesIO(await image.read())))
|
44 |
try:
|
45 |
content = await image.read()
|
46 |
image = Image.open(BytesIO(content))
|
|
|
47 |
text = pytesseract.image_to_string(image, lang = 'eng')
|
48 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
49 |
except Exception as e:
|