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
e84af8ce
Commit
e84af8ce
authored
Nov 22, 2018
by
Kai Chen
Browse files
minor fix
parent
8aaadf2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
mmdet/core/anchor/anchor_target.py
mmdet/core/anchor/anchor_target.py
+2
-2
mmdet/models/single_stage_heads/retina_head.py
mmdet/models/single_stage_heads/retina_head.py
+5
-0
No files found.
mmdet/core/anchor/anchor_target.py
View file @
e84af8ce
...
@@ -121,8 +121,8 @@ def anchor_target_single(flat_anchors,
...
@@ -121,8 +121,8 @@ def anchor_target_single(flat_anchors,
num_valid_anchors
=
anchors
.
shape
[
0
]
num_valid_anchors
=
anchors
.
shape
[
0
]
bbox_targets
=
torch
.
zeros_like
(
anchors
)
bbox_targets
=
torch
.
zeros_like
(
anchors
)
bbox_weights
=
torch
.
zeros_like
(
anchors
)
bbox_weights
=
torch
.
zeros_like
(
anchors
)
labels
=
gt_label
s
.
new_zeros
(
num_valid_anchors
)
labels
=
anchor
s
.
new_zeros
(
num_valid_anchors
,
dtype
=
torch
.
long
)
label_weights
=
gt_label
s
.
new_zeros
(
num_valid_anchors
,
dtype
=
torch
.
float
)
label_weights
=
anchor
s
.
new_zeros
(
num_valid_anchors
,
dtype
=
torch
.
float
)
pos_inds
=
sampling_result
.
pos_inds
pos_inds
=
sampling_result
.
pos_inds
neg_inds
=
sampling_result
.
neg_inds
neg_inds
=
sampling_result
.
neg_inds
...
...
mmdet/models/single_stage_heads/retina_head.py
View file @
e84af8ce
...
@@ -258,6 +258,11 @@ class RetinaHead(nn.Module):
...
@@ -258,6 +258,11 @@ class RetinaHead(nn.Module):
bbox_pred
=
bbox_pred
.
permute
(
1
,
2
,
0
).
contiguous
().
view
(
-
1
,
4
)
bbox_pred
=
bbox_pred
.
permute
(
1
,
2
,
0
).
contiguous
().
view
(
-
1
,
4
)
proposals
=
delta2bbox
(
anchors
,
bbox_pred
,
self
.
target_means
,
proposals
=
delta2bbox
(
anchors
,
bbox_pred
,
self
.
target_means
,
self
.
target_stds
,
img_shape
)
self
.
target_stds
,
img_shape
)
if
cfg
.
nms_pre
>
0
and
scores
.
shape
[
0
]
>
cfg
.
nms_pre
:
maxscores
,
_
=
scores
.
max
(
dim
=
1
)
_
,
topk_inds
=
maxscores
.
topk
(
cfg
.
nms_pre
)
proposals
=
proposals
[
topk_inds
,
:]
scores
=
scores
[
topk_inds
,
:]
mlvl_proposals
.
append
(
proposals
)
mlvl_proposals
.
append
(
proposals
)
mlvl_scores
.
append
(
scores
)
mlvl_scores
.
append
(
scores
)
mlvl_proposals
=
torch
.
cat
(
mlvl_proposals
)
mlvl_proposals
=
torch
.
cat
(
mlvl_proposals
)
...
...
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