Example #1
0
def vgg16_bn(pretrained=True, **kwargs):
    kwargs['lconf'] = [2, 2, 3, 3, 3]
    return get_net(VGG,
                   pretrained=pretrained,
                   pretrain_url=urls.vgg16_bn,
                   fname='vgg16_bn',
                   kwargs_net=kwargs,
                   attr='classifier',
                   inn=25088)
Example #2
0
def vgg19_bn(pretrained=False, **kwargs):
    if pretrained: raise Exception('No pretrained models avaialble!')
    kwargs['lconf'] = [2, 2, 4, 4, 4]
    return get_net(VGG,
                   pretrained=pretrained,
                   pretrain_url=None,
                   fname='vgg19_bn',
                   kwargs_net=kwargs,
                   attr='classifier',
                   inn=25088)
Example #3
0
def vgg19(pretrained=True, **kwargs):
    kwargs['lconf'] = [2, 2, 4, 4, 4]
    kwargs['norm'] = False
    return get_net(VGG,
                   pretrained=pretrained,
                   pretrain_url=urls.vgg19,
                   fname='vgg19',
                   kwargs_net=kwargs,
                   attr='classifier',
                   inn=25088)
Example #4
0
def googlenet_paper(pretrained=False, **kwargs):
  """
  GoogLeNet Model as given in the official Paper.
  """
  kwargs['aux'] = True if 'aux' not in kwargs else kwargs['aux']
  kwargs['replace5x5with3x3'] = False if 'replace5x5with3x3' not in kwargs \
                                else kwargs['replace5x5with3x3']

  return get_net(GoogLeNet, pretrained=pretrained, pretrain_url=None, 
                 fname='googlenet', kwargs_net=kwargs, attr='classifier',
                 inn=1024)
Example #5
0
def googlenet(pretrained=True, **kwargs):
  """
  GoogLeNet Model with weights as given by the officials who 
  trained it on TensorFlow.
  """
  kwargs['aux'] = False if 'aux' not in kwargs else kwargs['aux']
  kwargs['replace5x5with3x3'] = True if 'replace5x5with3x3' not in kwargs \
                                else kwargs['replace5x5with3x3']

  return get_net(GoogLeNet, pretrained=pretrained, fname='googlenet', 
                 kwargs_net=kwargs, attr='classifier', inn=1024,
                 pretrain_url=urls.googlenet_url)