Skip to content

Commit

Permalink
add fast rcnn api & fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanPang committed Oct 10, 2018
1 parent b07edd6 commit 763decc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mmdet/models/detectors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .base import BaseDetector
from .rpn import RPN
from .faster_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .mask_rcnn import MaskRCNN

__all__ = ['BaseDetector', 'RPN', 'FasterRCNN', 'MaskRCNN']
__all__ = ['BaseDetector', 'RPN', 'FastRCNN', 'FasterRCNN', 'MaskRCNN']
25 changes: 25 additions & 0 deletions mmdet/models/detectors/fast_rcnn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from .two_stage import TwoStageDetector


class FastRCNN(TwoStageDetector):

def __init__(self,
backbone,
neck,
bbox_roi_extractor,
bbox_head,
train_cfg,
test_cfg,
mask_roi_extractor=None,
mask_head=None,
pretrained=None):
super(FastRCNN, self).__init__(
backbone=backbone,
neck=neck,
bbox_roi_extractor=bbox_roi_extractor,
bbox_head=bbox_head,
train_cfg=train_cfg,
test_cfg=test_cfg,
mask_roi_extractor=mask_roi_extractor,
mask_head=mask_head,
pretrained=pretrained)
3 changes: 2 additions & 1 deletion mmdet/models/detectors/two_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def simple_test(self, img, img_meta, proposals=None, rescale=False):
x = self.extract_feat(img)

proposal_list = self.simple_test_rpn(
x, img_meta, self.test_cfg.rpn) if proposals is None else proposals
x, img_meta,
self.test_cfg.rpn) if proposals is None else proposals[0]

det_bboxes, det_labels = self.simple_test_bboxes(
x, img_meta, proposal_list, self.test_cfg.rcnn, rescale=rescale)
Expand Down

0 comments on commit 763decc

Please sign in to comment.