CASME2 Database

This is the Bob database entry for the AR face database.

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

Returns a string containing the configuration information.

class bob.db.casme2.Client(id)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Information about the clients (identities) of the CASME2 database

id
class bob.db.casme2.Database(original_directory=None, original_extension='.ppm')[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.

annotations(file_id)[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 action units for the given file

client_ids(groups=None, genders=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.
protocol
Ignored since clients are identical for all protocols.

Returns: A list containing all the client ids which have the desired properties.

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

Returns a list of Client objects for the specific query by the user.

Keyword Parameters:

groups
Ignored
protocol
Ignored since clients are identical for all protocols.

Returns: A list containing all the Client objects which have the desired 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

Returns: The client_id attached to the given model_id

groups(protocol=None)[source]

Returns the names of all registered groups

model_ids(groups=None, genders=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.
protocol
Ignored since clients are identical for all protocols.

Returns: A list containing all the client ids which have the desired properties.

objects(protocol=None, model_ids=None, emotions=None, purposes=None, groups=None)[source]

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

Keyword Parameters:

protocol
CASME2 protocols.
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.
emotions
One or several emotions from - If not specified, objects with all expressions emotions returned.
purpose
The purpose of the Object (Train or Test)
class bob.db.casme2.File(client_id, path, emotion, onset, apex, offset)[source]

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

NOTE:this interface is the variant of the CASME2 database which does not use the video files, but rather the ones converted into frames of images. (i.e. the ones in the “CROPPED” folder). As such, this folder is supposed to be an abstract representation of the video file - in this case, its a fodler containing the video frames.

This is represent the video file directory containing the frames. * the emotions (‘happiness’, ‘repression’, ‘disgust’, ‘surprise’, ‘sadness’, ‘others’) for the client * the client id, in this case, each file is a frame in the video

apex
client
client_id
emotion
emotion_choices = ('happiness', 'repression', 'disgust', 'surprise', 'sadness', 'fear', 'others')
id
offset
onset
path
class bob.db.casme2.Frame(path, client_id, file_id, frame_no, filename)[source]

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

This is represents the frames in the video file (in this case, contained in the folder)

It contains the sequence of frames for each file recorded for the subjects in CASME2

client_id
file_id
filename
files
frame_no
id
class bob.db.casme2.Protocol(protocol)[source]

Bases: sqlalchemy.ext.declarative.api.Base

The protocols of the CASME2 database.

i = 26
name
protocol_choices = ['fold_1', 'fold_2', 'fold_3', 'fold_4', 'fold_5', 'fold_6', 'fold_7', 'fold_8', 'fold_9', 'fold_10', 'fold_11', 'fold_12', 'fold_13', 'fold_14', 'fold_15', 'fold_16', 'fold_17', 'fold_18', 'fold_19', 'fold_20', 'fold_21', 'fold_22', 'fold_23', 'fold_24', 'fold_25', 'fold_26']