Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,21 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from rembg import remove
|
| 3 |
-
from PIL import Image
|
| 4 |
-
import io
|
| 5 |
-
|
| 6 |
-
def remove_bg(image):
|
| 7 |
-
img_bytes = io.BytesIO()
|
| 8 |
-
image.save(img_bytes, format='PNG')
|
| 9 |
-
result = remove(img_bytes.getvalue())
|
| 10 |
-
return Image.open(io.BytesIO(result))
|
| 11 |
-
|
| 12 |
-
demo = gr.Interface(
|
| 13 |
-
fn=remove_bg,
|
| 14 |
-
inputs=gr.Image(type="pil", label="Upload an Image"),
|
| 15 |
-
outputs=gr.Image(label="Background Removed"),
|
| 16 |
-
title="AI Background Remover",
|
| 17 |
-
description="
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from rembg import remove
|
| 3 |
+
from PIL import Image
|
| 4 |
+
import io
|
| 5 |
+
|
| 6 |
+
def remove_bg(image):
|
| 7 |
+
img_bytes = io.BytesIO()
|
| 8 |
+
image.save(img_bytes, format='PNG')
|
| 9 |
+
result = remove(img_bytes.getvalue())
|
| 10 |
+
return Image.open(io.BytesIO(result))
|
| 11 |
+
|
| 12 |
+
demo = gr.Interface(
|
| 13 |
+
fn=remove_bg,
|
| 14 |
+
inputs=gr.Image(type="pil", label="🖼️ Upload an Image"),
|
| 15 |
+
outputs=gr.Image(label="✨ Background Removed"),
|
| 16 |
+
title="🎨 AI Background Remover",
|
| 17 |
+
description="A sleek AI tool to instantly remove backgrounds from your images using **Rembg**. Just upload and magic happens ✨",
|
| 18 |
+
theme=gr.themes.Soft(primary_hue="emerald", secondary_hue="teal")
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
demo.launch()
|