vsd-benchmark commited on
Commit
5d786fe
·
1 Parent(s): e8a42f1

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -58,3 +58,5 @@ in_fashion/dataset_metadata_wild.json filter=lfs diff=lfs merge=lfs -text
58
  in_fashion/gt_tagging/in_fashion_outshop_tags_dict.json filter=lfs diff=lfs merge=lfs -text
59
  in_fashion/gt_tagging/manifest.json filter=lfs diff=lfs merge=lfs -text
60
  in_fashion/gt_tagging/manifest_wild.json filter=lfs diff=lfs merge=lfs -text
 
 
 
58
  in_fashion/gt_tagging/in_fashion_outshop_tags_dict.json filter=lfs diff=lfs merge=lfs -text
59
  in_fashion/gt_tagging/manifest.json filter=lfs diff=lfs merge=lfs -text
60
  in_fashion/gt_tagging/manifest_wild.json filter=lfs diff=lfs merge=lfs -text
61
+ in_fashion/gt_tagging_wild/in_fashion_outshop_tags_dict.json filter=lfs diff=lfs merge=lfs -text
62
+ in_fashion/gt_tagging_wild/manifest.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,6 +1,3 @@
1
  ---
2
  license: mit
3
- tags:
4
- - vsd
5
- pretty_name: VSDFashion
6
- ---
 
1
  ---
2
  license: mit
3
+ ---
 
 
 
in_fashion/gt_tagging_wild/in_fashion_outshop_tags_dict.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed2cc5de0e47e9de2d460a57fcf9f68a89074d69ac628c3286c6fea8b7cf2be3
3
+ size 11836899
in_fashion/gt_tagging_wild/manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4257bfcfc9e867d62844a31c82d3a20db2c71e15b36cef814a13251a8ed2f52
3
+ size 15430033
in_fashion/gt_tagging_wild/seeds.json ADDED
The diff for this file is too large to render. See raw diff
 
vsd-fashion.py CHANGED
@@ -127,6 +127,12 @@ class VSDFashion(datasets.GeneratorBasedBuilder):
127
  dataset_folder='in_fashion',
128
  split_folder='gt_tagging_split_closed_catalog',
129
  ),
 
 
 
 
 
 
130
  ]
131
 
132
  DEFAULT_CONFIG_NAME = "in_catalog_retrieval_zero_shot"
@@ -157,16 +163,6 @@ class VSDFashion(datasets.GeneratorBasedBuilder):
157
  )
158
 
159
  def _split_generators(self, dl_manager):
160
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
161
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
162
-
163
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
164
- # 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.
165
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
166
- # urls = _URLS[self.config.name]
167
- # data_dir = dl_manager.download_and_extract(urls)
168
- # dataset_path = Path(snapshot_download(repo_id=HF_DATASET_ID, repo_type='datasets'))
169
- # dataset_path = Path(dl_manager.download_and_extract(_URL + f"/{self.config.dataset_folder}/{self.config.split_folder}"))
170
  dataset_path = Path(snapshot_download(_HF_DATASET_ID, repo_type='dataset'))
171
 
172
  task_data_path = dataset_path/self.config.dataset_folder/self.config.split_folder
@@ -177,9 +173,22 @@ class VSDFashion(datasets.GeneratorBasedBuilder):
177
  name=datasets.Split.TEST,
178
  # These kwargs will be passed to _generate_examples
179
  gen_kwargs={
180
- "manifest": task_data_path/'mainifest.json',
181
- "seeds": task_data_path/'seeds.json',
182
- "annotations": task_data_path/'in_fashion_tags_dict.json',
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  "split": "test",
184
  },
185
  ),
@@ -190,9 +199,9 @@ class VSDFashion(datasets.GeneratorBasedBuilder):
190
  name=datasets.Split.TRAIN,
191
  # These kwargs will be passed to _generate_examples
192
  gen_kwargs={
193
- "manifest": task_data_path/'mainifest_train.json',
194
- "seeds": task_data_path/'seeds_train.json',
195
- "annotations": task_data_path/'in_fashion_tags_dict_train.json',
196
  "split": "train",
197
  },
198
  ),
@@ -200,20 +209,17 @@ class VSDFashion(datasets.GeneratorBasedBuilder):
200
  name=datasets.Split.TEST,
201
  # These kwargs will be passed to _generate_examples
202
  gen_kwargs={
203
- "manifest": task_data_path/'mainifest_test.json',
204
- "seeds": task_data_path/'seeds_test.json',
205
- "annotations": task_data_path/'in_fashion_tags_dict_test.json',
206
  "split": "test",
207
  },
208
  ),
209
  ]
210
 
211
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
212
- def _generate_examples(self, annotations, **kwargs):
213
- # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
214
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
215
- print("Opening ", annotations)
216
- with open(annotations, encoding="utf-8") as f:
217
  data = json.load(f)
218
 
219
  for key, row in enumerate(data):
 
127
  dataset_folder='in_fashion',
128
  split_folder='gt_tagging_split_closed_catalog',
129
  ),
130
+ VSDFashionConfig(
131
+ name="consumer-catalog_wild_zero_shot",
132
+ description="Zero shot task for matching a consumer taken photo of a clothing and visually matching with a catalog item. Pretraining on any data is allowed, except consumer photos (queries).",
133
+ dataset_folder='in_fashion',
134
+ split_folder='gt_tagging_wild',
135
+ ),
136
  ]
137
 
138
  DEFAULT_CONFIG_NAME = "in_catalog_retrieval_zero_shot"
 
163
  )
164
 
165
  def _split_generators(self, dl_manager):
 
 
 
 
 
 
 
 
 
 
166
  dataset_path = Path(snapshot_download(_HF_DATASET_ID, repo_type='dataset'))
167
 
168
  task_data_path = dataset_path/self.config.dataset_folder/self.config.split_folder
 
173
  name=datasets.Split.TEST,
174
  # These kwargs will be passed to _generate_examples
175
  gen_kwargs={
176
+ "manifest_file": task_data_path/'mainifest.json',
177
+ "seeds_file": task_data_path/'seeds.json',
178
+ "annotations_file": task_data_path/'in_fashion_tags_dict.json',
179
+ "split": "test",
180
+ },
181
+ ),
182
+ ]
183
+ elif self.config.name == 'consumer-catalog_wild_zero_shot':
184
+ return [
185
+ datasets.SplitGenerator(
186
+ name=datasets.Split.TEST,
187
+ # These kwargs will be passed to _generate_examples
188
+ gen_kwargs={
189
+ "manifest_file": task_data_path/'mainifest.json',
190
+ "seeds_file": task_data_path/'seeds.json',
191
+ "annotations_file": task_data_path/'in_fashion_outshop_tags_dict.json',
192
  "split": "test",
193
  },
194
  ),
 
199
  name=datasets.Split.TRAIN,
200
  # These kwargs will be passed to _generate_examples
201
  gen_kwargs={
202
+ "manifest_file": task_data_path/'mainifest_train.json',
203
+ "seeds_file": task_data_path/'seeds_train.json',
204
+ "annotations_file": task_data_path/'in_fashion_tags_dict_train.json',
205
  "split": "train",
206
  },
207
  ),
 
209
  name=datasets.Split.TEST,
210
  # These kwargs will be passed to _generate_examples
211
  gen_kwargs={
212
+ "manifest_file": task_data_path/'mainifest_test.json',
213
+ "seeds_file": task_data_path/'seeds_test.json',
214
+ "annotations_file": task_data_path/'in_fashion_tags_dict_test.json',
215
  "split": "test",
216
  },
217
  ),
218
  ]
219
 
220
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
221
+ def _generate_examples(self, annotations_file, **kwargs):
222
+ with open(annotations_file, encoding="utf-8") as f:
 
 
 
223
  data = json.load(f)
224
 
225
  for key, row in enumerate(data):