Vadzim Kashko commited on
Commit
36d0ada
1 Parent(s): c3126ae

feat: upload script docs: readme

Browse files
Files changed (2) hide show
  1. README.md +18 -0
  2. anti-spoofing_replay.py +22 -34
README.md CHANGED
@@ -8,6 +8,24 @@ tags:
8
  - finance
9
  - legal
10
  - code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
  # Anti-Spoofing dataset: replay
 
8
  - finance
9
  - legal
10
  - code
11
+ dataset_info:
12
+ features:
13
+ - name: live_video_id
14
+ dtype: string
15
+ - name: phone
16
+ dtype: string
17
+ - name: video_file
18
+ dtype: string
19
+ - name: phone_video_playback
20
+ dtype: string
21
+ - name: worker_id
22
+ dtype: string
23
+ splits:
24
+ - name: train
25
+ num_bytes: 5063
26
+ num_examples: 30
27
+ download_size: 735628032
28
+ dataset_size: 5063
29
  ---
30
 
31
  # Anti-Spoofing dataset: replay
anti-spoofing_replay.py CHANGED
@@ -10,8 +10,9 @@ year = {2023}
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 = 'anti-spoofing_replay'
17
 
@@ -28,13 +29,11 @@ class AntiSpoofingReplay(datasets.GeneratorBasedBuilder):
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,
@@ -55,33 +54,22 @@ class AntiSpoofingReplay(datasets.GeneratorBasedBuilder):
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
  }
 
10
  """
11
 
12
  _DESCRIPTION = """\
13
+ The dataset consists of 40,000 videos and selfies with unique people. 15,000
14
+ attack replays from 4,000 unique devices. 10,000 attacks with A4 printouts and
15
+ 10,000 attacks with cut-out printouts.
16
  """
17
  _NAME = 'anti-spoofing_replay'
18
 
 
29
  return datasets.DatasetInfo(
30
  description=_DESCRIPTION,
31
  features=datasets.Features({
32
+ 'live_video_id': datasets.Value('string'),
33
+ 'phone': datasets.Value('string'),
34
  'video_file': datasets.Value('string'),
35
+ 'phone_video_playback': datasets.Value('string'),
36
+ 'worker_id': datasets.Value('string')
 
 
 
 
37
  }),
38
  supervised_keys=None,
39
  homepage=_HOMEPAGE,
 
54
 
55
  def _generate_examples(self, videos, annotations):
56
  annotations_df = pd.read_csv(annotations, sep=';')
57
+ for idx, (video_path, video) in enumerate(videos):
58
+ file_name = '/'.join(video_path.split('/')[-2:])
 
59
 
60
  yield idx, {
61
+ 'live_video_id':
62
+ annotations_df.loc[annotations_df['link'] == file_name]
63
+ ['live_video_id'].values[0],
64
+ 'phone':
65
+ annotations_df.loc[annotations_df['link'] == file_name]
66
+ ['phone'].values[0],
67
+ 'video_file':
68
+ video_path,
69
+ 'phone_video_playback':
70
+ annotations_df.loc[annotations_df['link'] == file_name]
71
+ ['phone_video_playback'].values[0],
72
  'worker_id':
73
+ annotations_df.loc[annotations_df['link'] == file_name]
74
+ ['worker_id'].values[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }