Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,8 +33,10 @@ def segment(img, clases):
|
|
33 |
prompts = clases.split(',')
|
34 |
|
35 |
inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
|
|
|
36 |
|
37 |
-
|
|
|
38 |
preds = outputs.logits.unsqueeze(1)
|
39 |
|
40 |
return visualize_segmentation(image, prompts, preds)
|
|
|
33 |
prompts = clases.split(',')
|
34 |
|
35 |
inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
|
36 |
+
|
37 |
|
38 |
+
with torch.no_grad():
|
39 |
+
outputs = model(**inputs)
|
40 |
preds = outputs.logits.unsqueeze(1)
|
41 |
|
42 |
return visualize_segmentation(image, prompts, preds)
|