Skip to content
Snippets Groups Projects
Commit 0136721f authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[database] used bob.extension.rc for DB directory, modified the config name

parent e76d3fbf
No related branches found
No related tags found
1 merge request!77CASIA-SURF database
Pipeline #26269 passed
#!/usr/bin/env python
"""CASIA-SURF is a database for face PAD experiments.
"""
from bob.pad.face.database import CasiaSurfPadDatabase
# Directory where the data files are stored.
# This directory is given in the .bob_bio_databases.txt file located in your home directory
original_directory = "[YOUR_CASIASURF_DB_DIRECTORY]"
"""Value of ``~/.bob_bio_databases.txt`` for this database"""
original_extension = ".jpg" # extension is not used to load the data in the HLDI of this database
database = CasiaSurfPadDatabase(
protocol='color',
original_directory=original_directory,
original_extension=original_extension,
)
"""The :py:class:`bob.pad.base.database.PadDatabase` derivative with CASIA-SURF
database settings.
.. warning::
This class only provides a programmatic interface to load data in an orderly
manner, respecting usage protocols. It does **not** contain the raw
data files. You should procure those yourself.
Notice that ``original_directory`` is set to ``[YOUR_CASIASURF_DB_DIRECTORY]``.
You must make sure to create ``${HOME}/.bob_bio_databases.txt`` setting this
value to the place where you actually installed the CASIA-SURF Database, as
explained in the section :ref:`bob.pad.face.baselines`.
"""
#!/usr/bin/env python
# encoding: utf-8
from bob.pad.face.database import CasiaSurfPadDatabase
from bob.extension import rc
database = CasiaSurfPadDatabase(
protocol='color',
original_directory=rc['bob.db.casiasurf.directory'],
original_extension=".jpg",
)
......@@ -9,6 +9,8 @@ from bob.bio.video import FrameSelector, FrameContainer
from bob.pad.face.database import VideoPadFile
from bob.pad.base.database import PadDatabase
from bob.extension import rc
class CasiaSurfPadFile(VideoPadFile):
"""
A high level implementation of the File class for the CASIA-SURF database.
......@@ -49,7 +51,7 @@ class CasiaSurfPadFile(VideoPadFile):
path=s.id)
def load(self, directory=None, extension='.jpg', frame_selector=FrameSelector(selection_style='all')):
def load(self, directory=rc['bob.db.casiasurf.directory'], extension='.jpg', frame_selector=FrameSelector(selection_style='all')):
"""Overloaded version of the load method defined in ``VideoPadFile``.
Parameters
......
......@@ -74,7 +74,7 @@ setup(
'batl-db-thermal = bob.pad.face.config.batl_db_thermal:database',
'celeb-a = bob.pad.face.config.celeb_a:database',
'maskattack = bob.pad.face.config.maskattack:database',
'casiasurf = bob.pad.face.config.casiasurf:database',
'casiasurf-color = bob.pad.face.config.casiasurf_color:database',
],
# registered configurations:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment