Spaces:
Runtime error
Runtime error
import gradio as gr | |
from rembg import remove | |
from PIL import Image | |
import numpy as np | |
import io | |
def remove_bg(image): | |
input_image = Image.fromarray(np.array(image)) | |
output_image = remove(input_image) | |
return output_image | |
iface = gr.Interface( | |
fn=remove_bg, | |
inputs=gr.Image(type="pil"), | |
outputs=gr.Image(type="pil"), | |
title="Background Remover", | |
description="Upload an image to remove the background." | |
) | |
iface.launch() | |