MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / generagedImage

Function generagedImage

fc-CGANCode/mainWindow.py:78–90  ·  view source on GitHub ↗

:param model: :return:

(model)

Source from the content-addressed store, hash-verified

76 return True
77
78def generagedImage(model):
79 """
80 :param model:
81 :return:
82 """
83 noise = torch.randn(size=(16, config.LATENT_DIM)).to(config.DEVICE)
84 # fixed labels
85 y_ = (torch.rand(16, 1) * config.NUM_CLASSES).type(torch.LongTensor)
86 y_fixed = torch.zeros(16, config.NUM_CLASSES)
87 y_fixed = y_fixed.scatter_(1, y_.view(16, 1), 1)
88
89 gen_imgs = model(noise, y_fixed).view(-1, config.CHANNELS, config.IMG_SIZE, config.IMG_SIZE)
90 save_image(gen_imgs.data, 'cur.png')
91
92def loadModel(model,root):
93 """

Callers 1

loadModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected