Python API

Details about the NIST SRE 2012 database can be found here: http://www.nist_sre12.org/

bob.db.nist_sre12.get_config()[source]

Returns a string containing the configuration information.

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.

client(id)[source]

Returns the client object in the database given a certain id. Raises an error if that does not exist.

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.

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.

genders()[source]

Returns the names of all registered groups

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

groups(protocol=None)[source]

Returns the names of all registered groups

has_client_id(id)[source]

Returns True if we have a client with a certain integer identifier

has_protocol(name)[source]

Tells if a certain protocol is available

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.

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.

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.

protocol(name)[source]

Returns the protocol object in the database given a certain name. Raises an error if that does not exist.

protocol_names()[source]

Returns all registered protocol names

protocol_purposes()[source]

Returns all registered protocol purposes

protocols()[source]

Returns all registered protocols

purposes()[source]

Returns the list of allowed purposes

class bob.db.nist_sre12.File(client_id, path, side)[source]

Bases: sqlalchemy.ext.declarative.api.Base, bob.db.base.File

Generic file container

client_id
id
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.
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.

path
side
side_choices = ('a', 'b')
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

client_id
gender
gender_choices = ('male', 'female')
id
class bob.db.nist_sre12.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

NIST SRE 2012 protocols

id
name
class bob.db.nist_sre12.ProtocolPurpose(protocol_id, sgroup, purpose)[source]

Bases: sqlalchemy.ext.declarative.api.Base

NIST SRE 2012 purposes

files
group_choices = ('eval',)
id
models
protocol
protocol_id
purpose
purpose_choices = ('enroll', 'probe')
sgroup