`ultralytics 8.3.34` FastSAM non-detection fix (#17628)

Co-authored-by: Francesco Mattioli <francesco.mttl@gmail.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
exp_pytorch_opencl^2 v8.3.34
HJH_Chenhe 6 days ago committed by GitHub
parent bde3105813
commit 1c6bfd3039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/__init__.py
  2. 3
      ultralytics/models/fastsam/predict.py

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license # Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.3.33" __version__ = "8.3.34"
import os import os

@ -64,6 +64,9 @@ class FastSAMPredictor(SegmentationPredictor):
if not isinstance(results, list): if not isinstance(results, list):
results = [results] results = [results]
for result in results: for result in results:
if len(result) == 0:
prompt_results.append(result)
continue
masks = result.masks.data masks = result.masks.data
if masks.shape[1:] != result.orig_shape: if masks.shape[1:] != result.orig_shape:
masks = scale_masks(masks[None], result.orig_shape)[0] masks = scale_masks(masks[None], result.orig_shape)[0]

Loading…
Cancel
Save