Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytorch open image

from PIL import Image
import torchvision.transforms.functional as TF

image = Image.open('YOUR_PATH')
x = TF.to_tensor(image)
x.unsqueeze_(0)
print(x.shape)

output = model(X)
Source by discuss.pytorch.org #
 
PREVIOUS NEXT
Tagged: #pytorch #open #image
ADD COMMENT
Topic
Name
4+4 =