Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -302,10 +302,19 @@ if __name__ == "__main__":
|
|
| 302 |
gr.inputs.Dropdown(["merge", "first"], label="Inpaint Mode")
|
| 303 |
]
|
| 304 |
|
| 305 |
-
outputs = [
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
|
| 310 |
iface = gr.Interface(run_grounded_sam, inputs, outputs, title="Grounded SAM Demo")
|
| 311 |
|
|
|
|
| 302 |
gr.inputs.Dropdown(["merge", "first"], label="Inpaint Mode")
|
| 303 |
]
|
| 304 |
|
| 305 |
+
outputs = []
|
| 306 |
+
|
| 307 |
+
if task_type == 'det':
|
| 308 |
+
outputs.append(gr.outputs.Image(type="pil", label="Output Image"))
|
| 309 |
+
elif task_type == 'seg' or task_type == 'automatic':
|
| 310 |
+
outputs.append(gr.outputs.Image(type="pil", label="Output Image"))
|
| 311 |
+
outputs.append(gr.outputs.Image(type="pil", label="Output Mask"))
|
| 312 |
+
elif task_type == 'inpainting':
|
| 313 |
+
outputs.append(gr.outputs.Image(type="pil", label="Output Image"))
|
| 314 |
+
outputs.append(gr.outputs.Image(type="pil", label="Output Mask"))
|
| 315 |
+
else:
|
| 316 |
+
print("task_type:{} error!".format(task_type))
|
| 317 |
+
|
| 318 |
|
| 319 |
iface = gr.Interface(run_grounded_sam, inputs, outputs, title="Grounded SAM Demo")
|
| 320 |
|