yonatanbitton
commited on
Commit
•
f5593f3
1
Parent(s):
f7ac0e2
Update vasr.py
Browse files
vasr.py
CHANGED
@@ -50,8 +50,8 @@ class Vasr(datasets.GeneratorBasedBuilder):
|
|
50 |
# data = datasets.load_dataset('vasr', 'test')
|
51 |
BUILDER_CONFIGS = [
|
52 |
datasets.BuilderConfig(name="TEST", version=VERSION, description="vasr dataset gold test"),
|
53 |
-
datasets.BuilderConfig(name="VALIDATION", version=VERSION, description="vasr dataset gold validation"),
|
54 |
-
datasets.BuilderConfig(name="TRAIN", version=VERSION, description="vasr dataset gold train")
|
55 |
]
|
56 |
IMAGE_EXTENSION = "jpg"
|
57 |
|
@@ -92,24 +92,30 @@ class Vasr(datasets.GeneratorBasedBuilder):
|
|
92 |
|
93 |
def _split_generators(self, dl_manager):
|
94 |
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
95 |
-
downloaded_files = dl_manager.download_and_extract(_URLS)
|
96 |
-
|
97 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
98 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
99 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
100 |
data_dir = dl_manager.download_and_extract({
|
|
|
101 |
"images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
|
102 |
})
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
115 |
def _generate_examples(self, examples_csv, images_dir):
|
|
|
50 |
# data = datasets.load_dataset('vasr', 'test')
|
51 |
BUILDER_CONFIGS = [
|
52 |
datasets.BuilderConfig(name="TEST", version=VERSION, description="vasr dataset gold test"),
|
53 |
+
# datasets.BuilderConfig(name="VALIDATION", version=VERSION, description="vasr dataset gold validation"),
|
54 |
+
# datasets.BuilderConfig(name="TRAIN", version=VERSION, description="vasr dataset gold train")
|
55 |
]
|
56 |
IMAGE_EXTENSION = "jpg"
|
57 |
|
|
|
92 |
|
93 |
def _split_generators(self, dl_manager):
|
94 |
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
95 |
+
# downloaded_files = dl_manager.download_and_extract(_URLS)
|
|
|
|
|
|
|
|
|
96 |
data_dir = dl_manager.download_and_extract({
|
97 |
+
"examples_csv": hf_hub_url("datasets/nlphuji/vasr", filename="test_gold.csv"),
|
98 |
"images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
|
99 |
})
|
100 |
|
101 |
+
return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
|
102 |
+
|
103 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
104 |
+
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
105 |
+
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
106 |
+
# data_dir = dl_manager.download_and_extract({
|
107 |
+
# "images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
|
108 |
+
# })
|
109 |
+
#
|
110 |
+
# # return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
|
111 |
+
# return [
|
112 |
+
# datasets.SplitGenerator(name=datasets.Split.TEST,
|
113 |
+
# gen_kwargs={**data_dir, **{'filepath': downloaded_files["test"]}}),
|
114 |
+
# datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
115 |
+
# gen_kwargs={**data_dir, **{'filepath': downloaded_files["train"]}}),
|
116 |
+
# datasets.SplitGenerator(name=datasets.Split.VALIDATION,
|
117 |
+
# gen_kwargs={**data_dir, **{'filepath': downloaded_files["dev"]}}),
|
118 |
+
# ]
|
119 |
|
120 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
121 |
def _generate_examples(self, examples_csv, images_dir):
|