def __init__(self): super().__init__() self.resnet50 = ResNet50(config.backbone_freeze_at, False) self.FPN = FPN(self.resnet50, 3, 7) self.R_Head = RetinaNet_Head() self.R_Anchor = RetinaNet_Anchor() self.R_Criteria = RetinaNet_Criteria()
def __init__(self): super().__init__() # self.resnet152 = ResNet152() self.resnet50 = ResNet50(config.backbone_freeze_at, False) self.FPN = FPN(self.resnet50, 2, 6) self.RPN = RPN(config.rpn_channel) self.RCNN = RCNN() assert config.num_classes == 2, 'Only support two class(1fg/1bg).'
def __init__(self): super().__init__() self.resnet50 = ResNet50(config.backbone_freeze_at, False) self.FPN = FPN(self.resnet50, 2, 6) self.RPN = RPN(config.rpn_channel) self.RCNN = RCNN() self.Cascade_0 = Cascade('cascade_0') self.Cascade_1 = Cascade('cascade_1')
def __init__(self): super().__init__() # ----------------------- build the backbone ------------------------ # self.resnet50 = ResNet50() # ------------ freeze the weights of resnet stage1 and stage 2 ------ # if config.backbone_freeze_at >= 1: for p in self.resnet50.conv1.parameters(): p.requires_grad = False if config.backbone_freeze_at >= 2: for p in self.resnet50.layer1.parameters(): p.requires_grad = False # -------------------------- build the FPN -------------------------- # self.backbone = FPN(self.resnet50) # -------------------------- build the RPN -------------------------- # self.RPN = RPN(config.rpn_channel) # ----------------------- build the RCNN head ----------------------- # self.Cascade_0 = Cascade('cascade_0') #self.Cascade_1 = Cascade('cascade_1') self.RCNN = RCNN() # -------------------------- input Tensor --------------------------- # self.inputs = { "image": mge.tensor( np.random.random([2, 3, 224, 224]).astype(np.float32), dtype="float32", ), "im_info": mge.tensor( np.random.random([2, 5]).astype(np.float32), dtype="float32", ), "gt_boxes": mge.tensor( np.random.random([2, 100, 5]).astype(np.float32), dtype="float32", ), }