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 #!/usr/bin/env python
from bob.db.oulunpu import Database from bob.db.oulunpu import Database
database = Database()
oulunpu_directory = "[OULUNPU_DIRECTORY]"
database = Database(
original_directory=oulunpu_directory,
)
...@@ -2,6 +2,7 @@ from pkg_resources import resource_filename ...@@ -2,6 +2,7 @@ from pkg_resources import resource_filename
from bob.pad.base.database import FileListPadDatabase from bob.pad.base.database import FileListPadDatabase
from bob.pad.face.database import VideoPadFile from bob.pad.face.database import VideoPadFile
from bob.pad.face.utils import frames, number_of_frames from bob.pad.face.utils import frames, number_of_frames
from bob.extension import rc
# documentation imports # documentation imports
import numpy import numpy
...@@ -14,7 +15,7 @@ class File(VideoPadFile): ...@@ -14,7 +15,7 @@ class File(VideoPadFile):
class Database(FileListPadDatabase): class Database(FileListPadDatabase):
"""The database interface for the OULU-NPU dataset.""" """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, name='oulunpu', bio_file_class=None,
original_extension=".avi", **kwargs): original_extension=".avi", **kwargs):
if bio_file_class is None: if bio_file_class is None:
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
"""Test Units """Test Units
""" """
from bob.db.oulunpu.config import database as db from bob.db.oulunpu.config import database as db
import os
import nose import nose
...@@ -67,12 +66,10 @@ def test_database(): ...@@ -67,12 +66,10 @@ def test_database():
def test_frames(): def test_frames():
protocol = 'Protocol_1' protocol = 'Protocol_1'
db.protocol = protocol db.protocol = protocol
db.replace_directories(os.path.expanduser('~/.bob_bio_databases.txt')) if db.original_directory is None:
if db.original_directory == '[OULUNPU_DIRECTORY]':
raise nose.SkipTest( raise nose.SkipTest(
"Please update '[OULUNPU_DIRECTORY]' in your " "Please configure bob.db.oulunpu (refer to package documentation) "
"'~/.bob_bio_databases.txt' to point to the directory where the " "to point to the directory where the database's raw data are. This"
"database's raw data are. This way we can test more features of " " way we can test more features of the database interface.")
"the database interface.")
padfile = db.all_files()[0][0] padfile = db.all_files()[0][0]
assert db.number_of_frames(padfile) == 151, db.number_of_frames(padfile) assert db.number_of_frames(padfile) == 151, db.number_of_frames(padfile)
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
This package provides an interface to the `OULU-NPU`_ - a mobile face This package provides an interface to the `OULU-NPU`_ - a mobile face
presentation attack database with real-world variations database. The original 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:: 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