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>
This commit is contained in:
parent
bde3105813
commit
1c6bfd3039
2 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue