OULU-NPU Database Access in Bob

This package provides an interface to the OULU-NPU - a mobile face presentation attack database with real-world variations database. The original data files need to be downloaded separately.After you have downloaded the dataset, you need to configure bob.db.oulunpu to find the dataset:

$ bob config set bob.db.oulunpu.directory /path/to/downloaded/dataset

If you use this database, please cite the following publication:

         author = {Boulkenafet, Z. and Komulainen, J. and Li, Lei. and Feng, X. and Hadid, A.},
       keywords = {biometrics, face recognition, anti-spoofing, presentation attack, generalization, colour texture},
          month = May,
          title = {{OULU-NPU}: A mobile face presentation attack database with real-world variations},
        journal = {IEEE International Conference on Automatic Face and Gesture Recognition},
           year = {2017},

Package Documentation

bob.db.oulunpu.OULUNPU_FRAME_SHAPE = (3, 1920, 1080)

Shape of the video frames in the oulunpu database.


Returns a string containing the configuration information.

class bob.db.oulunpu.Database(original_directory=None, name='oulunpu', pad_file_class=None, original_extension='.avi', **kwargs)

Bases: bob.pad.base.database.FileListPadDatabase

The database interface for the OULU-NPU dataset.

objects(groups=None, protocol=None, purposes=None, model_ids=None, classes=None, **kwargs)[source]
class bob.db.oulunpu.File(attack_type, client_id, path, file_id=None)

Bases: bob.pad.face.database.VideoPadFile

The file objects of the OULU-NPU dataset.


Reads the annotations

Returns:The annotations as a dictionary, e.g.: {'0': {'reye':(re_y,re_x), 'leye':(le_y,le_x)}, ...}
Return type:dict

Returns the size of each frame in this database.

Returns:The (#Channels, Height, Width) which is OULUNPU_FRAME_SHAPE.
Return type:(int, int, int)

Yields the frames of the biofile one by one.

Yields:numpy.array – A frame of the video. The size is (3, 1920, 1080).

Returns the number of frames in a video file.

Returns:The number of frames.
Return type:int