예제 #1
0
    def __init__(self, faster_rcnn, optimizer):
        super(FasterRCNNTrainer, self).__init__()

        self.faster_rcnn = faster_rcnn
        self.rpn_sigma = 1
        self.roi_sigma = 1

        self.anchor_target_creator = AnchorTargetCreator()
        self.proposal_target_creator = ProposalTargetCreator()

        self.loc_normalize_mean = [0, 0, 0, 0]
        self.loc_normalize_std = [0.1, 0.1, 0.2, 0.2]

        self.optimizer = optimizer
예제 #2
0
 def __init__(self):
     super(trainer, self).__init__()
     self.total_loss = 0.
     self.rpn_reg_loss = 0.
     self.rpn_cls_loss = 0.
     self.reg_loss = 0.
     self.cls_loss = 0.
     self.model=FRCNN('train')
     self.model.get_data_loader(shuffule=False)
     self.model.get_network()
     self.n_sample = [256, 128] # number of samples for two stage targets
     self.at = AnchorTargetCreator(self.n_sample[0]) # generate labels for rpn
     self.pt = ProposalTargetCreator(self.n_sample[1]) # generate labels for classifier
     self.post_thre = n_train_post_nms # number of rois kept for each image
예제 #3
0
    def __init__(self, faster_rcnn,optimizer):
        super(FasterRCNNTrainer, self).__init__()

        self.faster_rcnn = faster_rcnn
        self.rpn_sigma = 3
        self.roi_sigma = 1

        # target creator create gt_bbox gt_label etc as training targets. 
        self.anchor_target_creator = AnchorTargetCreator()
        self.proposal_target_creator = ProposalTargetCreator()

        self.loc_normalize_mean = faster_rcnn.loc_normalize_mean
        self.loc_normalize_std = faster_rcnn.loc_normalize_std

        self.optimizer = optimizer