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
bd8fd27e
Commit
bd8fd27e
authored
Apr 14, 2019
by
Cao Yuhang
Browse files
rename pos_mask to pos_inds
parent
cb68807f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
mmdet/models/bbox_heads/bbox_head.py
mmdet/models/bbox_heads/bbox_head.py
+6
-6
No files found.
mmdet/models/bbox_heads/bbox_head.py
View file @
bd8fd27e
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmdet.core
import
(
delta2bbox
,
multiclass_nms
,
bbox_target
,
from
mmdet.core
import
(
delta2bbox
,
multiclass_nms
,
bbox_target
,
weighted_cross_entropy
,
weighted_smoothl1
,
accuracy
)
weighted_cross_entropy
,
weighted_smoothl1
,
accuracy
)
from
..registry
import
HEADS
from
..registry
import
HEADS
...
@@ -94,16 +94,16 @@ class BBoxHead(nn.Module):
...
@@ -94,16 +94,16 @@ class BBoxHead(nn.Module):
cls_score
,
labels
,
label_weights
,
reduce
=
reduce
)
cls_score
,
labels
,
label_weights
,
reduce
=
reduce
)
losses
[
'acc'
]
=
accuracy
(
cls_score
,
labels
)
losses
[
'acc'
]
=
accuracy
(
cls_score
,
labels
)
if
bbox_pred
is
not
None
:
if
bbox_pred
is
not
None
:
pos_
mask
=
labels
>
0
pos_
inds
=
labels
>
0
if
self
.
reg_class_agnostic
:
if
self
.
reg_class_agnostic
:
pos_bbox_pred
=
bbox_pred
.
view
(
bbox_pred
.
size
(
0
),
4
)[
pos_
mask
]
pos_bbox_pred
=
bbox_pred
.
view
(
bbox_pred
.
size
(
0
),
4
)[
pos_
inds
]
else
:
else
:
pos_bbox_pred
=
bbox_pred
.
view
(
bbox_pred
.
size
(
0
),
-
1
,
pos_bbox_pred
=
bbox_pred
.
view
(
bbox_pred
.
size
(
0
),
-
1
,
4
)[
pos_
mask
,
labels
[
pos_
mask
]]
4
)[
pos_
inds
,
labels
[
pos_
inds
]]
losses
[
'loss_reg'
]
=
weighted_smoothl1
(
losses
[
'loss_reg'
]
=
weighted_smoothl1
(
pos_bbox_pred
,
pos_bbox_pred
,
bbox_targets
[
pos_
mask
],
bbox_targets
[
pos_
inds
],
bbox_weights
[
pos_
mask
],
bbox_weights
[
pos_
inds
],
avg_factor
=
bbox_targets
.
size
(
0
))
avg_factor
=
bbox_targets
.
size
(
0
))
return
losses
return
losses
...
...
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