Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Created April 29, 2020 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmic-cortex/10699fd280124e8420e7155d2869be5e to your computer and use it in GitHub Desktop.
Save cosmic-cortex/10699fd280124e8420e7155d2869be5e to your computer and use it in GitHub Desktop.
from PIL import Image
from torchvision import transforms as T
image = Image.open('cat.jpg')
transform = T.Compose([T.Resize((224, 224)), T.ToTensor()])
X = transform(image).unsqueeze(dim=0).to(device)
out = model(X)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment