Niv Sardi commited on
Commit
eb762cb
1 Parent(s): 4b0ef46

imtool: bugfix actually read all logos

Browse files

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

Files changed (1) hide show
  1. crawler/imtool.py +7 -4
crawler/imtool.py CHANGED
@@ -39,8 +39,11 @@ class Centroid(BoundingBox):
39
  def read_bounding_boxes(filename):
40
  boxes = []
41
  with open(filename, 'r') as f:
42
- (x,y,w,h) = [float(i) for i in f.readline().split(' ')[1:]]
43
- boxes.append(BoundingBox(x,y,w,h))
 
 
 
44
  return boxes
45
 
46
  def floor_point(a, b):
@@ -70,8 +73,8 @@ def crop(fn, logos):
70
 
71
  (h, w, c) = im.shape
72
  (tx, ty)= (
73
- math.ceil(w/(TILE_SIZE*TILE_OVERLAP)),
74
- math.ceil(h/(TILE_SIZE*TILE_OVERLAP))
75
  )
76
 
77
  print('shape', basename, tx, ty, h, w, logos)
 
39
  def read_bounding_boxes(filename):
40
  boxes = []
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
+ print(x, y, 'box')
46
+ boxes.append(BoundingBox(x,y,w,h))
47
  return boxes
48
 
49
  def floor_point(a, b):
 
73
 
74
  (h, w, c) = im.shape
75
  (tx, ty)= (
76
+ math.floor(w/(TILE_SIZE*TILE_OVERLAP)),
77
+ math.floor(h/(TILE_SIZE*TILE_OVERLAP))
78
  )
79
 
80
  print('shape', basename, tx, ty, h, w, logos)