Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
SOLOv2-pytorch
Commits
cd35200f
Unverified
Commit
cd35200f
authored
Dec 12, 2018
by
Kai Chen
Committed by
GitHub
Dec 12, 2018
Browse files
Merge pull request #177 from Zehaos/fix
Support class agnostic in mask_cross_entropy loss
parents
c1f9fa0f
b4af1c94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
mmdet/models/mask_heads/fcn_mask_head.py
mmdet/models/mask_heads/fcn_mask_head.py
+5
-1
No files found.
mmdet/models/mask_heads/fcn_mask_head.py
View file @
cd35200f
...
...
@@ -97,7 +97,11 @@ class FCNMaskHead(nn.Module):
def
loss
(
self
,
mask_pred
,
mask_targets
,
labels
):
loss
=
dict
()
loss_mask
=
mask_cross_entropy
(
mask_pred
,
mask_targets
,
labels
)
if
self
.
class_agnostic
:
loss_mask
=
mask_cross_entropy
(
mask_pred
,
mask_targets
,
torch
.
zeros_like
(
labels
))
else
:
loss_mask
=
mask_cross_entropy
(
mask_pred
,
mask_targets
,
labels
)
loss
[
'loss_mask'
]
=
loss_mask
return
loss
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment