Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ detector = pipeline(model=checkpoint, task="zero-shot-object-detection")
|
|
| 10 |
sam_model = SamModel.from_pretrained("jadechoghari/robustsam-vit-base")
|
| 11 |
sam_processor = SamProcessor.from_pretrained("jadechoghari/robustsam-vit-base")
|
| 12 |
|
| 13 |
-
|
| 14 |
def query(image, texts, threshold):
|
| 15 |
texts = texts.split(",")
|
| 16 |
|
|
@@ -69,6 +69,10 @@ demo = gr.Interface(
|
|
| 69 |
inputs=[gr.Image(type="pil", label="Image Input"), gr.Textbox(label = "Candidate Labels"), gr.Slider(0, 1, value=0.05, label="Confidence Threshold")],
|
| 70 |
outputs="annotatedimage",
|
| 71 |
title="OWL 🤝 SAM",
|
| 72 |
-
description=description
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
)
|
| 74 |
demo.launch(debug=True)
|
|
|
|
| 10 |
sam_model = SamModel.from_pretrained("jadechoghari/robustsam-vit-base")
|
| 11 |
sam_processor = SamProcessor.from_pretrained("jadechoghari/robustsam-vit-base")
|
| 12 |
|
| 13 |
+
|
| 14 |
def query(image, texts, threshold):
|
| 15 |
texts = texts.split(",")
|
| 16 |
|
|
|
|
| 69 |
inputs=[gr.Image(type="pil", label="Image Input"), gr.Textbox(label = "Candidate Labels"), gr.Slider(0, 1, value=0.05, label="Confidence Threshold")],
|
| 70 |
outputs="annotatedimage",
|
| 71 |
title="OWL 🤝 SAM",
|
| 72 |
+
description=description,
|
| 73 |
+
examples=[
|
| 74 |
+
["./cats.png", "cat", 0.1],
|
| 75 |
+
],
|
| 76 |
+
cache_examples=True
|
| 77 |
)
|
| 78 |
demo.launch(debug=True)
|