Beispiel #1
0
def ela_skresnext50_32x4d(num_classes=4, pretrained=True, dropout=0):
    encoder = skresnext50_32x4d(stem_type="deep", in_chans=6)
    del encoder.fc

    if pretrained:
        donor = skresnext50_32x4d(pretrained=True)
        transfer_weights(encoder, donor.state_dict())

    return TimmRgbElaModel(encoder, num_classes=num_classes, dropout=dropout)
Beispiel #2
0
    def __init__(self, pretrained=True, layers=None):
        if layers is None:
            layers = [1, 2, 3, 4]
        from timm.models import skresnext50_32x4d

        encoder = skresnext50_32x4d(pretrained=pretrained)
        super().__init__([64, 256, 512, 1024, 2048], [2, 4, 8, 16, 32], layers)
        self.stem = nn.Sequential(
            OrderedDict([("conv1", encoder.conv1), ("bn1", encoder.bn1), ("act1", encoder.act1)])
        )

        self.layer1 = nn.Sequential(encoder.maxpool, encoder.layer1)
        self.layer2 = encoder.layer2
        self.layer3 = encoder.layer3
        self.layer4 = encoder.layer4
Beispiel #3
0
def ela_s2d_skresnext50_32x4d(num_classes=4, pretrained=True, dropout=0):
    encoder = skresnext50_32x4d(stem_type="deep", in_chans=64)
    del encoder.fc

    return ELAYCbCcS2DModel(encoder, num_classes=num_classes, dropout=dropout)
def rgb_skresnext50_32x4d(num_classes=4, pretrained=True, dropout=0):
    encoder = skresnext50_32x4d(pretrained=pretrained)
    del encoder.fc

    return TimmRgbModel(encoder, num_classes=num_classes, dropout=dropout)
Beispiel #5
0
def ycrcb_skresnext50_32x4d(num_classes=4, pretrained=True, dropout=0):
    encoder = skresnext50_32x4d(stem_type="deep", in_chans=6)
    del encoder.fc
    # encoder.conv1 = make_n_channel_input(encoder.conv1, 6, "auto")

    return YCrCbModel(encoder, num_classes=num_classes, dropout=dropout)