vkashko commited on
Commit
b6351dc
1 Parent(s): bd29e25
presentation-attack-detection-2d-dataset.py CHANGED
@@ -64,21 +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(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
  }
 
64
  yield idx, {
65
  "photo": {"path": image_path, "bytes": image.read()},
66
  "video": annotations_df.loc[
67
+ annotations_df["image"] == image_path
68
  ]["video"].values[0],
69
  "worker_id": annotations_df.loc[
70
+ annotations_df["image"] == image_path
71
  ]["worker_id"].values[0],
72
  "set_id": annotations_df.loc[
73
+ annotations_df["image"] == image_path
74
  ]["set_id"].values[0],
75
  "age": annotations_df.loc[
76
+ annotations_df["image"] == image_path
77
  ]["age"].values[0],
78
  "country": annotations_df.loc[
79
+ annotations_df["image"] == image_path
80
  ]["country"].values[0],
81
  "gender": annotations_df.loc[
82
+ annotations_df["image"] == image_path
83
  ]["gender"].values[0],
84
  }