refactor: all data
Browse files- .gitattributes +1 -0
- live_videos/0001d815c0--61f3c3321e087a11af822fdc.mp4 → data/videos.tar.gz +2 -2
- live_videos/0001d815c0--61dc3cd237bb0b17026609ea.mp4 +0 -0
- live_videos/0001d815c0--61e409908ccae11700e6a347.mp4 +0 -0
- live_videos/0001d815c0--61e561016090114967d86569.mp4 +0 -3
- live_videos/0001d815c0--61eeaf9928213259ef95a20a.mp4 +0 -3
- live_videos/0001d815c0--6207d93b43afdc2f8d25853a.mp4 +0 -3
- live_videos/0001db3fa7--61e9938abb27377cdd4ea53a.mp4 +0 -3
- file_info.csv → low_quality_webcam_video_attacks.csv +0 -0
- low_quality_webcam_video_attacks.py +87 -0
.gitattributes
CHANGED
@@ -57,3 +57,4 @@ live_videos/0001d815c0--61eeaf9928213259ef95a20a.mp4 filter=lfs diff=lfs merge=l
|
|
57 |
live_videos/0001d815c0--61f3c3321e087a11af822fdc.mp4 filter=lfs diff=lfs merge=lfs -text
|
58 |
live_videos/0001d815c0--6207d93b43afdc2f8d25853a.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
live_videos/0001db3fa7--61e9938abb27377cdd4ea53a.mp4 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
57 |
live_videos/0001d815c0--61f3c3321e087a11af822fdc.mp4 filter=lfs diff=lfs merge=lfs -text
|
58 |
live_videos/0001d815c0--6207d93b43afdc2f8d25853a.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
live_videos/0001db3fa7--61e9938abb27377cdd4ea53a.mp4 filter=lfs diff=lfs merge=lfs -text
|
60 |
+
data filter=lfs diff=lfs merge=lfs -text
|
live_videos/0001d815c0--61f3c3321e087a11af822fdc.mp4 → data/videos.tar.gz
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c6ef5625cbdb0d58d44fe60ff6eae8bf72a46719f06727783fd6dae05a2b8d9f
|
3 |
+
size 8073719
|
live_videos/0001d815c0--61dc3cd237bb0b17026609ea.mp4
DELETED
Binary file (853 kB)
|
|
live_videos/0001d815c0--61e409908ccae11700e6a347.mp4
DELETED
Binary file (565 kB)
|
|
live_videos/0001d815c0--61e561016090114967d86569.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9f4d20cee120aeb2d21529d32fbc30de519ca655216ed980f63f775037bb5c50
|
3 |
-
size 1172009
|
|
|
|
|
|
|
|
live_videos/0001d815c0--61eeaf9928213259ef95a20a.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b59295e4404d7830b5345504e5a61121c40605412706c6668d8a7893f304fbf0
|
3 |
-
size 1059547
|
|
|
|
|
|
|
|
live_videos/0001d815c0--6207d93b43afdc2f8d25853a.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4df148f35adf452cf4d6d26158047d9e861e0f834c54ded4b20aac1cdf86233d
|
3 |
-
size 1795725
|
|
|
|
|
|
|
|
live_videos/0001db3fa7--61e9938abb27377cdd4ea53a.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:012637a839449add13860d2d7faa49af81a0bcd7e68bda9bc189f04495fff312
|
3 |
-
size 1265421
|
|
|
|
|
|
|
|
file_info.csv → low_quality_webcam_video_attacks.csv
RENAMED
File without changes
|
low_quality_webcam_video_attacks.py
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
_CITATION = """\
|
5 |
+
@InProceedings{huggingface:dataset,
|
6 |
+
title = {low_quality_webcam_video_attacks},
|
7 |
+
author = {TrainingDataPro},
|
8 |
+
year = {2023}
|
9 |
+
}
|
10 |
+
"""
|
11 |
+
|
12 |
+
_DESCRIPTION = """\
|
13 |
+
The dataset includes live-recorded Anti-Spoofing videos from around the world,
|
14 |
+
captured via low-quality webcams with resolutions like QVGA, QQVGA and QCIF.
|
15 |
+
"""
|
16 |
+
_NAME = 'low_quality_webcam_video_attacks'
|
17 |
+
|
18 |
+
_HOMEPAGE = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}"
|
19 |
+
|
20 |
+
_LICENSE = "cc-by-nc-nd-4.0"
|
21 |
+
|
22 |
+
_DATA = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}/resolve/main/data/"
|
23 |
+
|
24 |
+
|
25 |
+
class LowQualityWebcamVideoAttacks(datasets.GeneratorBasedBuilder):
|
26 |
+
|
27 |
+
def _info(self):
|
28 |
+
return datasets.DatasetInfo(
|
29 |
+
description=_DESCRIPTION,
|
30 |
+
features=datasets.Features({
|
31 |
+
'video_file': datasets.Value('string'),
|
32 |
+
'assignment_id': datasets.Value('string'),
|
33 |
+
'worker_id': datasets.Value('string'),
|
34 |
+
'gender': datasets.Value('string'),
|
35 |
+
'age': datasets.Value('uint8'),
|
36 |
+
'country': datasets.Value('string'),
|
37 |
+
'resolution': datasets.Value('string')
|
38 |
+
}),
|
39 |
+
supervised_keys=None,
|
40 |
+
homepage=_HOMEPAGE,
|
41 |
+
citation=_CITATION,
|
42 |
+
license=_LICENSE)
|
43 |
+
|
44 |
+
def _split_generators(self, dl_manager):
|
45 |
+
videos = dl_manager.download(f"{_DATA}videos.tar.gz")
|
46 |
+
annotations = dl_manager.download(f"{_DATA}{_NAME}.csv")
|
47 |
+
videos = dl_manager.iter_archive(videos)
|
48 |
+
return [
|
49 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
50 |
+
gen_kwargs={
|
51 |
+
"videos": videos,
|
52 |
+
'annotations': annotations
|
53 |
+
}),
|
54 |
+
]
|
55 |
+
|
56 |
+
def _generate_examples(self, videos, annotations):
|
57 |
+
annotations_df = pd.read_csv(annotations, sep=';')
|
58 |
+
for idx, (image_path, video) in enumerate(videos):
|
59 |
+
file_name = image_path.split('/')[-1]
|
60 |
+
assignment_id = file_name.split('.')[0]
|
61 |
+
|
62 |
+
yield idx, {
|
63 |
+
"video_file":
|
64 |
+
file_name,
|
65 |
+
'assignment_id':
|
66 |
+
assignment_id,
|
67 |
+
'worker_id':
|
68 |
+
annotations_df.loc[
|
69 |
+
annotations_df['assignment_id'] == assignment_id]
|
70 |
+
['worker_id'].values[0],
|
71 |
+
'gender':
|
72 |
+
annotations_df.loc[
|
73 |
+
annotations_df['assignment_id'] == assignment_id]
|
74 |
+
['gender'].values[0],
|
75 |
+
'age':
|
76 |
+
annotations_df.loc[
|
77 |
+
annotations_df['assignment_id'] == assignment_id]
|
78 |
+
['age'].values[0],
|
79 |
+
'country':
|
80 |
+
annotations_df.loc[
|
81 |
+
annotations_df['assignment_id'] == assignment_id]
|
82 |
+
['country'].values[0],
|
83 |
+
'resolution':
|
84 |
+
annotations_df.loc[
|
85 |
+
annotations_df['assignment_id'] == assignment_id]
|
86 |
+
['resolution'].values[0]
|
87 |
+
}
|