Update app.py
Browse files
app.py
CHANGED
|
@@ -254,8 +254,8 @@ async def predict(file: UploadFile = File(...)):
|
|
| 254 |
image = Image.open(io.BytesIO(contents))
|
| 255 |
if image.mode != "RGB":
|
| 256 |
image = image.convert("RGB")
|
| 257 |
-
if image.width >
|
| 258 |
-
image.thumbnail((
|
| 259 |
img_array = np.array(image)
|
| 260 |
|
| 261 |
async with ocr_semaphore:
|
|
|
|
| 254 |
image = Image.open(io.BytesIO(contents))
|
| 255 |
if image.mode != "RGB":
|
| 256 |
image = image.convert("RGB")
|
| 257 |
+
if image.width > 1600 or image.height > 1600:
|
| 258 |
+
image.thumbnail((1600, 1600))
|
| 259 |
img_array = np.array(image)
|
| 260 |
|
| 261 |
async with ocr_semaphore:
|