Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,11 @@ import gradio as gr
|
|
| 5 |
|
| 6 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 7 |
|
| 8 |
-
owl_model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16-ensemble").to(
|
| 9 |
owl_processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16-ensemble")
|
| 10 |
|
| 11 |
dino_processor = AutoProcessor.from_pretrained("IDEA-Research/grounding-dino-base")
|
| 12 |
-
dino_model = AutoModelForZeroShotObjectDetection.from_pretrained("IDEA-Research/grounding-dino-base").to(
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
def infer(img, text_queries, score_threshold, model):
|
|
|
|
| 5 |
|
| 6 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 7 |
|
| 8 |
+
owl_model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16-ensemble").to("cuda")
|
| 9 |
owl_processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16-ensemble")
|
| 10 |
|
| 11 |
dino_processor = AutoProcessor.from_pretrained("IDEA-Research/grounding-dino-base")
|
| 12 |
+
dino_model = AutoModelForZeroShotObjectDetection.from_pretrained("IDEA-Research/grounding-dino-base").to("cuda")
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
def infer(img, text_queries, score_threshold, model):
|