CAS-PEAL Database¶
This is the Bob database entry for the CAS-PEAL database.
-
class
bob.db.caspeal.
Database
(original_directory=None, original_extension='.tif')[source]¶ Bases:
bob.db.base.SQLiteDatabase
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.
-
groups
(protocol=None)[source]¶ Returns a list of groups for the given protocol
Keyword Parameters:
- protocol
Ignored since groups are identical for all protocols.
Returns: a list of groups
-
clients
(groups=None, genders=None, ages=None, protocol=None)[source]¶ Returns a list of Client objects for the specific query by the user.
Keyword Parameters:
- groups
One or several groups to which the models belong (‘world’, ‘dev’). If not specified, all groups are returned.
- genders
One or several of the genders (‘F’, ‘M’) of the clients. If not specified, clients of all genders are returned.
- ages
One or several of the age ranges (‘Y’, ‘M’, ‘O’) of the clients. If not specified, clients of all age ranges are returned.
- protocol
Ignored since clients are identical for all protocols.
Returns: A list containing all the Client objects which have the desired properties.
-
client_ids
(groups=None, genders=None, ages=None, protocol=None)[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’, ‘eval’). If not specified, all groups are returned.
- genders
One of the genders (‘m’, ‘w’) of the clients. If not specified, clients of all genders are returned.
- ages
One or several of the age ranges (‘Y’, ‘M’, ‘O’) of the clients. If not specified, clients of all age ranges are returned.
- protocol
Ignored since clients are identical for all protocols.
Returns: A list containing all the client ids which have the desired properties.
-
model_ids
(groups=None, genders=None, ages=None, protocol=None)¶ 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’, ‘eval’). If not specified, all groups are returned.
- genders
One of the genders (‘m’, ‘w’) of the clients. If not specified, clients of all genders are returned.
- ages
One or several of the age ranges (‘Y’, ‘M’, ‘O’) of the clients. If not specified, clients of all age ranges are returned.
- protocol
Ignored since clients are identical for all protocols.
Returns: A list containing all the client ids which have the desired properties.
-
get_client_id_from_file_id
(file_id, **kwargs)[source]¶ Returns the 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)[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
-
objects
(groups=None, protocol=None, purposes=None, model_ids=None, genders=None, ages=None, lightings=None, poses=None, expressions=None, accessories=None, distances=None, sessions=None, backgrounds=None)[source]¶ Using the specified restrictions, this function returns a list of File objects.
Note that in rare cases, File objects with the same path, but different ID’s might be returned. This is due to the fact that some images are in both the training list and in one of the gallery or probe lists.
Note further that the training set consists only of files with frontal pose (‘M+00’).
Keyword Parameters:
- groups
One or several groups to which the models belong (‘world’, ‘dev’).
- protocol
One of the CAS-PEAL protocols (‘accessory’, ‘aging’, ‘background’, ‘distance’, ‘expression’, ‘lighting’, ‘pose’). Note: this field is ignored for group ‘world’. Note: this field is ignored for purpose ‘enroll’.
- purposes
One or several purposes for which files should be retrieved (‘enroll’, ‘probe’). Note: this field is ignored for group ‘world’.
- 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. For ‘probe’ purposes, this field is ignored since probe files are identical for all models.
- genders
One or several of the genders (‘F’, ‘M’) of the clients. If not specified, objects of all genders are returned.
- ages
One or several of the age ranges (‘Y’, ‘M’, ‘O’) of the clients. If not specified, objects of all age ranges are returned.
- lightings
One or several of the possible lightings (e.g. ‘EU+00’ or ‘FM-45’). If not specified, objects of all lightings will be returned. Note: this field is ignored for purpose ‘enroll’.
- poses
One or several of the possible poses (e.g. ‘M+00’, ‘U-67’). If not specified, objects of all poses are returned. Note: this field is ignored for purpose ‘enroll’. Note: for group ‘world’, only pose ‘M+00’ is available.
- expressions
One or several expressions from (‘N’, ‘L’, ‘F’, ‘S’, ‘C’, ‘O’). If not specified, objects of all expressions are returned. Note: this field is ignored for purpose ‘enroll’.
- accessories
One or several accessories from (0, 1, 2, 3, 4, 5, 6). If not specified, objects of all accessories are returned. Note: this field is ignored for purpose ‘enroll’.
- distances
One or several distances from (0, 1, 2). If not specified, objects of all distances are returned. Note: this field is ignored for purpose ‘enroll’.
- sessions
One or several sessions from (0, 1, 2). If not specified, objects of all sessions are returned. Note: this field is ignored for purpose ‘enroll’.
- backgrounds
One or several backgrounds from (‘B’, ‘R’, ‘D’, ‘Y’, ‘W’). If not specified, objects of all backgrounds are returned. Note: this field is ignored for purpose ‘enroll’.
-
-
class
bob.db.caspeal.
Client
(client_type, client_id)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Information about the clients (identities) of the CAS-PEAL database
-
gender_choices
= ('F', 'M')¶
-
age_choices
= ('Y', 'M', 'O')¶
-
id
¶
-
gender
¶
-
age
¶
-
-
class
bob.db.caspeal.
File
(image_path, protocol)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,bob.db.base.File
Information about the files of the CAS-PEAL face database. Each file includes
the session
the expression
the pose
the lighting
the camera distance
the accessory
the background
a privacy field describing whether the image file might be published in papers
the client id
the path
-
itertools
= <module 'itertools' (built-in)>¶
-
purpose_choices
= ('world', 'enroll', 'probe')¶
-
lighting_type_choices
= ('E', 'F', 'L')¶
-
elevation_choices
= ('U', 'M', 'D')¶
-
lighting_azimuth_choices
= ('-90', '-45', '+00', '+45', '+90')¶
-
pose_azimuth_choices
= ('-90', '-67', '-45', '-30', '-22', '-15', '+00', '+15', '+22', '+30', '+45', '+67', '+90')¶
-
expression_choices
= ('N', 'L', 'F', 'S', 'C', 'O')¶
-
distance_choices
= [0, 1, 2]¶
-
accessory_choices
= [0, 1, 2, 3, 4, 5, 6]¶
-
session_choices
= [0, 1, 2]¶
-
background_choices
= ('B', 'R', 'D', 'Y', 'W')¶
-
lighting_choices
= ['EU-90', 'EU-45', 'EU+00', 'EU+45', 'EU+90', 'EM-90', 'EM-45', 'EM+00', 'EM+45', 'EM+90', 'ED-90', 'ED-45', 'ED+00', 'ED+45', 'ED+90', 'FU-90', 'FU-45', 'FU+00', 'FU+45', 'FU+90', 'FM-90', 'FM-45', 'FM+00', 'FM+45', 'FM+90', 'FD-90', 'FD-45', 'FD+00', 'FD+45', 'FD+90', 'LU-90', 'LU-45', 'LU+00', 'LU+45', 'LU+90', 'LM-90', 'LM-45', 'LM+00', 'LM+45', 'LM+90', 'LD-90', 'LD-45', 'LD+00', 'LD+45', 'LD+90']¶
-
pose_choices
= ['U-90', 'U-67', 'U-45', 'U-30', 'U-22', 'U-15', 'U+00', 'U+15', 'U+22', 'U+30', 'U+45', 'U+67', 'U+90', 'M-90', 'M-67', 'M-45', 'M-30', 'M-22', 'M-15', 'M+00', 'M+15', 'M+22', 'M+30', 'M+45', 'M+67', 'M+90', 'D-90', 'D-67', 'D-45', 'D-30', 'D-22', 'D-15', 'D+00', 'D+15', 'D+22', 'D+30', 'D+45', 'D+67', 'D+90']¶
-
id
¶
-
path
¶
-
annotation
¶
-
client
¶
-
protocol
¶
-
protocol_id
¶
-
purpose
¶
-
client_id
¶
-
lighting
¶
-
pose
¶
-
expression
¶
-
accessory
¶
-
distance
¶
-
session
¶
-
background
¶
-
privacy
¶
-
class
bob.db.caspeal.
Annotation
(file_id, eyes)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Annotations of the CAS-PEAL database consists only of the left and right eye positions. There is exactly one annotation for each file.
-
id
¶
-
file_id
¶
-
re_x
¶
-
re_y
¶
-
le_x
¶
-
le_y
¶
-
-
class
bob.db.caspeal.
Protocol
(name)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
The probe protocols of the CAS-PEAL database. Training and enrollment is identical for all protocols of CAS-PEAL.
-
protocol_choices
= ('training', 'gallery', 'accessory', 'aging', 'background', 'distance', 'expression', 'lighting', 'pose')¶
-
id
¶
-
name
¶
-