ultralytics 8.3.24 SAM fix pred_boxes when no objects segmented (#17215)
Co-authored-by: Muhammad Rizwan Munawar <muhammadrizwanmunawar123@gmail.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
542320c041
commit
6c12c1d69f
2 changed files with 2 additions and 2 deletions
|
|
@ -478,7 +478,7 @@ class Predictor(BasePredictor):
|
|||
results = []
|
||||
for masks, orig_img, img_path in zip([pred_masks], orig_imgs, self.batch[0]):
|
||||
if len(masks) == 0:
|
||||
masks = None
|
||||
masks, pred_bboxes = None, torch.zeros((0, 6), device=pred_masks.device)
|
||||
else:
|
||||
masks = ops.scale_masks(masks[None].float(), orig_img.shape[:2], padding=False)[0]
|
||||
masks = masks > self.model.mask_threshold # to bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue