Datasets:
Update CC6204-Hackaton-Cub-Dataset.py
Browse files
CC6204-Hackaton-Cub-Dataset.py
CHANGED
@@ -91,16 +91,23 @@ class CubDataset(datasets.GeneratorBasedBuilder):
|
|
91 |
|
92 |
# Download images
|
93 |
data_files = dl_manager.download_and_extract(_URLS["mini_images_urls"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
for batch in data_files:
|
96 |
-
path_files = dl_manager.iter_files(batch)
|
97 |
-
for img in path_files:
|
98 |
#if img.endswith("\d+.jpg"):
|
99 |
-
img_idx = _IMGNAME2ID[img]
|
100 |
-
if img_idx in _TRAIN_IDX_SET:
|
101 |
-
train_files.append(img)
|
102 |
-
else:
|
103 |
-
test_files.append(img)
|
104 |
|
105 |
return [
|
106 |
datasets.SplitGenerator(
|
|
|
91 |
|
92 |
# Download images
|
93 |
data_files = dl_manager.download_and_extract(_URLS["mini_images_urls"])
|
94 |
+
path_files = dl_manager.iter_files(data_files)
|
95 |
+
for img in path_files:
|
96 |
+
img_idx = _IMGNAME2ID[img]
|
97 |
+
if img_idx in _TRAIN_IDX_SET:
|
98 |
+
train_files.append(img)
|
99 |
+
else:
|
100 |
+
test_files.append(img)
|
101 |
|
102 |
+
#for batch in data_files:
|
103 |
+
#path_files = dl_manager.iter_files(batch)
|
104 |
+
#for img in path_files:
|
105 |
#if img.endswith("\d+.jpg"):
|
106 |
+
#img_idx = _IMGNAME2ID[img]
|
107 |
+
#if img_idx in _TRAIN_IDX_SET:
|
108 |
+
#train_files.append(img)
|
109 |
+
#else:
|
110 |
+
#test_files.append(img)
|
111 |
|
112 |
return [
|
113 |
datasets.SplitGenerator(
|