File size: 391 Bytes
95a864c
 
87614d2
95a864c
075a6c0
95a864c
87614d2
95a864c
075a6c0
95a864c
54acd01
 
 
 
87614d2
54acd01
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import pipeline
import gradio as gr
import spaces

pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)

@spaces.GPU
def predict(image_path):
    return pipe(image_path)

gr.Interface(
    predict,
    gr.Image(type="filepath"),
    "image",
    examples=[["./hafedh purple.jpg"], ["./gigachad.webp"]],
    cache_examples=True,
).launch()