Commit 6e201f17 authored by Laurent COLBOIS's avatar Laurent COLBOIS
Browse files

Fix lookup of database config (previous version did not work)

parent d34a578e
Pipeline #50814 passed with stage
in 26 minutes and 21 seconds
......@@ -4,7 +4,9 @@ from bob.bio.face.embeddings.tf2_inception_resnet import (
from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -21,7 +21,9 @@ import logging
logger = logging.getLogger(__name__)
#### SOLVING IF THERE'S ANY DATABASE INFORMATION
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def get_pipeline(face_cropper, transform_extra_arguments):
......
......@@ -7,12 +7,12 @@ import logging
logger = logging.getLogger(__name__)
def lookup_config_from_database():
def lookup_config_from_database(database):
"""
Read configuration values that might be already defined in the database configuration
file.
"""
if "database" in locals():
if database is not None:
annotation_type = database.annotation_type
fixed_positions = database.fixed_positions
memory_demanding = (
......
......@@ -4,7 +4,9 @@ from bob.bio.face.embeddings.tf2_inception_resnet import (
from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -5,7 +5,9 @@ from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -5,7 +5,9 @@ from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -4,7 +4,9 @@ from bob.bio.face.embeddings.tf2_inception_resnet import (
from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -22,7 +22,9 @@ import logging
logger = logging.getLogger(__name__)
#### SOLVING IF THERE'S ANY DATABASE INFORMATION
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
####### SOLVING THE FACE CROPPER TO BE USED ##########
......@@ -70,9 +72,7 @@ def load(annotation_type, fixed_positions=None):
### BIOMETRIC ALGORITHM
algorithm = BioAlgorithmLegacy(
lda,
base_dir=tempdir,
projector_file=os.path.join(tempdir, "Projector.hdf5"),
lda, base_dir=tempdir, projector_file=os.path.join(tempdir, "Projector.hdf5"),
)
return VanillaBiometricsPipeline(transformer, algorithm)
......
......@@ -17,7 +17,9 @@ import bob.math
#### SOLVING IF THERE'S ANY DATABASE INFORMATION
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def get_pipeline(face_cropper, transform_extra_arguments):
......
......@@ -3,7 +3,9 @@ from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import arcface_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -3,7 +3,9 @@ from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import arcface_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -3,7 +3,9 @@ from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import arcface_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
......@@ -3,7 +3,9 @@ from bob.bio.face.embeddings.tf2_inception_resnet import InceptionResnetv2
from bob.bio.face.config.baseline.helpers import lookup_config_from_database
from bob.bio.face.config.baseline.templates import facenet_baseline
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database()
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None):
......
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