kavg commited on
Commit
a17b121
1 Parent(s): eaf214f

convert image to RGB

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -34,7 +34,7 @@ async def ApplyOCR(file: UploadFile):
34
  try:
35
  # Read the uploaded image file
36
  contents = await file.read()
37
- image = Image.open(io.BytesIO(contents))
38
 
39
  pixel_values = config['processor'](image, return_tensors="pt").pixel_values
40
  generated_ids = config['ocr_model'].generate(pixel_values)
 
34
  try:
35
  # Read the uploaded image file
36
  contents = await file.read()
37
+ image = Image.open(io.BytesIO(contents)).convert("RGB")
38
 
39
  pixel_values = config['processor'](image, return_tensors="pt").pixel_values
40
  generated_ids = config['ocr_model'].generate(pixel_values)