|
import os |
|
os.system("pip3 install opencv-python") |
|
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 = "Eliminar Fondo de Imagen" |
|
|
|
description = "Elimina el fondo de cualquier imagen de forma fácil y rápida." |
|
|
|
article = "" |
|
|
|
|
|
gr.Interface( |
|
inference, |
|
gr.inputs.Image(type="filepath", label="Input"), |
|
gr.outputs.Image(type="pil", label="Output"), |
|
title=title, |
|
description=description, |
|
article=article |
|
).launch() |