Update main.py
Browse files
main.py
CHANGED
@@ -48,9 +48,9 @@ async def ocr(
|
|
48 |
# raise HTTPException(status_code=400, detail="Invalid file format. Only .jpg, .jpeg, and .png are allowed.")
|
49 |
|
50 |
content = await image.read()
|
51 |
-
print("[filename]", image.filename)
|
|
|
52 |
image = Image.open(BytesIO(content))
|
53 |
-
print("[image]", image)
|
54 |
text = pytesseract.image_to_string(image, lang = 'eng')
|
55 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
56 |
except Exception as e:
|
|
|
48 |
# raise HTTPException(status_code=400, detail="Invalid file format. Only .jpg, .jpeg, and .png are allowed.")
|
49 |
|
50 |
content = await image.read()
|
51 |
+
print("[filename]", image.filename.split("."))
|
52 |
+
# print("[image extension]", image.filename.split(".").len)
|
53 |
image = Image.open(BytesIO(content))
|
|
|
54 |
text = pytesseract.image_to_string(image, lang = 'eng')
|
55 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
56 |
except Exception as e:
|