Long Distance Heterogeneous Face Database (LDHF-DB)¶
-
class
bob.db.nivl.Database(original_directory=None, original_extension=None)[source]¶ Bases:
bob.db.base.SQLiteDatabaseWrapper class for the Near-Infrared and Visible-Light (NIVL) Dataset
-
annotations(file, annotation_type='eyes_center')[source]¶ This function returns the annotations for the given file id as a dictionary.
Parameters
- file:
bob.db.base.File The File object you want to retrieve the annotations for,
- Return
A dictionary of annotations, for face images usually something like {‘leye’:(le_y,le_x), ‘reye’:(re_y,re_x), …}, or None if there are no annotations for the given file ID (which is the case in this base class implementation).
- file:
-
objects(groups=None, protocol=None, purposes=None, model_ids=None, modality=None, **kwargs)[source]¶ This function returns lists of File objects, which fulfill the given restrictions.
-
groups(protocol=None, **kwargs)[source]¶ This function returns the list of groups for this database.
-
zclients(protocol=None)[source]¶ Returns a set of Z-Norm clients for the specific query by the user.
-
tclients(protocol=None)[source]¶ Returns a set of T-Norm clients for the specific query by the user.
-
zobjects(protocol=None, groups=None)[source]¶ Returns a set of Z-Norm objects for the specific query by the user.
-
tobjects(protocol=None, model_ids=None, groups=None)[source]¶ Returns a set of T-Norm objects for the specific query by the user.
-
tmodel_ids(groups=None, protocol=None, **kwargs)[source]¶ This function returns the ids of the T-Norm models of the given groups for the given protocol.
-
property
modality_separator¶
-
property
modalities¶
-
all_files(**kwargs)¶ Returns the list of all File objects that satisfy your query.
For possible keyword arguments, please check the implemention’s
objects()method.
-
assert_validity()¶ Raise a RuntimeError if the database back-end is not available.
-
check_parameter_for_validity(parameter, parameter_description, valid_parameters, default_parameter=None)¶
-
check_parameters_for_validity(parameters, parameter_description, valid_parameters, default_parameters=None)¶
-
convert_names_to_highlevel(names, low_level_names, high_level_names)¶
-
convert_names_to_lowlevel(names, low_level_names, high_level_names)¶
-
file_names(files, directory, extension)¶
-
files(ids, preserve_order=True)¶ Returns a list of
Fileobjects with the given file ids- Parameters
- Returns
a list (that may be empty) of
Fileobjects.- Return type
-
is_valid()¶ Returns if a valid session has been opened for reading the database.
-
original_file_name(file)¶ This function returns the original file name for the given File object.
- Parameters
file –
bob.db.base.Fileor a derivative The File objects for which the file name should be retrieved- Returns
The original file name for the given
bob.db.base.Fileobject.- Return type
- Raises
ValueError – if the file is not found.
-
original_file_names(files)¶ Returns the full path of the original data of the given File objects.
- Parameters
files (list of
bob.db.base.File) – The list of file object to retrieve the original data file names for.- Returns
The paths extracted for the files, in the same order.
- Return type
list of
str
-
paths(ids, prefix=None, suffix=None, preserve_order=True)¶ Returns a full file paths considering particular file ids
- Parameters
ids (
listor :obj`tuple`) – The ids of the object in the database table “file”. This object should be a python iterable (such as a tuple or list).prefix (
str, optional) – The bit of path to be prepended to the filename stemsuffix (
str, optional) – The extension determines the suffix that will be appended to the filename stem.preserve_order (bool) – If True (the default) the order of elements is preserved, but the execution time increases.
- Returns
A list (that may be empty) of the fully constructed paths given the file ids.
- Return type
-
query(*args)¶ Creates a query to the database using the given arguments.
-
reverse(paths, preserve_order=True)¶ Reverses the lookup from certain paths, returns a list of
bob.db.base.File’s- Parameters
- Returns
A list (that may be empty).
- Return type
-
sort(files)¶
-
uniquify(file_list)¶ Sorts the given list of File objects and removes duplicates from it.
- Parameters
file_list ([
bob.db.base.File]) – A list of File objects to be handled. Also other objects can be handled, as long as they are sortable.- Returns
A sorted copy of the given
file_listwith the duplicates removed.- Return type
-
-
class
bob.db.nivl.File(file_id, image_name, client_id, modality, session, year)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base,bob.db.base.FileInformation about the files of the LDHF database.
Each file includes * the client id
-
modality_choices= ('VIS', 'NIR')¶
-
id¶
-
path¶
-
client¶
-
all_annotations¶
-
client_id¶
-
load(directory=None, extension='.hdf5')[source]¶ Loads the data at the specified location and using the given extension. Override it if you need to load differently.
- Parameters
- Returns
The loaded data (normally
numpy.ndarray).- Return type
-
make_path(directory=None, extension=None)[source]¶ Wraps the current path so that a complete path is formed
- Parameters
- Returns
Returns a string containing the newly generated file path.
- Return type
-
metadata= MetaData(bind=None)¶
-
modality¶
-
save(data, directory=None, extension='.hdf5', create_directories=True)[source]¶ Saves the input data at the specified location and using the given extension. Override it if you need to save differently.
- Parameters
data (object) – The data blob to be saved (normally a
numpy.ndarray).directory (
str, optional) – If not empty or None, this directory is prefixed to the final file destinationextension (
str, optional) – The extension of the filename - this will control the type of output and the codec for saving the input blob.create_directories (
bool, optional) – Whether to create the required directories to save the data.
-
session¶
-
year¶
-
-
class
bob.db.nivl.Client(id, group)[source]¶ Bases:
sqlalchemy.ext.declarative.api.BaseInformation about the clients (identities) of the LDHF.
-
id¶
-
metadata= MetaData(bind=None)¶
-
-
class
bob.db.nivl.Annotation(file_id, le_x, le_y, re_x, re_y)[source]¶ Bases:
sqlalchemy.ext.declarative.api.BaseAnnotation.id
x
y
-
file_id¶
-
le_x¶
-
le_y¶
-
re_x¶
-
re_y¶
-
metadata= MetaData(bind=None)¶