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
6faa33d1
Commit
6faa33d1
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Included option to validate model on training set
parent
a0d12623
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/main/config.py
+10
-8
10 additions, 8 deletions
pysegcnn/main/config.py
pysegcnn/main/eval.py
+7
-3
7 additions, 3 deletions
pysegcnn/main/eval.py
with
17 additions
and
11 deletions
pysegcnn/main/config.py
+
10
−
8
View file @
6faa33d1
...
...
@@ -98,7 +98,7 @@ config = {
# (ttratio * tvratio) * 100 % will be used as for training
# (1 - ttratio * tvratio) * 100 % will be used for validation
# used if split_mode='random' and split_mode='scene'
'
tvratio
'
:
0.
95
,
'
tvratio
'
:
0.
8
,
# the date to split the scenes
# format: 'yyyymmdd'
...
...
@@ -106,6 +106,7 @@ config = {
# the validation set, the test set is empty
# used if split_mode='date'
'
date
'
:
'
yyyymmdd
'
,
'
dateformat
'
:
'
%Y%m%d
'
,
# define the batch size
# determines how many samples of the dataset are processed until the
...
...
@@ -216,14 +217,14 @@ config = {
# whether to early stop training if the accuracy on the validation set
# does not increase more than delta over patience epochs
'
early_stop
'
:
Fals
e
,
'
early_stop
'
:
Tru
e
,
'
mode
'
:
'
max
'
,
'
delta
'
:
0
,
'
patience
'
:
10
,
# define the number of epochs: the number of maximum iterations over
# the whole training dataset
'
epochs
'
:
1
0
,
'
epochs
'
:
20
0
,
# define the number of threads
'
nthreads
'
:
os
.
cpu_count
(),
...
...
@@ -244,9 +245,10 @@ config = {
# these options are only used for evaluating a trained model using
# main.eval.py
#
w
he
ther
to evaluate the model on
the validation set or test set
#
t
he
dataset
to evaluate the model on
# test=False means evaluating on the validation set
# test=True means evaluationg on the test set
# test=True means evaluating on the test set
# test=None means evaluating on the training set
'
test
'
:
False
,
# whether to compute and plot the confusion matrix
...
...
@@ -261,13 +263,13 @@ config = {
# split_mode="date"
'
predict_scene
'
:
True
,
# whether to save plots of (input, ground truth, prediction) of the
#
samples
from the validation/test dataset to disk
# whether to save plots of (input, ground truth, prediction) of the
samples
# from the validation/test dataset to disk
, applies if predict_scene=False
# output path is: pysegcnn/main/_samples/
'
plot_samples
'
:
False
,
# whether to save plots of (input, ground truth, prediction) for each scene
#
to disk
#
in the validation/test dataset to disk, applies if predict_scene=True
# output path is: pysegcnn/main/_samples/
'
plot_scenes
'
:
True
,
...
...
This diff is collapsed.
Click to expand it.
pysegcnn/main/eval.py
+
7
−
3
View file @
6faa33d1
...
...
@@ -10,7 +10,7 @@ import os
# locals
from
pysegcnn.core.trainer
import
NetworkTrainer
from
pysegcnn.core.predict
import
predict_samples
,
predict_scenes
from
pysegcnn.
core
.config
import
config
,
HERE
from
pysegcnn.
main
.config
import
config
,
HERE
from
pysegcnn.core.graphics
import
plot_confusion_matrix
,
plot_loss
...
...
@@ -23,8 +23,12 @@ if __name__ == '__main__':
# plot loss and accuracy
plot_loss
(
trainer
.
loss_state
,
outpath
=
os
.
path
.
join
(
HERE
,
'
_graphics/
'
))
# check whether to evaluate the model on the validation set or the test set
ds
=
trainer
.
test_ds
if
trainer
.
test
else
trainer
.
valid_ds
# check whether to evaluate the model on the training set, validation set
# or the test set
if
trainer
.
test
is
None
:
ds
=
trainer
.
train_ds
else
:
ds
=
trainer
.
test_ds
if
trainer
.
test
else
trainer
.
valid_ds
# whether to predict each sample or each scene individually
if
trainer
.
predict_scene
:
...
...
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