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