Spaces:
Sleeping
Sleeping
use CLS token, tuning default params
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def process_image(input_image, learning_rate, iterations):
|
|
17 |
|
18 |
def get_encoder_activations(x):
|
19 |
encoder_output = model.vit(x)
|
20 |
-
final_activations = encoder_output.last_hidden_state
|
21 |
return final_activations
|
22 |
|
23 |
image = input_image.convert('RGB')
|
@@ -47,8 +47,8 @@ iface = gr.Interface(
|
|
47 |
fn=process_image,
|
48 |
inputs=[
|
49 |
gr.Image(type="pil"),
|
50 |
-
gr.Number(value=0
|
51 |
-
gr.Number(value=
|
52 |
],
|
53 |
outputs=[gr.Image(type="numpy", label="ViT-Dreamed Image")]
|
54 |
)
|
|
|
17 |
|
18 |
def get_encoder_activations(x):
|
19 |
encoder_output = model.vit(x)
|
20 |
+
final_activations = encoder_output.last_hidden_state[:,0,:]
|
21 |
return final_activations
|
22 |
|
23 |
image = input_image.convert('RGB')
|
|
|
47 |
fn=process_image,
|
48 |
inputs=[
|
49 |
gr.Image(type="pil"),
|
50 |
+
gr.Number(value=4.0, label="Learning Rate"),
|
51 |
+
gr.Number(value=4, label="Iterations")
|
52 |
],
|
53 |
outputs=[gr.Image(type="numpy", label="ViT-Dreamed Image")]
|
54 |
)
|