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
179355a5
Commit
179355a5
authored
5 years ago
by
Tim Laibacher
Browse files
Options
Downloads
Patches
Plain Diff
Fix plotting
parent
d36ce7c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#29675
failed
5 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/ip/binseg/engine/inferencer.py
+3
-3
3 additions, 3 deletions
bob/ip/binseg/engine/inferencer.py
bob/ip/binseg/utils/plot.py
+1
-1
1 addition, 1 deletion
bob/ip/binseg/utils/plot.py
conda/meta.yaml
+2
-2
2 additions, 2 deletions
conda/meta.yaml
with
6 additions
and
6 deletions
bob/ip/binseg/engine/inferencer.py
+
3
−
3
View file @
179355a5
...
...
@@ -138,9 +138,8 @@ def do_inference(
times
.
append
(
batch_time
)
logger
.
info
(
"
Batch time: {:.5f} s
"
.
format
(
batch_time
))
b_metrics
=
batch_metrics
(
probabilities
,
ground_truths
,
masks
,
names
,
results_subfolder
,
logger
)
b_metrics
=
batch_metrics
(
probabilities
,
ground_truths
,
masks
,
names
,
results_subfolder
,
logger
)
metrics
.
extend
(
b_metrics
)
# Create probability images
save_probability_images
(
probabilities
,
names
,
output_folder
,
logger
)
...
...
@@ -161,6 +160,7 @@ def do_inference(
logger
.
info
(
"
Saving average over all input images: {}
"
.
format
(
metrics_file
))
avg_metrics
=
df_metrics
.
groupby
(
'
threshold
'
).
mean
()
avg_metrics
[
"
model_name
"
]
=
model
.
name
avg_metrics
.
to_csv
(
metrics_path
)
avg_metrics
[
"
f1_score
"
]
=
2
*
avg_metrics
[
"
precision
"
]
*
avg_metrics
[
"
recall
"
]
/
\
...
...
@@ -175,7 +175,7 @@ def do_inference(
np_avg_metrics
=
avg_metrics
.
to_numpy
().
T
fig_name
=
"
precision_recall_{}.pdf
"
.
format
(
model
.
name
)
logger
.
info
(
"
saving {}
"
.
format
(
fig_name
))
fig
=
precision_recall_f1iso
([
np_avg_metrics
[
0
]],[
np_avg_metrics
[
1
]],
model
.
name
)
fig
=
precision_recall_f1iso
([
np_avg_metrics
[
0
]],[
np_avg_metrics
[
1
]],
np_avg_metrics
[
-
1
]
)
fig_filename
=
os
.
path
.
join
(
results_subfolder
,
fig_name
)
fig
.
savefig
(
fig_filename
)
...
...
This diff is collapsed.
Click to expand it.
bob/ip/binseg/utils/plot.py
+
1
−
1
View file @
179355a5
...
...
@@ -46,7 +46,7 @@ def precision_recall_f1iso(precision, recall, names, title=None, human_perf_bsds
valid
=
(
pi
+
ri
)
>
0
f1
=
2
*
(
pi
[
valid
]
*
ri
[
valid
])
/
(
pi
[
valid
]
+
ri
[
valid
])
# Plot Recall/Precision as threshold changes
ax1
.
plot
(
ri
[
pi
>
0
],
pi
[
pi
>
0
],
label
=
'
[F=
%
.3f]
%s
'
%
(
f1
.
max
(),
n
))
ax1
.
plot
(
ri
[
pi
>
0
],
pi
[
pi
>
0
],
label
=
'
[F=
{:
.3f
}
]
{}
'
.
format
(
f1
.
max
(),
n
))
ax1
.
grid
(
linestyle
=
'
--
'
,
linewidth
=
1
,
color
=
'
gray
'
,
alpha
=
0.2
)
if
len
(
names
)
>
1
:
plt
.
legend
(
loc
=
'
lower left
'
,
framealpha
=
0.5
)
...
...
This diff is collapsed.
Click to expand it.
conda/meta.yaml
+
2
−
2
View file @
179355a5
...
...
@@ -55,8 +55,8 @@ test:
-
{{
name
}}
commands
:
# test commands ("script" entry-points) from your package here
-
bob binseg --help
-
bob binseg train --help
#
- bob binseg --help
#
- bob binseg train --help
-
nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
-
sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx
-
sphinx-build -aEb doctest {{ project_dir }}/doc sphinx
...
...
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