Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,15 +113,7 @@ def infer(
|
|
| 113 |
pil_images = []
|
| 114 |
for item in [image_1, image_2, image_3]:
|
| 115 |
if item is None: continue
|
| 116 |
-
|
| 117 |
-
if isinstance(item[0], Image.Image):
|
| 118 |
-
pil_images.append(item[0].convert("RGB"))
|
| 119 |
-
elif isinstance(item[0], str):
|
| 120 |
-
pil_images.append(Image.open(item[0]).convert("RGB"))
|
| 121 |
-
elif hasattr(item, "name"):
|
| 122 |
-
pil_images.append(Image.open(item.name).convert("RGB"))
|
| 123 |
-
except Exception:
|
| 124 |
-
continue
|
| 125 |
|
| 126 |
if height==256 and width==256:
|
| 127 |
height, width = None, None
|
|
@@ -178,9 +170,10 @@ with gr.Blocks(css=css) as demo:
|
|
| 178 |
""")
|
| 179 |
with gr.Row():
|
| 180 |
with gr.Column():
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
|
|
|
| 184 |
|
| 185 |
with gr.Column():
|
| 186 |
result = gr.Image(label="Result", type="pil", interactive=False)
|
|
|
|
| 113 |
pil_images = []
|
| 114 |
for item in [image_1, image_2, image_3]:
|
| 115 |
if item is None: continue
|
| 116 |
+
pil_images.append(item.convert("RGB"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
if height==256 and width==256:
|
| 119 |
height, width = None, None
|
|
|
|
| 170 |
""")
|
| 171 |
with gr.Row():
|
| 172 |
with gr.Column():
|
| 173 |
+
with gr.Row():
|
| 174 |
+
image_1 = gr.Image(label="image 1", type="pil", interactive=True)
|
| 175 |
+
image_2 = gr.Image(label="image 2", type="pil", interactive=True)
|
| 176 |
+
image_3 = gr.Image(label="image 3", type="pil", interactive=True)
|
| 177 |
|
| 178 |
with gr.Column():
|
| 179 |
result = gr.Image(label="Result", type="pil", interactive=False)
|