Niv Sardi commited on
Commit
eada63e
1 Parent(s): 8aa2646

imtool: have read_bounding_boxes return bco

Browse files

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>

Files changed (1) hide show
  1. 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(' ')[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
 
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))