diff --git a/bob/bio/vein/config/database/fv3d.py b/bob/bio/vein/config/database/fv3d.py deleted file mode 100644 index 357458af924b01ce200c1566250411b686e694f6..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/fv3d.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : - -"""`3D Fingervein`_ is a database for biometric fingervein recognition - -The `3D Fingervein`_ Database for finger vein recognition consists of 13614 -images from 141 subjects collected in various acquisition campaigns. - -You can download the raw data of the `3D Fingervein`_ database by following -the link. -""" - - -import logging - -from bob.bio.base.pipelines import DatabaseConnector -from bob.bio.vein.database.fv3d import Database -from bob.extension import rc - -logger = logging.getLogger("bob.bio.vein") - -# Retrieve directory from config -_fv3d_directory = rc.get("bob.db.fv3d.directory", "") -"""Value in ``~/.bobrc`` for this dataset directory""" - -# Set default protocol if not given via a config file -if "protocol" not in locals(): - logger.info("protocol not specified, using default: 'central'") - protocol = "central" - -legacy_database = Database( - original_directory=_fv3d_directory, - original_extension=".png", - protocol=protocol, -) -"""The :py:class:`bob.bio.base.database.BioDatabase` derivative with fv3d -database settings -""" - -database = DatabaseConnector( - legacy_database, annotation_type=None, fixed_positions=None -) -""" -The database interface wrapped for pipeline simple - -.. warning:: - - This class only provides a programmatic interface to load data in an orderly - manner, respecting usage protocols. It does **not** contain the raw - datafiles. You should procure those yourself. - -Notice that ``original_directory`` is set to ``rc[bob.db.fv3d.directory]``. You -must make sure to set this value with ``bob config set bob.db.fv3d.directory`` -to the place where you actually installed the `3D Fingervein`_ dataset, as -explained in the section :ref:`bob.bio.vein.baselines`. -""" - -logger.debug(f"Loaded database fv3d config file, using protocol '{protocol}'.") diff --git a/bob/bio/vein/config/database/protocol_fv3d/central.py b/bob/bio/vein/config/database/protocol_fv3d/central.py deleted file mode 100644 index 401a3a90963a4d2044c8a6b0f7e1b6deb3913801..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_fv3d/central.py +++ /dev/null @@ -1,23 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 10:54:47 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# 3D Fingervein dataset, defined at bob.db.fv3d. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> central fv3d -# or: -# $ bob bio pipeline simple -p <pipeline> central fv3d - -# The protocol resource must be specified before the database resource. - - -# Available protocols are: -# 'central', 'left', 'right', 'stitched' - -# This will be the default protocol if none is specified. - -protocol = "central" diff --git a/bob/bio/vein/config/database/protocol_fv3d/left.py b/bob/bio/vein/config/database/protocol_fv3d/left.py deleted file mode 100644 index e2eebac8c1c2e6cfc1e7c6d5966f43df626e992e..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_fv3d/left.py +++ /dev/null @@ -1,21 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 12:14:05 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# 3D Fingervein dataset, defined at bob.db.fv3d. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple<pipeline> left fv3d -# or: -# $ bob bio pipeline simple -p <pipeline> left fv3d - -# The protocol resource must be specified before the database resource. - - -# Available protocols are: -# 'central', 'left', 'right', 'stitched' - -protocol = "left" diff --git a/bob/bio/vein/config/database/protocol_fv3d/right.py b/bob/bio/vein/config/database/protocol_fv3d/right.py deleted file mode 100644 index 9693dd168c5082e0091d3254d35da26bb2f9728b..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_fv3d/right.py +++ /dev/null @@ -1,21 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 12:14:56 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# 3D Fingervein dataset, defined at bob.db.fv3d. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> right fv3d -# or: -# $ bob bio pipeline simple -p <pipeline> right fv3d - -# The protocol resource must be specified before the database resource. - - -# Available protocols are: -# 'central', 'left', 'right', 'stitched' - -protocol = "right" diff --git a/bob/bio/vein/config/database/protocol_fv3d/stitched.py b/bob/bio/vein/config/database/protocol_fv3d/stitched.py deleted file mode 100644 index d88f0f6d81ca37ec839313bbf57edec37ca62ce2..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_fv3d/stitched.py +++ /dev/null @@ -1,21 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 12:15:16 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# 3D Fingervein dataset, defined at bob.db.fv3d. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> stitched fv3d -# or: -# $ bob bio pipeline simple -p <pipeline> stitched fv3d - -# The protocol resource must be specified before the database resource. - - -# Available protocols are: -# 'central', 'left', 'right', 'stitched' - -protocol = "stitched" diff --git a/bob/bio/vein/config/database/protocol_putvein/palm_lr_1.py b/bob/bio/vein/config/database/protocol_putvein/palm_lr_1.py deleted file mode 100644 index bcc6e23bd7cce24d6514c512c99c35fa8f074866..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_putvein/palm_lr_1.py +++ /dev/null @@ -1,25 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Wed 21 Oct 2020 11:27:19 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# Put Vein dataset, defined at bob.db.putvein. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> wrist-LR-1 putvein -# or: -# $ bob bio pipeline simple -p <pipeline> wrist-LR-1 putvein - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'palm-L_1', 'palm-LR_1', 'palm-R_1', 'palm-RL_1', 'palm-R_BEAT_1', -# 'palm-L_4', 'palm-LR_4', 'palm-R_4', 'palm-RL_4', 'palm-R_BEAT_4', -# 'wrist-L_1', 'wrist-LR_1', 'wrist-R_1', 'wrist-RL_1', 'wrist-R_BEAT_1', -# 'wrist-L_4', 'wrist-LR_4', 'wrist-R_4', 'wrist-RL_4', 'wrist-R_BEAT_4' - - -protocol = "palm-LR_1" diff --git a/bob/bio/vein/config/database/protocol_putvein/palm_lr_4.py b/bob/bio/vein/config/database/protocol_putvein/palm_lr_4.py deleted file mode 100644 index 3b2a508cf3444d852cfb59d67c8b1cb4e53722e0..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_putvein/palm_lr_4.py +++ /dev/null @@ -1,25 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Wed 21 Oct 2020 11:27:19 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# Put Vein dataset, defined at bob.db.putvein. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> wrist-LR-1 putvein -# or: -# $ bob bio pipeline simple -p <pipeline> wrist-LR-1 putvein - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'palm-L_1', 'palm-LR_1', 'palm-R_1', 'palm-RL_1', 'palm-R_BEAT_1', -# 'palm-L_4', 'palm-LR_4', 'palm-R_4', 'palm-RL_4', 'palm-R_BEAT_4', -# 'wrist-L_1', 'wrist-LR_1', 'wrist-R_1', 'wrist-RL_1', 'wrist-R_BEAT_1', -# 'wrist-L_4', 'wrist-LR_4', 'wrist-R_4', 'wrist-RL_4', 'wrist-R_BEAT_4' - - -protocol = "palm-LR_4" diff --git a/bob/bio/vein/config/database/protocol_putvein/wrist_lr_1.py b/bob/bio/vein/config/database/protocol_putvein/wrist_lr_1.py deleted file mode 100644 index a5f3c2d535e6ceb3e2c497807a14ad12402f5caa..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_putvein/wrist_lr_1.py +++ /dev/null @@ -1,27 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Wed 21 Oct 2020 11:27:08 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# Put Vein dataset, defined at bob.db.putvein. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> wrist-LR-1 putvein -# or: -# $ bob bio pipeline simple -p <pipeline> wrist-LR-1 putvein - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'palm-L_1', 'palm-LR_1', 'palm-R_1', 'palm-RL_1', 'palm-R_BEAT_1', -# 'palm-L_4', 'palm-LR_4', 'palm-R_4', 'palm-RL_4', 'palm-R_BEAT_4', -# 'wrist-L_1', 'wrist-LR_1', 'wrist-R_1', 'wrist-RL_1', 'wrist-R_BEAT_1', -# 'wrist-L_4', 'wrist-LR_4', 'wrist-R_4', 'wrist-RL_4', 'wrist-R_BEAT_4' - - -# This will be the default protocol if none is specified. - -protocol = "wrist-LR_1" diff --git a/bob/bio/vein/config/database/protocol_putvein/wrist_lr_4.py b/bob/bio/vein/config/database/protocol_putvein/wrist_lr_4.py deleted file mode 100644 index 853887d873be0908fc7f4b4ac577e570ede0e4e3..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_putvein/wrist_lr_4.py +++ /dev/null @@ -1,25 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Wed 21 Oct 2020 11:27:00 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# Put Vein dataset, defined at bob.db.putvein. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> wrist-LR-1 putvein -# or: -# $ bob bio pipeline simple -p <pipeline> wrist-LR-1 putvein - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'palm-L_1', 'palm-LR_1', 'palm-R_1', 'palm-RL_1', 'palm-R_BEAT_1', -# 'palm-L_4', 'palm-LR_4', 'palm-R_4', 'palm-RL_4', 'palm-R_BEAT_4', -# 'wrist-L_1', 'wrist-LR_1', 'wrist-R_1', 'wrist-RL_1', 'wrist-R_BEAT_1', -# 'wrist-L_4', 'wrist-LR_4', 'wrist-R_4', 'wrist-RL_4', 'wrist-R_BEAT_4' - - -protocol = "wrist-LR_4" diff --git a/bob/bio/vein/config/database/protocol_verafinger/cropped_full.py b/bob/bio/vein/config/database/protocol_verafinger/cropped_full.py deleted file mode 100644 index b487a8bdeadacb757e1116179eb40d643ab5921a..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_verafinger/cropped_full.py +++ /dev/null @@ -1,22 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 14:50:58 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# VeraFinger dataset, defined at bob.db.verafinger. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> Cropped-Full verafinger -# or: -# $ bob bio pipeline simple -p <pipeline> Cropped-Full verafinger - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'B', 'Cropped-B', 'Cropped-Fifty', 'Cropped-Full', 'Cropped-Nom', 'Fifty', -# 'Full', 'Nom' - -protocol = "Cropped-Full" diff --git a/bob/bio/vein/config/database/protocol_verafinger/cropped_nom.py b/bob/bio/vein/config/database/protocol_verafinger/cropped_nom.py deleted file mode 100644 index b2a317ae1cbffdf8bf6552c5216c9ea4038be2b0..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_verafinger/cropped_nom.py +++ /dev/null @@ -1,22 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 14:51:02 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# VeraFinger dataset, defined at bob.db.verafinger. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> Cropped-Nom verafinger -# or: -# $ bob bio pipeline simple -p <pipeline> Cropped-Nom verafinger - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'B', 'Cropped-B', 'Cropped-Fifty', 'Cropped-Full', 'Cropped-Nom', 'Fifty', -# 'Full', 'Nom' - -protocol = "Cropped-Nom" diff --git a/bob/bio/vein/config/database/protocol_verafinger/full.py b/bob/bio/vein/config/database/protocol_verafinger/full.py deleted file mode 100644 index 7a62bf5e6ebbc2917e773edbd638937349d8ec3d..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_verafinger/full.py +++ /dev/null @@ -1,22 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 14:51:11 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# VeraFinger dataset, defined at bob.db.verafinger. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> Full verafinger -# or: -# $ bob bio pipeline simple -p <pipeline> Full verafinger - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'B', 'Cropped-B', 'Cropped-Fifty', 'Cropped-Full', 'Cropped-Nom', 'Fifty', -# 'Full', 'Nom' - -protocol = "Full" diff --git a/bob/bio/vein/config/database/protocol_verafinger/nom.py b/bob/bio/vein/config/database/protocol_verafinger/nom.py deleted file mode 100644 index 1a763f06c1974558d9b5d573b88956fdbc953ba5..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/protocol_verafinger/nom.py +++ /dev/null @@ -1,24 +0,0 @@ -# author: Yannick Dayer <yannick.dayer@idiap.ch> -# Fri 16 Oct 2020 14:51:16 UTC+02 - -# This is a config file for bob.bio.vein -# It defines the database protocol to use with the Database Interface for the -# VeraFinger dataset, defined at bob.db.verafinger. - -# It is defined as a resource in the setup file of this package. - -# Usage: -# $ bob bio pipeline simple <pipeline> Nom verafinger -# or: -# $ bob bio pipeline simple -p <pipeline> Nom verafinger - -# The protocol resource must be specified before the database resource. - - -# Available protocols are (some require the creation of your own config file): -# 'B', 'Cropped-B', 'Cropped-Fifty', 'Cropped-Full', 'Cropped-Nom', 'Fifty', -# 'Full', 'Nom' - -# This will be the default protocol if none is specified. - -protocol = "Nom" diff --git a/bob/bio/vein/config/database/putvein.py b/bob/bio/vein/config/database/putvein.py deleted file mode 100644 index 0d5287571818a68cf575fbae3ebdbe9e7b34a3d8..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/putvein.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : -# Mon 26 Sep 2016 17:21:42 CEST - -"""`PUT Vein`_ is a database for biometric palm and wrist vein recognition. - -PUT Vein pattern database consists of 2400 images presenting human vein patterns. -Half of images (1200 images) contain a palm vein pattern and the remaining images contain a wrist vein pattern (another 1200 images). -Data was acquired from both hands of 50 students. Thus, it has 100 different patterns for palm and wrist region. -Pictures ware taken in 3 series, 4 pictures each, with at least one week interval between each series. -Images in database have 1280x960 resolution and are stored as 24-bit bitmap. Database consist of 2 main splits: -hand and wrist, allowing to investigate both modalities. -The reference citation is [KK10]_. - -You can download the raw data of the `PUT Vein`_ database by following -the link. -""" - -import logging - -from bob.bio.base.pipelines import DatabaseConnector -from bob.bio.vein.database.putvein import PutveinBioDatabase -from bob.extension import rc - -logger = logging.getLogger("bob.bio.vein") - -_putvein_directory = rc.get("bob.db.putvein.directory", "") -"""Value in ``~/.bobrc`` for this dataset directory""" - -# Set default protocol if not given via a config file -if "protocol" not in locals(): - logger.info("protocol not specified, using default: 'wrist-LR_1'") - protocol = "wrist-LR_1" - -legacy_database = PutveinBioDatabase( - original_directory=_putvein_directory, - original_extension=".bmp", - protocol=protocol, -) -"""The :py:class:`bob.bio.base.database.BioDatabase` derivative with PUT Vein -database settings -""" - -database = DatabaseConnector( - legacy_database, annotation_type=None, fixed_positions=None -) - -""" -The database interface wrapped for pipeline simple - -.. warning:: - - This class only provides a programmatic interface to load data in an orderly - manner, respecting usage protocols. It does **not** contain the raw - datafiles. You should procure those yourself. - -Notice that ``original_directory`` is set to ``rc[bob.db.putvein.directory]``. -You must make sure to set this value with -``bob config set bob.db.putvein.directory`` to the place where you actually -installed the `put vein`_ dataset, as explained in the section -:ref:`bob.bio.vein.baselines`. -""" - -logger.debug( - f"loaded database putvein config file, using protocol '{protocol}'." -) diff --git a/bob/bio/vein/config/database/verafinger.py b/bob/bio/vein/config/database/verafinger.py deleted file mode 100644 index df1d86a3a2e74bc87e2e4b5079f1f545064292ed..0000000000000000000000000000000000000000 --- a/bob/bio/vein/config/database/verafinger.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : -# Mon 26 Sep 2016 17:21:42 CEST - -"""`VERA Fingervein`_ is a database for biometric fingervein recognition - -It consists of 440 images from 110 clients. It was produced at the Idiap -Research Institute in Martigny and at Haute Ecole Spécialisée de Suisse -Occidentale in Sion, in Switzerland. The reference citation is [TVM14]_. - -You can download the raw data of the `VERA Fingervein`_ database by following -the link. -""" - -import logging - -from bob.bio.base.pipelines import DatabaseConnector -from bob.bio.vein.database.verafinger import Database -from bob.extension import rc - -logger = logging.getLogger("bob.bio.vein") - -_verafinger_directory = rc.get("bob.db.verafinger.directory", "") -"""Value in ``~/.bobrc`` for this dataset directory""" - -# Set default protocol if not given via a config file -if "protocol" not in locals(): - logger.info("protocol not specified, using default: 'Nom'") - protocol = "Nom" - - -"""Updated with the wrapper for the pipelines package""" -database = DatabaseConnector( - Database( - original_directory=_verafinger_directory, - original_extension=".png", - protocol=protocol, - ), - annotation_type=None, - fixed_positions=None, -) -"""The :py:class:`bob.bio.base.database.BioDatabase` derivative with Verafinger -database settings, wrapped with the pipeline simple database connector. - -.. warning:: - - This class only provides a programmatic interface to load data in an orderly - manner, respecting usage protocols. It does **not** contain the raw - datafiles. You should procure those yourself. - -Notice that ``original_directory`` is set to -``rc[bob.db.verafinger.directory]``. You must make sure to set this value with -``bob config set bob.db.verafinger.directory`` to the place where you actually -installed the `vera fingervein`_ dataset, as explained in the section -:ref:`bob.bio.vein.baselines`. -""" - -logger.debug( - f"Loaded database verafinger config file, using protocol '{protocol}'." -) diff --git a/bob/bio/vein/config/maximum_curvature.py b/bob/bio/vein/config/maximum_curvature.py index 3935beccab847f5abdfa943ec45aa5e71f1ed881..3d13d8e77c4d627b7e4fcbf7fadb7c6b41a52fa6 100644 --- a/bob/bio/vein/config/maximum_curvature.py +++ b/bob/bio/vein/config/maximum_curvature.py @@ -74,7 +74,6 @@ extractor = ExtractorTransformer(MaximumCurvature()) Defaults taken from [TV13]_. """ -# biometric_algorithm = BioAlgorithmLegacy(MiuraMatch(), base_dir=legacy_temp_dir) biometric_algorithm = MiuraMatch() transformer = make_pipeline( diff --git a/bob/bio/vein/database/fv3d.py b/bob/bio/vein/database/fv3d.py deleted file mode 100644 index 7c60331ccd24934a220907f3fcc8be61029f6a63..0000000000000000000000000000000000000000 --- a/bob/bio/vein/database/fv3d.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : -# Fri 13 Jan 2017 14:46:06 CET - - -import numpy - -from bob.bio.base.database import BioDatabase, BioFile - -from . import AnnotatedArray - - -class File(BioFile): - """ - Implements extra properties of vein files for the 3D Fingervein database - - - Parameters: - - f (object): Low-level file (or sample) object that is kept inside - - """ - - def __init__(self, f): - - super(File, self).__init__( - client_id=f.finger.unique_name, path=f.path, file_id=f.id - ) - self.__f = f - - def load(self, *args, **kwargs): - """(Overrides base method) Loads both image and mask""" - - image = super(File, self).load(*args, **kwargs) - image = numpy.rot90(image, -1) - - if not self.__f.has_roi(): - return image - - else: - roi = self.__f.roi() - - # calculates the 90 degrees anti-clockwise rotated RoI points - w, h = image.shape - roi = [(x, h - y) for (y, x) in roi] - - return AnnotatedArray(image, metadata=dict(roi=roi)) - - -class Database(BioDatabase): - """ - Implements verification API for querying the 3D Fingervein database. - """ - - def __init__(self, **kwargs): - - super(Database, self).__init__(name="fv3d", **kwargs) - from bob.db.fv3d.query import Database as LowLevelDatabase - - self.__db = LowLevelDatabase() - - self.low_level_group_names = ("train", "dev", "eval") - self.high_level_group_names = ("world", "dev", "eval") - - def groups(self): - - return self.convert_names_to_highlevel( - self.__db.groups(), - self.low_level_group_names, - self.high_level_group_names, - ) - - def client_id_from_model_id(self, model_id, group="dev"): - """Required as ``model_id != client_id`` on this database""" - - return self.__db.finger_name_from_model_id(model_id) - - def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs): - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - return self.__db.model_ids(groups=groups, protocol=protocol) - - def objects( - self, - groups=None, - protocol=None, - purposes=None, - model_ids=None, - **kwargs - ): - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - retval = self.__db.objects( - groups=groups, - protocol=protocol, - purposes=purposes, - model_ids=model_ids, - **kwargs - ) - - return [File(f) for f in retval] - - def annotations(self, file): - return None diff --git a/bob/bio/vein/database/putvein.py b/bob/bio/vein/database/putvein.py deleted file mode 100644 index 3090d48b9b7fb1888a87596e43039ab83a124e0a..0000000000000000000000000000000000000000 --- a/bob/bio/vein/database/putvein.py +++ /dev/null @@ -1,233 +0,0 @@ -# vim: set fileencoding=utf-8 : - -""" -PUTVEIN database implementation of bob.bio.db.BioDatabase interface. -It is an extension of low level database interface, which directly talks to -PUTVEIN database for verification experiments (good to use in bob.bio.base -framework). -""" - -import numpy as np - -from bob.bio.base.database import BioDatabase, BioFile - - -# TODO: I know this is not DRY recommended, but that's life -# I might move this to a proper package. -def rgb_to_gray(image): - """ - Converts an RGB image to a grayscale image. - The formula is: - GRAY = 0.299 * R + 0.587 * G + 0.114 * B - - - Parameters - ---------- - - image : numpy.ndarray - An image in RGB format (channels first): For an ND array (N >= 3), - - - """ - - assert image.ndim == 3, "The image should have 3 dimensions" - - R = image[0, :, :] - G = image[1, :, :] - B = image[2, :, :] - - return 0.299 * R + 0.587 * G + 0.114 * B - - -class File(BioFile): - """ - Implements extra properties of vein files for the PUTVEIN database - - Parameters: - - f (object): Low-level file (or sample) object that is kept inside - """ - - def __init__(self, f): - super(File, self).__init__( - client_id=f.client_id, path=f.path, file_id=f.id - ) - - self.f = f - - def load(self, directory=None, extension=".bmp"): - """ - The image returned by the ``bob.db.putvein`` is RGB (with shape - (3, 768, 1024)). This method converts image to a greyscale (shape - (768, 1024)) and then rotates image by 270 deg so that images can be - used with ``bob.bio.vein`` algorythms designed for the - ``bob.db.biowave_v1`` database. - Output images dimentions - (1024, 768). - """ - color_image = self.f.load(directory=directory, extension=extension) - grayscale_image = rgb_to_gray(color_image) - grayscale_image = np.rot90(grayscale_image, k=3) - return grayscale_image - - -class PutveinBioDatabase(BioDatabase): - """ - Implements verification API for querying PUTVEIN database. - This class allows to use the following protocols: - - palm-L_1 - palm-LR_1 - palm-R_1 - palm-RL_1 - palm-R_BEAT_1 - - palm-L_4 - palm-LR_4 - palm-R_4 - palm-RL_4 - palm-R_BEAT_4 - - wrist-L_1 - wrist-LR_1 - wrist-R_1 - wrist-RL_1 - wrist-R_BEAT_1 - - wrist-L_4 - wrist-LR_4 - wrist-R_4 - wrist-RL_4 - wrist-R_BEAT_4 - """ - - def __init__(self, **kwargs): - - super(PutveinBioDatabase, self).__init__(name="putvein", **kwargs) - - from bob.db.putvein.query import Database as LowLevelDatabase - - self.__db = LowLevelDatabase() - - self.low_level_group_names = ("train", "dev", "eval") - self.high_level_group_names = ("world", "dev", "eval") - - def groups(self): - - return self.convert_names_to_highlevel( - self.__db.groups(), - self.low_level_group_names, - self.high_level_group_names, - ) - - def __protocol_split__(self, prot_name): - """ - Overrides the "high level" database names (see the list abowe) to the - low level ``protocols`` (currently there are 8 low level protocols: - L_1; - LR_1; - R_1; - RL_1; - R_BEAT_1; - L_4; - LR_4; - R_4; - RL_4; - R_BEAT_4; - And the kinds - wrist or palm. - The low level protocols are derived from the original 4: - L; - R; - LR; - RL; - please read the ``bob.db.putvein`` documentation. - """ - allowed_prot_names = [ - "palm-L_1", - "palm-LR_1", - "palm-R_1", - "palm-RL_1", - "palm-R_BEAT_1", - "palm-L_4", - "palm-LR_4", - "palm-R_4", - "palm-RL_4", - "palm-R_BEAT_4", - "wrist-L_1", - "wrist-LR_1", - "wrist-R_1", - "wrist-RL_1", - "wrist-R_BEAT_1", - "wrist-L_4", - "wrist-LR_4", - "wrist-R_4", - "wrist-RL_4", - "wrist-R_BEAT_4", - ] - - if prot_name not in allowed_prot_names: - raise IOError( - "Protocol name {} not allowed. Allowed names - {}".format( - prot_name, allowed_prot_names - ) - ) - - kind, prot = prot_name.split("-") - - return kind, prot - - def client_id_from_model_id(self, model_id, group="dev"): - """Required as ``model_id != client_id`` on this database""" - return self.__db.client_id_from_model_id(model_id) - - def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs): - """model_ids_with_protocol(groups = None, protocol = None, **kwargs) -> ids - - Returns a list of model ids for the given groups and given protocol. - - **Parameters:** - - groups : one or more of ``('world', 'dev', 'eval')`` - The groups to get the model ids for. - - protocol: a protocol name - - **Returns:** - - ids : [int] - The list of (unique) model ids for the given groups. - """ - kind, prot = self.__protocol_split__(protocol) - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - - return self.__db.model_ids(protocol=prot, groups=groups, kinds=kind) - - def objects( - self, - protocol=None, - groups=None, - purposes=None, - model_ids=None, - kinds=None, - **kwargs - ): - - kind, prot = self.__protocol_split__(protocol) - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - - retval = self.__db.objects( - protocol=prot, - groups=groups, - purposes=purposes, - model_ids=model_ids, - kinds=kind, - ) - return [File(f) for f in retval] - - def annotations(self, file): - return None diff --git a/bob/bio/vein/database/verafinger.py b/bob/bio/vein/database/verafinger.py deleted file mode 100644 index 397bb4a147e96f0d1651e23d407310a9b32ac15f..0000000000000000000000000000000000000000 --- a/bob/bio/vein/database/verafinger.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : -# Tue 27 Sep 2016 16:48:57 CEST - -import os - -from bob.bio.base.database import BioDatabase, BioFile - -from . import AnnotatedArray - - -class File(BioFile): - """ - Implements extra properties of vein files for the Vera Fingervein database - - - Parameters: - - f (object): Low-level file (or sample) object that is kept inside - - """ - - def __init__(self, f): - - id_ = f.finger.unique_name - if f.source == "pa": - id_ = "attack/%s" % id_ - super(File, self).__init__(client_id=id_, path=f.path, file_id=f.id) - self.__f = f - - def load(self, *args, **kwargs): - """(Overrides base method) Loads both image and mask""" - - image = super(File, self).load(*args, **kwargs) - basedir = args[0] if args else kwargs["directory"] - annotdir = os.path.join(basedir, "annotations", "roi") - if os.path.exists(annotdir): - roi = self.__f.roi(args[0]) - return AnnotatedArray(image, metadata=dict(roi=roi)) - return image - - -class Database(BioDatabase): - """ - Implements verification API for querying Vera Fingervein database. - """ - - def __init__(self, **kwargs): - - super(Database, self).__init__(name="verafinger", **kwargs) - from bob.db.verafinger.query import Database as LowLevelDatabase - - self._db = LowLevelDatabase() - - self.low_level_group_names = ("train", "dev") - self.high_level_group_names = ("world", "dev") - - def groups(self): - - return self.convert_names_to_highlevel( - self._db.groups(), - self.low_level_group_names, - self.high_level_group_names, - ) - - def client_id_from_model_id(self, model_id, group="dev"): - """Required as ``model_id != client_id`` on this database""" - - return self._db.finger_name_from_model_id(model_id) - - def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs): - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - if protocol.endswith("-va") or protocol.endswith("-VA"): - protocol = protocol[:-3] - return self._db.model_ids(groups=groups, protocol=protocol) - - def objects( - self, - groups=None, - protocol=None, - purposes=None, - model_ids=None, - **kwargs - ): - - groups = self.convert_names_to_lowlevel( - groups, self.low_level_group_names, self.high_level_group_names - ) - - if protocol.endswith("-va") or protocol.endswith("-VA"): - protocol = protocol[:-3] - if purposes == "probe": - purposes = "attack" - - retval = self._db.objects( - groups=groups, - protocol=protocol, - purposes=purposes, - model_ids=model_ids, - **kwargs - ) - - return [File(f) for f in retval] - - def annotations(self, file): - return None diff --git a/bob/bio/vein/script/validate.py b/bob/bio/vein/script/validate.py index b338959a7cbd3b579eb3ab7fdd7ec2f3205c64af..655f4e98dbd94f59a986c2f2bd52e640813ea4cd 100644 --- a/bob/bio/vein/script/validate.py +++ b/bob/bio/vein/script/validate.py @@ -175,81 +175,3 @@ def open_multipage_pdf_file(s): from matplotlib.backends.backend_pdf import PdfPages return PdfPages(s) - - -class validate_protocol(object): - """Validates the protocol for a given database - - - Parameters: - - name (str): The name of the database to validate the protocol for - - - Raises: - - schema.SchemaError: if the database is not supported - - """ - - def __init__(self, name): - - self.dbname = name - - if name == "fv3d": - import bob.db.fv3d - - self.valid_names = bob.db.fv3d.Database().protocol_names() - elif name == "verafinger": - import bob.db.verafinger - - self.valid_names = bob.db.verafinger.Database().protocol_names() - else: - raise schema.SchemaError("do not support database {}".format(name)) - - def __call__(self, name): - - if name not in self.valid_names: - msg = "{} is not a valid protocol for database {}" - raise schema.SchemaError(msg.format(name, self.dbname)) - - return True - - -class validate_group(object): - """Validates the group for a given database - - - Parameters: - - name (str): The name of the database to validate the group for - - - Raises: - - schema.SchemaError: if the database is not supported - - """ - - def __init__(self, name): - - self.dbname = name - - if name == "fv3d": - import bob.db.fv3d - - self.valid_names = bob.db.fv3d.Database().groups() - elif name == "verafinger": - import bob.db.verafinger - - self.valid_names = bob.db.verafinger.Database().groups() - else: - raise schema.SchemaError("do not support database {}".format(name)) - - def __call__(self, name): - - if name not in self.valid_names: - msg = "{} is not a valid group for database {}" - raise schema.SchemaError(msg.format(name, self.dbname)) - - return True diff --git a/bob/bio/vein/script/view_sample.py b/bob/bio/vein/script/view_sample.py index 16a2dafa95ffe66a70b8b21fab1c6c047c1b90f3..24511e3ec1664624d51fa59a73c63b46bc94ef62 100644 --- a/bob/bio/vein/script/view_sample.py +++ b/bob/bio/vein/script/view_sample.py @@ -225,10 +225,13 @@ def main(user_input=None): except schema.SchemaError as e: sys.exit(e) - if args["<database>"] == "fv3d": - from bob.bio.vein.config.fv3d import database as db - elif args["<database>"] == "verafinger": - from bob.bio.vein.config.verafinger import database as db + raise NotImplementedError("Supported databases are not implemented yet") + db = args["<database>"] + + # if args["<database>"] == "fv3d": + # from bob.bio.vein.config.fv3d import database as db + # elif args["<database>"] == "verafinger": + # from bob.bio.vein.config.verafinger import database as db database_replacement = "%s/.bob_bio_databases.txt" % os.environ["HOME"] db.replace_directories(database_replacement) diff --git a/bob/bio/vein/tests/test_databases.py b/bob/bio/vein/tests/test_databases.py index 2e4cf9fe5753ecc09f77e90de35042da1c7402d6..b53db117cb8d282dfdbc1cba759a88fb545561b9 100644 --- a/bob/bio/vein/tests/test_databases.py +++ b/bob/bio/vein/tests/test_databases.py @@ -4,12 +4,6 @@ import os -from nose.plugins.skip import SkipTest - -import bob.bio.base - -from bob.bio.base.test.test_database_implementations import check_database -from bob.bio.base.test.utils import db_available from bob.extension.download import get_file @@ -307,47 +301,3 @@ def test_utfvp(): for p in UtfvpDatabase.protocols(): assert p in checked_protocols, "Protocol {} untested".format(p) - - -@db_available("verafinger") -def test_verafinger(): - module = bob.bio.base.load_resource( - "verafinger", "config", preferred_package="bob.bio.vein" - ) - try: - check_database( - module.database, protocol="Fifty", groups=("dev", "eval") - ) - except IOError as e: - raise SkipTest( - "The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" - % e - ) - - -@db_available("fv3d") -def test_fv3d(): - module = bob.bio.base.load_resource( - "fv3d", "config", preferred_package="bob.bio.vein" - ) - try: - check_database(module.database, protocol="central", groups=("dev",)) - except IOError as e: - raise SkipTest( - "The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" - % e - ) - - -@db_available("putvein") -def test_putvein(): - module = bob.bio.base.load_resource( - "putvein", "config", preferred_package="bob.bio.vein" - ) - try: - check_database(module.database, protocol="wrist-LR_1", groups=("dev",)) - except IOError as e: - raise SkipTest( - "The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" - % e - ) diff --git a/buildout.cfg b/buildout.cfg index a593740beb8c9b81c7334fbf937b2c2dd74fdb96..e521a2b53e80dad5b472b68ab67a481d73c6cbac 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -4,10 +4,6 @@ [buildout] parts = scripts eggs = bob.bio.vein - bob.db.verafinger - bob.db.utfvp - bob.db.putvein - bob.db.fv3d extensions = bob.buildout develop = . diff --git a/doc/api.rst b/doc/api.rst index 52d12748282ce552eb83a61adcc5684f0ed867e5..13baecb9e2f2ac3172a3d3ce69b9eaa0a237063b 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -20,20 +20,12 @@ Common Utilities .. automodule:: bob.bio.vein.database -Vera Fingervein Database -======================== - -.. automodule:: bob.bio.vein.database.verafinger UTFVP Database ============== .. automodule:: bob.bio.vein.database.utfvp -3D Fingervein Database -====================== - -.. automodule:: bob.bio.vein.database.fv3d VERA Fingervein Contactless Database ==================================== diff --git a/doc/baselines.rst b/doc/baselines.rst index 0fd05d7ff2869fb8f679432c1579fd6fd7d1aacb..236cc791c10334cfc71b8bfce7f4a65a2072f340 100644 --- a/doc/baselines.rst +++ b/doc/baselines.rst @@ -25,8 +25,8 @@ Repeated Line-Tracking with Miura Matching Detailed description at :ref:`bob.bio.vein.resources.recognition.rlt`. -To run the baseline on the `VERA fingervein`_ database, using the ``Nom`` -protocol, do the following: +To run the baseline on the ``VERA fingervein`` database, using the ``Nom`` +protocol (deprecated), do the following: .. code-block:: sh @@ -53,7 +53,7 @@ protocol, do the following: This command line selects and runs the following implementations for the toolchain: -* :ref:`bob.bio.vein.resources.database.verafinger` +* ``bob.bio.vein.resources.database.verafinger`` * :ref:`bob.bio.vein.resources.recognition.rlt` As the tool runs, you'll see printouts that show how it advances through @@ -86,7 +86,7 @@ Maximum Curvature with Miura Matching Detailed description at :ref:`bob.bio.vein.resources.recognition.mc`. -To run the baseline on the `VERA fingervein`_ database, using the ``Nom`` +To run the baseline on the ``VERA fingervein`` database, using the ``Nom`` protocol like above, do the following: @@ -98,7 +98,7 @@ protocol like above, do the following: This command line selects and runs the following implementations for the toolchain: -* :ref:`bob.bio.vein.resources.database.verafinger` +* ``bob.bio.vein.resources.database.verafinger`` * :ref:`bob.bio.vein.resources.recognition.mc` In a 4-core machine and using 4 parallel tasks, it takes around 1 hour and 40 @@ -127,7 +127,7 @@ Wide Line Detector with Miura Matching You can find the description of this method on the paper from Huang *et al.* [HDLTL10]_. -To run the baseline on the `VERA fingervein`_ database, using the ``Nom`` +To run the baseline on the ``VERA fingervein`` database, using the ``Nom`` protocol like above, do the following: @@ -139,7 +139,7 @@ protocol like above, do the following: This command line selects and runs the following implementations for the toolchain: -* :ref:`bob.bio.vein.resources.database.verafinger` +* ``bob.bio.vein.resources.database.verafinger`` * :ref:`bob.bio.vein.resources.recognition.wld` In a 4-core machine and using 4 parallel tasks, it takes only around 5 minutes diff --git a/doc/installation.rst b/doc/installation.rst index 8980cda8bbb3abbb684a1f30e48a6378bb2a0b79..b74b80e028713408a5f977f046f3e3e1ea4eca36 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -23,16 +23,6 @@ package: $ conda install bob.bio.vein -You must also install drivers for all database interfaces you may want to use. -The next command line install some of the available drivers: - -.. code-block:: sh - - $ conda install bob.db.utfvp bob.db.verafinger - -For a list of currently maintained database drivers, you may check `this file <https://gitlab.idiap.ch/bob/bob.bio.vein/blob/master/test-requirements.txt>`_. - - Setting up Databases -------------------- @@ -53,10 +43,10 @@ to run the baselines. The current system readily supports the following freely available datasets: -* ``vera``: `Vera Fingervein`_ * ``utfvp``: `UTFVP`_ -* ``fv3d``: `3D Fingervein`_ +.. * ``vera``: ``VERA fingervein`` +.. * ``fv3d``: `3D Fingervein`_ .. * ``put``: `PUT`_ Vein Dataset diff --git a/doc/resources.rst b/doc/resources.rst index 56f30d5679c53c4f7e1457abe8903467a30c2913..1d6b9407696a4d219a72090c1916e82e67afad5f 100644 --- a/doc/resources.rst +++ b/doc/resources.rst @@ -27,15 +27,6 @@ the following runtime attributes of ``verify.py``: * ``protocol`` -.. _bob.bio.vein.resources.database.verafinger: - -Verafinger Database -=================== - -.. .. automodule:: bob.bio.vein.config.database.verafinger -.. :members: - - .. _bob.bio.vein.resources.database.utfvp: UTFVP Database @@ -44,23 +35,6 @@ UTFVP Database .. .. automodule:: bob.bio.vein.config.database.utfvp .. :members: -.. _bob.bio.vein.resources.database.fv3d: - -3D Fingervein Database -====================== - -.. .. automodule:: bob.bio.vein.config.database.fv3d -.. :members: - - -.. _bob.bio.vein.resources.database.putvein: - -PUT Vein Databas -====================== - -.. .. automodule:: bob.bio.vein.config.database.putvein -.. :members: - .. _bob.bio.vein.resources.recognition: diff --git a/setup.py b/setup.py index 8be30a304a1f955fe1563140e88449ef2f6632f1..e2a0e0da8465ea11bab98be6f7c8974ba7329259 100644 --- a/setup.py +++ b/setup.py @@ -26,29 +26,10 @@ setup( entry_points={ "bob.bio.config": [ # protocols (must be specified before the database in the cmd) - # verafinger - "Nom = bob.bio.vein.config.database.protocol_verafinger.nom", - "Cropped-Nom = bob.bio.vein.config.database.protocol_verafinger.cropped_nom", - "Full = bob.bio.vein.config.database.protocol_verafinger.full", - "Cropped-Full = bob.bio.vein.config.database.protocol_verafinger.cropped_full", # utfvp "nom = bob.bio.vein.config.database.utfvp_nom", "full = bob.bio.vein.config.database.utfvp_full", "1vsall = bob.bio.vein.config.database.utfvp_1vsall", - # fv3d - "central = bob.bio.vein.config.database.protocol_fv3d.central", - "left = bob.bio.vein.config.database.protocol_fv3d.left", - "right = bob.bio.vein.config.database.protocol_fv3d.right", - "stitched = bob.bio.vein.config.database.protocol_fv3d.stitched", - # putvein - "wrist-LR-1 = bob.bio.vein.config.database.protocol_putvein.wrist_lr_1", - "wrist-LR-4 = bob.bio.vein.config.database.protocol_putvein.wrist_lr_4", - "palm-LR-1 = bob.bio.vein.config.database.protocol_putvein.palm_lr_1", - "palm-LR-4 = bob.bio.vein.config.database.protocol_putvein.palm_lr_4", - # legacy databases - "verafinger = bob.bio.vein.config.database.verafinger", - "fv3d = bob.bio.vein.config.database.fv3d", - "putvein = bob.bio.vein.config.database.putvein", # legacy baselines "mc = bob.bio.vein.config.maximum_curvature", "rlt = bob.bio.vein.config.repeated_line_tracking", @@ -57,10 +38,7 @@ setup( "vera_nom = bob.bio.vein.config.database.verafinger_contactless_nom", ], "bob.bio.database": [ - "verafinger = bob.bio.vein.config.database.verafinger:database", "utfvp = bob.bio.vein.config.database.utfvp_nom:database", - "fv3d = bob.bio.vein.config.database.fv3d:database", - "putvein = bob.bio.vein.config.database.putvein:database", "verafinger_contactless = bob.bio.vein.config.database.verafinger_contactless_nom:database", ], "bob.bio.pipeline": [ diff --git a/test-requirements.txt b/test-requirements.txt index da6c7fb7fd17632515b685e7af65521fdb3e5df8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +0,0 @@ -bob.db.atnt