Datasets:

ArXiv:
DOI:
License:
ProgramComputer commited on
Commit
63632a6
·
1 Parent(s): e04feae

Update VGGFace2.py

Browse files
Files changed (1) hide show
  1. VGGFace2.py +17 -17
VGGFace2.py CHANGED
@@ -78,20 +78,23 @@ class VGGFace2(datasets.GeneratorBasedBuilder):
78
 
79
  def _info(self):
80
  features = {
81
- "file": datasets.Image(),
82
  "image_id": datasets.Value("string"),
83
  "class_id": datasets.Value("string"),
84
  "identity": datasets.Value("string"),
85
- "male": datasets.Value("binary"),
86
- "black_hair": datasets.Value("string"),
87
- "gray_hair": datasets.Value("string"),
88
- "blond_hair": datasets.Value("string"),
89
- "long_hair": datasets.Value("string"),
90
- "mustache_or_beard": datasets.Value("string"),
91
- "wearing_hat": datasets.Value("string"),
92
- "eyeglasses": datasets.Value("string"),
93
- "sunglasses": datasets.Value("string"),
94
- "mouth_open": datasets.Value("string"),
 
 
 
95
  }
96
 
97
  return datasets.DatasetInfo(
@@ -157,14 +160,11 @@ class VGGFace2(datasets.GeneratorBasedBuilder):
157
  temp.drop(columns=['Image_Path'], inplace=True)
158
 
159
  result_df = meta.merge(temp, on='Class_ID', how='outer')
160
- raise Exception(result_df)
161
  for file_path, file_obj in paths:
162
- if file_path.startswith(_IMAGES_DIR):
163
- if file_path[len(_IMAGES_DIR) : -len(".jpg")] in files_to_keep:
164
- clip_index = int(clip.stem)
165
 
166
- label = file_path.split("/")[2]
167
- yield file_path, {
168
  "image": {"path": file_path, "bytes": file_obj.read()},
169
  "label": label,
170
  }
 
78
 
79
  def _info(self):
80
  features = {
81
+ "image": datasets.Image(),
82
  "image_id": datasets.Value("string"),
83
  "class_id": datasets.Value("string"),
84
  "identity": datasets.Value("string"),
85
+ 'gender': dataset.Value("string"),
86
+ 'sample_num':dataset.Value("int"),
87
+ 'flag':dataset.Value("bool"),
88
+ "male": datasets.Value("bool"),
89
+ "black_hair": datasets.Value("bool"),
90
+ "gray_hair": datasets.Value("bool"),
91
+ "blond_hair": datasets.Value("bool"),
92
+ "long_hair": datasets.Value("bool"),
93
+ "mustache_or_beard": datasets.Value("bool"),
94
+ "wearing_hat": datasets.Value("bool"),
95
+ "eyeglasses": datasets.Value("bool"),
96
+ "sunglasses": datasets.Value("bool"),
97
+ "mouth_open": datasets.Value("bool"),
98
  }
99
 
100
  return datasets.DatasetInfo(
 
160
  temp.drop(columns=['Image_Path'], inplace=True)
161
 
162
  result_df = meta.merge(temp, on='Class_ID', how='outer')
 
163
  for file_path, file_obj in paths:
164
+ raise Exception(file_path)
 
 
165
 
166
+ label = file_path.split("/")[2]
167
+ yield file_path, {
168
  "image": {"path": file_path, "bytes": file_obj.read()},
169
  "label": label,
170
  }