MingDoan's picture
feat: Add VQA feature
4d5b0bf
raw
history blame
727 Bytes
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=[]
)