Python API

This is the Bob database entry for the Multi-PIE database.

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

Returns a string containing the configuration information.

class bob.db.multipie.Camera(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Multi-PIE cameras

files_multiview
id
name
class bob.db.multipie.Client(id, group, birthyear, gender, first_session, second_session, third_session, fourth_session)[source]

Bases: sqlalchemy.ext.declarative.api.Base

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

birthyear
first_session
fourth_session
gender
gender_choices = ('male', 'female')
group_choices = ('dev', 'eval', 'world')
id
second_session
sgroup
third_session
class bob.db.multipie.Database(original_directory=None, original_extension='.png', annotation_directory=None, annotation_extension='.pos')[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]

Reads the annotations for the given file id from file and returns them in a dictionary. Depending on the view type of the file (i.e., the camera), different annotations might be returned.

If you have no copy of the annotations yet, you can download them under http://www.idiap.ch/resource/biometric, where you also can find more information about the annotations.

Keyword parameters:

file
The ID of the file for which the annotations should be read.
Return value
The annotations as a dictionary, e.g., {‘reye’:(re_y,re_x), ‘leye’:(le_y,le_x), …}
camera_names()[source]

Returns all registered camera names

cameras()[source]

Returns the list of cameras

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, subworld=None, genders=None, birthyears=None)[source]

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the clients belong (‘dev’, ‘eval’, ‘world’)
subworld
Specify a split of the world data (‘sub41’, ‘sub81’, ‘sub121’, ‘sub161’) In order to be considered, “world” should be in groups.
genders
The genders to which the clients belong (‘female’, ‘male’)
birthyears
The birth year of the clients (in the range [1900,2050])

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

expression_names()[source]

Returns all registered expression names

expressions()[source]

Returns the list of expressions

genders()[source]

Returns the list of genders

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

Tells if a certain camera is available

has_client_id(id)[source]

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

has_expression(name)[source]

Tells if a certain expression is available

has_protocol(name)[source]

Tells if a certain protocol is available

has_subworld(name)[source]

Tells if a certain subworld is available

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

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the subjects attached to the models belong (‘dev’, ‘eval’, ‘world’)

Returns: A list containing the ids all the 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
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
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, subworld=None, expressions=None, cameras=None, world_sampling=1, world_noflash=False, world_first=False, world_second=False, world_third=False, world_fourth=False, world_nshots=None, world_shots=None)[source]

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
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). 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.
subworld
Specify a split of the world data (‘sub41’, ‘sub81’, ‘sub121’, ‘sub161’) In order to be considered, “world” should be in groups.
expressions
The (face) expressions to be retrieved (use expression_names() to get the list of expressions) 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. Notice that some protocols only contain images with ‘neutral’ expression.
cameras
The cameras to be retrieved (use camera_names() to get the list of cameras) r 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. The cameras keyword has no impact for some protocols (frontal images ones).
world_sampling

Samples the files from the world data set. Keeps only files such as:

File.client_id + File.shot_id % world_sampling == 0

This argument should be an integer between 1 (keep everything) and 19. It is not used if world_noflash is also set.

world_nshots
Only considers the n first shots from the world data set.
world_shots
Only considers the shots with the given ids.
world_noflash
Keeps the files from the world dataset recorded without flash (shot 0)
world_first
Only uses data from the first recorded session of each user of the world dataset.
world_second
Only uses data from the second recorded session of each user of the world dataset.
world_third
Only uses data from the third recorded session of each user of the world dataset.
world_fourth
Only uses data from the fourth recorded session of each user of the world dataset.

Returns: A set of Files with 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

subworld_names()[source]

Returns all registered subworld names

subworlds()[source]

Returns the list of subworlds

t_enroll_files(protocol, model_id, groups='dev', **kwargs)[source]

Returns the list of T-Norm model enrollment File objects from the given model id of the given protocol for the given group that satisfy your query. For possible keyword arguments, please check the tobjects() function.

t_model_ids(protocol, groups='dev', **kwargs)[source]

Returns the list of model ids used for T-Norm of the given protocol for the given group that satisfy your query. For possible keyword arguments, please check the tmodel_ids() function.

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

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the clients belong (‘dev’, ‘eval’).

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

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

Returns a set of T-Norm model ids for the specific query by the user.

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the models belong (‘dev’, ‘eval’).

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

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

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the models belong (‘dev’, ‘eval’).

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

tobjects(protocol=None, model_ids=None, groups=None, expressions=None)[source]
Returns a set of filenames for enrolling T-norm models for score
normalization.

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
model_ids
Only retrieves the files for the provided list of model ids (claimed client id). If ‘None’ is given (this is the default), no filter over the model_ids is performed.
groups
The groups to which the clients belong (‘dev’, ‘eval’).
expressions
The (face) expressions to be retrieved (use expression_names() to get the list of expressions) 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. Notice that some protocols only contain images with ‘neutral’ expression.

Returns: A list of Files with the given properties.

z_probe_files(protocol, groups='dev', **kwargs)[source]

Returns the list of Z-Norm probe File objects to probe the model with the given model id of the given protocol for the given group that satisfy your query. For possible keyword arguments, please check the zobjects() function.

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

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

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
groups
The groups to which the clients belong (‘dev’, ‘eval’).

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

zobjects(protocol=None, model_ids=None, groups=None, expressions=None)[source]

Returns a set of filenames of impostors for Z-norm score normalization.

Keyword Parameters:

protocol
One of the Multi-PIE protocols (use protocol_names() to get the list of available ones)
model_ids
Only retrieves the files for the provided list of model ids (client id). If ‘None’ is given (this is the default), no filter over the model_ids is performed.
groups
The groups to which the clients belong (‘dev’, ‘eval’).
expressions
The (face) expressions to be retrieved (use expression_names() to get the list of expressions) 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. Notice that some protocols only contain images with ‘neutral’ expression.

Returns: A list of Files with the given properties.

class bob.db.multipie.Expression(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Multi-PIE expressions

files
id
name
class bob.db.multipie.File(client_id, path, session_id, recording_id, img_type, expression_id)[source]

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

Generic file container

client
client_id
expression_id
id
imagetype_choices = ('multiview', 'highres')
img_type
path
recording_id
session_id
class bob.db.multipie.FileMultiview(file_id, shot_id, camera_id)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Additional file information for multiview-like files

camera_id
file
id
shot_id
class bob.db.multipie.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Multi-PIE protocols

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

Bases: sqlalchemy.ext.declarative.api.Base

Multi-PIE protocol purposes

files
group_choices = ('dev', 'eval', 'world')
id
protocol
protocol_id
purpose
purpose_choices = ('train', 'enroll', 'probe')
sgroup
class bob.db.multipie.Subworld(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Database clients belonging to the world group are split in two disjoint subworlds, onethird and twothirds

clients
id
name