jaydeepkarale's picture
Update app.py
272920e
raw
history blame contribute delete
No virus
409 Bytes
import gradio as gr
from rembg import remove
import subprocess
def remove_background(input_img):
subprocess.call(['sh', 'copylib.sh'])
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()