Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import spaces
|
|
6 |
import torch
|
7 |
import torch.nn as nn
|
8 |
import torch.optim as optim
|
9 |
-
import torch.amp as amp
|
10 |
import torchvision.transforms as transforms
|
11 |
import torchvision.models as models
|
12 |
import gradio as gr
|
@@ -102,7 +101,7 @@ def inference(content_image, style_image, style_strength, progress=gr.Progress(t
|
|
102 |
generated_img = content_img.clone().requires_grad_(True)
|
103 |
optimizer = optim.Adam([generated_img], lr=lr)
|
104 |
|
105 |
-
for _ in tqdm(range(iters)
|
106 |
generated_features = model(generated_img)
|
107 |
content_features = model(content_img)
|
108 |
style_features = model(style_img)
|
|
|
6 |
import torch
|
7 |
import torch.nn as nn
|
8 |
import torch.optim as optim
|
|
|
9 |
import torchvision.transforms as transforms
|
10 |
import torchvision.models as models
|
11 |
import gradio as gr
|
|
|
101 |
generated_img = content_img.clone().requires_grad_(True)
|
102 |
optimizer = optim.Adam([generated_img], lr=lr)
|
103 |
|
104 |
+
for _ in tqdm(range(iters)):
|
105 |
generated_features = model(generated_img)
|
106 |
content_features = model(content_img)
|
107 |
style_features = model(style_img)
|