fix
Browse files
presentation-attack-detection-2d-dataset.py
CHANGED
@@ -64,33 +64,21 @@ class PresentationAttackDetection2dDataset(datasets.GeneratorBasedBuilder):
|
|
64 |
yield idx, {
|
65 |
"photo": {"path": image_path, "bytes": image.read()},
|
66 |
"video": annotations_df.loc[
|
67 |
-
annotations_df["set_id"].str.contains(
|
68 |
-
"|".join(image_path.split("/")[0])
|
69 |
-
)
|
70 |
]["video"].values[0],
|
71 |
"worker_id": annotations_df.loc[
|
72 |
-
annotations_df["set_id"].str.contains(
|
73 |
-
"|".join(image_path.split("/")[0])
|
74 |
-
)
|
75 |
]["worker_id"].values[0],
|
76 |
"set_id": annotations_df.loc[
|
77 |
-
annotations_df["set_id"].str.contains(
|
78 |
-
"|".join(image_path.split("/")[0])
|
79 |
-
)
|
80 |
]["set_id"].values[0],
|
81 |
"age": annotations_df.loc[
|
82 |
-
annotations_df["set_id"].str.contains(
|
83 |
-
"|".join(image_path.split("/")[0])
|
84 |
-
)
|
85 |
]["age"].values[0],
|
86 |
"country": annotations_df.loc[
|
87 |
-
annotations_df["set_id"].str.contains(
|
88 |
-
"|".join(image_path.split("/")[0])
|
89 |
-
)
|
90 |
]["country"].values[0],
|
91 |
"gender": annotations_df.loc[
|
92 |
-
annotations_df["set_id"].str.contains(
|
93 |
-
"|".join(image_path.split("/")[0])
|
94 |
-
)
|
95 |
]["gender"].values[0],
|
96 |
}
|
|
|
64 |
yield idx, {
|
65 |
"photo": {"path": image_path, "bytes": image.read()},
|
66 |
"video": annotations_df.loc[
|
67 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
68 |
]["video"].values[0],
|
69 |
"worker_id": annotations_df.loc[
|
70 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
71 |
]["worker_id"].values[0],
|
72 |
"set_id": annotations_df.loc[
|
73 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
74 |
]["set_id"].values[0],
|
75 |
"age": annotations_df.loc[
|
76 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
77 |
]["age"].values[0],
|
78 |
"country": annotations_df.loc[
|
79 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
80 |
]["country"].values[0],
|
81 |
"gender": annotations_df.loc[
|
82 |
+
annotations_df["set_id"].str.contains(image_path.split("/")[2])
|
|
|
|
|
83 |
]["gender"].values[0],
|
84 |
}
|