vkashko commited on
Commit
dbf9108
·
1 Parent(s): dadf4d5

refactor: all data

Browse files
Files changed (30) hide show
  1. files/000269e00f--64c8d84d089f4e44f6481bb0/2.jpg → data/attacks.tar.gz +2 -2
  2. Result.csv → data/presentation-attack-detection-2d-dataset.csv +0 -0
  3. files/000269e00f--64c8d84d089f4e44f6481bb0/3.mp4 +0 -3
  4. files/000269e00f--64c8f4db4a10835184c95641/2.jpg +0 -3
  5. files/000269e00f--64c8f4db4a10835184c95641/3.mp4 +0 -3
  6. files/000269e00f--64c8f55c64b09d4014084391/2.jpg +0 -3
  7. files/000269e00f--64c8f55c64b09d4014084391/3.mp4 +0 -3
  8. files/000269e00f--64c9cbf134a9be2301431749/2.jpg +0 -3
  9. files/000269e00f--64c9cbf134a9be2301431749/3.mp4 +0 -3
  10. files/000269e00f--64ca0aa684be481f7568360f/2.jpg +0 -3
  11. files/000269e00f--64ca0aa684be481f7568360f/3.MOV +0 -3
  12. files/000269e00f--64ca72f2c38b125fffa93c6e/2.jpg +0 -3
  13. files/000269e00f--64ca72f2c38b125fffa93c6e/3.mp4 +0 -3
  14. files/000269e00f--64caa8acb4858c670df55582/2.jpg +0 -3
  15. files/000269e00f--64caa8acb4858c670df55582/3.mp4 +0 -3
  16. files/000269e00f--64cb61c13dc862273921414f/2.jpg +0 -3
  17. files/000269e00f--64cb61c13dc862273921414f/3.mp4 +0 -3
  18. files/000269e00f--64cbccc402343312e74eccfb/2.jpg +0 -3
  19. files/000269e00f--64cbccc402343312e74eccfb/3.mp4 +0 -3
  20. files/000269e00f--64cce2f9747ca45dad369280/2.jpg +0 -3
  21. files/000269e00f--64cce2f9747ca45dad369280/3.mp4 +0 -3
  22. files/000269e00f--64ce34be591a914f7a454dae/2.jpg +0 -3
  23. files/000269e00f--64ce34be591a914f7a454dae/3.mp4 +0 -3
  24. files/000269e00f--64cf6c2ca3e04150ef4c19c2/2.jpg +0 -3
  25. files/000269e00f--64cf6c2ca3e04150ef4c19c2/3.MOV +0 -3
  26. files/000269e00f--64d1d284038f0820fecdab8b/2.jpg +0 -3
  27. files/000269e00f--64d1d284038f0820fecdab8b/3.mp4 +0 -3
  28. files/000269e00f--64d25998571de06b0eecc774/2.jpg +0 -3
  29. files/000269e00f--64d25998571de06b0eecc774/3.mp4 +0 -3
  30. presentation-attack-detection-2d-dataset.py +83 -0
files/000269e00f--64c8d84d089f4e44f6481bb0/2.jpg → data/attacks.tar.gz RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f2cd69f335d4d757f9d1bbceae84343e8d83d335fb5c3662e52b8d39c88b3ecf
3
- size 1637564
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d274a43cec22d1736d35e9cd86f8af8c3066f2e3337f927e8a3c8c068cd04fd0
3
+ size 458881420
Result.csv → data/presentation-attack-detection-2d-dataset.csv RENAMED
File without changes
files/000269e00f--64c8d84d089f4e44f6481bb0/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4bfb8d3712fec27b2306aaa882e3b9ccdd58b7a7b7f7f5e72da856ec593a9fc6
3
- size 35693421
 
 
 
 
files/000269e00f--64c8f4db4a10835184c95641/2.jpg DELETED

Git LFS Details

  • SHA256: 11cff61274ae60104d03607e5bc52661ad81cf3cbf2e2cec1909552e82a0d619
  • Pointer size: 131 Bytes
  • Size of remote file: 642 kB
files/000269e00f--64c8f4db4a10835184c95641/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0d2a3126e8d4500e192e15bc71fa65eee6df81b6059cd25b0fec65dc556615cf
3
- size 29130162
 
 
 
 
files/000269e00f--64c8f55c64b09d4014084391/2.jpg DELETED

Git LFS Details

  • SHA256: 5ea9b22e0bc566138e7794970e424a035f3813e1bab455e0612b3af3e3b87393
  • Pointer size: 132 Bytes
  • Size of remote file: 3.3 MB
