Reeve commited on
Commit
0f8fc17
·
1 Parent(s): 910e300

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -19,7 +19,7 @@ pretransform = transforms.Compose([
19
  def pipeline(img):
20
  img = model_build.img_preprocess(img, pretransform)
21
  with torch.no_grad():
22
- _, latent_space = psp(img.float(), randomize_noise=True, resize=False, return_latents=True)
23
  img = stylegan2(latent_space, noise_mode='none')
24
  img = Image.fromarray(np.array((img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8).squeeze(0)[20:-20,:,:]))
25
  img.save('output.png')
 
19
  def pipeline(img):
20
  img = model_build.img_preprocess(img, pretransform)
21
  with torch.no_grad():
22
+ latent_space = psp(img.float(), randomize_noise=True, resize=False, return_latents=True)
23
  img = stylegan2(latent_space, noise_mode='none')
24
  img = Image.fromarray(np.array((img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8).squeeze(0)[20:-20,:,:]))
25
  img.save('output.png')