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
cfc3cf0e
Commit
cfc3cf0e
authored
Aug 07, 2019
by
liushuchun
Committed by
Kai Chen
Aug 07, 2019
Browse files
Fix scale test error (#883)
parent
92595ea6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
mmdet/models/bbox_heads/bbox_head.py
mmdet/models/bbox_heads/bbox_head.py
+4
-1
mmdet/models/detectors/cascade_rcnn.py
mmdet/models/detectors/cascade_rcnn.py
+10
-3
No files found.
mmdet/models/bbox_heads/bbox_head.py
View file @
cfc3cf0e
...
...
@@ -152,7 +152,10 @@ class BBoxHead(nn.Module):
bboxes
[:,
[
1
,
3
]].
clamp_
(
min
=
0
,
max
=
img_shape
[
0
]
-
1
)
if
rescale
:
bboxes
/=
scale_factor
if
isinstance
(
scale_factor
,
float
):
bboxes
/=
scale_factor
else
:
bboxes
/=
torch
.
from_numpy
(
scale_factor
).
to
(
bboxes
.
device
)
if
cfg
is
None
:
return
bboxes
,
scores
...
...
mmdet/models/detectors/cascade_rcnn.py
View file @
cfc3cf0e
...
...
@@ -323,9 +323,16 @@ class CascadeRCNN(BaseDetector, RPNTestMixin):
mask_classes
=
self
.
mask_head
[
-
1
].
num_classes
-
1
segm_result
=
[[]
for
_
in
range
(
mask_classes
)]
else
:
_bboxes
=
(
det_bboxes
[:,
:
4
]
*
scale_factor
if
rescale
else
det_bboxes
)
if
isinstance
(
scale_factor
,
float
):
# aspect ratio fixed
_bboxes
=
(
det_bboxes
[:,
:
4
]
*
scale_factor
if
rescale
else
det_bboxes
)
else
:
_bboxes
=
(
det_bboxes
[:,
:
4
]
*
torch
.
from_numpy
(
scale_factor
).
to
(
det_bboxes
.
device
)
if
rescale
else
det_bboxes
)
mask_rois
=
bbox2roi
([
_bboxes
])
aug_masks
=
[]
for
i
in
range
(
self
.
num_stages
):
...
...
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