Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
+
from rembg import remove
|
| 4 |
+
from PIL import Image
|
| 5 |
+
import io
|
| 6 |
+
|
| 7 |
+
def remove_bg(image):
|
| 8 |
+
output_image = remove(image)
|
| 9 |
+
return output_image
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(fn=remove_bg, inputs=gr.Image(type="pil"), outputs="image")
|
| 12 |
+
|
| 13 |
+
if __name__ == "__main__":
|
| 14 |
+
demo.launch()
|