Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import base64
|
|
7 |
from PIL import Image, ImageDraw
|
8 |
from io import BytesIO
|
9 |
from sentence_transformers import SentenceTransformer, util
|
|
|
10 |
|
11 |
backgroundPipe = pipeline("image-segmentation", model="facebook/maskformer-swin-large-coco")
|
12 |
PersonPipe = pipeline("image-segmentation", model="mattmdjaga/segformer_b2_clothes")
|
@@ -95,6 +96,7 @@ def process_image(image):
|
|
95 |
processed_image.putdata(final_data)
|
96 |
return processed_image
|
97 |
|
|
|
98 |
def processAndGetMask(image: str, text: str):
|
99 |
datas = getImageDetails(image)
|
100 |
labs = list(datas.keys())
|
|
|
7 |
from PIL import Image, ImageDraw
|
8 |
from io import BytesIO
|
9 |
from sentence_transformers import SentenceTransformer, util
|
10 |
+
import spaces
|
11 |
|
12 |
backgroundPipe = pipeline("image-segmentation", model="facebook/maskformer-swin-large-coco")
|
13 |
PersonPipe = pipeline("image-segmentation", model="mattmdjaga/segformer_b2_clothes")
|
|
|
96 |
processed_image.putdata(final_data)
|
97 |
return processed_image
|
98 |
|
99 |
+
@spaces.GPU()
|
100 |
def processAndGetMask(image: str, text: str):
|
101 |
datas = getImageDetails(image)
|
102 |
labs = list(datas.keys())
|