Commit 282ba2e2 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Use bob.extension.rc

parent d1e91ad5
Pipeline #14497 passed with stages
in 15 minutes and 16 seconds
#!/usr/bin/env python
from bob.db.oulunpu import Database
oulunpu_directory = "[OULUNPU_DIRECTORY]"
database = Database(
original_directory=oulunpu_directory,
)
database = Database()
......@@ -2,6 +2,7 @@ from pkg_resources import resource_filename
from bob.pad.base.database import FileListPadDatabase
from bob.pad.face.database import VideoPadFile
from bob.pad.face.utils import frames, number_of_frames
from bob.extension import rc
# documentation imports
import numpy
......@@ -14,7 +15,7 @@ class File(VideoPadFile):
class Database(FileListPadDatabase):
"""The database interface for the OULU-NPU dataset."""
def __init__(self, original_directory=None,
def __init__(self, original_directory=rc['bob.db.oulunpu.directory'],
name='oulunpu', bio_file_class=None,
original_extension=".avi", **kwargs):
if bio_file_class is None:
......
......@@ -4,7 +4,6 @@
"""Test Units
"""
from bob.db.oulunpu.config import database as db
import os
import nose
......@@ -67,12 +66,10 @@ def test_database():
def test_frames():
protocol = 'Protocol_1'
db.protocol = protocol
db.replace_directories(os.path.expanduser('~/.bob_bio_databases.txt'))
if db.original_directory == '[OULUNPU_DIRECTORY]':
if db.original_directory is None:
raise nose.SkipTest(
"Please update '[OULUNPU_DIRECTORY]' in your "
"'~/.bob_bio_databases.txt' to point to the directory where the "
"database's raw data are. This way we can test more features of "
"the database interface.")
"Please configure bob.db.oulunpu (refer to package documentation) "
"to point to the directory where the database's raw data are. This"
" way we can test more features of the database interface.")
padfile = db.all_files()[0][0]
assert db.number_of_frames(padfile) == 151, db.number_of_frames(padfile)
......@@ -8,7 +8,10 @@
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.
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::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment