Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
·
eada63e
1
Parent(s):
8aa2646
imtool: have read_bounding_boxes return bco
Browse filesSigned-off-by: Niv Sardi <[email protected]>
- python/imtool.py +2 -2
python/imtool.py
CHANGED
@@ -41,12 +41,12 @@ def read_bounding_boxes(filename):
|
|
41 |
with open(filename, 'r') as f:
|
42 |
lines = f.readlines()
|
43 |
for l in lines:
|
44 |
-
(x,y,w,h) = [float(i) for i in l.split(' ')
|
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 |
|
51 |
def floor_point(x, y):
|
52 |
return (math.floor(x), math.floor(y))
|
|
|
41 |
with open(filename, 'r') as f:
|
42 |
lines = f.readlines()
|
43 |
for l in lines:
|
44 |
+
(bco, x,y,w,h) = [float(i) for i in l.split(' ')]
|
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 bco, boxes
|
50 |
|
51 |
def floor_point(x, y):
|
52 |
return (math.floor(x), math.floor(y))
|