def __init__( self, light_head_rcnn, rpn_sigma=3., roi_sigma=1., n_ohem_sample=256, anchor_target_creator=None, proposal_target_creator=None, ): super(LightHeadRCNNTrainChain, self).__init__() with self.init_scope(): self.light_head_rcnn = light_head_rcnn self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.n_ohem_sample = n_ohem_sample if anchor_target_creator is None: self.anchor_target_creator = AnchorTargetCreator() else: self.anchor_target_creator = anchor_target_creator if proposal_target_creator is None: self.proposal_target_creator = ProposalTargetCreator(n_sample=None) else: self.proposal_target_creator = proposal_target_creator self.loc_normalize_mean = light_head_rcnn.loc_normalize_mean self.loc_normalize_std = light_head_rcnn.loc_normalize_std
def __init__( self, mask_rcnn, rpn_sigma=3., roi_sigma=1., anchor_target_creator=AnchorTargetCreator(), proposal_target_creator=ProposalTargetCreator(), notrain=None, pix_loss_scale=1., ): super(MaskRCNNPanopticTrainChain, self).__init__() with self.init_scope(): self.mask_rcnn = mask_rcnn self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.anchor_target_creator = anchor_target_creator self.proposal_target_creator = proposal_target_creator self.loc_normalize_mean = mask_rcnn.loc_normalize_mean self.loc_normalize_std = mask_rcnn.loc_normalize_std assert notrain in [None, 'pix', 'ins'] self._notrain = notrain assert isinstance(pix_loss_scale, (int, float)) assert pix_loss_scale > 0 self._pix_loss_scale = pix_loss_scale
def __init__(self, fcis, rpn_sigma=3.0, roi_sigma=1.0, n_sample=None, loc_normalize_mean=(0., 0., 0., 0.), loc_normalize_std=(0.2, 0.2, 0.5, 0.5), fg_ratio=0.25, fg_iou_thresh=0.5, bg_iou_thresh_hi=0.5, bg_iou_thresh_lo=0.0, mask_size=21, binary_thresh=0.4): super(FCISTrainChain, self).__init__() with self.init_scope(): self.fcis = fcis self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.loc_normalize_mean = fcis.loc_normalize_mean self.loc_normalize_std = fcis.loc_normalize_std self.anchor_target_creator = AnchorTargetCreator() self.proposal_target_creator = ProposalTargetCreator( n_sample=n_sample, loc_normalize_mean=self.loc_normalize_mean, loc_normalize_std=self.loc_normalize_std, fg_ratio=fg_ratio, fg_iou_thresh=fg_iou_thresh, bg_iou_thresh_hi=bg_iou_thresh_hi, bg_iou_thresh_lo=bg_iou_thresh_lo, mask_size=mask_size, binary_thresh=binary_thresh)
def __init__(self, faster_rcnn, rpn_sigma=3., roi_sigma=1., anchor_target_creator=AnchorTargetCreator(), proposal_target_creator=ProposalTargetCreator()): super(MaskRCNNTrainChain, self).__init__(faster_rcnn, proposal_target_creator=proposal_target_creator)
def __init__(self, faster_rcnn, mask_loss_fun, binary_mask=True, rpn_sigma=3., roi_sigma=1., anchor_target_creator=AnchorTargetCreator()): # todo: clean up class dependencies proposal_target_creator = ProposalTargetCreator( faster_rcnn.extractor.anchor_sizes) super().__init__(faster_rcnn, proposal_target_creator=proposal_target_creator) self.mask_loss_fun = mask_loss_fun self.binary_mask = binary_mask
def __init__(self, faster_rcnn, rpn_sigma=3., roi_sigma=1., anchor_target_creator=AnchorTargetCreator(), proposal_target_creator=ProposalTargetCreator()): super(FasterRCNNTrainChain, self).__init__() with self.init_scope(): self.faster_rcnn = faster_rcnn self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.anchor_target_creator = anchor_target_creator self.proposal_target_creator = proposal_target_creator self.loc_normalize_mean = faster_rcnn.loc_normalize_mean self.loc_normalize_std = faster_rcnn.loc_normalize_std
def __init__(self, mask_rcnn, rpn_sigma=3., roi_sigma=1., gamma=1, anchor_target_creator=AnchorTargetCreator(), roi_size=7): super(MaskRCNNTrainChain, self).__init__() with self.init_scope(): self.mask_rcnn = mask_rcnn self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.anchor_target_creator = anchor_target_creator self.proposal_target_creator = ProposalTargetCreator(roi_size=roi_size) self.loc_normalize_mean = mask_rcnn.loc_normalize_mean self.loc_normalize_std = mask_rcnn.loc_normalize_std self.decayrate=0.99 self.avg_loss = None self.gamma=gamma
def __init__(self, fcis, rpn_sigma=3.0, roi_sigma=1.0, anchor_target_creator=AnchorTargetCreator(), proposal_target_creator=ProposalTargetCreator()): super(FCISTrainChain, self).__init__() with self.init_scope(): self.fcis = fcis self.rpn_sigma = rpn_sigma self.roi_sigma = roi_sigma self.mask_size = self.fcis.head.roi_size self.loc_normalize_mean = fcis.loc_normalize_mean self.loc_normalize_std = fcis.loc_normalize_std self.anchor_target_creator = anchor_target_creator self.proposal_target_creator = proposal_target_creator