File size: 389 Bytes
db1e9a5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import gradio as gr
from PIL import Image
from u2net_utils import remove_background
def process(image):
result = remove_background(image)
return result
demo = gr.Interface(
fn=process,
inputs=gr.Image(type="pil"),
outputs=gr.Image(type="pil"),
title="Remove Background",
description="Upload an image and remove the background using U²-Net."
)
demo.launch()
|