nolenfelten commited on
Commit
95234b5
·
verified ·
1 Parent(s): b0c0608

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from rembg import remove
3
+ from PIL import Image
4
+ import numpy as np
5
+ import io
6
+
7
+ def remove_bg(image):
8
+ input_image = Image.fromarray(np.array(image))
9
+ output_image = remove(input_image)
10
+ return output_image
11
+
12
+ iface = gr.Interface(
13
+ fn=remove_bg,
14
+ inputs=gr.Image(type="pil"),
15
+ outputs=gr.Image(type="pil"),
16
+ title="Background Remover",
17
+ description="Upload an image to remove the background."
18
+ )
19
+
20
+ iface.launch()