Skip to content

Commit dec4c12

Browse files
committed
Fix mypy thinking output of SamPredictor.predict is a tensor.
1 parent d4ecc68 commit dec4c12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

segment_anything/predictor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ def predict(
160160
return_logits=return_logits,
161161
)
162162

163-
masks = masks[0].detach().cpu().numpy()
164-
iou_predictions = iou_predictions[0].detach().cpu().numpy()
165-
low_res_masks = low_res_masks[0].detach().cpu().numpy()
166-
return masks, iou_predictions, low_res_masks
163+
masks_np = masks[0].detach().cpu().numpy()
164+
iou_predictions_np = iou_predictions[0].detach().cpu().numpy()
165+
low_res_masks_np = low_res_masks[0].detach().cpu().numpy()
166+
return masks_np, iou_predictions_np, low_res_masks_np
167167

168168
@torch.no_grad()
169169
def predict_torch(

0 commit comments

Comments
 (0)