split img paths
Browse files
NLVR2.py
CHANGED
|
@@ -44,7 +44,7 @@ _SPLITS = {
|
|
| 44 |
# "test1": "test1.json",
|
| 45 |
# "test2": "test2.json",
|
| 46 |
}
|
| 47 |
-
_JZ_IMG_FOLDER_PATH = f"{os.environ['cnw_ALL_CCFRSCRATCH']}/local_datasets/nlvr2"
|
| 48 |
_IMG_SPLITS = {
|
| 49 |
# "train": "train_nlvr2.zip",
|
| 50 |
"validation": "dev_nlvr2.zip",
|
|
@@ -89,26 +89,26 @@ class NLVR2Dataset(datasets.GeneratorBasedBuilder):
|
|
| 89 |
files_path = dl_manager.download_and_extract(urls)
|
| 90 |
|
| 91 |
images_files = {
|
| 92 |
-
"
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
# "test2": os.path.join(_JZ_IMG_FOLDER_PATH, _IMG_SPLITS["test2"]),
|
| 97 |
-
},
|
| 98 |
}
|
| 99 |
-
|
|
|
|
|
|
|
| 100 |
return [
|
| 101 |
# datasets.SplitGenerator(
|
| 102 |
# name=datasets.Split.TRAIN,
|
| 103 |
-
# gen_kwargs={"files_paths": [files_path[self.config.name]["train"]], "images_path":
|
| 104 |
# ),
|
| 105 |
datasets.SplitGenerator(
|
| 106 |
name=datasets.Split.VALIDATION,
|
| 107 |
-
gen_kwargs={"files_paths": [files_path[self.config.name]["validation"]], "images_path":
|
| 108 |
),
|
| 109 |
# datasets.SplitGenerator(
|
| 110 |
# name=datasets.Split.TEST,
|
| 111 |
-
# gen_kwargs={"files_paths": [files_path[self.config.name]["test1"], files_path[self.config.name]["test2"]], "images_path":
|
| 112 |
# ),
|
| 113 |
]
|
| 114 |
|
|
|
|
| 44 |
# "test1": "test1.json",
|
| 45 |
# "test2": "test2.json",
|
| 46 |
}
|
| 47 |
+
_JZ_IMG_FOLDER_PATH = f"{os.environ['cnw_ALL_CCFRSCRATCH']}/local_datasets/nlvr2/"
|
| 48 |
_IMG_SPLITS = {
|
| 49 |
# "train": "train_nlvr2.zip",
|
| 50 |
"validation": "dev_nlvr2.zip",
|
|
|
|
| 89 |
files_path = dl_manager.download_and_extract(urls)
|
| 90 |
|
| 91 |
images_files = {
|
| 92 |
+
# "train": os.path.join(_JZ_IMG_FOLDER_PATH, _IMG_SPLITS["train"]),
|
| 93 |
+
"validation": os.path.join(_JZ_IMG_FOLDER_PATH, _IMG_SPLITS["validation"]),
|
| 94 |
+
# "test1": os.path.join(_JZ_IMG_FOLDER_PATH, _IMG_SPLITS["test1"]),
|
| 95 |
+
# "test2": os.path.join(_JZ_IMG_FOLDER_PATH, _IMG_SPLITS["test2"]),
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
+
train_img_path = os.path.join(dl_manager.extract(images_files["train"]), "train_nlvr2")
|
| 98 |
+
validation_img_path = os.path.join(dl_manager.extract(images_files["validation"]), "dev_nlvr2")
|
| 99 |
+
test1_img_path = os.path.join(dl_manager.extract(images_files["test1"]), "test1_nlvr2")
|
| 100 |
return [
|
| 101 |
# datasets.SplitGenerator(
|
| 102 |
# name=datasets.Split.TRAIN,
|
| 103 |
+
# gen_kwargs={"files_paths": [files_path[self.config.name]["train"]], "images_path": train_img_path, "split_name": "train"},
|
| 104 |
# ),
|
| 105 |
datasets.SplitGenerator(
|
| 106 |
name=datasets.Split.VALIDATION,
|
| 107 |
+
gen_kwargs={"files_paths": [files_path[self.config.name]["validation"]], "images_path": validation_img_path, "split_name": "dev"},
|
| 108 |
),
|
| 109 |
# datasets.SplitGenerator(
|
| 110 |
# name=datasets.Split.TEST,
|
| 111 |
+
# gen_kwargs={"files_paths": [files_path[self.config.name]["test1"], files_path[self.config.name]["test2"]], "images_path": test1_img_path, "split_name": "test1"},
|
| 112 |
# ),
|
| 113 |
]
|
| 114 |
|