def mobilenetv2(self): model = MobileNetV2() model = ModuleHelper.load_model(model, pretrained=self.configer.get( 'network', 'pretrained'), all_match=False) return model
def squeezenet(self): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = SqueezeNet() model = ModuleHelper.load_model(model, pretrained=self.configer.get('network', 'pretrained'), all_match=False) return model
def dfnetv2(pretrained=None): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = DFNetV2(num_classes=1000) model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def vgg(self, vgg_cfg=None): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ backbone = self.configer.get('network', 'backbone') model = VGG(cfg_name=backbone, vgg_cfg=vgg_cfg, bn=False) model = ModuleHelper.load_model(model, pretrained=self.configer.get('network', 'pretrained'), all_match=False) return model
def densenet161(self, pretrained=None, **kwargs): r"""Densenet-161 model from `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_ Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = DenseNet(num_init_features=96, growth_rate=48, block_config=(6, 12, 36, 24), norm_type=self.configer.get('network', 'norm_type'), **kwargs) model = ModuleHelper.load_model(model, pretrained=pretrained) return model
def vgg(self, backbone=None, pretrained=None): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = VGG(cfg_name=backbone, bn=False) model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def mobilenetv2_dilated8(self, pretrained=None): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = MobileNetV2Dilated8() model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def squeezenet(self, pretrained=None): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = SqueezeNet() model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def deepbase_resnet101(self, **kwargs): """Constructs a ResNet-101 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = ResNet(Bottleneck, [3, 4, 23, 3], deep_base=True, norm_type=self.configer.get('network', 'norm_type'), **kwargs) model = ModuleHelper.load_model(model, pretrained=self.configer.get( 'network', 'pretrained')) return model
def resnet34(self, **kwargs): """Constructs a ResNet-34 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = ResNet(BasicBlock, [3, 4, 6, 3], deep_base=False, norm_type=self.configer.get('network', 'norm_type'), **kwargs) model = ModuleHelper.load_model(model, pretrained=self.configer.get( 'network', 'pretrained')) return model
def deepbase_resnet101(num_classes=1000, pretrained=None, norm_type='batchnorm', **kwargs): """Constructs a ResNet-101 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = ResNet(Bottleneck, [3, 4, 23, 3], num_classes=num_classes, deep_base=True, norm_type=norm_type) model = ModuleHelper.load_model(model, pretrained=pretrained) return model
def resnet34(num_classes=1000, pretrained=None, norm_type='batchnorm', **kwargs): """Constructs a ResNet-34 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = ResNet(BasicBlock, [3, 4, 6, 3], num_classes=num_classes, deep_base=False, norm_type=norm_type) model = ModuleHelper.load_model(model, pretrained=pretrained) return model
def deepbase_resnet18(num_classes=1000, pretrained=None, norm_type='batchnorm', **kwargs): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on Places """ model = ResNet(BasicBlock, [2, 2, 2, 2], num_classes=num_classes, deep_base=True, norm_type=norm_type) model = ModuleHelper.load_model(model, all_match=False, pretrained=pretrained) return model
def _shufflenetv2(arch, pretrained, progress, *args, **kwargs): model = ShuffleNetV2(*args, **kwargs) model = ModuleHelper.load_model(model, pretrained=pretrained) return model
def squeezenet_dilated8(self, pretrained): model = DilatedSqueezeNet() model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def mobilenetv2(self, pretrained=None): model = MobileNetV2() model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def vgg_bn(self, vgg_cfg=None): backbone = self.configer.get('network', 'backbone') model = VGG(cfg_name=backbone, vgg_cfg=vgg_cfg, bn=True) model = ModuleHelper.load_model(model, pretrained=self.configer.get('network', 'pretrained'), all_match=False) return model
def dfnetv1(pretrained=None): model = DFNetV1(num_classes=1000) model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def darknet53(self, pretrained=None): """Constructs a darknet-53 model. """ model = DarkNet([1, 2, 8, 8, 4]) model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def darknet53(self): """Constructs a darknet-53 model. """ model = DarkNet([1, 2, 8, 8, 4]) model = ModuleHelper.load_model(model, pretrained=self.configer.get('network', 'pretrained'), all_match=False) return model
def vgg_bn(self, backbone=None, pretrained=None): model = VGG(cfg_name=backbone, bn=True) model = ModuleHelper.load_model(model, pretrained=pretrained, all_match=False) return model
def squeezenet_dilated8(self): model = DilatedSqueezeNet() model = ModuleHelper.load_model(model, pretrained=self.configer.get('network', 'pretrained'), all_match=False) return model