Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
1ff61c1
1
Parent(s):
f7de572
Add example images.
Browse files
app.py
CHANGED
@@ -34,8 +34,8 @@ if os.path.exists(state_dict):
|
|
34 |
model.eval()
|
35 |
|
36 |
|
37 |
-
def pred_maps(
|
38 |
-
|
39 |
image_shapes = [image.shape[:2] for image in images]
|
40 |
images = [Image.fromarray(image) for image in images]
|
41 |
|
@@ -61,7 +61,7 @@ def pred_maps(images):
|
|
61 |
|
62 |
|
63 |
N = 4
|
64 |
-
examples = [[_] for _ in glob('example_images/butterfly/*')][:N]
|
65 |
|
66 |
ipt = [gr.Image().style(width=600, height=150) for _ in range(N)]
|
67 |
opt = [gr.Image().style(width=600, height=150) for _ in range(N)]
|
@@ -69,7 +69,7 @@ demo = gr.Interface(
|
|
69 |
fn=pred_maps,
|
70 |
inputs=ipt,
|
71 |
outputs=opt,
|
72 |
-
examples=examples,
|
73 |
interpretation='default',
|
74 |
title='Online demo for `GCoNet+: A Stronger Group Collaborative Co-Salient Object Detector (T-PAMI 2023)`',
|
75 |
description='Upload pictures, most of which contain salient objects of the same class. Our demo will give you the binary maps of these co-salient objects :)\n**********Example images need to be dropped into each block, instead of click.**********'
|
|
|
34 |
model.eval()
|
35 |
|
36 |
|
37 |
+
def pred_maps(image_1, image_2, image_3, image_4):
|
38 |
+
images = [image_1, image_2, image_3, image_4]
|
39 |
image_shapes = [image.shape[:2] for image in images]
|
40 |
images = [Image.fromarray(image) for image in images]
|
41 |
|
|
|
61 |
|
62 |
|
63 |
N = 4
|
64 |
+
# examples = [[_] for _ in glob('example_images/butterfly/*')][:N]
|
65 |
|
66 |
ipt = [gr.Image().style(width=600, height=150) for _ in range(N)]
|
67 |
opt = [gr.Image().style(width=600, height=150) for _ in range(N)]
|
|
|
69 |
fn=pred_maps,
|
70 |
inputs=ipt,
|
71 |
outputs=opt,
|
72 |
+
# examples=examples,
|
73 |
interpretation='default',
|
74 |
title='Online demo for `GCoNet+: A Stronger Group Collaborative Co-Salient Object Detector (T-PAMI 2023)`',
|
75 |
description='Upload pictures, most of which contain salient objects of the same class. Our demo will give you the binary maps of these co-salient objects :)\n**********Example images need to be dropped into each block, instead of click.**********'
|