Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
•
971aff7
1
Parent(s):
226d6f5
bugfix, typo
Browse filesSigned-off-by: Niv Sardi <xaiki@evilgiggle.com>
- crawler/imtool.py +3 -3
crawler/imtool.py
CHANGED
@@ -61,7 +61,7 @@ def cut_logo(im, l):
|
|
61 |
|
62 |
def crop(fn, logos):
|
63 |
basename = os.path.basename(fn).replace('.png', '')
|
64 |
-
img_out = f"./data/squares/
|
65 |
txt_out = f"./data/squares/labels"
|
66 |
pathlib.Path(img_out).mkdir(parents=True, exist_ok=True)
|
67 |
pathlib.Path(txt_out).mkdir(parents=True, exist_ok=True)
|
@@ -125,8 +125,8 @@ def crop(fn, logos):
|
|
125 |
if len(li):
|
126 |
with open(txt_name, 'w') as f:
|
127 |
for p in li:
|
128 |
-
cx =
|
129 |
-
cy =
|
130 |
|
131 |
a = f"{basename} {cx/TILE_SIZE} {cy/TILE_SIZE} {p.w/TILE_SIZE} {p.h/TILE_SIZE}"
|
132 |
f.write(a)
|
|
|
61 |
|
62 |
def crop(fn, logos):
|
63 |
basename = os.path.basename(fn).replace('.png', '')
|
64 |
+
img_out = f"./data/squares/images"
|
65 |
txt_out = f"./data/squares/labels"
|
66 |
pathlib.Path(img_out).mkdir(parents=True, exist_ok=True)
|
67 |
pathlib.Path(txt_out).mkdir(parents=True, exist_ok=True)
|
|
|
125 |
if len(li):
|
126 |
with open(txt_name, 'w') as f:
|
127 |
for p in li:
|
128 |
+
cx = p.w/2 + p.x
|
129 |
+
cy = p.h/2 + p.y
|
130 |
|
131 |
a = f"{basename} {cx/TILE_SIZE} {cy/TILE_SIZE} {p.w/TILE_SIZE} {p.h/TILE_SIZE}"
|
132 |
f.write(a)
|