diff --git a/bob/bio/vein/algorithm/MiuraMatch.py b/bob/bio/vein/algorithm/MiuraMatch.py index b5ade6196f601e7b692c15078ec72a2f9fc8be03..379a303cbf49b42c669fa2ac1f9625b656bba71b 100644 --- a/bob/bio/vein/algorithm/MiuraMatch.py +++ b/bob/bio/vein/algorithm/MiuraMatch.py @@ -58,8 +58,8 @@ class MiuraMatch (Algorithm): ch = ch, cw = cw, - multiple_model_scoring = None, - multiple_probe_scoring = None + #multiple_model_scoring = None, + #multiple_probe_scoring = None ) self.ch = ch diff --git a/bob/bio/vein/configurations/verafinger.py b/bob/bio/vein/configurations/verafinger.py index ee23e42f1180e8effa8a30ff47b608fb5ee3aaf8..7be25f8c1798585c76b10b904e7044fa9ad6fc3f 100644 --- a/bob/bio/vein/configurations/verafinger.py +++ b/bob/bio/vein/configurations/verafinger.py @@ -12,16 +12,37 @@ You can download the raw data of the `VERA Fingervein`_ database by following the link. """ +from bob.extension import rc +from bob.bio.vein.database.verafinger import Database +from bob.bio.base.pipelines.vanilla_biometrics import DatabaseConnector -from ..database.verafinger import Database +_verafinger_directory = rc["bob.db.verafinger.directory"] +"""Value of ``~/.bobrc`` for this database""" -_verafinger_directory = "[YOUR_VERAFINGER_DIRECTORY]" -"""Value of ``~/.bob_bio_databases.txt`` for this database""" -database = Database( +protocol = 'Nom' +"""The default protocol to use for tests + +You may modify this at runtime by specifying the option ``--protocol`` on the +command-line of ``verify.py`` or using the keyword ``protocol`` on a +configuration file that is loaded **after** this configuration resource. + +We accept any biometric recognition protocol implemented by bob.db.verafinger. +Variants of the biometric recognition protocol ending in ``-va`` can be used to +test for vulnerability analysis. For example, use the protocol ``Nom-va`` to +test the vulnerability of a biometric recognition pipeline using the ``Nom`` +protocol for enrollment and probe samples from presentation attacks. +""" + +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 @@ -37,16 +58,4 @@ value to the place where you actually installed the Verafinger Database, as explained in the section :ref:`bob.bio.vein.baselines`. """ -protocol = 'Nom' -"""The default protocol to use for tests - -You may modify this at runtime by specifying the option ``--protocol`` on the -command-line of ``verify.py`` or using the keyword ``protocol`` on a -configuration file that is loaded **after** this configuration resource. -We accept any biometric recognition protocol implemented by bob.db.verafinger. -Variants of the biometric recognition protocol ending in ``-va`` can be used to -test for vulnerability analysis. For example, use the protocol ``Nom-va`` to -test the vulnerability of a biometric recognition pipeline using the ``Nom`` -protocol for enrollment and probe samples from presentation attacks. -""" diff --git a/bob/bio/vein/configurations/wide_line_detector.py b/bob/bio/vein/configurations/wide_line_detector.py index 8b2662c08f0ab4ed3e9b1f42b92dcdaddd9e167c..63ec6fd94beaf29288487f74ae3bb3dafa960a52 100644 --- a/bob/bio/vein/configurations/wide_line_detector.py +++ b/bob/bio/vein/configurations/wide_line_detector.py @@ -2,7 +2,7 @@ # vim: set fileencoding=utf-8 : # Tue 27 Sep 2016 16:48:16 CEST -'''Huang's Wide-Line Detector and Miura Matching baseline +"""Huang's Wide-Line Detector and Miura Matching baseline References: @@ -10,31 +10,41 @@ References: 2. [TV13]_ 3. [TVM14]_ -''' - -sub_directory = 'wld' -"""Sub-directory where results will be placed. - -You may change this setting using the ``--sub-directory`` command-line option -or the attribute ``sub_directory`` in a configuration file loaded **after** -this resource. """ -from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \ - NoFilter, Preprocessor +from bob.bio.base.transformers import PreprocessorTransformer +from bob.bio.base.transformers import ExtractorTransformer +from bob.bio.base.pipelines.vanilla_biometrics import ( + VanillaBiometricsPipeline, + BioAlgorithmLegacy, +) +from sklearn.pipeline import make_pipeline +from bob.pipelines import wrap -preprocessor = Preprocessor( - crop=NoCrop(), - mask=TomesLeeMask(), - normalize=HuangNormalization(), - filter=NoFilter(), +from bob.bio.vein.preprocessor import ( + NoCrop, + TomesLeeMask, + HuangNormalization, + NoFilter, + Preprocessor, +) + +preprocessor = PreprocessorTransformer( + Preprocessor( + crop=NoCrop(), + mask=TomesLeeMask(), + normalize=HuangNormalization(), + filter=NoFilter(), ) +) + + """Preprocessing using gray-level based finger cropping and no post-processing """ -from ..extractor import WideLineDetector +from bob.bio.vein.extractor import WideLineDetector -extractor = WideLineDetector() +extractor = ExtractorTransformer(WideLineDetector()) """Features are the output of the maximum curvature algorithm, as described on [HDLTL10]_. @@ -43,9 +53,15 @@ Defaults taken from [TV13]_. # Notice the values of ch and cw are different than those from the # repeated-line tracking **and** maximum curvature baselines. -from ..algorithm import MiuraMatch -algorithm = MiuraMatch(ch=18, cw=28) +from bob.bio.vein.algorithm import MiuraMatch + +biometric_algorithm = BioAlgorithmLegacy( + MiuraMatch(ch=18, cw=28), base_dir="/idiap/temp/vbros/pipeline_test/verafinger" +) """Miura-matching algorithm with specific settings for search displacement Defaults taken from [TV13]_. """ +transformer = make_pipeline(wrap(["sample"], preprocessor), wrap(["sample"], extractor)) + +pipeline = VanillaBiometricsPipeline(transformer, biometric_algorithm) diff --git a/setup.py b/setup.py index 986e76be7263be8ea30a5e749641668d0e388d0c..05d616f7d68b22c4ac78dc0c760999e7658df0ac 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,14 @@ setup( 'grid = bob.bio.vein.configurations.gridio4g48', ], + 'bob.bio.database': [ + 'verafinger = bob.bio.vein.configurations.verafinger:database', + ], + + 'bob.bio.pipeline': [ + 'wld = bob.bio.vein.configurations.wide_line_detector:pipeline' + ], + 'console_scripts': [ 'bob_bio_vein_compare_rois.py = bob.bio.vein.script.compare_rois:main', 'bob_bio_vein_view_sample.py = bob.bio.vein.script.view_sample:main',