jaydeepkarale commited on
Commit
9fd2345
1 Parent(s): 31a6a5e

Create new file

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from rembg import remove
3
+
4
+
5
+ def remove_background(input_img):
6
+ output_path = f'output.png + {id(input_img)}'
7
+ output = remove(input_img)
8
+ output.save(output_path)
9
+ return output_path
10
+
11
+ # type = pil passes the image as a Pillow object
12
+ demo = gr.Interface(remove_background, gr.Image(type="pil"), "image")
13
+ demo.launch()