File size: 522 Bytes
a9296a9
 
 
 
 
 
 
 
 
 
 
 
16c0fa6
a9296a9
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from rembg import remove

def process_image(input_img):
    """Processes an image by removing its background and resizing it."""
    img = remove(input_img)
    return img

with gr.Blocks() as demo:
    gr.Interface(
        fn=process_image, 
        inputs = [gr.Image(label="Input Image", interactive=True)], 
        outputs = gr.Image(label="Processed Image"),
        examples=[["images/sample1.png"]],
        title="📸 Image Background Remover")

if __name__ == "__main__":
    demo.launch()