vkashko commited on
Commit
cd24403
·
1 Parent(s): 4e87813

fix: script

Browse files
presentation-attack-detection-2d-dataset.py CHANGED
@@ -64,21 +64,33 @@ class PresentationAttackDetection2dDataset(datasets.GeneratorBasedBuilder):
64
  yield idx, {
65
  "photo": {"path": image_path, "bytes": image},
66
  "video": annotations_df.loc[
67
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
68
  ]["video"].values[0],
69
  "worker_id": annotations_df.loc[
70
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
71
  ]["worker_id"].values[0],
72
  "set_id": annotations_df.loc[
73
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
74
  ]["set_id"].values[0],
75
  "age": annotations_df.loc[
76
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
77
  ]["age"].values[0],
78
  "country": annotations_df.loc[
79
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
80
  ]["country"].values[0],
81
  "gender": annotations_df.loc[
82
- annotations_df["set_id"].str.contains(image_path.split("/")[0])
 
 
83
  ]["gender"].values[0],
84
  }
 
64
  yield idx, {
65
  "photo": {"path": image_path, "bytes": image},
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
  }