Spaces:
Sleeping
Sleeping
Yaz Hobooti
commited on
Commit
·
3401128
1
Parent(s):
5065cea
Remove validation text exceptions: Ignore all errors in bottom 115mm
Browse files
app.py
CHANGED
|
@@ -684,10 +684,10 @@ def find_misspell_boxes_from_text(
|
|
| 684 |
# Create box
|
| 685 |
box = Box(y1=y1, x1=x1, y2=y2, x2=x2, area=(x2 - x1) * (y2 - y1))
|
| 686 |
|
| 687 |
-
# Skip boxes in excluded bottom area
|
| 688 |
if image_size:
|
| 689 |
img_height = image_size[1]
|
| 690 |
-
if _is_in_excluded_bottom_area(box, img_height)
|
| 691 |
continue
|
| 692 |
else:
|
| 693 |
if _is_in_excluded_bottom_area(box, ph):
|
|
@@ -802,8 +802,8 @@ def find_misspell_boxes(
|
|
| 802 |
|
| 803 |
# NOTE: adjust to match your Box constructor if needed
|
| 804 |
b = Box(top, left, top + height, left + width, width * height)
|
| 805 |
-
# Exclude bottom 115mm
|
| 806 |
-
if _is_in_excluded_bottom_area(b, img.height)
|
| 807 |
continue
|
| 808 |
boxes.append(b)
|
| 809 |
|
|
|
|
| 684 |
# Create box
|
| 685 |
box = Box(y1=y1, x1=x1, y2=y2, x2=x2, area=(x2 - x1) * (y2 - y1))
|
| 686 |
|
| 687 |
+
# Skip boxes in excluded bottom area
|
| 688 |
if image_size:
|
| 689 |
img_height = image_size[1]
|
| 690 |
+
if _is_in_excluded_bottom_area(box, img_height):
|
| 691 |
continue
|
| 692 |
else:
|
| 693 |
if _is_in_excluded_bottom_area(box, ph):
|
|
|
|
| 802 |
|
| 803 |
# NOTE: adjust to match your Box constructor if needed
|
| 804 |
b = Box(top, left, top + height, left + width, width * height)
|
| 805 |
+
# Exclude bottom 115mm
|
| 806 |
+
if _is_in_excluded_bottom_area(b, img.height):
|
| 807 |
continue
|
| 808 |
boxes.append(b)
|
| 809 |
|