Python API

Bob database interface for the Face Recognition Grand Challange (FRGC) v2.0

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

Returns a string containing the configuration information.

class bob.db.frgc.Database(original_directory='/idiap/resource/database/frgc/FRGC-2.0-dist', original_extension='.jpg')

Bases: bob.db.base.Database

The Database class reads the original XML lists and provides access using the common bob.db API.

annotations(file)[source]

Returns the annotations for the given file as a dictionary {‘reye’:(y,x), ‘leye’:(y,x), ‘mouth’:(y,x), ‘nose’:(y,x)}.

client_ids(groups=None, protocol=None, purposes=None, mask_type='maskIII')[source]

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

Keyword Parameters:

groups
One or several groups to which the models belong (‘world’, ‘dev’).
protocol
One or several of the FRGC protocols (‘2.0.1’, ‘2.0.2, ‘2.0.4’), required only if one of the groups is ‘dev’.
purposes
One or several groups for which files should be retrieved (‘enroll’, ‘probe’). Only used when the group is ‘dev’· For some protocol/mask_type pairs, not all clients are used for enrollment / for probe.
mask_type
One of the mask types (‘maskI’, ‘maskII’, ‘maskIII’).

Returns: A list containing all the client id’s which have the given properties.

get_client_id_from_file_id(file_id, **kwargs)[source]

Returns the client_id (real client id) attached to the given file_id

Keyword Parameters:

file_id
The file_id to consider

Returns: The client_id attached to the given file_id

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

Warning

The given model_id must have been the result of a previous call to model_ids() of the same database object, otherwise it will not be known or might be corrupted.

Returns: The client_id attached to the given model_id

groups(protocol=None)[source]

Returns a list of groups for the given protocol

Keyword Parameters:

protocol
One or several of the FRGC protocols (‘2.0.1’, ‘2.0.2, ‘2.0.4’),

Returns: a list of groups

model_ids(groups=None, protocol=None, mask_type='maskIII')[source]

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

The models are dependent on the protocol and the mask. Only those FRGC “target” files are returned that are required by the given mask!

Warning

Clients, models, and files are not identical for the FRGC database! Model ids are neither client nor file id’s, so please do not mix that up!

Keyword Parameters:

groups
One or several groups to which the models belong (‘world’, ‘dev’).
protocol
One or several of the FRGC protocols (‘2.0.1’, ‘2.0.2, ‘2.0.4’), required only if one of the groups is ‘dev’.
mask_type
One of the mask types (‘maskI’, ‘maskII’, ‘maskIII’).

Returns: A list containing all the model id’s belonging to the given group.

object_sets(groups=None, protocol='2.0.2', purposes=None, model_ids=None, mask_type='maskIII')[source]

Using the specified restrictions, this function returns a list of FileSet objects.

Keyword Parameters:

groups
Here, only the ‘dev’ group is valid.
protocol
Here, only the FRGC protocol ‘2.0.2’ is valid. Only used, if ‘dev’ is amongst the groups.
purposes
One or several groups for which files should be retrieved (‘enroll’, ‘probe’). In FRGC terms, ‘enroll’ is “Target”, while ‘probe’ is “Target” (protocols ‘2.0.1’ and ‘2.0.2’) or “Query” (protocol ‘2.0.4’)
model_ids
If given (as a list of model id’s or a single one), only the files belonging to the specified model id is returned.
mask_type
One of the mask types (‘maskI’, ‘maskII’, ‘maskIII’).
objects(groups=None, protocol=None, purposes=None, model_ids=None, mask_type='maskIII')[source]

Using the specified restrictions, this function returns a list of File objects.

Keyword Parameters:

groups
One or several groups to which the models belong (‘world’, ‘dev’). ‘world’ files are “Training”, whereas ‘dev’ files are “Target” and/or “Query”.
protocol
One or more of the FRGC protocols (‘2.0.1’, ‘2.0.2’, ‘2.0.4’). Only used, if ‘dev’ is amongst the groups. If not specified, all FRGC protocols will be taken into account.
purposes
One or several groups for which files should be retrieved (‘enroll’, ‘probe’). Only used when the group is ‘dev’· In FRGC terms, ‘enroll’ is “Target”, while ‘probe’ is “Target” (protocols ‘2.0.1’ and ‘2.0.2’) or “Query” (protocol ‘2.0.4’)
model_ids

If given (as a list of model id’s or a single one), only the files belonging to the specified model id is returned.

Warning

When querying objects of group ‘world’, model ids are expected to be client ids (as returned by ‘client_ids()’), whereas for group ‘dev’ model ids are real model ids (as returned by ‘model_ids()’)

mask_type
One of the mask types (‘maskI’, ‘maskII’, ‘maskIII’).
provides_file_set_for_protocol(protocol)[source]

Returns True for every protocol for which file sets (instead of single files) are used for enrollment and probing. Currently, this is only the ‘2.0.2’, protocol.

class bob.db.frgc.File(signature, presentation, path)

Bases: bob.db.base.File

This class is just the File object that is returned by the objects function. It will be created on need and is not stored anywhere.

make_path(directory=None, extension=None)[source]

Wraps the current path so that a complete path is formed. If directory and extension ‘.jpg’ are specified, extensions are automatically replaced by ‘.JPG’ if necessary.

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.

class bob.db.frgc.FileSet(frgc_file)

This class is just the FileSet object that is returned by the object_sets function. It will be created on need and is not stored anywhere.

class bob.db.frgc.Interface

Bases: bob.db.base.driver.Interface

add_commands(parser)[source]
files()[source]

Returns the list of files required for this interface to work, which is empty.

frgc_database_directory()[source]

Returnes the FRGC database base directory, where the original FRGC file lists (XML) are stored. You might want to adapt this directory to your needs.

name()[source]
type()[source]

Defines the type of the database, which is not SQL3, but text based

version()[source]