adirik commited on
Commit
9808945
1 Parent(s): 150c578

use transformers dev

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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 = {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
 
 
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