Python API

The SCFace database

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

Returns a string containing the configuration information.

class bob.db.scface.Annotation(file_id, annotations)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Annotations of the SC face database consists of the left and right eye positions as well as the nose tip and the center of the mouth. There is exactly one annotation for each file.

file_id
id
le_x
le_y
m_x
m_y
n_x
n_y
re_x
re_y
class bob.db.scface.Client(id, group, birthyear, gender, beard, moustache, glasses)[source]

Bases: sqlalchemy.ext.declarative.api.Base

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

beard
birthyear
gender
gender_choices = ('m', 'f')
glasses
group_choices = ('dev', 'eval', 'world')
id
moustache
sgroup
class bob.db.scface.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), ‘mouth’:(y,x), ‘nose’:(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, subworld=None, gender=None, birthyear=None)[source]

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

Keyword Parameters:

protocol
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
groups
The groups to which the clients belong (‘dev’, ‘eval’, ‘world’)
subworld
Specify a split of the world data (“onethird”, “twothirds”, “”) In order to be considered, “world” should be in groups and only one split should be specified.
gender
The genders to which the clients belong (‘f’, ‘m’)
birthyear
The birth year of the clients (in the range [1900,2050])

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

genders()[source]

Returns the list of genders: ‘m’ for male and ‘f’ for female

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

has_subworld(name)[source]

Tells if a certain subworld is available

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

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

Keyword Parameters:

protocol
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
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 (‘combined’, ‘close’, ‘medium’, ‘far’)
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, distances=None)[source]

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

Keyword Parameters:

protocol
One of the SCFace protocols (‘combined’, ‘close’, ‘medium’, ‘far’)
purposes
The purposes required to be retrieved (‘enroll’, ‘probe’, ‘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. 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.
subworld
Specify a split of the world data (“onethird”, “twothirds”, “”) In order to be considered, “world” should be in groups and only one split should be specified.
distances
Specify the subject-camera distance as an integral value. Possible values: (3: close, 2:medium, 1:far)

Returns: A list 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
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
groups
Ignored.

Returns: A list containing all the clients 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
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
groups
Ignored.

Returns: A list containing the ids of all T-Norm models.

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

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

Keyword Parameters:

protocol
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
groups
Ignored.

Returns: A list containing all the T-Norm models.

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

Keyword Parameters:

protocol
One of the SCFace protocols (‘combined’, ‘close’, ‘medium’, ‘far’)
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
Ignored.

Returns: A set 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
The protocol to consider (‘combined’, ‘close’, ‘medium’, ‘far’)
groups
The groups to which the clients belong (‘dev’, ‘eval’, ‘world’)

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

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

Returns a set of Files to perform Z-norm score normalization.

Keyword Parameters:

protocol
One of the SCFace protocols (‘combined’, ‘close’, ‘medium’, ‘far’)
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
Ignored.
distances
Specify the subject-camera distance as an integral value. Possible values: (3: close, 2:medium, 1:far)

Returns: A set of Files

class bob.db.scface.File(client_id, path, camera, distance)[source]

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

Generic file container

annotation
camera
client
client_id
distance
id
path
class bob.db.scface.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

SCface protocols

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

Bases: sqlalchemy.ext.declarative.api.Base

SCface protocol purposes

files
group_choices = ('world', 'dev', 'eval')
id
protocol
protocol_id
purpose
purpose_choices = ('train', 'enroll', 'probe')
sgroup
class bob.db.scface.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