Spaces:
Sleeping
Sleeping
evandroabdao
commited on
Commit
•
01f6bb0
1
Parent(s):
be0cb7a
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def remove_background(image):
|
2 |
pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)
|
3 |
pillow_mask = pipe(image, return_mask = True)
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
import librosa
|
6 |
+
import numpy as np
|
7 |
+
import torch
|
8 |
+
|
9 |
+
from transformers import AutoProcessor, AutoModelForCausalLM
|
10 |
+
|
11 |
+
ic_processor = AutoProcessor.from_pretrained("microsoft/git-base")
|
12 |
+
ic_model = AutoModelForCausalLM.from_pretrained("microsoft/git-base")
|
13 |
+
|
14 |
def remove_background(image):
|
15 |
pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)
|
16 |
pillow_mask = pipe(image, return_mask = True)
|