Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
5c094092
Commit
5c094092
authored
Sep 20, 2017
by
Alykhan Tejani
Committed by
GitHub
Sep 20, 2017
Browse files
Merge pull request #266 from kmike/patch-2
add all models to torchvision.models docstring
parents
5aff89e1
249030bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
torchvision/models/__init__.py
torchvision/models/__init__.py
+11
-4
No files found.
torchvision/models/__init__.py
View file @
5c094092
...
@@ -6,6 +6,7 @@ architectures:
...
@@ -6,6 +6,7 @@ architectures:
- `ResNet`_
- `ResNet`_
- `SqueezeNet`_
- `SqueezeNet`_
- `DenseNet`_
- `DenseNet`_
- `Inception`_ v3
You can construct a model with random weights by calling its constructor:
You can construct a model with random weights by calling its constructor:
...
@@ -14,22 +15,27 @@ You can construct a model with random weights by calling its constructor:
...
@@ -14,22 +15,27 @@ You can construct a model with random weights by calling its constructor:
import torchvision.models as models
import torchvision.models as models
resnet18 = models.resnet18()
resnet18 = models.resnet18()
alexnet = models.alexnet()
alexnet = models.alexnet()
vgg16 = models.vgg16()
squeezenet = models.squeezenet1_0()
squeezenet = models.squeezenet1_0()
densenet = models.densenet_161()
densenet = models.densenet_161()
inception = models.inception_v3()
We provide pre-trained models for the ResNet variants and AlexNet, using the
We provide pre-trained models, using the PyTorch :mod:`torch.utils.model_zoo`.
PyTorch :mod:`torch.utils.model_zoo`. These can constructed by passing
These can be constructed by passing ``pretrained=True``:
``pretrained=True``:
.. code:: python
.. code:: python
import torchvision.models as models
import torchvision.models as models
resnet18 = models.resnet18(pretrained=True)
resnet18 = models.resnet18(pretrained=True)
alexnet = models.alexnet(pretrained=True)
alexnet = models.alexnet(pretrained=True)
squeezenet = models.squeezenet1_0(pretrained=True)
vgg16 = models.vgg16(pretrained=True)
densenet = models.densenet_161(pretrained=True)
inception = models.inception_v3(pretrained=True)
All pre-trained models expect input images normalized in the same way,
All pre-trained models expect input images normalized in the same way,
i.e. mini-batches of 3-channel RGB images of shape (3 x H x W),
i.e. mini-batches of 3-channel RGB images of shape (3 x H x W),
where H and W are expected to be atleast 224.
where 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
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]``.
using ``mean = [0.485, 0.456, 0.406]`` and ``std = [0.229, 0.224, 0.225]``.
You can use the following transform to normalize::
You can use the following transform to normalize::
...
@@ -74,6 +80,7 @@ Densenet-161 22.35 6.20
...
@@ -74,6 +80,7 @@ Densenet-161 22.35 6.20
.. _ResNet: https://arxiv.org/abs/1512.03385
.. _ResNet: https://arxiv.org/abs/1512.03385
.. _SqueezeNet: https://arxiv.org/abs/1602.07360
.. _SqueezeNet: https://arxiv.org/abs/1602.07360
.. _DenseNet: https://arxiv.org/abs/1608.06993
.. _DenseNet: https://arxiv.org/abs/1608.06993
.. _Inception: https://arxiv.org/abs/1512.00567
"""
"""
from
.alexnet
import
*
from
.alexnet
import
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment