omkar56 commited on
Commit
ddd5cbb
·
1 Parent(s): 4ce158a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
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: