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
1d797153
Unverified
Commit
1d797153
authored
Aug 26, 2019
by
Kai Chen
Committed by
GitHub
Aug 26, 2019
Browse files
Revert "add RepPoints support (#1256)" (#1263)
This reverts commit
ea9b20af
.
parent
ea9b20af
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
683 deletions
+2
-683
mmdet/models/anchor_heads/__init__.py
mmdet/models/anchor_heads/__init__.py
+1
-3
mmdet/models/anchor_heads/reppoints_head.py
mmdet/models/anchor_heads/reppoints_head.py
+0
-596
mmdet/models/detectors/__init__.py
mmdet/models/detectors/__init__.py
+1
-3
mmdet/models/detectors/reppoints_detector.py
mmdet/models/detectors/reppoints_detector.py
+0
-81
No files found.
mmdet/models/anchor_heads/__init__.py
View file @
1d797153
...
@@ -3,13 +3,11 @@ from .fcos_head import FCOSHead
...
@@ -3,13 +3,11 @@ from .fcos_head import FCOSHead
from
.ga_retina_head
import
GARetinaHead
from
.ga_retina_head
import
GARetinaHead
from
.ga_rpn_head
import
GARPNHead
from
.ga_rpn_head
import
GARPNHead
from
.guided_anchor_head
import
FeatureAdaption
,
GuidedAnchorHead
from
.guided_anchor_head
import
FeatureAdaption
,
GuidedAnchorHead
from
.reppoints_head
import
RepPointsHead
from
.retina_head
import
RetinaHead
from
.retina_head
import
RetinaHead
from
.rpn_head
import
RPNHead
from
.rpn_head
import
RPNHead
from
.ssd_head
import
SSDHead
from
.ssd_head
import
SSDHead
__all__
=
[
__all__
=
[
'AnchorHead'
,
'GuidedAnchorHead'
,
'FeatureAdaption'
,
'RPNHead'
,
'AnchorHead'
,
'GuidedAnchorHead'
,
'FeatureAdaption'
,
'RPNHead'
,
'GARPNHead'
,
'RetinaHead'
,
'GARetinaHead'
,
'SSDHead'
,
'FCOSHead'
,
'GARPNHead'
,
'RetinaHead'
,
'GARetinaHead'
,
'SSDHead'
,
'FCOSHead'
'RepPointsHead'
]
]
mmdet/models/anchor_heads/reppoints_head.py
deleted
100644 → 0
View file @
ea9b20af
This diff is collapsed.
Click to expand it.
mmdet/models/detectors/__init__.py
View file @
1d797153
...
@@ -8,7 +8,6 @@ from .grid_rcnn import GridRCNN
...
@@ -8,7 +8,6 @@ from .grid_rcnn import GridRCNN
from
.htc
import
HybridTaskCascade
from
.htc
import
HybridTaskCascade
from
.mask_rcnn
import
MaskRCNN
from
.mask_rcnn
import
MaskRCNN
from
.mask_scoring_rcnn
import
MaskScoringRCNN
from
.mask_scoring_rcnn
import
MaskScoringRCNN
from
.reppoints_detector
import
RepPointsDetector
from
.retinanet
import
RetinaNet
from
.retinanet
import
RetinaNet
from
.rpn
import
RPN
from
.rpn
import
RPN
from
.single_stage
import
SingleStageDetector
from
.single_stage
import
SingleStageDetector
...
@@ -17,6 +16,5 @@ from .two_stage import TwoStageDetector
...
@@ -17,6 +16,5 @@ from .two_stage import TwoStageDetector
__all__
=
[
__all__
=
[
'BaseDetector'
,
'SingleStageDetector'
,
'TwoStageDetector'
,
'RPN'
,
'BaseDetector'
,
'SingleStageDetector'
,
'TwoStageDetector'
,
'RPN'
,
'FastRCNN'
,
'FasterRCNN'
,
'MaskRCNN'
,
'CascadeRCNN'
,
'HybridTaskCascade'
,
'FastRCNN'
,
'FasterRCNN'
,
'MaskRCNN'
,
'CascadeRCNN'
,
'HybridTaskCascade'
,
'DoubleHeadRCNN'
,
'RetinaNet'
,
'FCOS'
,
'GridRCNN'
,
'MaskScoringRCNN'
,
'DoubleHeadRCNN'
,
'RetinaNet'
,
'FCOS'
,
'GridRCNN'
,
'MaskScoringRCNN'
'RepPointsDetector'
]
]
mmdet/models/detectors/reppoints_detector.py
deleted
100644 → 0
View file @
ea9b20af
import
torch
from
mmdet.core
import
bbox2result
,
bbox_mapping_back
,
multiclass_nms
from
..registry
import
DETECTORS
from
.single_stage
import
SingleStageDetector
@
DETECTORS
.
register_module
class
RepPointsDetector
(
SingleStageDetector
):
"""RepPoints: Point Set Representation for Object Detection.
This detector is the implementation of:
- RepPoints detector (https://arxiv.org/pdf/1904.11490)
"""
def
__init__
(
self
,
backbone
,
neck
,
bbox_head
,
train_cfg
=
None
,
test_cfg
=
None
,
pretrained
=
None
):
super
(
RepPointsDetector
,
self
).
__init__
(
backbone
,
neck
,
bbox_head
,
train_cfg
,
test_cfg
,
pretrained
)
def
merge_aug_results
(
self
,
aug_bboxes
,
aug_scores
,
img_metas
):
"""Merge augmented detection bboxes and scores.
Args:
aug_bboxes (list[Tensor]): shape (n, 4*#class)
aug_scores (list[Tensor] or None): shape (n, #class)
img_shapes (list[Tensor]): shape (3, ).
Returns:
tuple: (bboxes, scores)
"""
recovered_bboxes
=
[]
for
bboxes
,
img_info
in
zip
(
aug_bboxes
,
img_metas
):
img_shape
=
img_info
[
0
][
'img_shape'
]
scale_factor
=
img_info
[
0
][
'scale_factor'
]
flip
=
img_info
[
0
][
'flip'
]
bboxes
=
bbox_mapping_back
(
bboxes
,
img_shape
,
scale_factor
,
flip
)
recovered_bboxes
.
append
(
bboxes
)
bboxes
=
torch
.
cat
(
recovered_bboxes
,
dim
=
0
)
if
aug_scores
is
None
:
return
bboxes
else
:
scores
=
torch
.
cat
(
aug_scores
,
dim
=
0
)
return
bboxes
,
scores
def
aug_test
(
self
,
imgs
,
img_metas
,
rescale
=
False
):
# recompute feats to save memory
feats
=
self
.
extract_feats
(
imgs
)
aug_bboxes
=
[]
aug_scores
=
[]
for
x
,
img_meta
in
zip
(
feats
,
img_metas
):
# only one image in the batch
outs
=
self
.
bbox_head
(
x
)
bbox_inputs
=
outs
+
(
img_meta
,
self
.
test_cfg
,
False
,
False
)
det_bboxes
,
det_scores
=
self
.
bbox_head
.
get_bboxes
(
*
bbox_inputs
)[
0
]
aug_bboxes
.
append
(
det_bboxes
)
aug_scores
.
append
(
det_scores
)
# after merging, bboxes will be rescaled to the original image size
merged_bboxes
,
merged_scores
=
self
.
merge_aug_results
(
aug_bboxes
,
aug_scores
,
img_metas
)
det_bboxes
,
det_labels
=
multiclass_nms
(
merged_bboxes
,
merged_scores
,
self
.
test_cfg
.
score_thr
,
self
.
test_cfg
.
nms
,
self
.
test_cfg
.
max_per_img
)
if
rescale
:
_det_bboxes
=
det_bboxes
else
:
_det_bboxes
=
det_bboxes
.
clone
()
_det_bboxes
[:,
:
4
]
*=
img_metas
[
0
][
0
][
'scale_factor'
]
bbox_results
=
bbox2result
(
_det_bboxes
,
det_labels
,
self
.
bbox_head
.
num_classes
)
return
bbox_results
Prev
1
2
Next
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