diff --git a/bob/pad/base/__init__.py b/bob/pad/base/__init__.py index c4f2695a24c5523e775a5a28c1570b31b8681fa0..f40abcb8dea0c94d0f2dd1cf357eefda26481288 100644 --- a/bob/pad/base/__init__.py +++ b/bob/pad/base/__init__.py @@ -6,6 +6,23 @@ from . import evaluation from . import script from . import test + +def padfile_to_label(padfile): + """Returns an integer presenting the label of the current sample. + + Parameters + ---------- + padfile : :any:`bob.pad.base.database.PadFile` + A pad file. + + Returns + ------- + bool + True (1) if it is a bona-fide sample, False (O) otherwise. + """ + return padfile.attack_type is None + + def get_config(): """Returns a string containing the configuration information. """