def __init__(self, trunk_class=VGG16, rpn_in_ch=512, rpn_mid_ch=512, feat_stride=16, anchor_ratios=(0.5, 1, 2), anchor_scales=(8, 16, 32), num_classes=21, loss_lambda=1, rpn_delta=3, rcnn_delta=1):
    w = initializers.Normal(0.01)
    super(FasterRCNN, self).__init__(trunk=trunk_class(), RPN=RegionProposalNetwork(rpn_in_ch, rpn_mid_ch, feat_stride, anchor_ratios, anchor_scales, num_classes, loss_lambda, rpn_delta), fc6=L.Linear(None, 4096, initialW=w), fc7=L.Linear(4096, 4096, initialW=w), cls_score=L.Linear(4096, num_classes, initialW=w), bbox_pred=L.Linear(4096, (num_classes * 4), initialW=w))
    self._feat_stride = feat_stride
    self._anchor_ratios = anchor_ratios
    self._anchor_scales = anchor_scales
    self._num_classes = num_classes
    self.RPN.train = False
    self._rcnn_train = False
    self._spatial_scale = (1.0 / feat_stride)
    self._rpn_delta = rpn_delta
    self._rcnn_delta = rcnn_delta
def __init__(self, trunk_class=VGG16, rpn_in_ch=512, rpn_mid_ch=512, feat_stride=16, anchor_ratios=(0.5, 1, 2), anchor_scales=(8, 16, 32), num_classes=21, loss_lambda=1, rpn_delta=3, rcnn_delta=1):
    w = initializers.Normal(0.01)
    super(FasterRCNN, self).__init__(trunk=trunk_class(), RPN=RegionProposalNetwork(rpn_in_ch, rpn_mid_ch, feat_stride, anchor_ratios, anchor_scales, num_classes, loss_lambda, rpn_delta), fc6=L.Linear(None, 4096, initialW=w), fc7=L.Linear(4096, 4096, initialW=w), cls_score=L.Linear(4096, num_classes, initialW=w), bbox_pred=L.Linear(4096, (num_classes * 4), initialW=w))
    self._feat_stride = feat_stride
    self._anchor_ratios = anchor_ratios
    self._anchor_scales = anchor_scales
    self._num_classes = num_classes
    self.RPN.train = False
    self._rcnn_train = False
    self._spatial_scale = (1.0 / feat_stride)
    self._rpn_delta = rpn_delta
    self._rcnn_delta = rcnn_delta