rembg_remove_bg / app.py
de3sec's picture
Update app.py
7282e90
raw
history blame contribute delete
478 Bytes
import os
os.system("/usr/local/bin/python -m pip install --upgrade pip")
import gradio as gr
from rembg import remove
import cv2
def inference(img):
input_img = cv2.imread(img)
output = remove(input_img[:, :, [2,1,0]])
return output
title = "Remove Background App"
description = "Upload images and click submit"
gr.Interface(
inference,
gr.inputs.Image(type="filepath", label="Input"),
gr.outputs.Image(type="pil", label="Output"),
).launch()