|
3 | 3 | This repository consists of:
|
4 | 4 |
|
5 | 5 | - [vision.datasets](#datasets) : Data loaders for popular vision datasets
|
| 6 | +- [vision.models](#models) : Definitions for popular model architectures, such as AlexNet, VGG, and ResNet and pre-trained models. |
6 | 7 | - [vision.transforms](#transforms) : Common image transformations such as random crop, rotations etc.
|
7 | 8 | - [vision.utils](#utils) : Useful stuff such as saving tensor (3 x H x W) as image to disk, given a mini-batch creating a grid of images, etc.
|
8 |
| -- `[WIP] vision.models` : Model definitions and Pre-trained models for popular models such as AlexNet, VGG, ResNet etc. |
9 | 9 |
|
10 | 10 | # Installation
|
11 | 11 |
|
@@ -140,6 +140,31 @@ The data is preprocessed [as described here](https://github.com/facebook/fb.resn
|
140 | 140 |
|
141 | 141 | [Here is an example](https://github.com/pytorch/examples/blob/27e2a46c1d1505324032b1d94fc6ce24d5b67e97/imagenet/main.py#L48-L62).
|
142 | 142 |
|
| 143 | +# Models |
| 144 | + |
| 145 | +The models subpackage contains definitions for the following model architectures: |
| 146 | + |
| 147 | + - [AlexNet](https://arxiv.org/abs/1404.5997): AlexNet variant from the "One weird trick" paper. |
| 148 | + - [VGG](https://arxiv.org/abs/1409.1556): VGG-11, VGG-13, VGG-16, VGG-19 (with and without batch normalization) |
| 149 | + - [ResNet](https://arxiv.org/abs/1512.03385): ResNet-18, ResNet-34, ResNet-50, ResNet-101, ResNet-152 |
| 150 | + |
| 151 | +You can construct a model with random weights by calling its constructor: |
| 152 | + |
| 153 | +```python |
| 154 | +import torchvision.models as models |
| 155 | +resnet18 = models.resnet18() |
| 156 | +alexnet = models.alexnet() |
| 157 | +``` |
| 158 | + |
| 159 | + We provide pre-trained models for the ResNet variants and AlexNet, using the |
| 160 | + PyTorch [model zoo](http://pytorch.org/docs/model_zoo.html). These can |
| 161 | + be constructed by passing `pretrained=True`: |
| 162 | + |
| 163 | + ```python |
| 164 | + import torchvision.models as models |
| 165 | + resnet18 = models.resnet18(pretrained=True) |
| 166 | + alexnet = models.alexnet(pretrained=True) |
| 167 | +``` |
143 | 168 |
|
144 | 169 | # Transforms
|
145 | 170 |
|
|
0 commit comments