Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
·
d4ab848
1
Parent(s):
ffb5b24
imtool: drop bad points
Browse filesSigned-off-by: Niv Sardi <[email protected]>
- crawler/imtool.py +3 -1
crawler/imtool.py
CHANGED
@@ -42,7 +42,9 @@ def read_bounding_boxes(filename):
|
|
42 |
lines = f.readlines()
|
43 |
for l in lines:
|
44 |
(x,y,w,h) = [float(i) for i in l.split(' ')[1:]]
|
45 |
-
|
|
|
|
|
46 |
boxes.append(BoundingBox(x,y,w,h))
|
47 |
return boxes
|
48 |
|
|
|
42 |
lines = f.readlines()
|
43 |
for l in lines:
|
44 |
(x,y,w,h) = [float(i) for i in l.split(' ')[1:]]
|
45 |
+
if x < 0 or y < 0 or w < 10 or h < 10:
|
46 |
+
print(f"dropping logo, it has inconsistent size: {w}x{h}+{x}x{y}")
|
47 |
+
continue
|
48 |
boxes.append(BoundingBox(x,y,w,h))
|
49 |
return boxes
|
50 |
|