Commit 60d6e5a6 authored by Soumith Chintala's avatar Soumith Chintala
Browse files

document normalization for pre-trained models

parent b13bac51
......@@ -271,6 +271,15 @@ These can be constructed by passing ``pretrained=True``:
squeezenet = models.squeezenet1_0(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 (3 x H x W), where H and W are expected
to be atleast 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]`
An example of such normalization can be found in `the imagenet example here` <https://github.com/pytorch/examples/blob/42e5b996718797e45c46a25c55b031e6768f8440/imagenet/main.py#L89-L101>
Transforms
==========
......@@ -395,7 +404,7 @@ normalize the image.
scale_each=True will scale each image in the batch of images separately rather than
computing the (min, max) over all images.
[Example usage is given in this notebook](https://gist.github.com/anonymous/bf16430f7750c023141c562f3e9f2a91)
`Example usage is given in this notebook` <https://gist.github.com/anonymous/bf16430f7750c023141c562f3e9f2a91>
save\_image(tensor, filename, nrow=8, padding=2, normalize=False, range=None, scale\_each=False)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment