Spaces:
Runtime error
Runtime error
File size: 727 Bytes
3a63794 4d5b0bf 3a63794 4d5b0bf 3a63794 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from controllers.rembg import rembg_controller
from services.state import get_state
from utilities.constants import REMBG_DROPDOWN_CHOICES, FW_DEFAULT_OPTION
def rembg_interface():
return gr.Interface(
title="Remove Background",
fn=lambda resolution, image: rembg_controller(
image, resolution, get_state('fw_option', FW_DEFAULT_OPTION)),
inputs=[
gr.Dropdown(choices=REMBG_DROPDOWN_CHOICES,
value=REMBG_DROPDOWN_CHOICES[0], label="Resolution"),
gr.Image(type="pil", label="Input Image")
],
outputs=[
gr.Image(type="pil", label="Output Image")
],
flagging_options=[]
)
|