Spaces:
Sleeping
Sleeping
Josue Aaron Soriano Rivero
commited on
Commit
•
ab5c1d1
1
Parent(s):
2114012
detach
Browse files
utils.py
CHANGED
@@ -48,5 +48,5 @@ def carga_modelo(nombre_modelo="ceyda/butterfly_cropped_uniq1K_512", model_versi
|
|
48 |
def genera(gan, batch_size=1):
|
49 |
with torch.no_grad():
|
50 |
ims = gan.G(torch.randn(batch_size, gan.latent_dim)).clamp(0.0, 1.0) * 255
|
51 |
-
ims = ims.permute(0,2,3,1).
|
52 |
return ims
|
|
|
48 |
def genera(gan, batch_size=1):
|
49 |
with torch.no_grad():
|
50 |
ims = gan.G(torch.randn(batch_size, gan.latent_dim)).clamp(0.0, 1.0) * 255
|
51 |
+
ims = ims.permute(0,2,3,1).detach().cpu().numpy().astype(np.uint8)
|
52 |
return ims
|