ariG23498 commited on
Commit
5752380
1 Parent(s): d09e8bd

fix: example path change and tensor to PIL

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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].numpy(),
26
- inv2_kernel[0, ..., None].numpy(),
27
- inv3_kernel[0, ..., None].numpy(),
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=[["./examples/llama.jpeg"], ["./examples/dalai-lamao.jpeg"]],
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()