Esempio n. 1
0
def build_rpn(cfg, in_channels):
    """
    This gives the gist of it. Not super important because it doesn't change as much
    """
    if cfg.MODEL.RETINANET_ON:
        return build_retinanet(cfg, in_channels)
    return RPNModule(cfg, in_channels)
Esempio n. 2
0
 def __init__(self, cfg):
     super(RetinaNet, self).__init__()
     self.cfg = copy.deepcopy(cfg)
     self.backbone = build_backbone(cfg)
     self.rpn = build_retinanet(cfg, self.backbone.out_channels)
     self.mask = None
     if cfg.MODEL.MASK_ON:
         self.mask = build_roi_mask_head(cfg)
Esempio n. 3
0
def build_rpn(cfg, in_channels):
    """
    This gives the gist of it. Not super important because it doesn't change as much
    """
    if cfg.MODEL.RETINANET_ON:
        return build_retinanet(cfg, in_channels)

    rpn = RPNModule(cfg, in_channels)

    if not cfg.MODEL.TRAIN_RPN:
        for p in rpn.parameters():
            p.requires_grad = False
    return rpn
Esempio n. 4
0
def build_rpn(cfg, in_channels):
    """
    This gives the gist of it. Not super important because it doesn't change as much
    """
    # add by hui ###############################
    if cfg.MODEL.LOC_ON:
        return build_location_net(cfg, in_channels)
    if cfg.MODEL.FCOS_ON:
        if cfg.MODEL.FCOS.CASCADE_ON:
            return build_cascade_fcos(cfg, in_channels)
        else:
            return build_fcos(cfg, in_channels)
    if cfg.MODEL.GAU_ON:
        return build_gaussian_net(cfg, in_channels)
    ############################################################
    if cfg.MODEL.RETINANET_ON:
        # add by hui ###############################
        if cfg.FREEANCHOR.FREEANCHOR_ON:
            return retinanet_fa.build_retinanet(cfg, in_channels)
        ############################################################
        return build_retinanet(cfg, in_channels)

    return RPNModule(cfg, in_channels)
Esempio n. 5
0
def build_rpn(cfg, in_channels):
    if cfg.MODEL.RETINANET_ON:
        return build_retinanet(cfg, in_channels)

    return RPNModule(cfg, in_channels)