Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,16 +22,14 @@ def visualize_segmentation(image, prompts, preds):
|
|
| 22 |
|
| 23 |
|
| 24 |
def segment(img, clases):
|
|
|
|
| 25 |
prompts = clases.split(',')
|
| 26 |
|
| 27 |
inputs = processor(text=prompts, images=[img] * len(img), padding="max_length", return_tensors="pt")
|
| 28 |
|
| 29 |
-
|
| 30 |
-
outputs = model(**inputs)
|
| 31 |
preds = outputs.logits.unsqueeze(1)
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
return "Hello " + prompts + "!!"
|
| 36 |
|
| 37 |
demo = gr.Interface(fn=segment, inputs=["image","text"], outputs="text")
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
def segment(img, clases):
|
| 25 |
+
print(img)
|
| 26 |
prompts = clases.split(',')
|
| 27 |
|
| 28 |
inputs = processor(text=prompts, images=[img] * len(img), padding="max_length", return_tensors="pt")
|
| 29 |
|
| 30 |
+
outputs = model(**inputs)
|
|
|
|
| 31 |
preds = outputs.logits.unsqueeze(1)
|
| 32 |
|
|
|
|
|
|
|
| 33 |
return "Hello " + prompts + "!!"
|
| 34 |
|
| 35 |
demo = gr.Interface(fn=segment, inputs=["image","text"], outputs="text")
|