Spaces:
Sleeping
Sleeping
using strings as input/outputs
Browse files
app.py
CHANGED
@@ -92,6 +92,9 @@ def NormalizeData(data):
|
|
92 |
|
93 |
# Visualization
|
94 |
def visualize_similarities(image1, image2):
|
|
|
|
|
|
|
95 |
a = get_layer4(image1).squeeze()
|
96 |
b = get_layer4(image2).squeeze()
|
97 |
sim1, sim2 = compute_spatial_similarity(a, b)
|
@@ -127,12 +130,9 @@ def visualize_similarities(image1, image2):
|
|
127 |
# GRADIO APP
|
128 |
main = gr.Interface(
|
129 |
fn=visualize_similarities,
|
130 |
-
inputs=[
|
131 |
-
gr.Image(type="pil"),
|
132 |
-
gr.Image(type="pil"),
|
133 |
-
],
|
134 |
allow_flagging="never",
|
135 |
-
outputs=
|
136 |
cache_examples=True,
|
137 |
enable_queue=False,
|
138 |
examples=[
|
|
|
92 |
|
93 |
# Visualization
|
94 |
def visualize_similarities(image1, image2):
|
95 |
+
image1 = Image.fromarray(image1)
|
96 |
+
image2 = Image.fromarray(image2)
|
97 |
+
|
98 |
a = get_layer4(image1).squeeze()
|
99 |
b = get_layer4(image2).squeeze()
|
100 |
sim1, sim2 = compute_spatial_similarity(a, b)
|
|
|
130 |
# GRADIO APP
|
131 |
main = gr.Interface(
|
132 |
fn=visualize_similarities,
|
133 |
+
inputs=["image", "image"],
|
|
|
|
|
|
|
134 |
allow_flagging="never",
|
135 |
+
outputs="plot",
|
136 |
cache_examples=True,
|
137 |
enable_queue=False,
|
138 |
examples=[
|