Spaces:
Sleeping
Sleeping
convert n_targets to int, wording change
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def process_image(input_image, learning_rate, iterations, n_targets, seed):
|
|
27 |
|
28 |
|
29 |
torch.manual_seed(int(seed))
|
30 |
-
random_indices = torch.randperm(1000)[:n_targets].to(pixel_values.device)
|
31 |
|
32 |
for iteration in range(int(iterations)):
|
33 |
model.zero_grad()
|
@@ -55,7 +55,7 @@ iface = gr.Interface(
|
|
55 |
gr.Number(value=4.0, label="Learning Rate"),
|
56 |
gr.Number(value=4, label="Iterations"),
|
57 |
gr.Number(value=420, label="Seed"),
|
58 |
-
gr.Number(value=50, minimum=1, maximum=1000, label="
|
59 |
],
|
60 |
outputs=[gr.Image(type="numpy", label="ViT-Dreamed Image")]
|
61 |
)
|
|
|
27 |
|
28 |
|
29 |
torch.manual_seed(int(seed))
|
30 |
+
random_indices = torch.randperm(1000)[:int(n_targets)].to(pixel_values.device)
|
31 |
|
32 |
for iteration in range(int(iterations)):
|
33 |
model.zero_grad()
|
|
|
55 |
gr.Number(value=4.0, label="Learning Rate"),
|
56 |
gr.Number(value=4, label="Iterations"),
|
57 |
gr.Number(value=420, label="Seed"),
|
58 |
+
gr.Number(value=50, minimum=1, maximum=1000, label="Number of Random Target Class Activations to Maximise"),
|
59 |
],
|
60 |
outputs=[gr.Image(type="numpy", label="ViT-Dreamed Image")]
|
61 |
)
|