files/000269e00f--64c8f55c64b09d4014084391/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2d8ee739c7a79e23e677c48cf62606d02c5b8fce965013719cc033f4a5a479e7
3
- size 29855473
 
 
 
 
files/000269e00f--64c9cbf134a9be2301431749/2.jpg DELETED

Git LFS Details

  • SHA256: 5738a1920fea590a0191dab0cae2899cac4a6be5fb3e0ff1d1af085392f11c02
  • Pointer size: 132 Bytes
  • Size of remote file: 3.66 MB
files/000269e00f--64c9cbf134a9be2301431749/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:672cbc06127406d86a7f6fc64a675ade5bb8100b4f6f2adafec814f4b60509ca
3
- size 20297697
 
 
 
 
files/000269e00f--64ca0aa684be481f7568360f/2.jpg DELETED

Git LFS Details

  • SHA256: d8f7fe95076333f89161c1ad7e472afb527d8ec1fa57a4c7c7486139f90ad917
  • Pointer size: 132 Bytes
  • Size of remote file: 1.13 MB
files/000269e00f--64ca0aa684be481f7568360f/3.MOV DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2dbddb26499ff55e29b0f1c248ca8112a08cf3c7188b3aff558726b55de45518
3
- size 36517070
 
 
 
 
files/000269e00f--64ca72f2c38b125fffa93c6e/2.jpg DELETED

Git LFS Details

  • SHA256: 3089bef3022c2d7ba1cbad640ae27d540d92f8d6c8a5569214494ad971e86964
  • Pointer size: 132 Bytes
  • Size of remote file: 5.64 MB
files/000269e00f--64ca72f2c38b125fffa93c6e/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7b9ea3ba009fa9381edb11df9f48cfda47d9181e8dc369bf13979265e3d2b69e
3
- size 49482389
 
 
 
 
files/000269e00f--64caa8acb4858c670df55582/2.jpg DELETED

Git LFS Details

  • SHA256: f8f7bc4cc81940788beccb4710e5fc641c83f4ce5a25fdf76c0e8e73d436767c
  • Pointer size: 132 Bytes
  • Size of remote file: 3.31 MB
files/000269e00f--64caa8acb4858c670df55582/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7ea0e13b3ff87f822605ae44ef31e11cba3a711581338bcd6f01cae0e6504544
3
- size 10317431
 
 
 
 
files/000269e00f--64cb61c13dc862273921414f/2.jpg DELETED

Git LFS Details

  • SHA256: 417151b09ca62ca66012d63607ec2e3138336186d5323ff343c300f1c8d45654
  • Pointer size: 132 Bytes
  • Size of remote file: 3.01 MB
files/000269e00f--64cb61c13dc862273921414f/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:8f09bfce1c11737bf6f25205c83903716e621225b2f56a18401633231b48db4c
3
- size 28215017
 
 
 
 
files/000269e00f--64cbccc402343312e74eccfb/2.jpg DELETED

Git LFS Details

  • SHA256: 06e91f0ca87ebb3a29fd21c6991ae8a98feeb041a3eb65e53142e8c7fd79f55e
  • Pointer size: 132 Bytes
  • Size of remote file: 9.46 MB
files/000269e00f--64cbccc402343312e74eccfb/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:95c6781399cd2a5368cab5b851b3d5f94943423b4341ee4c874273055e2cc01a
3
- size 32080430
 
 
 
 
files/000269e00f--64cce2f9747ca45dad369280/2.jpg DELETED

Git LFS Details

  • SHA256: 1406ddaf287dd1e671805169c92c428c80b4cbcbdd2d1e665e8ab95d89ab69d5
  • Pointer size: 131 Bytes
  • Size of remote file: 128 kB
files/000269e00f--64cce2f9747ca45dad369280/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a502352bf97aa0652449e921d54d8ce3ce9278c405a1d476c74545e41687d445
3
- size 45720267
 
 
 
 
files/000269e00f--64ce34be591a914f7a454dae/2.jpg DELETED

Git LFS Details

  • SHA256: 0c05fb53f064e9f8311655274f991c060de6ba92657dd37bdcb9eeebde3be63c
  • Pointer size: 132 Bytes
  • Size of remote file: 6.29 MB
files/000269e00f--64ce34be591a914f7a454dae/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a947f590f5cc0a4f9dbc76c0f7802190c9875761cec4fc03bc356e42dd1ab723
3
- size 23043427
 
 
 
 
files/000269e00f--64cf6c2ca3e04150ef4c19c2/2.jpg DELETED

Git LFS Details

  • SHA256: 09913d26ca8be65980e1b34608f7111dcf9b297db2635a5a4df09bf4be3bc692
  • Pointer size: 132 Bytes
  • Size of remote file: 1.71 MB
