JANUS Database¶
This is the Bob database entry for the IJB-A database.
-
class
bob.db.ijba.
Database
(original_directory=None, annotations_directory=None, original_extension=None)¶ Bases:
bob.db.base.Database
The database 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 given
File
object as a dictionary, seeread_annotations()
for details.
-
client_ids
(groups=None, protocol='search_split1')[source]¶ Returns a list of client ids (aka. subject_id) for the specific query by the user.
Keyword Parameters:
- groups
- One or several groups to which the models belong (‘world’, ‘dev’, ‘eval’). If not specified, all groups are returned.
- protocol
- One of the available protocol names, see
protocol_names()
.
Returns: A list containing all the client ids which have the desired properties.
-
clients
(groups=None, protocol='search_split1')[source]¶ Same as client_id
Keyword Parameters:
- groups
- One or several groups to which the models belong (‘world’, ‘dev’, ‘eval’). If not specified, all groups are returned.
- protocol
- One of the available protocol names, see
protocol_names()
.
Returns: A list containing all the client ids which have the desired properties.
-
groups
()[source]¶ Returns a list of groups for the given protocol.
Keyword Parameters:
- protocol
- One of the available protocol names, see
protocol_names()
.
Returns: a list of groups for the given protocol.
-
model_ids
(groups=None, protocol='search_split1', purposes='enroll', model_ids=None)[source]¶ Returns a list of model ids for the specific query by the user.
Keyword Parameters:
- groups
- Ignored; only model ids from the ‘dev’ group will be used.
- protocol
- One of the available protocol names, see
protocol_names()
.
purposes
Returns: A list containing all the model ids for the given protocol.
-
object_sets
(groups='dev', protocol='search_split1', purposes='probe', model_ids=None, media_ids=None, frames=None)[source]¶ Using the specified restrictions, this function returns a list of
Template
objects.Keyword Parameters:
- groups : str or [str]
- Only the ‘dev’ group is accepted.
- protocol : str
- One of the available protocol names, see
protocol_names()
. - purposes : str or [str]
- Only the ‘probe’ purpose is accepted.
- model_ids : int or [int] or
None
- ignored
- media_ids : int or [int] or
None
- If given, only the files with the given media ids are returned.
- frames : int or [int] or
None
- If given, only the video files with the given frame number are returned. Note that the images of the database will be ignored, when this option is selected.
-
objects
(groups=None, protocol='search_split1', purposes=None, model_ids=None, media_ids=None, frames=None)[source]¶ Using the specified restrictions, this function returns a list of File objects.
Keyword Parameters:
- groups : str or [str] or
None
- One or several groups to which the models belong (‘world’, ‘dev’).
- protocol : str
- One of the available protocol names, see
protocol_names()
. - purposes : str or [str] or
None
- One or several purposes for which files should be retrieved (‘enroll’, ‘probe’). Note: this field is ignored for group ‘world’.
- model_ids : int or [int] or
None
- If given (as a list of model id’s or a single one), only the files belonging to the specified model id is returned. For ‘probe’ purposes, this field is ignored since probe files are identical for all models. Remember that the database provides only identification protocols.
- media_ids : int or [int] or
None
- If given, only the files with the given media ids are returned.
- frames : int or [int] or
None
- If given, only the video files with the given frame number are returned. Note that the images of the database will be ignored, when this option is selected.
- groups : str or [str] or
-
original_file_name
(file, check_existence=True)[source]¶ Returns the original image file name with the correct file name extension. To be able to call this function, the
original_directory
must have been specified in theDatabase
constructor.Keyword parameters:
- file :
File
- The
File
object to get the original file name from. - check_existence : bool
- If set to True (the default), the existence of the original image file is checked, prior to returning the files name.
- file :
-
protocol_names
()[source]¶ Returns all registered protocol names, which are usually
['NoTrain'] + ['split%d' for d in range(1,11)]
-
-
class
bob.db.ijba.
File
(client_id, path, file_id=None)¶ Bases:
bob.db.base.File
IJBA File class
Diferent from its ascendent class, this one has the client ID as input
-
class
bob.db.ijba.
Template
(template_id, subject_id, files)¶ Bases:
object
A
Template
contains a list ofFile
objects belonging to the same subject (there might be several templates per subject).These are listed in the
self.files
field.A
Template
can serve for training, model enrollment, or for probing.Each template belongs specifically to a certain protocol, as the template_id in the original file lists might differ for different protocols.
The protocol purpose can be obtained using
self.protocol_purpose
after creation of the database.Note that the
template_id
corresponds to the template_id of the file lists, while theid
is only used as a unique key for querying the database.For convenience, the template also contains a
path
, which is a concatenation of theFile.media_id
of the first file, and theself.template_id
, making it unique (at least per protocol).
-
bob.db.ijba.
get_templates
(filename, verbose=True)¶ Given a IJBA file, get a dictionary with all their templates with their respective files in the following format:
templates[‘template_01’] = [file_01, file_02, file_03] templates[‘template_02’] = [file_01, file_02, file_03] . . .
-
bob.db.ijba.
read_annotations
(raw_annotations)¶ Parse the annotations