blob: ff55f402425a344c2e29fb4155ab1638800d8438 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<title>mxnet.gluon.model_zoo.vision — mxnet documentation</title>
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="../../../../_static/basic.css" rel="stylesheet" type="text/css">
<link href="../../../../_static/pygments.css" rel="stylesheet" type="text/css">
<link href="../../../../_static/mxnet.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../../',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script src="../../../../_static/jquery-1.11.1.js" type="text/javascript"></script>
<script src="../../../../_static/underscore.js" type="text/javascript"></script>
<script src="../../../../_static/searchtools_custom.js" type="text/javascript"></script>
<script src="../../../../_static/doctools.js" type="text/javascript"></script>
<script src="../../../../_static/selectlang.js" type="text/javascript"></script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-96378503-1', 'auto');
ga('send', 'pageview');
</script>
<!-- -->
<!-- <script type="text/javascript" src="../../../../_static/jquery.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../../../../_static/underscore.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../../../../_static/doctools.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -->
<!-- -->
<link href="../../../../genindex.html" rel="index" title="Index">
<link href="../../../../search.html" rel="search" title="Search"/>
<link href="../../../index.html" rel="up" title="Module code"/>
<link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/>
</link></link></link></head>
<body background="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background.png" role="document">
<div class="content-block"><!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="navbar navbar-fixed-top">
<div class="container" id="navContainer">
<div class="innder" id="header-inner">
<h1 id="logo-wrap">
<a href="../../../../" id="logo"><img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"/></a>
</h1>
<nav class="nav-bar" id="main-nav">
<a class="main-nav-link" href="../../../../install/index.html">Install</a>
<a class="main-nav-link" href="../../../../tutorials/index.html">Tutorials</a>
<span id="dropdown-menu-position-anchor">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Gluon <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../../../../gluon/index.html">About</a></li>
<li><a class="main-nav-link" href="http://gluon.mxnet.io">Tutorials</a></li>
</ul>
</span>
<span id="dropdown-menu-position-anchor">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../../../../api/python/index.html">Python</a></li>
<li><a class="main-nav-link" href="../../../../api/scala/index.html">Scala</a></li>
<li><a class="main-nav-link" href="../../../../api/r/index.html">R</a></li>
<li><a class="main-nav-link" href="../../../../api/julia/index.html">Julia</a></li>
<li><a class="main-nav-link" href="../../../../api/c++/index.html">C++</a></li>
<li><a class="main-nav-link" href="../../../../api/perl/index.html">Perl</a></li>
</ul>
</span>
<span id="dropdown-menu-position-anchor-docs">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Docs <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-docs">
<li><a class="main-nav-link" href="../../../../faq/index.html">FAQ</a></li>
<li><a class="main-nav-link" href="../../../../architecture/index.html">Architecture</a></li>
<li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/1.0.0/example">Examples</a></li>
<li><a class="main-nav-link" href="../../../../model_zoo/index.html">Model Zoo</a></li>
</ul>
</span>
<a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a>
<span id="dropdown-menu-position-anchor-community">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Community <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-community">
<li><a class="main-nav-link" href="../../../../community/index.html">Community</a></li>
<li><a class="main-nav-link" href="../../../../community/contribute.html">Contribute</a></li>
<li><a class="main-nav-link" href="../../../../community/powered_by.html">Powered By</a></li>
</ul>
</span>
<a class="main-nav-link" href="http://discuss.mxnet.io">Discuss</a>
<span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Versions(1.0.0)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/>1.1.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/1.0.0/index.html>1.0.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></span></nav>
<script> function getRootPath(){ return "../../../../" } </script>
<div class="burgerIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"></a>
<ul class="dropdown-menu" id="burgerMenu">
<li><a href="../../../../install/index.html">Install</a></li>
<li><a class="main-nav-link" href="../../../../tutorials/index.html">Tutorials</a></li>
<li class="dropdown-submenu">
<a href="#" tabindex="-1">Community</a>
<ul class="dropdown-menu">
<li><a href="../../../../community/index.html" tabindex="-1">Community</a></li>
<li><a href="../../../../community/contribute.html" tabindex="-1">Contribute</a></li>
<li><a href="../../../../community/powered_by.html" tabindex="-1">Powered By</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#" tabindex="-1">API</a>
<ul class="dropdown-menu">
<li><a href="../../../../api/python/index.html" tabindex="-1">Python</a>
</li>
<li><a href="../../../../api/scala/index.html" tabindex="-1">Scala</a>
</li>
<li><a href="../../../../api/r/index.html" tabindex="-1">R</a>
</li>
<li><a href="../../../../api/julia/index.html" tabindex="-1">Julia</a>
</li>
<li><a href="../../../../api/c++/index.html" tabindex="-1">C++</a>
</li>
<li><a href="../../../../api/perl/index.html" tabindex="-1">Perl</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#" tabindex="-1">Docs</a>
<ul class="dropdown-menu">
<li><a href="../../../../tutorials/index.html" tabindex="-1">Tutorials</a></li>
<li><a href="../../../../faq/index.html" tabindex="-1">FAQ</a></li>
<li><a href="../../../../architecture/index.html" tabindex="-1">Architecture</a></li>
<li><a href="https://github.com/apache/incubator-mxnet/tree/1.0.0/example" tabindex="-1">Examples</a></li>
<li><a href="../../../../model_zoo/index.html" tabindex="-1">Model Zoo</a></li>
</ul>
</li>
<li><a href="../../../../architecture/index.html">Architecture</a></li>
<li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li>
<li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(1.0.0)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/>1.1.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/1.0.0/index.html>1.0.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></li></ul>
</div>
<div class="plusIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a>
<ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul>
</div>
<div id="search-input-wrap">
<form action="../../../../search.html" autocomplete="off" class="" method="get" role="search">
<div class="form-group inner-addon left-addon">
<i class="glyphicon glyphicon-search"></i>
<input class="form-control" name="q" placeholder="Search" type="text"/>
</div>
<input name="check_keywords" type="hidden" value="yes">
<input name="area" type="hidden" value="default"/>
</input></form>
<div id="search-preview"></div>
</div>
<div id="searchIcon">
<span aria-hidden="true" class="glyphicon glyphicon-search"></span>
</div>
<!-- <div id="lang-select-wrap"> -->
<!-- <label id="lang-select-label"> -->
<!-- <\!-- <i class="fa fa-globe"></i> -\-> -->
<!-- <span></span> -->
<!-- </label> -->
<!-- <select id="lang-select"> -->
<!-- <option value="en">Eng</option> -->
<!-- <option value="zh">中文</option> -->
<!-- </select> -->
<!-- </div> -->
<!-- <a id="mobile-nav-toggle">
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
</a> -->
</div>
</div>
</div>
<script type="text/javascript">
$('body').css('background', 'white');
</script>
<div class="container">
<div class="row">
<div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/python/index.html">Python Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/r/index.html">R Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/julia/index.html">Julia Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/c++/index.html">C++ Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/scala/index.html">Scala Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/perl/index.html">Perl Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../faq/index.html">HowTo Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../architecture/index.html">System Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../tutorials/index.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../community/index.html">Community</a></li>
</ul>
</div>
</div>
<div class="content">
<div class="page-tracker"></div>
<h1>Source code for mxnet.gluon.model_zoo.vision</h1><div class="highlight"><pre>
<span></span><span class="c1"># Licensed to the Apache Software Foundation (ASF) under one</span>
<span class="c1"># or more contributor license agreements. See the NOTICE file</span>
<span class="c1"># distributed with this work for additional information</span>
<span class="c1"># regarding copyright ownership. The ASF licenses this file</span>
<span class="c1"># to you under the Apache License, Version 2.0 (the</span>
<span class="c1"># "License"); you may not use this file except in compliance</span>
<span class="c1"># with the License. You may obtain a copy of the License at</span>
<span class="c1">#</span>
<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1">#</span>
<span class="c1"># Unless required by applicable law or agreed to in writing,</span>
<span class="c1"># software distributed under the License is distributed on an</span>
<span class="c1"># "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span>
<span class="c1"># KIND, either express or implied. See the License for the</span>
<span class="c1"># specific language governing permissions and limitations</span>
<span class="c1"># under the License.</span>
<span class="c1"># coding: utf-8</span>
<span class="c1"># pylint: disable=wildcard-import, arguments-differ</span>
<span class="sa">r</span><span class="sd">"""Module for pre-defined neural network models.</span>
<span class="sd">This module contains definitions for the following model architectures:</span>
<span class="sd">- `AlexNet`_</span>
<span class="sd">- `DenseNet`_</span>
<span class="sd">- `Inception V3`_</span>
<span class="sd">- `ResNet V1`_</span>
<span class="sd">- `ResNet V2`_</span>
<span class="sd">- `SqueezeNet`_</span>
<span class="sd">- `VGG`_</span>
<span class="sd">- `MobileNet`_</span>
<span class="sd">You can construct a model with random weights by calling its constructor:</span>
<span class="sd">.. code::</span>
<span class="sd"> from mxnet.gluon.model_zoo import vision</span>
<span class="sd"> resnet18 = vision.resnet18_v1()</span>
<span class="sd"> alexnet = vision.alexnet()</span>
<span class="sd"> squeezenet = vision.squeezenet1_0()</span>
<span class="sd"> densenet = vision.densenet_161()</span>
<span class="sd">We provide pre-trained models for all the models except ResNet V2.</span>
<span class="sd">These can constructed by passing ``pretrained=True``:</span>
<span class="sd">.. code::</span>
<span class="sd"> from mxnet.gluon.model_zoo import vision</span>
<span class="sd"> resnet18 = vision.resnet18_v1(pretrained=True)</span>
<span class="sd"> alexnet = vision.alexnet(pretrained=True)</span>
<span class="sd">Pretrained models are converted from torchvision.</span>
<span class="sd">All pre-trained models expect input images normalized in the same way,</span>
<span class="sd">i.e. mini-batches of 3-channel RGB images of shape (N x 3 x H x W),</span>
<span class="sd">where N is the batch size, and H and W are expected to be at least 224.</span>
<span class="sd">The images have to be loaded in to a range of [0, 1] and then normalized</span>
<span class="sd">using ``mean = [0.485, 0.456, 0.406]`` and ``std = [0.229, 0.224, 0.225]``.</span>
<span class="sd">The transformation should preferrably happen at preprocessing. You can use</span>
<span class="sd">``mx.image.color_normalize`` for such transformation::</span>
<span class="sd"> image = image/255</span>
<span class="sd"> normalized = mx.image.color_normalize(image,</span>
<span class="sd"> mean=mx.nd.array([0.485, 0.456, 0.406]),</span>
<span class="sd"> std=mx.nd.array([0.229, 0.224, 0.225]))</span>
<span class="sd">.. _AlexNet: https://arxiv.org/abs/1404.5997</span>
<span class="sd">.. _DenseNet: https://arxiv.org/abs/1608.06993</span>
<span class="sd">.. _Inception V3: http://arxiv.org/abs/1512.00567</span>
<span class="sd">.. _ResNet V1: https://arxiv.org/abs/1512.03385</span>
<span class="sd">.. _ResNet V2: https://arxiv.org/abs/1512.03385</span>
<span class="sd">.. _SqueezeNet: https://arxiv.org/abs/1602.07360</span>
<span class="sd">.. _VGG: https://arxiv.org/abs/1409.1556</span>
<span class="sd">.. _MobileNet: https://arxiv.org/abs/1704.04861</span>
<span class="sd">"""</span>
<span class="kn">from</span> <span class="nn">.alexnet</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.densenet</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.inception</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.resnet</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.squeezenet</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.vgg</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.mobilenet</span> <span class="k">import</span> <span class="o">*</span>
<div class="viewcode-block" id="get_model"><a class="viewcode-back" href="../../../../api/python/gluon/model_zoo.html#mxnet.gluon.model_zoo.vision.get_model">[docs]</a><span class="k">def</span> <span class="nf">get_model</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">"""Returns a pre-defined model by name</span>
<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> name : str</span>
<span class="sd"> Name of the model.</span>
<span class="sd"> pretrained : bool</span>
<span class="sd"> Whether to load the pretrained weights for model.</span>
<span class="sd"> classes : int</span>
<span class="sd"> Number of classes for the output layer.</span>
<span class="sd"> ctx : Context, default CPU</span>
<span class="sd"> The context in which to load the pretrained weights.</span>
<span class="sd"> root : str, default '~/.mxnet/models'</span>
<span class="sd"> Location for keeping the model parameters.</span>
<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> HybridBlock</span>
<span class="sd"> The model.</span>
<span class="sd"> """</span>
<span class="n">models</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'resnet18_v1'</span><span class="p">:</span> <span class="n">resnet18_v1</span><span class="p">,</span>
<span class="s1">'resnet34_v1'</span><span class="p">:</span> <span class="n">resnet34_v1</span><span class="p">,</span>
<span class="s1">'resnet50_v1'</span><span class="p">:</span> <span class="n">resnet50_v1</span><span class="p">,</span>
<span class="s1">'resnet101_v1'</span><span class="p">:</span> <span class="n">resnet101_v1</span><span class="p">,</span>
<span class="s1">'resnet152_v1'</span><span class="p">:</span> <span class="n">resnet152_v1</span><span class="p">,</span>
<span class="s1">'resnet18_v2'</span><span class="p">:</span> <span class="n">resnet18_v2</span><span class="p">,</span>
<span class="s1">'resnet34_v2'</span><span class="p">:</span> <span class="n">resnet34_v2</span><span class="p">,</span>
<span class="s1">'resnet50_v2'</span><span class="p">:</span> <span class="n">resnet50_v2</span><span class="p">,</span>
<span class="s1">'resnet101_v2'</span><span class="p">:</span> <span class="n">resnet101_v2</span><span class="p">,</span>
<span class="s1">'resnet152_v2'</span><span class="p">:</span> <span class="n">resnet152_v2</span><span class="p">,</span>
<span class="s1">'vgg11'</span><span class="p">:</span> <span class="n">vgg11</span><span class="p">,</span>
<span class="s1">'vgg13'</span><span class="p">:</span> <span class="n">vgg13</span><span class="p">,</span>
<span class="s1">'vgg16'</span><span class="p">:</span> <span class="n">vgg16</span><span class="p">,</span>
<span class="s1">'vgg19'</span><span class="p">:</span> <span class="n">vgg19</span><span class="p">,</span>
<span class="s1">'vgg11_bn'</span><span class="p">:</span> <span class="n">vgg11_bn</span><span class="p">,</span>
<span class="s1">'vgg13_bn'</span><span class="p">:</span> <span class="n">vgg13_bn</span><span class="p">,</span>
<span class="s1">'vgg16_bn'</span><span class="p">:</span> <span class="n">vgg16_bn</span><span class="p">,</span>
<span class="s1">'vgg19_bn'</span><span class="p">:</span> <span class="n">vgg19_bn</span><span class="p">,</span>
<span class="s1">'alexnet'</span><span class="p">:</span> <span class="n">alexnet</span><span class="p">,</span>
<span class="s1">'densenet121'</span><span class="p">:</span> <span class="n">densenet121</span><span class="p">,</span>
<span class="s1">'densenet161'</span><span class="p">:</span> <span class="n">densenet161</span><span class="p">,</span>
<span class="s1">'densenet169'</span><span class="p">:</span> <span class="n">densenet169</span><span class="p">,</span>
<span class="s1">'densenet201'</span><span class="p">:</span> <span class="n">densenet201</span><span class="p">,</span>
<span class="s1">'squeezenet1.0'</span><span class="p">:</span> <span class="n">squeezenet1_0</span><span class="p">,</span>
<span class="s1">'squeezenet1.1'</span><span class="p">:</span> <span class="n">squeezenet1_1</span><span class="p">,</span>
<span class="s1">'inceptionv3'</span><span class="p">:</span> <span class="n">inception_v3</span><span class="p">,</span>
<span class="s1">'mobilenet1.0'</span><span class="p">:</span> <span class="n">mobilenet1_0</span><span class="p">,</span>
<span class="s1">'mobilenet0.75'</span><span class="p">:</span> <span class="n">mobilenet0_75</span><span class="p">,</span>
<span class="s1">'mobilenet0.5'</span><span class="p">:</span> <span class="n">mobilenet0_5</span><span class="p">,</span>
<span class="s1">'mobilenet0.25'</span><span class="p">:</span> <span class="n">mobilenet0_25</span>
<span class="p">}</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">if</span> <span class="n">name</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">models</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="s1">'Model </span><span class="si">%s</span><span class="s1"> is not supported. Available options are</span><span class="se">\n\t</span><span class="si">%s</span><span class="s1">'</span><span class="o">%</span><span class="p">(</span>
<span class="n">name</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n\t</span><span class="s1">'</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">models</span><span class="o">.</span><span class="n">keys</span><span class="p">()))))</span>
<span class="k">return</span> <span class="n">models</span><span class="p">[</span><span class="n">name</span><span class="p">](</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
<div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
</div>
</div>
</div><!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="footer">
<div class="section-disclaimer">
<div class="container">
<div>
<img height="60" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png"/>
<p>
Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
</p>
<p>
"Copyright © 2017, The Apache Software Foundation
Apache MXNet, MXNet, Apache, the Apache feather, and the Apache MXNet project logo are either registered trademarks or trademarks of the Apache Software Foundation."
</p>
</div>
</div>
</div>
</div> <!-- pagename != index -->
</div>
<script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="../../../../_static/js/sidebar.js" type="text/javascript"></script>
<script src="../../../../_static/js/search.js" type="text/javascript"></script>
<script src="../../../../_static/js/navbar.js" type="text/javascript"></script>
<script src="../../../../_static/js/clipboard.min.js" type="text/javascript"></script>
<script src="../../../../_static/js/copycode.js" type="text/javascript"></script>
<script src="../../../../_static/js/page.js" type="text/javascript"></script>
<script type="text/javascript">
$('body').ready(function () {
$('body').css('visibility', 'visible');
});
</script>
</body>
</html>