Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,11 +42,10 @@ def inference(filepath, lang):
|
|
| 42 |
bounds = reader.readtext(filepath)
|
| 43 |
new_bounds=[]
|
| 44 |
for (bbox, text, prob) in bounds:
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
x1 = bbox[1].max()
|
| 50 |
|
| 51 |
# crop the region of interest (ROI)
|
| 52 |
img = Image.open(filepath)
|
|
|
|
| 42 |
bounds = reader.readtext(filepath)
|
| 43 |
new_bounds=[]
|
| 44 |
for (bbox, text, prob) in bounds:
|
| 45 |
+
y0 = min(bbox[0])
|
| 46 |
+
y1 = max(bbox[0])
|
| 47 |
+
x0 = min(bbox[1])
|
| 48 |
+
x1 = max(bbox[1])
|
|
|
|
| 49 |
|
| 50 |
# crop the region of interest (ROI)
|
| 51 |
img = Image.open(filepath)
|