import gradio as gr import shutil from PIL import Image from modnet_utils import remove_background shutil.rmtree('__pycache__', ignore_errors=True) def process(image: Image.Image) -> Image.Image: return remove_background_modnet(image) demo = gr.Interface(fn=process, inputs=gr.Image(type="pil"), outputs="image") demo.launch()