cc
Browse files
scripts/build_cyclegan_dataset.py
CHANGED
@@ -45,7 +45,7 @@ def build_cyclegan_dataset(swim_dir: str, output_dir: str, type: str, no_night:
|
|
45 |
|
46 |
if type != "night":
|
47 |
for label in tqdm(train_labels, desc="train"):
|
48 |
-
if no_night and label["
|
49 |
continue
|
50 |
|
51 |
if label["weather"] == type:
|
@@ -58,7 +58,7 @@ def build_cyclegan_dataset(swim_dir: str, output_dir: str, type: str, no_night:
|
|
58 |
)
|
59 |
|
60 |
for label in tqdm(val_labels, desc="val"):
|
61 |
-
if no_night and label["
|
62 |
continue
|
63 |
|
64 |
if label["weather"] == type:
|
@@ -71,21 +71,21 @@ def build_cyclegan_dataset(swim_dir: str, output_dir: str, type: str, no_night:
|
|
71 |
)
|
72 |
else:
|
73 |
for label in tqdm(train_labels, desc="train"):
|
74 |
-
if label["
|
75 |
os.system(
|
76 |
f"cp {os.path.join(swim_dir, 'train', 'images', label['name'])} {os.path.join(output_dir, 'trainB', label['name'])}"
|
77 |
)
|
78 |
-
elif label["
|
79 |
os.system(
|
80 |
f"cp {os.path.join(swim_dir, 'train', 'images', label['name'])} {os.path.join(output_dir, 'trainA', label['name'])}"
|
81 |
)
|
82 |
|
83 |
for label in tqdm(val_labels, desc="val"):
|
84 |
-
if label["
|
85 |
os.system(
|
86 |
f"cp {os.path.join(swim_dir, 'val', 'images', label['name'])} {os.path.join(output_dir, 'testB', label['name'])}"
|
87 |
)
|
88 |
-
elif label["
|
89 |
os.system(
|
90 |
f"cp {os.path.join(swim_dir, 'val', 'images', label['name'])} {os.path.join(output_dir, 'testA', label['name'])}"
|
91 |
)
|
|
|
45 |
|
46 |
if type != "night":
|
47 |
for label in tqdm(train_labels, desc="train"):
|
48 |
+
if no_night and label["timeofday"] == "night":
|
49 |
continue
|
50 |
|
51 |
if label["weather"] == type:
|
|
|
58 |
)
|
59 |
|
60 |
for label in tqdm(val_labels, desc="val"):
|
61 |
+
if no_night and label["timeofday"] == "night":
|
62 |
continue
|
63 |
|
64 |
if label["weather"] == type:
|
|
|
71 |
)
|
72 |
else:
|
73 |
for label in tqdm(train_labels, desc="train"):
|
74 |
+
if label["timeofday"] == "night":
|
75 |
os.system(
|
76 |
f"cp {os.path.join(swim_dir, 'train', 'images', label['name'])} {os.path.join(output_dir, 'trainB', label['name'])}"
|
77 |
)
|
78 |
+
elif label["timeofday"] == "daytime":
|
79 |
os.system(
|
80 |
f"cp {os.path.join(swim_dir, 'train', 'images', label['name'])} {os.path.join(output_dir, 'trainA', label['name'])}"
|
81 |
)
|
82 |
|
83 |
for label in tqdm(val_labels, desc="val"):
|
84 |
+
if label["timeofday"] == "night":
|
85 |
os.system(
|
86 |
f"cp {os.path.join(swim_dir, 'val', 'images', label['name'])} {os.path.join(output_dir, 'testB', label['name'])}"
|
87 |
)
|
88 |
+
elif label["timeofday"] == "daytime":
|
89 |
os.system(
|
90 |
f"cp {os.path.join(swim_dir, 'val', 'images', label['name'])} {os.path.join(output_dir, 'testA', label['name'])}"
|
91 |
)
|