Datasets:
ArXiv:
DOI:
License:
Commit
·
63632a6
1
Parent(s):
e04feae
Update VGGFace2.py
Browse files- VGGFace2.py +17 -17
VGGFace2.py
CHANGED
@@ -78,20 +78,23 @@ class VGGFace2(datasets.GeneratorBasedBuilder):
|
|
78 |
|
79 |
def _info(self):
|
80 |
features = {
|
81 |
-
"
|
82 |
"image_id": datasets.Value("string"),
|
83 |
"class_id": datasets.Value("string"),
|
84 |
"identity": datasets.Value("string"),
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
"
|
89 |
-
"
|
90 |
-
"
|
91 |
-
"
|
92 |
-
"
|
93 |
-
"
|
94 |
-
"
|
|
|
|
|
|
|
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 |
-
|
163 |
-
if file_path[len(_IMAGES_DIR) : -len(".jpg")] in files_to_keep:
|
164 |
-
clip_index = int(clip.stem)
|
165 |
|
166 |
-
|
167 |
-
|
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 |
}
|