Python API¶
Low level Bob API interface to voicePA speech presentation attack database.
-
class
bob.db.voicepa.query.
Database
(original_directory=None, original_extension=None)¶ Bases:
bob.db.base.SQLiteDatabase
The dataset class opens and maintains a connection opened to the Database.
It provides many different ways to probe for the characteristics of the data and for the data itself inside the database.
-
client
(id)[source]¶ Returns the Client object in the database given a certain id. Raises an error if that does not exist.
-
clients
(groups=None, protocol=None, gender=None)[source]¶ Returns a list of Clients for the specific query by the user. If no parameters are specified - return all clients.
Keyword Parameters:
- protocol
- An voicePA protocol.
- groups
- The groups to which the subjects attached to the models belong (‘train’, ‘dev’, ‘eval’)
- gender
- The gender to consider (‘male’, ‘female’)
Returns: A list containing the ids of all models belonging to the given group.
-
objects
(protocol='grandtest', attack_data=('undefined', 'laptop', 'iphone3gs', 'samsungs3', 'ss', 'vc'), groups=('train', 'dev', 'eval'), cls=('real', ), recording_devices=('laptop', 'iphone3gs', 'samsungs3'), sessions=('sess1', 'sess2', 'sess3', 'sess4'), gender=('male', 'female'), attack_devices=('undefined', 'laptop', 'hqspeaker', 'iphone3gs', 'samsungs3', 'iphone6s'), asv_devices=('undefined', 'laptop', 'iphone3gs', 'samsungs3'), environments=('undefined', 'r106', 'r107', 'seboffice'), clients=None)[source]¶ Returns a list of unique
File
objects for the specific query by the userParameters: - protocol (str) – The protocol for the attack. one of the ones returned by protocols(). if you set this parameter to an empty string or the value none, we reset it to the default, “grandtest”.
- groups (str) – One of the protocol subgroups of data as returned by groups() or a tuple with several of them. if you set this parameter to an empty string or the value none, we reset it to the default which is to get all.
- cls (str) – Either
attack
,real
,enroll
,probe
, or a combination of those (in a tuple). defines the class of data to be retrieved. If you set this parameter to an empty string or the value none, we reset it to the default, (real
). - attack_data (str) – One of the valid attack types as returned by
models.attack.attack_datas()
or all, as a tuple. if you set this parameter to an empty string or the value none, we reset it to the default, which is to get all. - asv_devices (str) – One or more devices that are running automatic verification system, i.e., these are the devices that are being attacked.
- attack_devices (str) – One or more devices that are used to play the presentation attack.
- environments (str) – One or more locations (rooms) where the attacks were recorded.
- recording_devices (str) – One of the recording_devices used to record the data (laptop, phone1, and phone2) or a combination of them (in a tuple), which is also the default.
- clients (int) – If set, should be a single integer or a list of integers that define the client identifiers from which files should be retrieved. if omitted, set to none or an empty list, then data from all clients is retrieved.
Returns: Corresponds to the selected objects
Return type: list of
File
-