Spaces:
Runtime error
Runtime error
use transformers dev
Browse files
app.py
CHANGED
@@ -24,7 +24,8 @@ def query_image(img, text_queries):
|
|
24 |
outputs = model(**inputs)
|
25 |
|
26 |
target_sizes = torch.Tensor([[768, 768]])
|
27 |
-
outputs =
|
|
|
28 |
results = processor.post_process(outputs=outputs, target_sizes=target_sizes)
|
29 |
boxes, scores, labels = results[0]["boxes"], results[0]["scores"], results[0]["labels"]
|
30 |
|
|
|
24 |
outputs = model(**inputs)
|
25 |
|
26 |
target_sizes = torch.Tensor([[768, 768]])
|
27 |
+
outputs.logits = outputs.logits.cpu()
|
28 |
+
outputs.pred_boxes = outputs.pred_boxes.cpu()
|
29 |
results = processor.post_process(outputs=outputs, target_sizes=target_sizes)
|
30 |
boxes, scores, labels = results[0]["boxes"], results[0]["scores"], results[0]["labels"]
|
31 |
|