Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySegCNN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
earth_observation_public
PySegCNN
Commits
eeef4de9
Commit
eeef4de9
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Made the calcutation of the prediction accuracy optional.
parent
0c9d47ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pysegcnn/core/graphics.py
+5
-1
5 additions, 1 deletion
pysegcnn/core/graphics.py
pysegcnn/core/trainer.py
+1
-0
1 addition, 0 deletions
pysegcnn/core/trainer.py
with
6 additions
and
1 deletion
pysegcnn/core/graphics.py
+
5
−
1
View file @
eeef4de9
...
...
@@ -155,6 +155,7 @@ def floor_decimal(x, decimal=0):
def
plot_sample
(
x
,
use_bands
,
labels
,
y
=
None
,
y_pred
=
{},
accuracy
=
False
,
date
=
None
,
figsize
=
(
16
,
9
),
bands
=
[
'
nir
'
,
'
red
'
,
'
green
'
],
...
...
@@ -186,6 +187,9 @@ def plot_sample(x, use_bands, labels,
the values are the predicted classes for tile ``x``,
shape=(height, width). The default is `{}`, i.e. no prediction is
plotted.
accuracy : `bool`, optional
Whether to calculate the accuracy of the predictions ``y_pred`` with
respect to the ground truth ``y``. The default is `False`
date : :py:class:`datetime.datetime` or `None`
The date of the sample. If specified, ``date`` is plotted as title of
the FCC. The default is `None`, i.e. ``date`` is not used as title.
...
...
@@ -303,7 +307,7 @@ def plot_sample(x, use_bands, labels,
ax
=
fig
.
axes
[
int
(
i
+
removed
)]
# check whether the ground truth is specified and calculate accuracy
if
y
is
not
None
:
if
y
is
not
None
and
accuracy
:
acc
=
accuracy_function
(
v
,
y
)
k
+=
'
({:.2f}%)
'
.
format
(
acc
*
100
)
...
...
This diff is collapsed.
Click to expand it.
pysegcnn/core/trainer.py
+
1
−
0
View file @
eeef4de9
...
...
@@ -1720,6 +1720,7 @@ class NetworkInference(BaseConfig):
self
.
use_labels
,
y
=
gt
,
y_pred
=
{
self
.
model
.
__class__
.
__name__
:
prdctn
},
accuracy
=
True
,
state
=
batch_name
,
date
=
date
,
fig
=
self
.
fig
,
...
...
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