Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,9 +8,8 @@ import cv2
|
|
| 8 |
processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 9 |
model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 10 |
|
| 11 |
-
def process_image(image,
|
| 12 |
-
|
| 13 |
-
inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
|
| 14 |
|
| 15 |
# predict
|
| 16 |
with torch.no_grad():
|
|
|
|
| 8 |
processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 9 |
model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 10 |
|
| 11 |
+
def process_image(image, prompt):
|
| 12 |
+
inputs = processor(text=prompt, images=image, padding="max_length", return_tensors="pt")
|
|
|
|
| 13 |
|
| 14 |
# predict
|
| 15 |
with torch.no_grad():
|