SerdarHelli commited on
Commit
0fc4a2a
1 Parent(s): 1cdd16d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -54,10 +54,10 @@ def predict(Seed,noise_mode,truncation_psi,trans_x,trans_y,angle):
54
  # Construct an inverse rotation/translation matrix and pass to the generator. The
55
  # generator expects this matrix as an inverse to avoid potentially failing numerical
56
  # operations in the network.
57
- if hasattr(G.synthesis, 'input'):
58
- m = make_transform((trans_x,trans_y), angle)
59
- m = np.linalg.inv(m)
60
- G.synthesis.input.transform.copy_(torch.from_numpy(m))
61
 
62
  img = G(z, label, truncation_psi=truncation_psi, noise_mode=noise_mode)
63
  img = (img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8)
 
54
  # Construct an inverse rotation/translation matrix and pass to the generator. The
55
  # generator expects this matrix as an inverse to avoid potentially failing numerical
56
  # operations in the network.
57
+
58
+ m = make_transform((trans_x,trans_y), angle)
59
+ m = np.linalg.inv(m)
60
+ G.synthesis.input.transform.copy_(torch.from_numpy(m))
61
 
62
  img = G(z, label, truncation_psi=truncation_psi, noise_mode=noise_mode)
63
  img = (img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8)