# Python API¶

The UTFVP Database for finger verification

class bob.db.utfvp.Database(original_directory=None, original_extension=None)[source]

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.

protocol_names()[source]

Returns a list of all supported protocols

purposes()[source]

Returns a list of all supported purposes

groups()[source]

Returns a list of all supported groups

genders()[source]

Returns a list of all supported gender values

finger_names()[source]

Returns a list of all supported finger name values

sessions()[source]

Returns a list of all supported session values

file_from_model_id(model_id)[source]

Returns the file in the database given a model_id

finger_name_from_model_id(model_id)[source]

Returns the unique finger name in the database given a model_id

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

Returns a set of models for a given protocol/group

Parameters
• protocol (str, list, optional) – One or more of the supported protocols. If not set, returns data from all protocols

• groups (str, list, optional) – One or more of the supported groups. If not set, returns data from all groups. Notice this parameter should either not set or set to dev. Otherwise, this method will return an empty list given we don’t have a test set, only a development set.

Returns

A list of string corresponding model identifiers with the specified filtering criteria

Return type

list

objects(protocol=None, groups=None, purposes=None, model_ids=None, genders=None, finger_names=None, sessions=None)[source]

Returns objects filtered by criteria

Parameters
Returns

A list of File objects corresponding to the filtering criteria.

Return type

list

class bob.db.utfvp.Client(id, gender, age, handedness, publishable, daydiff, comment)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Unique clients in the database, referred by a single integer

gender_choices = ('M', 'F')
handedness_choices = ('R', 'L', 'X')
id
gender
age
handedness
publishable
daydiff
comment
gender_display()[source]

Returns a representation of the client gender

handedness_display()[source]

Returns a representation of the client handedness

fingers
class bob.db.utfvp.Finger(client, name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Unique fingers in the database, referred by a string

Fingers have the format 0003_3 (i.e. <client>_<finger>)

id
client_id
name_choices = ('1', '2', '3', '4', '5', '6')
finger_names = {'1': 'left ring', '2': 'left middle', '3': 'left index', '4': 'right index', '5': 'right middle', '6': 'right ring'}
client
name
name_display()[source]

Returns a representation of the finger side

files
class bob.db.utfvp.File(finger, session, date_hour)[source]

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

Unique files in the database, referred by a string

Files have the format 0003/0003_3_2_121224-134932 (i.e. <client>/<client>_<finger>_<session>_<date>-<hour>)

id
finger_id
session_choices = ('1', '2', '3', '4')
finger
session
model_id
date_hour
property path
property unique_finger_name

Unique name for a given finger in the database

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

roi()[source]

Loads region-of-interest annotations for a particular image

The returned points (see return value below) correspond to a polygon in the 2D space delimiting the finger image. It is up to you to generate a mask out of these annotations.

Returns

A 2D array of 16-bit unsigned integers corresponding to

annotations for the given fingervein image. Points are loaded in (y,x) format so, the first column of the returned array correspond to the y-values while the second column to the x-values of each coordinate.

Return type

numpy.ndarray

subsets
class bob.db.utfvp.Protocol(name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

VERA protocols

id
name
subsets
class bob.db.utfvp.Subset(protocol, group, purpose)[source]

Bases: sqlalchemy.ext.declarative.api.Base

VERA protocol subsets

id
protocol_id
group_choices = ('train', 'dev', 'eval')
purpose_choices = ('train', 'enroll', 'probe')
files
avoid_self_probe
protocol
group
purpose
bob.db.utfvp.get_config()[source]

Returns a string containing the configuration information.