Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,8 @@ def inference(filepath, lang):
|
|
| 48 |
# crop the region of interest (ROI)
|
| 49 |
|
| 50 |
cropped_image = img.crop((min_x, min_y, max_x, max_y)) # crop the image
|
| 51 |
-
cropped_image =
|
|
|
|
| 52 |
out = recognitor.predict(cropped_image)
|
| 53 |
print(out)
|
| 54 |
new_bounds.append((bbox,text, out, prob))
|
|
|
|
| 48 |
# crop the region of interest (ROI)
|
| 49 |
|
| 50 |
cropped_image = img.crop((min_x, min_y, max_x, max_y)) # crop the image
|
| 51 |
+
cropped_image = Image.fromarray(cropped_image)
|
| 52 |
+
cropped_image = cropped_image.convert("RGB")
|
| 53 |
out = recognitor.predict(cropped_image)
|
| 54 |
print(out)
|
| 55 |
new_bounds.append((bbox,text, out, prob))
|