Update cord.py
Browse files
cord.py
CHANGED
|
@@ -142,10 +142,10 @@ class Cord(datasets.GeneratorBasedBuilder):
|
|
| 142 |
x3 = abs(word['quad']['x3'])
|
| 143 |
y3 = abs(word['quad']['y3'])
|
| 144 |
|
| 145 |
-
x1 = width
|
| 146 |
-
y1 = height
|
| 147 |
-
x3 = width
|
| 148 |
-
y3 = height
|
| 149 |
|
| 150 |
box = [x1, y1, x3, y3]
|
| 151 |
box = normalize_bbox(box, width=width, height=height)
|
|
|
|
| 142 |
x3 = abs(word['quad']['x3'])
|
| 143 |
y3 = abs(word['quad']['y3'])
|
| 144 |
|
| 145 |
+
x1 = width if x1 > width else x1
|
| 146 |
+
y1 = height if y1 > height else y1
|
| 147 |
+
x3 = width if x3 > width else x3
|
| 148 |
+
y3 = height if y3 > height else y3
|
| 149 |
|
| 150 |
box = [x1, y1, x3, y3]
|
| 151 |
box = normalize_bbox(box, width=width, height=height)
|