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
07a96ada
Commit
07a96ada
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[engine] Cast vector types to avoid issues with pytorch > 1.0
parent
6ba55d93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Cast vector types to avoid issues with pytorch > 1.0
Pipeline
#38113
passed
5 years ago
Stage: build
Changes
1
Pipelines
1
Hide 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 @
07a96ada
...
...
@@ -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