Spaces:
Runtime error
Runtime error
app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ def compute_loss(input_image):
|
|
73 |
loss += coeff * tf.reduce_sum(tf.square(activation[:, 2:-2, 2:-2, :])) / scaling
|
74 |
return loss
|
75 |
|
76 |
-
|
77 |
with tf.GradientTape() as tape:
|
78 |
tape.watch(img)
|
79 |
loss = compute_loss(img)
|
@@ -128,11 +128,11 @@ iface = gr.Interface(classify_image,image,label,
|
|
128 |
#outputs=[
|
129 |
# gr.outputs.Textbox(label="Engine issue"),
|
130 |
# gr.outputs.Textbox(label="Engine issue score")],
|
131 |
-
examples=["sky.jpg"], title="
|
132 |
-
description = "Model for
|
133 |
article = "Author: <a href=\"https://huggingface.co/joheras\">Jónathan Heras</a>"
|
134 |
# examples = ["sample.csv"],
|
135 |
)
|
136 |
|
137 |
|
138 |
-
iface.launch()
|
|
|
73 |
loss += coeff * tf.reduce_sum(tf.square(activation[:, 2:-2, 2:-2, :])) / scaling
|
74 |
return loss
|
75 |
|
76 |
+
def gradient_ascent_step(img, learning_rate):
|
77 |
with tf.GradientTape() as tape:
|
78 |
tape.watch(img)
|
79 |
loss = compute_loss(img)
|
|
|
128 |
#outputs=[
|
129 |
# gr.outputs.Textbox(label="Engine issue"),
|
130 |
# gr.outputs.Textbox(label="Engine issue score")],
|
131 |
+
examples=["sky.jpg"], title="Deep dream",
|
132 |
+
description = "Model for applying Deep Dream to an image.",
|
133 |
article = "Author: <a href=\"https://huggingface.co/joheras\">Jónathan Heras</a>"
|
134 |
# examples = ["sample.csv"],
|
135 |
)
|
136 |
|
137 |
|
138 |
+
iface.launch()
|