[nosetest] Fixed baselines

parent 37269599
Pipeline #46278 failed with stage
in 12 minutes and 3 seconds
......@@ -12,8 +12,7 @@ References:
"""
from tempfile import TemporaryDirectory
from pathlib import Path
import tempfile
import os
from bob.bio.base.transformers import PreprocessorTransformer
......@@ -38,14 +37,19 @@ from bob.bio.vein.algorithm import MiuraMatch
"""Baseline updated with the wrapper for the pipelines package"""
"""Sub-directory where temporary files are saved"""
sub_directory = 'rlt'
user_temp = Path("/idiap/") / "temp" / os.environ["USER"]
if user_temp.exists():
# use /idiap/temp/<USER>/bob_bio_vein_tmp/<SUBDIRECTORY>/
legacy_temp_dir = user_temp / "bob_bio_vein_tmp" / sub_directory
sub_directory = "rlt"
default_temp = (
os.path.join("/idiap", "temp", os.environ["USER"])
if "USER" in os.environ
else "~/temp"
)
if os.path.exists(default_temp):
legacy_temp_dir = os.path.join(default_temp, "bob_bio_base_tmp", sub_directory)
else:
# if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
legacy_temp_dir = TemporaryDirectory().name
legacy_temp_dir = tempfile.TemporaryDirectory().name
"""Preprocessing using gray-level based finger cropping and no post-processing
"""
......@@ -69,9 +73,7 @@ extractor = ExtractorTransformer(MaximumCurvature())
Defaults taken from [TV13]_.
"""
biometric_algorithm = BioAlgorithmLegacy(
MiuraMatch(), base_dir=legacy_temp_dir
)
biometric_algorithm = BioAlgorithmLegacy(MiuraMatch(), base_dir=legacy_temp_dir)
transformer = make_pipeline(wrap(["sample"], preprocessor), wrap(["sample"], extractor))
pipeline = VanillaBiometricsPipeline(transformer, biometric_algorithm)
......@@ -35,17 +35,14 @@ from bob.bio.vein.extractor import PrincipalCurvature
legacy_extractor = PrincipalCurvature()
from bob.bio.base.transformers import (
PreprocessorTransformer,
ExtractorTransformer
)
from bob.bio.base.transformers import PreprocessorTransformer, ExtractorTransformer
from sklearn.pipeline import make_pipeline
from bob.pipelines import wrap
transformer = make_pipeline(
wrap(["sample"], PreprocessorTransformer(legacy_preprocessor)),
wrap(["sample"], ExtractorTransformer(legacy_extractor))
wrap(["sample"], ExtractorTransformer(legacy_extractor)),
)
......@@ -60,18 +57,21 @@ Defaults taken from [TV13]_.
"""
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import tempfile
sub_directory = "pc"
user_temp = Path("/idiap/") / "temp" / os.environ["USER"]
if user_temp.exists():
# use /idiap/temp/<USER>/bob_bio_vein_tmp/<SUBDIRECTORY>/
legacy_temp_dir = user_temp / "bob_bio_vein_tmp" / sub_directory
default_temp = (
os.path.join("/idiap", "temp", os.environ["USER"])
if "USER" in os.environ
else "~/temp"
)
if os.path.exists(default_temp):
legacy_temp_dir = os.path.join(default_temp, "bob_bio_base_tmp", sub_directory)
else:
# if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
legacy_temp_dir = TemporaryDirectory().name
legacy_temp_dir = tempfile.TemporaryDirectory().name
from bob.bio.base.pipelines.vanilla_biometrics import (
......@@ -79,9 +79,6 @@ from bob.bio.base.pipelines.vanilla_biometrics import (
BioAlgorithmLegacy,
)
biometric_algorithm = BioAlgorithmLegacy(
legacy_algorithm,
base_dir=legacy_temp_dir,
)
biometric_algorithm = BioAlgorithmLegacy(legacy_algorithm, base_dir=legacy_temp_dir,)
pipeline = VanillaBiometricsPipeline(transformer, biometric_algorithm)
......@@ -11,8 +11,7 @@ References:
3. [TVM14]_
"""
from tempfile import TemporaryDirectory
from pathlib import Path
import tempfile
import os
from bob.bio.base.transformers import PreprocessorTransformer
......@@ -37,14 +36,18 @@ from bob.bio.vein.algorithm import MiuraMatch
"""Baseline updated with the wrapper for the pipelines package"""
"""Sub-directory where temporary files are saved"""
sub_directory = 'rlt'
user_temp = Path("/idiap/") / "temp" / os.environ["USER"]
if user_temp.exists():
# use /idiap/temp/<USER>/bob_bio_vein_tmp/<SUBDIRECTORY>/
legacy_temp_dir = user_temp / "bob_bio_vein_tmp" / sub_directory
sub_directory = "rlt"
default_temp = (
os.path.join("/idiap", "temp", os.environ["USER"])
if "USER" in os.environ
else "~/temp"
)
if os.path.exists(default_temp):
legacy_temp_dir = os.path.join(default_temp, "bob_bio_base_tmp", sub_directory)
else:
# if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
legacy_temp_dir = TemporaryDirectory().name
legacy_temp_dir = tempfile.TemporaryDirectory().name
"""Preprocessing using gray-level based finger cropping and no post-processing
"""
......
......@@ -11,8 +11,7 @@ References:
3. [TVM14]_
"""
from tempfile import TemporaryDirectory
from pathlib import Path
import tempfile
import os
from bob.bio.base.transformers import PreprocessorTransformer
......@@ -38,14 +37,18 @@ from bob.bio.vein.algorithm import MiuraMatch
"""Baseline updated with the wrapper for the pipelines package"""
"""Sub-directory where temporary files are saved"""
sub_directory = 'wld'
user_temp = Path("/idiap/") / "temp" / os.environ["USER"]
if user_temp.exists():
# use /idiap/temp/<USER>/bob_bio_vein_tmp/<SUBDIRECTORY>/
legacy_temp_dir = user_temp / "bob_bio_vein_tmp" / sub_directory
sub_directory = "wld"
default_temp = (
os.path.join("/idiap", "temp", os.environ["USER"])
if "USER" in os.environ
else "~/temp"
)
if os.path.exists(default_temp):
legacy_temp_dir = os.path.join(default_temp, "bob_bio_base_tmp", sub_directory)
else:
# if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
legacy_temp_dir = TemporaryDirectory().name
legacy_temp_dir = tempfile.TemporaryDirectory().name
"""Preprocessing using gray-level based finger cropping and no post-processing
"""
......
Markdown is supported
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