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 |
-
|
|
|
28 |
boxes, scores, labels = results[0]["boxes"], results[0]["scores"], results[0]["labels"]
|
29 |
|
30 |
img = cv2.resize(img, (768, 768), interpolation = cv2.INTER_AREA)
|
|
|
24 |
outputs = model(**inputs)
|
25 |
|
26 |
target_sizes = torch.Tensor([[768, 768]])
|
27 |
+
outputs = {k: val.cpu() for k, val in outputs.items()}
|
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 |
|
31 |
img = cv2.resize(img, (768, 768), interpolation = cv2.INTER_AREA)
|