Example #1
0
    def __init__(self):
        super(ModelBuilder, self).__init__()

        # build backbone
        self.backbone = get_backbone(cfg.BACKBONE.TYPE,
                                     **cfg.BACKBONE.KWARGS)

        # build adjust layer
        if cfg.ADJUST.ADJUST:
            self.neck = get_neck(cfg.ADJUST.TYPE,
                                 **cfg.ADJUST.KWARGS)

        # build ban head
        if cfg.BAN.BAN:
            self.head = get_ban_head(cfg.BAN.TYPE,
                                     **cfg.BAN.KWARGS)

        # get multidect
        if cfg.MULDECT.MULDECT:
            self.get_multidect_target = GetMultidectTarget()
            # build multi dect head
            self.multi_det = get_dect_head(cfg.MULDECT.TYPE,
                                           **cfg.MULDECT.KWARGS)
            if cfg.MULDECT.TRAINHEAD:
                self.head4dect = get_dect_head(cfg.MULDECT.TYPE,
                                               **cfg.MULDECT.KWARGS)
Example #2
0
    def __init__(self):
        super(ModelBuilder, self).__init__()

        # build backbone  骨干网络
        self.backbone = get_backbone(cfg.BACKBONE.TYPE, **cfg.BACKBONE.KWARGS)

        # build adjust layer  调整层
        if cfg.ADJUST.ADJUST:
            self.neck = get_neck(cfg.ADJUST.TYPE, **cfg.ADJUST.KWARGS)

        # build ban head
        if cfg.BAN.BAN:
            self.head = get_ban_head(cfg.BAN.TYPE, **cfg.BAN.KWARGS)
Example #3
0
    def __init__(self):
        super(ModelBuilder, self).__init__()

        # build backbone
        self.backbone = get_backbone(cfg.BACKBONE.TYPE, **cfg.BACKBONE.KWARGS)

        # build adjust layer
        if cfg.ADJUST.ADJUST:
            self.neck = get_neck(cfg.ADJUST.TYPE, **cfg.ADJUST.KWARGS)

        # build ban head
        if cfg.BAN.BAN:
            self.ban_head = get_ban_head(cfg.BAN.TYPE, **cfg.BAN.KWARGS)

        self.centerness_loss_func = nn.BCEWithLogitsLoss()