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
GitLab 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
11138b24
Commit
11138b24
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[engine.inferencer] Fix type mismatch in pos/neg operations
parent
0e67a78e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/engine/inferencer.py
+3
-3
3 additions, 3 deletions
bob/ip/binseg/engine/inferencer.py
with
3 additions
and
3 deletions
bob/ip/binseg/engine/inferencer.py
+
3
−
3
View file @
11138b24
...
...
@@ -60,8 +60,8 @@ def batch_metrics(predictions, ground_truths, names, output_folder, logger):
binary_pred
=
torch
.
gt
(
predictions
[
j
],
threshold
).
byte
()
# equals and not-equals
equals
=
torch
.
eq
(
binary_pred
,
gts
)
# tensor
notequals
=
torch
.
ne
(
binary_pred
,
gts
)
# tensor
equals
=
torch
.
eq
(
binary_pred
,
gts
)
.
type
(
torch
.
uint8
)
# tensor
notequals
=
torch
.
ne
(
binary_pred
,
gts
)
.
type
(
torch
.
uint8
)
# tensor
# true positives
tp_tensor
=
(
gts
*
binary_pred
)
# tensor
...
...
@@ -76,7 +76,7 @@ def batch_metrics(predictions, ground_truths, names, output_folder, logger):
tn_count
=
torch
.
sum
(
tn_tensor
).
item
()
# false negatives
fn_tensor
=
notequals
-
fp_tensor
fn_tensor
=
notequals
-
fp_tensor
.
type
(
torch
.
uint8
)
fn_count
=
torch
.
sum
(
fn_tensor
).
item
()
# calc metrics
...
...
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