Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
1d3eb4d0
Commit
1d3eb4d0
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[script.evaluate] Simplify location of CSV metrics files
parent
cd1f64fd
No related branches found
No related tags found
1 merge request
!12
Streamlining
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/script/evaluate.py
+13
-38
13 additions, 38 deletions
bob/ip/binseg/script/evaluate.py
with
13 additions
and
38 deletions
bob/ip/binseg/script/evaluate.py
+
13
−
38
View file @
1d3eb4d0
...
...
@@ -152,50 +152,25 @@ def evaluate(
threshold
=
_validate_threshold
(
threshold
,
dataset
)
# if we work with dictionaries of datasets, then output evaluation
# information into sub-directories of the output_folder
config
=
{}
if
not
isinstance
(
dataset
,
dict
):
config
[
"
test
"
]
=
{
"
dataset
"
:
dataset
,
"
output_folder
"
:
output_folder
,
"
second_annotator
"
:
second_annotator
,
}
else
:
for
k
,
v
in
dataset
.
items
():
if
k
.
startswith
(
"
_
"
):
logger
.
info
(
f
"
Skipping dataset
'
{
k
}
'
(not to be evaluated)
"
)
continue
config
[
k
]
=
{
"
dataset
"
:
v
,
"
output_folder
"
:
os
.
path
.
join
(
output_folder
,
k
),
"
second_annotator
"
:
second_annotator
.
get
(
k
)
if
second_annotator
else
None
,
}
dataset
=
{
"
test
"
:
dataset
}
if
second_annotator
is
not
None
:
if
not
isinstance
(
second_annotator
,
dict
):
second_annotator
=
{
"
test
"
:
second_annotator
}
if
isinstance
(
threshold
,
str
):
# first run evaluation for reference dataset, do not save overlays
logger
.
info
(
f
"
Evaluating threshold on
'
{
threshold
}
'
set
"
)
threshold
=
run
(
dataset
[
threshold
],
predictions_folder
)
threshold
=
run
(
dataset
[
threshold
],
threshold
,
predictions_folder
)
logger
.
info
(
f
"
Set --threshold=
{
threshold
:
.
5
f
}
"
)
# now run with the
for
k
,
v
in
config
.
items
():
for
k
,
v
in
dataset
.
items
():
if
k
.
startswith
(
"
_
"
):
logger
.
info
(
f
"
Skipping dataset
'
{
k
}
'
(not to be evaluated)
"
)
continue
logger
.
info
(
f
"
Analyzing
'
{
k
}
'
set...
"
)
run
(
v
[
"
dataset
"
],
predictions_folder
,
v
[
"
output_folder
"
],
overlayed
,
threshold
,
)
if
v
[
"
second_annotator
"
]
is
not
None
:
compare_annotators
(
v
[
"
dataset
"
],
v
[
"
second_annotator
"
],
v
[
"
output_folder
"
],
os
.
path
.
join
(
overlayed
,
"
second-annotator
"
)
if
overlayed
else
None
,
)
run
(
v
,
k
,
predictions_folder
,
output_folder
,
overlayed
,
threshold
)
second
=
second_annotator
.
get
(
k
)
if
second
is
not
None
:
compare_annotators
(
v
,
second
,
k
,
output_folder
,
overlayed
)
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