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
|
|
@ -1,6 +1,6 @@
|
||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
__version__ = "8.3.23"
|
__version__ = "8.3.24"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ class Predictor(BasePredictor):
|
||||||
results = []
|
results = []
|
||||||
for masks, orig_img, img_path in zip([pred_masks], orig_imgs, self.batch[0]):
|
for masks, orig_img, img_path in zip([pred_masks], orig_imgs, self.batch[0]):
|
||||||
if len(masks) == 0:
|
if len(masks) == 0:
|
||||||
masks = None
|
masks, pred_bboxes = None, torch.zeros((0, 6), device=pred_masks.device)
|
||||||
else:
|
else:
|
||||||
masks = ops.scale_masks(masks[None].float(), orig_img.shape[:2], padding=False)[0]
|
masks = ops.scale_masks(masks[None].float(), orig_img.shape[:2], padding=False)[0]
|
||||||
masks = masks > self.model.mask_threshold # to bool
|
masks = masks > self.model.mask_threshold # to bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue