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:

@INPROCEEDINGS{OULU_NPU_2017,
         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.

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

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.

annotations(padfile)[source]
frame_shape
frames(padfile)[source]
number_of_frames(padfile)[source]
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.

annotations

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
frame_shape

Returns the size of each frame in this database.

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

Yields the frames of the biofile one by one.

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

Returns the number of frames in a video file.

Returns:The number of frames.
Return type:int