Skip to content
Snippets Groups Projects
Commit 5317f720 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Created a dummy baseline for test

parent bd556dc2
Branches
Tags
1 merge request!64Dask pipelines
from bob.pipelines import wrap
from sklearn.pipeline import make_pipeline
from bob.bio.base.pipelines.vanilla_biometrics import (
Distance,
VanillaBiometricsPipeline,
)
from bob.pipelines.transformers import SampleLinearize
if "database" in locals():
annotation_type = database.annotation_type
fixed_positions = database.fixed_positions
else:
annotation_type = None
fixed_positions = None
import bob.ip.color
from sklearn.base import TransformerMixin, BaseEstimator
class ToGray(TransformerMixin, BaseEstimator):
def transform(self, X, annotations=None):
return [bob.ip.color.rgb_to_gray(data)[0:10,0:10] for data in X]
def _more_tags(self):
return {"stateless": True, "requires_fit": False}
def fit(self, X, y=None):
return self
def load(annotation_type, fixed_positions=None):
transform_extra_arguments = (("annotations", "annotations"),)
transformer = make_pipeline(
wrap(
["sample"],
ToGray(),
transform_extra_arguments=transform_extra_arguments,
),
SampleLinearize(),
)
algorithm = Distance()
return VanillaBiometricsPipeline(transformer, algorithm)
pipeline = load(annotation_type, fixed_positions)
transformer = pipeline.transformer
...@@ -143,6 +143,7 @@ setup( ...@@ -143,6 +143,7 @@ setup(
'arcface_insight_tf = bob.bio.face.config.baseline.arcface_insight_tf:transformer', 'arcface_insight_tf = bob.bio.face.config.baseline.arcface_insight_tf:transformer',
'gabor_graph = bob.bio.face.config.baseline.gabor_graph:transformer', 'gabor_graph = bob.bio.face.config.baseline.gabor_graph:transformer',
'lgbphs = bob.bio.face.config.baseline.lgbphs:transformer', 'lgbphs = bob.bio.face.config.baseline.lgbphs:transformer',
'dummy = bob.bio.face.config.baseline.dummy:transformer',
], ],
#baselines #baselines
...@@ -156,6 +157,7 @@ setup( ...@@ -156,6 +157,7 @@ setup(
'arcface_insight_tf = bob.bio.face.config.baseline.arcface_insight_tf:pipeline', 'arcface_insight_tf = bob.bio.face.config.baseline.arcface_insight_tf:pipeline',
'lgbphs = bob.bio.face.config.baseline.lgbphs:pipeline', 'lgbphs = bob.bio.face.config.baseline.lgbphs:pipeline',
'lda = bob.bio.face.config.baseline.lda:pipeline', 'lda = bob.bio.face.config.baseline.lda:pipeline',
'dummy = bob.bio.face.config.baseline.dummy:pipeline',
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment