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
8da0f39a
Commit
8da0f39a
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a bug: model is now correctly passed to predict function.
parent
463be8e9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pysegcnn/core/trainer.py
+9
-4
9 additions, 4 deletions
pysegcnn/core/trainer.py
with
9 additions
and
4 deletions
pysegcnn/core/trainer.py
+
9
−
4
View file @
8da0f39a
...
...
@@ -955,9 +955,9 @@ class LogConfig(BaseConfig):
The string to write to the model log file.
"""
LOGGER
.
info
(
8
0
*
'
-
'
)
LOGGER
.
info
(
20
0
*
'
-
'
)
LOGGER
.
info
(
'
{}:
'
.
format
(
LogConfig
.
now
())
+
init_str
)
LOGGER
.
info
(
8
0
*
'
-
'
)
LOGGER
.
info
(
20
0
*
'
-
'
)
@dataclasses.dataclass
...
...
@@ -2459,6 +2459,11 @@ class NetworkInference(BaseConfig):
def
predict
(
self
,
model
):
"""
Classify the samples of the target dataset.
Parameters
----------
model : :py:class:`pysegcnn.core.models.Network`
The model to evaluate on the target dataset.
Returns
-------
output : `dict` [`str`, `dict`]
...
...
@@ -2581,7 +2586,7 @@ class NetworkInference(BaseConfig):
# initialize logging
log
=
LogConfig
(
state
)
dictConfig
(
log_conf
(
log
.
log_file
))
log
.
init_log
(
'
Evaluating model: {}.
'
.
format
(
state
.
name
))
log
.
init_log
(
'
Evaluating model: {}.
'
.
format
(
state
))
# check whether model was already evaluated
if
self
.
eval_file
(
state
).
exists
():
...
...
@@ -2607,7 +2612,7 @@ class NetworkInference(BaseConfig):
model
,
_
=
Network
.
load_pretrained_model
(
state
)
# evaluate the model on the target dataset
output
=
self
.
predict
()
output
=
self
.
predict
(
model
)
# check whether to calculate confusion matrix
if
self
.
cm
:
...
...
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