New processor API
Working with the new bob.pipelines
API in bob.bio.base
.
Merge request reports
Activity
added 2 commits
mentioned in merge request bob.pipelines!6 (merged)
Hi guys, this is one step towards the integration of our new pipeline mechanism with
bob.bio.base
. If youbuildout
this branch developingbob.pipelines
, you can type this example to see how it goes../bin/bob pipelines vanilla-biometrics ./src/bob.bio.base/bob/bio/base/config/baselines/pca_atnt.py -o ./example/
Following the discussions with @amohammadi, follow the skeleton of the vanilla-biometrics pipeline. https://gitlab.idiap.ch/bob/bob.bio.base/blob/new-processing-API/bob/bio/base/pipelines/vanilla_biometrics/pipeline.py
It didn't changed much, but basically all the checkpoint shenenigans are gone. Comparators and Estimators should handle this themselves. WARNING. This is not the final setup, but it's going to look like more/less like this,
Follow below a macro list of tasks to be completed before the final merge (not to master, but to the other branch)
-
Make this pipeline work with dask. The idea is; once you do
dask_it(pipeline)
everything should work flawlessly. Propably we would need to play around with https://gitlab.idiap.ch/bob/bob.bio.base/blob/62ddf1a3bc440560044413d15c4d904569c5ac46/bob/bio/base/pipelines/vanilla_biometrics/pipeline.py#L68 to make it work properly. Let's see. -
Implement the checkpoint mixing for the
Comparators
. - Implement Mixins for the legacy stuff
- Implement Comparator for the legacy stuff
- Remove unecessary stuff from the package (file database API for instance)
Edited by Tiago de Freitas Pereira-
Make this pipeline work with dask. The idea is; once you do
added 2 commits
Hi guys,
Another step foward in the
vanilla-biometrics
. Still have some work to be done (look at the macro checklist above).Today I put in place the dask thingy.
Now, if you want to dask the WHOLE
vanilla-biometrics
, you just need todask_it
the scikit pipeline. If want to debug and run stuff locally, just remove the dask verb that everything works flawlessly. You can also checkpoint or not your thingsFollow a possible config file to be triggered with
bob pipelines vanilla-biometrics
.# Database setup import bob.db.atnt from bob.bio.base.pipelines.vanilla_biometrics.legacy import DatabaseConnector database = DatabaseConnector(bob.db.atnt.Database(), protocol="Default") from sklearn.pipeline import Pipeline, make_pipeline from sklearn.decomposition import PCA # USING THE PCA FROM SCIKIT MIXED WITH OUR STUFF from bob.pipelines.mixins import CheckpointMixin, SampleMixin from bob.bio.base.mixins import CheckpointSampleLinearize class CheckpointSamplePCA(CheckpointMixin, SampleMixin, PCA): pass from bob.pipelines.mixins import dask_it extractor = Pipeline(steps=[('0',CheckpointSampleLinearize(features_dir="./example/extractor0")), ('1',CheckpointSamplePCA(features_dir="./example/extractor1", model_path="./example/pca.pkl"))]) # DASKING THE PIPELINE extractor = dask_it(extractor) # BIOMETRIC ALGORITHM from bob.bio.base.pipelines.vanilla_biometrics.biometric_algorithm import Distance, BiometricAlgorithmCheckpointMixin class CheckpointDistance(BiometricAlgorithmCheckpointMixin, Distance): pass algorithm = CheckpointDistance(features_dir="./example/")
Let me know what do you think.
Cheers
added 1 commit
- 499ed374 - Created legacy mixin for preprocessor and extractors
Hi guys,
Update.
-
I implemented something on
bob.pipelines
that helps us to integrate ourSamples
with scikit (and ours) supervised models (https://gitlab.idiap.ch/bob/bob.bio.base/blob/dc22f7ea72ce4656ebac7b925ff43f88fcb823eb/bob/bio/base/pipelines/vanilla_biometrics/pipeline.py#L44). -
The legacy integration is half way done. Full update when it's 100% done.
-
BiometricAlgorithm (a.k.a Comparator) is finished for legacy stuff.
Basically i created 3 classes to handle our legacy stuff on bob.bio.base.
-
LegacyProcessorMixin
(https://gitlab.idiap.ch/bob/bob.bio.base/blob/debfe7de112f4195593f63aad2abec5117deeadd/bob/bio/base/mixins/legacy.py#L43). This one is supposed to handlePreprocessors
andExtractors
. They can be mixed in with whaterver mixins we created. Basically itstransform
function maps with__call__
-
LegacyAlgorithmMixin
(https://gitlab.idiap.ch/bob/bob.bio.base/blob/debfe7de112f4195593f63aad2abec5117deeadd/bob/bio/base/mixins/legacy.py#L91). This one handles one part ofbob.bio.base.algorithm.Algorithm
. Itsfit
maps to thebob.bio.base.algorithm.Algorithm.train_projector
and itstransform
maps tobob.bio.base.algorithm.Algorithm.project
. Since thetrain_projector
function always save its content, this class HAS TO BE CHECKPOINTABLE. -
LegacyBiometricAlgorithm
(https://gitlab.idiap.ch/bob/bob.bio.base/blob/debfe7de112f4195593f63aad2abec5117deeadd/bob/bio/base/pipelines/vanilla_biometrics/legacy.py#L195). This one handles the second part of thebob.bio.base.algorithm.Algorithm
, which is do theenroll
`score`.
Monday I'll do a major clean up in this MR and I would like to meet with you either on Tuesday/Wednesday for a personal (zoom) discussion.
Cheers and have a nice weekend
-
added 2 commits
added 2 commits