Python API

This is the Bob database entry for the PUT Vein database

class bob.db.putvein.Database[source]

Bases: object

check_validity(l, obj, valid, default)[source]

Checks validity of user input data against a set of valid values

client_id_from_model_id(model_id)[source]
model_ids(protocol=None, groups=None, kinds=None)[source]

Returns a list of model ids for the specific query by the user.

check_ids_validity(ids, max_value)[source]

Checks validity of client ids

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

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

Keyword Parameters:

protocol

One of the PUT protocols. As on 08.02.2017 protocols are:

  • L_4,

  • R_4,

  • LR_4,

  • RL_4,

  • R_BEAT_4,

  • L_1,

  • R_1,

  • LR_1

  • RL_1,

  • R_BEAT_1.

Protocols still contains the original protocol (‘L’, ‘R’, ‘LR’, ‘RL’) data, the difference is, whether each enroll model is constructed using all hand’s images (4), or each enroll image is used as a model. E.g.:

The R_1 protocol, if one kind (palm / wrist) is used, each group (dev / eval) consists of 25*4 enroll images (each image treated as a separate model) and 25*8 probe images, resulting in:

  • 25*4*8 = 800 genuine comparisons,

  • (25*4)*(24*8) = 19200 zero-effort impostor comparisons,

  • 25*4*25*8 = 20’000 total comparisons.

The R_4 protocol consists of the same data as R_1 but now 4 images makes enroll model resulting in 25 enroll models per dev / eval group. Meaning there are:

  • 25*8 = 200 genuine SCORES;

  • 25*(24*8) = 4800 zero-effort impostor SCORES;

  • 25*25*8 = 5’000 total SCORES.

Protocols R_BEAT_1 and R_BEAT_4 are new quick test protocols for BOB and BEAT platforms.

The R_BEAT_1 protocol consists only of 2 persons in dev / eval datasets so that databse could be effectively use for algorithm testing. If we use only one kind of data (palm / wrist), than for each group (dev / eval) we have 4*2 enroll images (each image makes a separate model) and 2*8 probe images resulting in:

  • 2*4*8 = 64 genuine compressions;

  • 2*4*8 = 64 zero-effort impostor compressions;

  • 4*2*2*8 = 128 total comparisons.

The R_BEAT_4 consists of the same data as R_BEAT_1 but now 4 images makes enroll model resulting in 2 enroll models per dev / eval group. Meaning there are:

  • 2*8 = 16 genuine SCORES;

  • 2*8 = 16 zero-effort impostor SCORES;

  • 2*2*8 = 32 total SCORES.

You can find more information in packages documentation.

purposes

The purposes required to be retrieved (‘enroll’, ‘probe’) 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. This field is ignored for the data from the “train” group.

model_ids

Only retrieves the files for provided of model ids. To enable database compatibility with bob.bio.vein, model_ids can be None or list with length 1 (user can’t pass multiple model_ids) The model_ids is a string. If ‘None’ is given (this is the default), no filter over the model_ids is performed. Be careful - model ID correspond to the ENROLL data set objects (files), don’t try to make a specific ‘probe’ data set query using the model_ids – in any way entire probe data set will be returned.

groups

One of the groups (‘train’, ‘dev’, ‘eval’) 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.

kinds

One of the kinds of data (‘palm’, ‘wrist’), 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.

Returns: A list of File objects.

file_model_id(file, protocol)[source]

file_model_id - is a function made for the BEAT platform. Function outputs the model_id according to the protocol used.

Keyword Parameters:

file

The bob.db.putvein file object

protocol

The bob.db.putvein protocol used - one of the protocols:

  • ‘L_4’,

  • ‘R_4’,

  • ‘LR_4’,

  • ‘RL_4’,

  • ‘R_BEAT_4’,

  • ‘L_1’,

  • ‘R_1’,

  • ‘LR_1’,

  • ‘RL_1’,

  • ‘R_BEAT_1’.

Returns: A model_id – a string that represents the file model_id according to the protocol used.

class bob.db.putvein.File(filename, id, mirrored=False)[source]

Bases: object

Generic file container

make_path(directory=None)[source]

Wraps this files’ filename so that a complete path is formed

Keyword parameters:

directory

An optional directory name that will be prefixed to the returned result.

Returns a string containing the newly generated file path.

property path
is_mirrored()[source]
get_client_id()[source]
load(directory=None, **kwargs)[source]

Loads the data at the specified location.

Keyword parameters:

directory

[optional] If not empty or None, this directory is prefixed to the final file destination

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

Returns a string containing the configuration information.