Niv Sardi commited on
Commit
304ab5e
1 Parent(s): 90c5fac

debug to debug, tile overlap 20%

Browse files

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

Files changed (1) hide show
  1. crawler/imtool.py +4 -2
crawler/imtool.py CHANGED
@@ -9,7 +9,7 @@ from typing import NamedTuple
9
  from entity import Entity
10
 
11
  TILE_SIZE = 800
12
- TILE_OVERLAP = 0.8
13
 
14
  class BoundingBox(NamedTuple):
15
  x: float = 0.0
@@ -68,6 +68,8 @@ def crop(fn, logos):
68
  basename = os.path.basename(fn).replace('.png', '')
69
  img_out = f"./data/squares/images"
70
  txt_out = f"./data/squares/labels"
 
 
71
  pathlib.Path(img_out).mkdir(parents=True, exist_ok=True)
72
  pathlib.Path(txt_out).mkdir(parents=True, exist_ok=True)
73
 
@@ -153,7 +155,7 @@ def crop(fn, logos):
153
  a = f"{basename} {cx/TILE_SIZE} {cy/TILE_SIZE} {p.w/TILE_SIZE} {p.h/TILE_SIZE}"
154
  f.write(a)
155
  print(a)
156
- cv2.imwrite(f'{basename}.debug.png', im)
157
 
158
  if __name__ == '__main__':
159
  with os.scandir('./data/') as it:
 
9
  from entity import Entity
10
 
11
  TILE_SIZE = 800
12
+ TILE_OVERLAP = 0.2
13
 
14
  class BoundingBox(NamedTuple):
15
  x: float = 0.0
 
68
  basename = os.path.basename(fn).replace('.png', '')
69
  img_out = f"./data/squares/images"
70
  txt_out = f"./data/squares/labels"
71
+ debug_out = f"./data/debug"
72
+ pathlib.Path(debug_out).mkdir(parents=True, exist_ok=True)
73
  pathlib.Path(img_out).mkdir(parents=True, exist_ok=True)
74
  pathlib.Path(txt_out).mkdir(parents=True, exist_ok=True)
75
 
 
155
  a = f"{basename} {cx/TILE_SIZE} {cy/TILE_SIZE} {p.w/TILE_SIZE} {p.h/TILE_SIZE}"
156
  f.write(a)
157
  print(a)
158
+ cv2.imwrite(f'{debug_out}/{basename}.debug.png', im)
159
 
160
  if __name__ == '__main__':
161
  with os.scandir('./data/') as it: