Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,14 +45,12 @@ def image_create(seed: int, truncation_psi: float):
|
|
| 45 |
#gaussian=gaussian_radius,
|
| 46 |
log_visual_freq=1000
|
| 47 |
))
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
img_out, _, _ = generator([latent])
|
| 52 |
imgs_arr = make_image(img_out)
|
| 53 |
-
return imgs_arr[0]
|
| 54 |
-
n=np.zeros((10,10,3))
|
| 55 |
-
n[0][0]=[0,0,254]
|
| 56 |
return n
|
| 57 |
|
| 58 |
def main():
|
|
|
|
| 45 |
#gaussian=gaussian_radius,
|
| 46 |
log_visual_freq=1000
|
| 47 |
))
|
| 48 |
+
device = th.device()
|
| 49 |
+
generator = create_generator("stylegan2-ffhq-config-f.pt","feng2022/Time-TravelRephotography_stylegan2-ffhq-config-f",args,device)
|
| 50 |
+
latent = torch.randn((1, 512), device=device)
|
| 51 |
img_out, _, _ = generator([latent])
|
| 52 |
imgs_arr = make_image(img_out)
|
| 53 |
+
return imgs_arr[0]/255
|
|
|
|
|
|
|
| 54 |
return n
|
| 55 |
|
| 56 |
def main():
|