MCPcopy Create free account
hub / github.com/pytorch/tutorials / image_loader

Function image_loader

advanced_source/neural_style_tutorial.py:105–109  ·  view source on GitHub ↗
(image_name)

Source from the content-addressed store, hash-verified

103
104
105def image_loader(image_name):
106 image = Image.open(image_name)
107 # fake batch dimension required to fit network's input dimensions
108 image = loader(image).unsqueeze(0)
109 return image.to(device, torch.float)
110
111
112style_img = image_loader("./data/images/neural-style/picasso.jpg")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected