akhaliq HF staff commited on
Commit
0c87638
1 Parent(s): 76f9bf9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -15,11 +15,14 @@ def inference(img):
15
  output_dir='output',
16
  visualization=True)
17
  print(result)
18
- return result[0][0]
19
 
20
-
 
 
 
21
  title="u2Net"
22
  description="U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection"
23
 
24
  examples=[['cat2.jpg']]
25
- gr.Interface(inference,gr.inputs.Image(type="filepath"),"label",title=title,description=description,examples=examples).launch(enable_queue=True)
 
15
  output_dir='output',
16
  visualization=True)
17
  print(result)
18
+ return result[0]['front'][:,:,::-1], result[0]['mask']
19
 
20
+ outputs = [
21
+ gr.outputs.Image(type="numpy",label="Front"),
22
+ gr.outputs.Image(type="numpy",label="Mask")
23
+ ]
24
  title="u2Net"
25
  description="U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection"
26
 
27
  examples=[['cat2.jpg']]
28
+ gr.Interface(inference,gr.inputs.Image(type="filepath"),outputs,title=title,description=description,examples=examples).launch(enable_queue=True)