jesoteric commited on
Commit
22e15d0
·
1 Parent(s): bcbc0b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -302,10 +302,19 @@ if __name__ == "__main__":
302
  gr.inputs.Dropdown(["merge", "first"], label="Inpaint Mode")
303
  ]
304
 
305
- outputs = [
306
- gr.outputs.Image(type="pil", label="Output Image"),
307
- gr.outputs.Image(type="pil", label="Output Mask")
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