Commit 70507d21 authored by Victor BROS's avatar Victor BROS
Browse files

[py] Porting to the new bob.bio.base

parent c78cdef7
Pipeline #44020 failed with stage
in 7 minutes and 27 seconds
...@@ -58,8 +58,8 @@ class MiuraMatch (Algorithm): ...@@ -58,8 +58,8 @@ class MiuraMatch (Algorithm):
ch = ch, ch = ch,
cw = cw, cw = cw,
multiple_model_scoring = None, #multiple_model_scoring = None,
multiple_probe_scoring = None #multiple_probe_scoring = None
) )
self.ch = ch self.ch = ch
......
...@@ -12,16 +12,37 @@ You can download the raw data of the `VERA Fingervein`_ database by following ...@@ -12,16 +12,37 @@ You can download the raw data of the `VERA Fingervein`_ database by following
the link. 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_directory = _verafinger_directory,
original_extension = '.png', original_extension = '.png',
protocol = protocol),
annotation_type = None,
fixed_positions = None
) )
"""The :py:class:`bob.bio.base.database.BioDatabase` derivative with Verafinger """The :py:class:`bob.bio.base.database.BioDatabase` derivative with Verafinger
database settings database settings
...@@ -37,16 +58,4 @@ value to the place where you actually installed the Verafinger Database, as ...@@ -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`. 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.
"""
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# vim: set fileencoding=utf-8 : # vim: set fileencoding=utf-8 :
# Tue 27 Sep 2016 16:48:16 CEST # 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: References:
...@@ -10,31 +10,41 @@ References: ...@@ -10,31 +10,41 @@ References:
2. [TV13]_ 2. [TV13]_
3. [TVM14]_ 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, \ from bob.bio.base.transformers import PreprocessorTransformer
NoFilter, Preprocessor 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( from bob.bio.vein.preprocessor import (
crop=NoCrop(), NoCrop,
mask=TomesLeeMask(), TomesLeeMask,
normalize=HuangNormalization(), HuangNormalization,
filter=NoFilter(), NoFilter,
Preprocessor,
)
preprocessor = PreprocessorTransformer(
Preprocessor(
crop=NoCrop(),
mask=TomesLeeMask(),
normalize=HuangNormalization(),
filter=NoFilter(),
) )
)
"""Preprocessing using gray-level based finger cropping and no post-processing """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 """Features are the output of the maximum curvature algorithm, as described on
[HDLTL10]_. [HDLTL10]_.
...@@ -43,9 +53,15 @@ Defaults taken from [TV13]_. ...@@ -43,9 +53,15 @@ Defaults taken from [TV13]_.
# Notice the values of ch and cw are different than those from the # Notice the values of ch and cw are different than those from the
# repeated-line tracking **and** maximum curvature baselines. # repeated-line tracking **and** maximum curvature baselines.
from ..algorithm import MiuraMatch from bob.bio.vein.algorithm import MiuraMatch
algorithm = MiuraMatch(ch=18, cw=28)
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 """Miura-matching algorithm with specific settings for search displacement
Defaults taken from [TV13]_. Defaults taken from [TV13]_.
""" """
transformer = make_pipeline(wrap(["sample"], preprocessor), wrap(["sample"], extractor))
pipeline = VanillaBiometricsPipeline(transformer, biometric_algorithm)
...@@ -49,6 +49,14 @@ setup( ...@@ -49,6 +49,14 @@ setup(
'grid = bob.bio.vein.configurations.gridio4g48', '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': [ 'console_scripts': [
'bob_bio_vein_compare_rois.py = bob.bio.vein.script.compare_rois:main', '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', 'bob_bio_vein_view_sample.py = bob.bio.vein.script.view_sample:main',
......
Supports Markdown
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