Spaces:
Runtime error
Runtime error
fix: example path change and tensor to PIL
Browse files
app.py
CHANGED
@@ -22,9 +22,9 @@ def infer(test_image):
|
|
22 |
inv3_kernel = tf.reduce_sum(inv3_kernel, axis=[-1, -2, -3])
|
23 |
|
24 |
return (
|
25 |
-
inv1_kernel[0, ..., None]
|
26 |
-
inv2_kernel[0, ..., None]
|
27 |
-
inv3_kernel[0, ..., None]
|
28 |
)
|
29 |
|
30 |
iface = gr.Interface(
|
@@ -40,5 +40,5 @@ iface = gr.Interface(
|
|
40 |
gr.outputs.Image(label="Activation from Kernel 2"),
|
41 |
gr.outputs.Image(label="Activation from Kernel 3"),
|
42 |
],
|
43 |
-
examples=[["
|
44 |
).launch()
|
|
|
22 |
inv3_kernel = tf.reduce_sum(inv3_kernel, axis=[-1, -2, -3])
|
23 |
|
24 |
return (
|
25 |
+
tf.keras.utils.array_to_img(inv1_kernel[0, ..., None]),
|
26 |
+
tf.keras.utils.array_to_img(inv2_kernel[0, ..., None]),
|
27 |
+
tf.keras.utils.array_to_img(inv3_kernel[0, ..., None]),
|
28 |
)
|
29 |
|
30 |
iface = gr.Interface(
|
|
|
40 |
gr.outputs.Image(label="Activation from Kernel 2"),
|
41 |
gr.outputs.Image(label="Activation from Kernel 3"),
|
42 |
],
|
43 |
+
examples=[["examples/lama.jpeg"], ["examples/dalai_lama.jpeg"]],
|
44 |
).launch()
|