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
-
model_ids(protocol=None, groups=None, kinds=None)[source]¶ Returns a list of model ids for the specific query by the user.
-
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_1RL_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_1protocol, 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_4protocol consists of the same data asR_1but 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_1andR_BEAT_4are new quick test protocols for BOB and BEAT platforms.The
R_BEAT_1protocol 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_4consists of the same data asR_BEAT_1but 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_idscan beNoneor list with length1(user can’t pass multiplemodel_ids) Themodel_idsis a string. If ‘None’ is given (this is the default), no filter over themodel_idsis 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 themodel_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
Fileobjects.
-
file_model_id(file, protocol)[source]¶ file_model_id- is a function made for theBEATplatform. Function outputs themodel_idaccording to the protocol used.Keyword Parameters:
- file
The
bob.db.putveinfile object- protocol
The
bob.db.putveinprotocol 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_idaccording to the protocol used.
-
-
class
bob.db.putvein.File(filename, id, mirrored=False)[source]¶ Bases:
objectGeneric 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¶
-