Spaces:
Running
Running
use transformers dev
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def query_image(img, text_queries):
|
|
24 |
outputs = model(**inputs)
|
25 |
|
26 |
target_sizes = torch.Tensor([[768, 768]])
|
27 |
-
results = processor.post_process(outputs=outputs, target_sizes=target_sizes)
|
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 |
+
results = processor.post_process(outputs=outputs.cpu(), target_sizes=target_sizes)
|
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)
|