Python API

The UTFVP Database for finger verification

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

Returns a string containing the configuration information.

class bob.db.utfvp.Client(id, subclient_id)[source]

Bases: sqlalchemy.ext.declarative.api.Base

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

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

client(id)[source]

Returns the client object in the database given a certain id. Raises an error if that does not exist.

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

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

Parameters:
  • protocol (str, optional) –

    One of the UTFVP protocols:

    • 1vsall
    • nom
    • nomLeftRing
    • nomLeftMiddle
    • nomLeftIndex
    • nomRightIndex
    • nomRightMiddle
    • nomRightRing
  • groups (str, optional) –

    Groups the clients belong to. Should be one of:

    • world
    • dev
    • eval
Returns:

Containing all the clients which have the given properties.

Return type:

list

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

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

Parameters:
  • protocol (str, optional) –

    One of the UTFVP protocols:

    • 1vsall
    • nom
    • nomLeftRing
    • nomLeftMiddle
    • nomLeftIndex
    • nomRightIndex
    • nomRightMiddle
    • nomRightRing
  • groups (str, Optional) – ignored (The clients belong both to world and dev)

Returns

list: Containing all the clients which have the given properties.
get_client_id_from_model_id(model_id)[source]

Returns the client_id attached to the given model_id

Parameters:model_id (str) – The model_id to consider
Returns:The client_id attached to the given model_id
Return type:str
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

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

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

Parameters:
  • protocol (str, optional) –

    One of the UTFVP protocols:

    • 1vsall
    • nom
    • nomLeftRing
    • nomLeftMiddle
    • nomLeftIndex
    • nomRightIndex
    • nomRightMiddle
    • nomRightRing
  • groups (str, optional) –

    Groups the clients belong to. Should be one of:

    • world
    • dev
    • eval
Returns:

Containing all the models ids which have the given properties.

Return type:

list

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

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

Parameters:
  • protocol (str, optional) –

    One of the UTFVP protocols:

    • 1vsall
    • nom
    • nomLeftRing
    • nomLeftMiddle
    • nomLeftIndex
    • nomRightIndex
    • nomRightMiddle
    • nomRightRing
  • groups (str, optional) –

    Groups the clients belong to. Should be one of:

    • dev
    • eval
Returns:

containing all the models which have the given properties

Return type:

list

objects(protocol=None, purposes=None, model_ids=None, groups=None, classes=None, finger_ids=None, session_ids=None)[source]

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

Parameters:
  • protocol (str, list, optional) –

    One or several of:

    • 1vsall
    • nom
    • nomLeftRing
    • nomLeftMiddle
    • nomLeftIndex
    • nomRightIndex
    • nomRightMiddle
    • nomRightRing
  • purposes (str, list, optional) –

    One or several of:

    • train
    • enroll
    • probe
  • model_ids (str, list, optional) – Only retrieves the files for the provided list of model ids. If None is given (this is the default), no filter over the model_ids is performed.
  • groups (str, list, optional) –

    Groups the clients belong to. Should be one or several of:

    • world
    • dev
    • eval
  • classes (str, list, optional) – The classes (types of accesses) to be retrieved (client or 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.
  • finger_ids (str, list, optional) – Only retrieves the files for the provided list of finger ids. If None is given (this is the default), no filter over the finger_ids is performed.
  • session_ids (str, list, optional) – Only retrieves the files for the provided list of session ids. If None is given (this is the default), no filter over the session_ids is performed.
Returns:

Containing the files which have the given properties.

Return type:

list

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

protocols()[source]

Returns all registered protocols

purposes()[source]
class bob.db.utfvp.File(client_id, path, finger_id, session_id)[source]

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

Generic file container

client
client_id
finger_id
id
load(directory=None, extension='.png')[source]

Loads the image for this file entry

Parameters:directory (str) – The path to the root of the database installation. This is the path leading to files named DDD-G where D‘s correspond to digits and G to the client gender. For example 032-M.
Returns:
A 2D array of unsigned integers corresponding to the input
image for this file in (y,x) notation (Bob-style).
Return type:numpy.ndarray
path
session_id
class bob.db.utfvp.Model(name, client_id, sgroup)[source]

Bases: sqlalchemy.ext.declarative.api.Base

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

client
client_id
enrollment_files
group_choices = ('dev', 'eval')
id
name
probe_files
sgroup
class bob.db.utfvp.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

UTFVP protocols

id
models
name
train_files