files/000269e00f--64cf6c2ca3e04150ef4c19c2/3.MOV DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:302a299bce7f0aeb47b31765884f58a507f9d12a6f1b5af6a5921840fc48d692
3
- size 31207878
 
 
 
 
files/000269e00f--64d1d284038f0820fecdab8b/2.jpg DELETED

Git LFS Details

  • SHA256: 8dc401b8f32e4b3d34f1685620e56030a29c47d9bd1fd16194fe4fc359828745
  • Pointer size: 132 Bytes
  • Size of remote file: 3.37 MB
files/000269e00f--64d1d284038f0820fecdab8b/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d769a5e42367e028fecccdbbcd29cd511e25800173408e21d3d59ece4d7e25c9
3
- size 39626974
 
 
 
 
files/000269e00f--64d25998571de06b0eecc774/2.jpg DELETED

Git LFS Details

  • SHA256: 227856e45100a9c43b746b34181429606407c29a3cb1225190b88125b79eacf5
  • Pointer size: 132 Bytes
  • Size of remote file: 2.28 MB
files/000269e00f--64d25998571de06b0eecc774/3.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4746be404ba86ad49be7cc3af81245f7ef21b4a4d7d67d592426a7810bc95731
3
- size 5866023
 
 
 
 
presentation-attack-detection-2d-dataset.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from itertools import pairwise
2
+
3
+ import datasets
4
+ import pandas as pd
5
+
6
+ _CITATION = """\
7
+ @InProceedings{huggingface:dataset,
8
+ title = {presentation-attack-detection-2d-dataset},
9
+ author = {TrainingDataPro},
10
+ year = {2023}
11
+ }
12
+ """
13
+
14
+ _DESCRIPTION = """\
15
+ The dataset consists of photos of individuals and videos of him/her wearing printed 2D
16
+ mask with cut-out holes for eyes. Videos are filmed in different lightning conditions
17
+ and in different places (*indoors, outdoors*), a person moves his/her head left, right,
18
+ up and down. Each video in the dataset has an approximate duration of 15-17 seconds.
19
+ """
20
+ _NAME = "presentation-attack-detection-2d-dataset"
21
+
22
+ _HOMEPAGE = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}"
23
+
24
+ _LICENSE = ""
25
+
26
+ _DATA = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}/resolve/main/data/"
27
+
28
+
29
+ class PresentationAttackDetection2dDataset(datasets.GeneratorBasedBuilder):
30
+ def _info(self):
31
+ return datasets.DatasetInfo(
32
+ description=_DESCRIPTION,
33
+ features=datasets.Features(
34
+ {
35
+ "photo": datasets.Image(),
36
+ "video": datasets.Value("string"),
37
+ "worker_id": datasets.Value("string"),
38
+ "set_id": datasets.Value("string"),
39
+ "age": datasets.Value("int8"),
40
+ "country": datasets.Value("string"),
41
+ "gender": datasets.Value("string"),
42
+ }
43
+ ),
44
+ supervised_keys=None,
45
+ homepage=_HOMEPAGE,
46
+ citation=_CITATION,
47
+ )
48
+
49
+ def _split_generators(self, dl_manager):
50
+ attacks = dl_manager.download(f"{_DATA}attacks.tar.gz")
51
+ annotations = dl_manager.download(f"{_DATA}{_NAME}.csv")
52
+ attacks = dl_manager.iter_archive(attacks)
53
+ return [
54
+ datasets.SplitGenerator(
55
+ name=datasets.Split.TRAIN,
56
+ gen_kwargs={"attacks": attacks, "annotations": annotations},
57
+ ),
58
+ ]
59
+
60
+ def _generate_examples(self, attacks, annotations):
61
+ annotations_df = pd.read_csv(annotations, sep=",")
62
+ for idx, ((image_path, image), (video_path, video)) in enumerate(
63
+ pairwise(attacks)
64
+ ):
65
+ yield idx, {
66
+ "photo": {"path": image_path, "bytes": image.read()},
67
+ "video": video_path,
68
+ "worker_id": annotations_df.loc[
69
+ annotations_df["worker_id"] == image_path.split("/")[-2]
70
+ ]["worker_id"].values[0],
71
+ "set_id": annotations_df.loc[
72
+ annotations_df["worker_id"] == image_path.split("/")[-2]
73
+ ]["set_id"].values[0],
74
+ "age": annotations_df.loc[
75
+ annotations_df["worker_id"] == image_path.split("/")[-2]
76
+ ]["age"].values[0],
77
+ "country": annotations_df.loc[
78
+ annotations_df["worker_id"] == image_path.split("/")[-2]
79
+ ]["country"].values[0],
80
+ "gender": annotations_df.loc[
81
+ annotations_df["worker_id"] == image_path.split("/")[-2]
82
+ ]["gender"].values[0],
83
+ }