jaydeepkarale's picture
Create new file
9fd2345
raw
history blame
348 Bytes
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()