Spaces:
Runtime error
Runtime error
File size: 348 Bytes
9fd2345 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import gradio as gr
from rembg import remove
def remove_background(input_img):
output_path = f'output.png + {id(input_img)}'
output = remove(input_img)
output.save(output_path)
return output_path
# type = pil passes the image as a Pillow object
demo = gr.Interface(remove_background, gr.Image(type="pil"), "image")
demo.launch()
|