ó łµČ[c@sYdZddlTddlTddlTddlTddlTddlTddlTd„ZdS(s¬Module for pre-defined neural network models. This module contains definitions for the following model architectures: - `AlexNet`_ - `DenseNet`_ - `Inception V3`_ - `ResNet V1`_ - `ResNet V2`_ - `SqueezeNet`_ - `VGG`_ - `MobileNet`_ - `MobileNetV2`_ You can construct a model with random weights by calling its constructor: .. code:: from mxnet.gluon.model_zoo import vision resnet18 = vision.resnet18_v1() alexnet = vision.alexnet() squeezenet = vision.squeezenet1_0() densenet = vision.densenet_161() We provide pre-trained models for all the listed models. These models can constructed by passing ``pretrained=True``: .. code:: from mxnet.gluon.model_zoo import vision resnet18 = vision.resnet18_v1(pretrained=True) alexnet = vision.alexnet(pretrained=True) All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (N x 3 x H x W), where N is the batch size, and H and W are expected to be at least 224. The images have to be loaded in to a range of [0, 1] and then normalized using ``mean = [0.485, 0.456, 0.406]`` and ``std = [0.229, 0.224, 0.225]``. The transformation should preferrably happen at preprocessing. You can use ``mx.image.color_normalize`` for such transformation:: image = image/255 normalized = mx.image.color_normalize(image, mean=mx.nd.array([0.485, 0.456, 0.406]), std=mx.nd.array([0.229, 0.224, 0.225])) .. _AlexNet: https://arxiv.org/abs/1404.5997 .. _DenseNet: https://arxiv.org/abs/1608.06993 .. _Inception V3: http://arxiv.org/abs/1512.00567 .. _ResNet V1: https://arxiv.org/abs/1512.03385 .. _ResNet V2: https://arxiv.org/abs/1603.05027 .. _SqueezeNet: https://arxiv.org/abs/1602.07360 .. _VGG: https://arxiv.org/abs/1409.1556 .. _MobileNet: https://arxiv.org/abs/1704.04861 .. _MobileNetV2: https://arxiv.org/abs/1801.04381 i(t*cKsHi"td6td6td6td6td6td6td6td6td 6t d 6t d 6t d 6t d 6t d6td6td6td6td6td6td6td6td6td6td6td6td6td6td6td6td6td6td 6t d!6t!d"6}|j"ƒ}||kr:t#d#|d$j$t%|j&ƒƒƒfƒ‚n|||S(%sūReturns a pre-defined model by name Parameters ---------- name : str Name of the model. pretrained : bool Whether to load the pretrained weights for model. classes : int Number of classes for the output layer. ctx : Context, default CPU The context in which to load the pretrained weights. root : str, default '$MXNET_HOME/models' Location for keeping the model parameters. Returns ------- HybridBlock The model. t resnet18_v1t resnet34_v1t resnet50_v1t resnet101_v1t resnet152_v1t resnet18_v2t resnet34_v2t resnet50_v2t resnet101_v2t resnet152_v2tvgg11tvgg13tvgg16tvgg19tvgg11_bntvgg13_bntvgg16_bntvgg19_bntalexnett densenet121t densenet161t densenet169t densenet201s squeezenet1.0s squeezenet1.1t inceptionv3s mobilenet1.0s mobilenet0.75s mobilenet0.5s mobilenet0.25smobilenetv2_1.0smobilenetv2_0.75smobilenetv2_0.5smobilenetv2_0.25s4Model %s is not supported. Available options are %ss ('RRRRRRRRR R R R R RRRRRRRRRRt squeezenet1_0t squeezenet1_1t inception_v3t mobilenet1_0t mobilenet0_75t mobilenet0_5t mobilenet0_25tmobilenet_v2_1_0tmobilenet_v2_0_75tmobilenet_v2_0_5tmobilenet_v2_0_25tlowert ValueErrortjointsortedtkeys(tnametkwargstmodels((se/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/model_zoo/vision/__init__.pyt get_model[sP    (N( t__doc__Rtdensenett inceptiontresnett squeezenettvggt mobilenetR,(((se/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/model_zoo/vision/__init__.pytJs