Datasets:
Update v-lol-trains.py
Browse files- v-lol-trains.py +3 -4
v-lol-trains.py
CHANGED
@@ -60,7 +60,6 @@ _URL_DATA = {
|
|
60 |
"V-LoL-Random-Trains-TheoryX": f"{_DIR}/Trains_theoryx_RandomTrains_base_scene_len_2-4.zip",
|
61 |
}
|
62 |
|
63 |
-
|
64 |
_NAMES = ["westbound", "eastbound"]
|
65 |
|
66 |
|
@@ -107,8 +106,8 @@ class vloltrains(datasets.GeneratorBasedBuilder):
|
|
107 |
|
108 |
def _split_generators(self, dl_manager):
|
109 |
"""Returns SplitGenerators."""
|
110 |
-
archive_path = dl_manager.download_and_extract(self.config.data_url)
|
111 |
-
print
|
112 |
image_dir = os.path.join(archive_path, "data", "images")
|
113 |
metadata_pth = os.path.join(archive_path, "data", "all_scenes", "all_scenes.json")
|
114 |
self.images, self.y, self.trains, self.masks = [], [], [], []
|
@@ -156,4 +155,4 @@ class vloltrains(datasets.GeneratorBasedBuilder):
|
|
156 |
|
157 |
def _generate_examples(self, image_dir, labels, images):
|
158 |
for i, (image, label) in enumerate(zip(images, labels)):
|
159 |
-
yield i, {"image": os.path.join(image_dir, image), "label": label}
|
|
|
60 |
"V-LoL-Random-Trains-TheoryX": f"{_DIR}/Trains_theoryx_RandomTrains_base_scene_len_2-4.zip",
|
61 |
}
|
62 |
|
|
|
63 |
_NAMES = ["westbound", "eastbound"]
|
64 |
|
65 |
|
|
|
106 |
|
107 |
def _split_generators(self, dl_manager):
|
108 |
"""Returns SplitGenerators."""
|
109 |
+
archive_path = os.path.join(dl_manager.download_and_extract(self.config.data_url), self.config.data_url.split('/')[-1].split('.')[0])
|
110 |
+
# print containg folders
|
111 |
image_dir = os.path.join(archive_path, "data", "images")
|
112 |
metadata_pth = os.path.join(archive_path, "data", "all_scenes", "all_scenes.json")
|
113 |
self.images, self.y, self.trains, self.masks = [], [], [], []
|
|
|
155 |
|
156 |
def _generate_examples(self, image_dir, labels, images):
|
157 |
for i, (image, label) in enumerate(zip(images, labels)):
|
158 |
+
yield i, {"image": os.path.join(image_dir, image), "label": label}
|