Spaces:
Runtime error
Runtime error
Tobias Cornille
commited on
Commit
·
d738b86
1
Parent(s):
d42d2a5
Fix device
Browse files
app.py
CHANGED
|
@@ -114,9 +114,6 @@ def dino_detection(
|
|
| 114 |
box_threshold=box_threshold,
|
| 115 |
text_threshold=text_threshold,
|
| 116 |
)
|
| 117 |
-
logits = logits.cpu()
|
| 118 |
-
boxes = boxes.cpu()
|
| 119 |
-
phrases = phrases.cpu()
|
| 120 |
category_ids = [category_name_to_id[phrase] for phrase in phrases]
|
| 121 |
|
| 122 |
if visualize:
|
|
@@ -311,6 +308,7 @@ def generate_panoptic_mask(
|
|
| 311 |
warnings.warn(
|
| 312 |
"Failed to load custom C++ ops. Running on CPU mode Only in groundingdino!"
|
| 313 |
)
|
|
|
|
| 314 |
|
| 315 |
# detect boxes for "thing" categories using Grounding DINO
|
| 316 |
thing_boxes, _ = dino_detection(
|
|
|
|
| 114 |
box_threshold=box_threshold,
|
| 115 |
text_threshold=text_threshold,
|
| 116 |
)
|
|
|
|
|
|
|
|
|
|
| 117 |
category_ids = [category_name_to_id[phrase] for phrase in phrases]
|
| 118 |
|
| 119 |
if visualize:
|
|
|
|
| 308 |
warnings.warn(
|
| 309 |
"Failed to load custom C++ ops. Running on CPU mode Only in groundingdino!"
|
| 310 |
)
|
| 311 |
+
groundingdino_device = "cpu"
|
| 312 |
|
| 313 |
# detect boxes for "thing" categories using Grounding DINO
|
| 314 |
thing_boxes, _ = dino_detection(
|