Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.demographics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.demographics
Commits
fc296d9f
Verified
Commit
fc296d9f
authored
1 year ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
fix: minor refactor, add comments, remove old code
parent
8ad58a4c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
experiments/score-norm/morph.py
+20
-42
20 additions, 42 deletions
experiments/score-norm/morph.py
with
20 additions
and
42 deletions
experiments/score-norm/morph.py
+
20
−
42
View file @
fc296d9f
...
@@ -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!
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment