ninelnwza007 commited on
Commit
0da3e7e
·
verified ·
1 Parent(s): c8f6efe

Update sam3/sam3/model/geometry_encoders.py

Browse files
sam3/sam3/model/geometry_encoders.py CHANGED
@@ -645,7 +645,7 @@ class SequenceGeometryEncoder(nn.Module):
645
  # We need to denormalize, and convert to [x, y, x, y]
646
  boxes_xyxy = box_cxcywh_to_xyxy(boxes)
647
  scale = torch.tensor([W, H, W, H], dtype=boxes_xyxy.dtype)
648
- scale = scale.pin_memory().to(device=boxes_xyxy.device, non_blocking=True)
649
  scale = scale.view(1, 1, 4)
650
  boxes_xyxy = boxes_xyxy * scale
651
  sampled = torchvision.ops.roi_align(
 
645
  # We need to denormalize, and convert to [x, y, x, y]
646
  boxes_xyxy = box_cxcywh_to_xyxy(boxes)
647
  scale = torch.tensor([W, H, W, H], dtype=boxes_xyxy.dtype)
648
+ scale = scale.to(device=boxes_xyxy.device)
649
  scale = scale.view(1, 1, 4)
650
  boxes_xyxy = boxes_xyxy * scale
651
  sampled = torchvision.ops.roi_align(