Skip to content
Snippets Groups Projects
Verified Commit fc296d9f authored by Yannick DAYER's avatar Yannick DAYER
Browse files

fix: minor refactor, add comments, remove old code

parent 8ad58a4c
Branches
Tags
No related merge requests found
...@@ -27,7 +27,7 @@ from bob.bio.face.embeddings.mxnet import arcface_insightFace_lresnet100 ...@@ -27,7 +27,7 @@ from bob.bio.face.embeddings.mxnet import arcface_insightFace_lresnet100
from bob.bio.face.embeddings.opencv import vgg16_oxford_baseline from bob.bio.face.embeddings.opencv import vgg16_oxford_baseline
max_attempts = 2 max_attempts = 1
logger = clapper.logging.setup("bob") logger = clapper.logging.setup("bob")
logger.setLevel("DEBUG") logger.setLevel("DEBUG")
...@@ -77,19 +77,18 @@ baselines = [MobileFaceNet] ...@@ -77,19 +77,18 @@ baselines = [MobileFaceNet]
from bob.bio.base.pipelines.entry_points import execute_pipeline_score_norm from bob.bio.base.pipelines.entry_points import execute_pipeline_score_norm
for bl in baselines: for bl in baselines:
print(f"Running {bl.__name__}....") print(f"Running {bl.__name__}....")
def run(groups): def run(groups):
for i in range(max_attempts): for i in range(max_attempts):
IDIAP = True
IDIAP = False
dask_client = None dask_client = None
if IDIAP: if IDIAP:
from dask.distributed import Client from dask.distributed import Client
from bob.pipelines.distributed.sge import SGEMultipleQueuesCluster from bob.pipelines.distributed.sge import (
SGEMultipleQueuesCluster,
)
cluster = SGEMultipleQueuesCluster(min_jobs=1) cluster = SGEMultipleQueuesCluster(min_jobs=1)
dask_client = Client(cluster) dask_client = Client(cluster)
...@@ -99,13 +98,15 @@ for bl in baselines: ...@@ -99,13 +98,15 @@ for bl in baselines:
OUTPUT_PATH, "score-norm", database_name, bl.__name__ OUTPUT_PATH, "score-norm", database_name, bl.__name__
) )
rec_pipeline = bl(
annotation_type=database.annotation_type,
fixed_positions=database.fixed_positions,
)
try: try:
# New Z-norm # Z-norm
execute_pipeline_score_norm( execute_pipeline_score_norm(
pipeline=bl( pipeline=rec_pipeline,
annotation_type=database.annotation_type,
fixed_positions=database.fixed_positions
),
database=database, database=database,
dask_client=dask_client, dask_client=dask_client,
groups=groups, groups=groups,
...@@ -114,19 +115,15 @@ for bl in baselines: ...@@ -114,19 +115,15 @@ for bl in baselines:
checkpoint=True, checkpoint=True,
dask_partition_size=100, dask_partition_size=100,
dask_n_workers=20, dask_n_workers=20,
top_norm=False, top_norm=False, # TODO set this?
# top_norm_score_fraction=0.8, # top_norm_score_fraction=0.8, # TODO: and this?
score_normalization_type="znorm", score_normalization_type="znorm",
# consider_genuines=False, # consider_genuines=False, # TODO: find if equivalent exists in new
# ztnorm_cohort_proportion=1.0,
) )
# New T-norm # T-norm
execute_pipeline_score_norm( execute_pipeline_score_norm(
pipeline=bl( pipeline=rec_pipeline,
annotation_type=database.annotation_type,
fixed_positions=database.fixed_positions
),
database=database, database=database,
dask_client=dask_client, dask_client=dask_client,
groups=groups, groups=groups,
...@@ -135,30 +132,12 @@ for bl in baselines: ...@@ -135,30 +132,12 @@ for bl in baselines:
checkpoint=True, checkpoint=True,
dask_partition_size=100, dask_partition_size=100,
dask_n_workers=40, dask_n_workers=40,
top_norm=False, top_norm=False, # TODO set this?
# top_norm_score_fraction=0.8, # top_norm_score_fraction=0.8, # TODO: and this?
score_normalization_type="tnorm", score_normalization_type="tnorm",
# consider_genuines=False, # consider_genuines=False, # TODO: find if equivalent exists in new
# ztnorm_cohort_proportion=1.0,
) )
# ORIGINAL
# execute_vanilla_biometrics_ztnorm(
# bl(
# annotation_type=database.annotation_type,
# fixed_positions=database.fixed_positions,
# ),
# database,
# dask_client,
# groups=groups,
# output=output_path,
# write_metadata_scores=True,
# checkpoint=True,
# dask_partition_size=100,
# dask_n_workers=20,
# consider_genuines=consider_genuines,
# ztnorm_cohort_proportion=ztnorm_cohort_proportion,
# )
break break
except Exception as e: except Exception as e:
...@@ -168,6 +147,5 @@ for bl in baselines: ...@@ -168,6 +147,5 @@ for bl in baselines:
dask_client.close() dask_client.close()
cluster.close() cluster.close()
# run(groups=["dev"])
run(groups=["dev", "eval"]) run(groups=["dev", "eval"])
print(f"Done!") print(f"Done!")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment