Python API

The Biosecure database

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

Returns a string containing the configuration information.

class bob.db.biosecure.Annotation(file_id, eyes)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Annotations of the BioSecure database consists only of the left and right eye positions. There is exactly one annotation for each file.

file_id
id
le_x
le_y
re_x
re_y
class bob.db.biosecure.Client(id, group)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Database clients, marked by an integer identifier and the group they belong to

group_choices = ('dev', 'eval', 'world')
id
sgroup
class bob.db.biosecure.Database(original_directory=None, original_extension='.jpg')[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.

annotations(file)[source]

Returns the annotations for the image with the given file id.

Keyword Parameters:

file
The File object to retrieve the annotations for.

Returns: the eye annotations as a dictionary {‘reye’:(y,x), ‘leye’:(y,x)}.

client(id)[source]

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

clients(protocol=None, groups=None)[source]

Returns a set of clients for the specific query by the user.

Keyword Parameters:

protocol
The protocol to consider (‘ca0’, ‘caf’, ‘wc’)
groups
The groups to which the clients belong (‘dev’, ‘eval’, ‘world’)

Returns: A list containing all the clients which have the given properties.

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)[source]

Returns a list of model ids for the specific query by the user.

Keyword Parameters:

protocol
The protocol to consider (‘ca0’, ‘caf’, ‘wc’)
groups
The groups to which the subjects attached to the models belong (‘dev’, ‘eval’, ‘world’)

Returns: A list containing the ids of all models belonging to the given group.

models(protocol=None, groups=None)[source]

Returns a set of models for the specific query by the user.

Keyword Parameters:

protocol
The protocol to consider (‘ca0’, ‘caf’, ‘wc’)
groups
The groups to which the subjects attached to the models belong (‘dev’, ‘eval’, ‘world’)

Returns: A list containing all the models belonging to the given group.

objects(protocol=None, purposes=None, model_ids=None, groups=None, classes=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
One of the Biosecure protocols (‘ca0’, ‘caf’, ‘wc’).
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’) 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.biosecure.File(client_id, path, session_id, camera, shot_id)[source]

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

Generic file container

annotation
camera
camera_choices = ('ca0', 'caf', 'wc')
client
client_id
id
path
session_id
shot_id
class bob.db.biosecure.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Biosecure protocols

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

Bases: sqlalchemy.ext.declarative.api.Base

Biosecure protocol purposes

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