Coverage for src/bob/bio/face/database/casia_africa.py: 100%
16 statements
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-13 00:04 +0200
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-13 00:04 +0200
1#!/usr/bin/env python
2# vim: set fileencoding=utf-8 :
3# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
5"""
6 CASIA-Face-Africa: database implementation
7"""
9from clapper.rc import UserDefaults
10from sklearn.pipeline import make_pipeline
12import bob.io.base
14from bob.bio.base.database import CSVDatabase, FileSampleLoader
15from bob.bio.face.database.sample_loaders import EyesAnnotations
17rc = UserDefaults("bobrc.toml")
20class CasiaAfricaDatabase(CSVDatabase):
21 """
22 The Casia-Face-Africa dataset is composed of 1133 identities from different ethical groups in Nigeria.
24 The capturing locations are:
25 - Dabai city in Katsina state
26 - Hotoro in Kano state
27 - Birget in Kano state
28 - Gandun Albasa in Kano state
29 - Sabon Gari inKano state
30 - Kano State School of Technology
32 These locations were strategically selected as they are known to have diverse population of local ethnicities.
34 .. warning::
35 Only 17 subjects had their images captured in two sessions.
37 Images were captured during daytime and night using three different cameras:
38 - C1: Visual Light Camera
39 - C2: Visual Light Camera
40 - C3: NIR camera
43 This dataset interface implemented the three verification protocols: "ID-V-All-Ep1", "ID-V-All-Ep2", and "ID-V-All-Ep3"
44 and they are organized as the following:
46 +------------------------------------------------------------------------------------+
47 | Dev. Set |
48 +------------------+----------------------------+------------+----------+------------+
49 | protocol name | Cameras (gallery/probe) | Identities | Gallery | Probes |
50 +==================+============================+============+==========+============+
51 | ID-V-All-Ep1 | C1/C2 | 1133 | 2455 | 2426 |
52 +------------------+----------------------------+------------+----------+------------+
53 | ID-V-All-Ep2 | C1/C3 | 1133 | 2455 | 1171 |
54 +------------------+----------------------------+------------+----------+------------+
55 | ID-V-All-Ep3 | C2/C3 | 1133 | 2466 | 1193 |
56 +------------------+----------------------------+------------+----------+------------+
59 .. warning::
60 Use the command below to set the path of the real data::
62 $ bob config set bob.db.casia-africa.directory [PATH-TO-RAW-DATA]
65 .. code-block:: latex
67 @article{jawad2020,
68 author = {Jawad, Muhammad and Yunlong, Wang andCaiyong, Wang and Kunbo, Zhang and Zhenan, Sun},
69 title = {CASIA-Face-Africa: A Large-scale African Face Image Database},
70 journal = {IEEE Transactions on Information Forensics and Security},
71 pages = {},
72 ISSN = {},
73 year = {},
74 type = {Journal Article}
75 }
78 Example
79 -------
81 Fetching biometric references::
83 >>> from bob.bio.face.database import CasiaAfricaDatabase
84 >>> database = CasiaAfricaDatabase(protocol="ID-V-All-Ep1")
85 >>> database.references()
88 Fetching probes::
90 >>> from bob.bio.face.database import CasiaAfricaDatabase
91 >>> database = CasiaAfricaDatabase(protocol="ID-V-All-Ep1")
92 >>> database.probes()
95 Parameters
96 ----------
98 protocol: str
99 One of the database protocols. Options are "ID-V-All-Ep1", "ID-V-All-Ep2" and "ID-V-All-Ep3"
100 """
102 name = "casia-africa"
103 category = "face"
104 dataset_protocols_name = "casia-africa.tar.gz"
105 dataset_protocols_urls = [
106 "https://www.idiap.ch/software/bob/databases/latest/face/casia-africa-e517a48d.tar.gz",
107 "http://www.idiap.ch/software/bob/databases/latest/face/casia-africa-e517a48d.tar.gz",
108 ]
109 dataset_protocols_hash = "e517a48d"
111 def __init__(
112 self, protocol, annotation_type="eyes-center", fixed_positions=None
113 ):
114 directory = rc.get("bob.db.casia-africa.directory", "")
115 extension = rc.get("bob.db.casia-africa.extension", ".jpg")
117 super().__init__(
118 name=self.name,
119 protocol=protocol,
120 transformer=make_pipeline(
121 FileSampleLoader(
122 data_loader=bob.io.base.load,
123 dataset_original_directory=directory,
124 extension=extension,
125 ),
126 EyesAnnotations(),
127 ),
128 annotation_type=annotation_type,
129 fixed_positions=fixed_positions,
130 )