yonatanbitton commited on
Commit
e32d03f
1 Parent(s): 6851022

Update fairface_val.py

Browse files
Files changed (1) hide show
  1. fairface_val.py +14 -5
fairface_val.py CHANGED
@@ -20,13 +20,15 @@ import json
20
  from huggingface_hub import hf_hub_url
21
 
22
  _INPUT_CSV = "fairface_labeled_val.csv"
23
- _INPUT_IMAGES = "fairface_val_images"
 
24
  _REPO_ID = "nlphuji/fairface_val"
25
 
26
  class Dataset(datasets.GeneratorBasedBuilder):
27
  VERSION = datasets.Version("1.1.0")
28
  BUILDER_CONFIGS = [
29
- datasets.BuilderConfig(name="TEST", version=VERSION, description="test"),
 
30
  ]
31
 
32
  def _info(self):
@@ -49,12 +51,19 @@ class Dataset(datasets.GeneratorBasedBuilder):
49
  """Returns SplitGenerators."""
50
 
51
  repo_id = _REPO_ID
52
- data_dir = dl_manager.download_and_extract({
53
  "examples_csv": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=_INPUT_CSV),
54
- "images_dir": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=f"{_INPUT_IMAGES}.zip")
55
  })
 
 
 
 
 
 
 
56
 
57
- return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
58
 
59
 
60
  def _generate_examples(self, examples_csv, images_dir):
 
20
  from huggingface_hub import hf_hub_url
21
 
22
  _INPUT_CSV = "fairface_labeled_val.csv"
23
+ _INPUT_IMAGES_025 = "fairface_val_images"
24
+ _INPUT_IMAGE_125 = 'fairface_val_images_125'
25
  _REPO_ID = "nlphuji/fairface_val"
26
 
27
  class Dataset(datasets.GeneratorBasedBuilder):
28
  VERSION = datasets.Version("1.1.0")
29
  BUILDER_CONFIGS = [
30
+ datasets.BuilderConfig(name="padding_025", version=VERSION, description="Padding=0.25"),
31
+ datasets.BuilderConfig(name="padding_125", version=VERSION, description="Padding=0.25"),
32
  ]
33
 
34
  def _info(self):
 
51
  """Returns SplitGenerators."""
52
 
53
  repo_id = _REPO_ID
54
+ data_dir_025 = dl_manager.download_and_extract({
55
  "examples_csv": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=_INPUT_CSV),
56
+ "images_dir": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=f"{_INPUT_IMAGES_025}.zip")
57
  })
58
+ data_dir_125 = dl_manager.download_and_extract({
59
+ "examples_csv": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=_INPUT_CSV),
60
+ "images_dir": hf_hub_url(repo_id=repo_id, repo_type='dataset', filename=f"{_INPUT_IMAGES_125}.zip")
61
+ })
62
+
63
+ splits = [datasets.SplitGenerator(name=datasets.Split.padding_025, gen_kwargs=data_dir_025),
64
+ datasets.SplitGenerator(name=datasets.Split.padding_125, gen_kwargs=data_dir_125)]
65
 
66
+ return splits
67
 
68
 
69
  def _generate_examples(self, examples_csv, images_dir):