Skip to content

Commit

Permalink
document normalization for pre-trained models
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Mar 18, 2017
1 parent b13bac5 commit 60d6e5a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========

Expand Down Expand Up @@ -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)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 60d6e5a

Please sign in to comment.