Python API¶
Details about the NIST SRE 2012 database can be found here: http://www.nist_sre12.org/
-
class
bob.db.nist_sre12.
Database
(original_directory=None, original_extension='.sph')[source]¶ 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.
-
clients
(protocol=None, groups=None, filter_ids_unknown=True)[source]¶ Returns a set of clients for the specific query by the user.
Keyword Parameters:
- protocol
The protocol to consider (‘female’, ‘male’)
- groups
The groups to which the clients belong (‘core-all’)
- filter_ids_unknown
Do not add the ids unknown ‘F_ID_X_F’ and ‘M_ID_X_M’
Returns: A list containing all the clients which have the given properties.
-
models
(protocol=None, groups=None, filter_ids_unknown=True)[source]¶ Returns a set of models for the specific query by the user.
Keyword Parameters:
- protocol
The protocol to consider (‘female’, ‘male’)
- groups
The groups to which the subjects attached to the models belong (‘eval’)
- filter_ids_unknown
Do not add the ids unknown ‘F_ID_X’ and ‘M_ID_X’
Returns: A list containing all the models belonging to the given group.
-
model_ids
(protocol=None, groups=None, filter_ids_unknown=True)[source]¶ Returns a list of model ids for the specific query by the user.
Keyword Parameters:
- protocol
The protocol to consider (‘female’, ‘male’)
- groups
The groups to which the subjects attached to the models belong (‘dev’, ‘eval’, ‘world’)
- filter_ids_unknown
Do not add the ids unknown ‘F_ID_X’ and ‘M_ID_X’
Returns: A list containing the ids of all models belonging to the given group.
-
client_ids
(protocol=None, groups=None, filter_ids_unknown=True)[source]¶ Returns a list of client ids for the specific query by the user.
Keyword Parameters:
- protocol
The protocol to consider (‘female’, ‘male’)
- groups
The groups to which the subjects attached to the models belong (‘dev’, ‘eval’, ‘world’)
- filter_ids_unknown
Do not add the ids unknown ‘F_ID_X’ and ‘M_ID_X’
Returns: A list containing the ids of all clients belonging to the given group.
-
client
(id)[source]¶ Returns the client object in the database given a certain id. Raises an error if that does not exist.
-
get_client_id_from_model_id
(model_id, **kwargs)[source]¶ Returns the client_id attached to the given model_id
Keyword Parameters:
- model_id
The model_id to consider
Returns: The client_id attached to the given model_id
-
objects
(protocol=None, purposes=None, model_ids=None, groups=None, gender=None)[source]¶ Returns a set of filenames for the specific query by the user. WARNING: Files used as impostor access for several different models are only listed one and refer to only a single model
Keyword Parameters:
- protocol
The protocol to consider (‘female’, ‘male’)
- purposes
The purposes required to be retrieved (‘enroll’, ‘probe’, ‘train’) or a tuple with several of them. If ‘None’ is given (this is the default), it is considered the same as a tuple with all possible values. This field is ignored for the data from the “world” group.
- model_ids
Only retrieves the files for the provided list of model ids (claimed client id). The model ids are string. If ‘None’ is given (this is the default), no filter over the model_ids is performed.
- groups
One of the groups (‘dev’, ‘eval’, ‘world’, ‘optional_world_1’, ‘optional_world_2’) or a tuple with several of them. If ‘None’ is given (this is the default), it is considered the same as a tuple with all possible values.
- classes
The classes (types of accesses) to be retrieved (‘client’, ‘impostor’) or a tuple with several of them. If ‘None’ is given (this is the default), it is considered the same as a tuple with all possible values.
Returns: A list of files which have the given properties.
-
-
class
bob.db.nist_sre12.
Model
(id, client_id, gender)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Database models, marked by an integer identifier and the group they belong to
-
gender_choices
= ('male', 'female')¶
-
id
¶
-
client_id
¶
-
gender
¶
-
-
class
bob.db.nist_sre12.
File
(client_id, path, side)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,bob.db.base.File
Generic file container
-
side_choices
= ('a', 'b')¶
-
id
¶
-
path
¶
-
client_id
¶
-
side
¶
-
make_path
(directory=None, extension='.sph', add_side=True)[source]¶ Wraps the current path so that a complete path is formed
Keyword Parameters:
- directory
An optional directory name that will be prefixed to the returned result.
- extension
An optional extension that will be suffixed to the returned filename. The extension normally includes the leading
.
character as in.jpg
or.hdf5
.
Returns a string containing the newly generated file path.
-
load
(directory=None, extension='.sph')[source]¶ Loads the data at the specified location and using the given extension. Override it if you need to load differently.
Keyword Parameters:
- data
The data blob to be saved (normally a
numpy.ndarray
).- directory
[optional] If not empty or None, this directory is prefixed to the final file destination
- extension
[optional] The extension of the filename - this will control the type of output and the codec for saving the input blob.
-
-
class
bob.db.nist_sre12.
Protocol
(name)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
NIST SRE 2012 protocols
-
id
¶
-
name
¶
-