Update main.py
Browse files
main.py
CHANGED
|
@@ -48,7 +48,7 @@ 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("[
|
| 52 |
image = Image.open(BytesIO(content))
|
| 53 |
print("[image]", image)
|
| 54 |
text = pytesseract.image_to_string(image, lang = 'eng')
|
|
|
|
| 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')
|