Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Nov 19, 2024
1 parent 52bde0e commit 62763c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fiftyone/core/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| `voxel51.com <https://voxel51.com/>`_
|
"""

from functools import partial
import itertools
import warnings
Expand Down Expand Up @@ -529,7 +530,7 @@ def to_segmentation(self, mask=None, frame_size=None, target=255):
Returns:
a :class:`Segmentation`
"""
if self.get_mask() is None:
if not self.has_mask:
raise ValueError(
"Only detections with their `mask` attributes populated can "
"be converted to segmentations"
Expand Down Expand Up @@ -648,7 +649,7 @@ def to_segmentation(self, mask=None, frame_size=None, mask_targets=None):

# pylint: disable=not-an-iterable
for detection in self.detections:
if detection.mask is None:
if not detection.has_mask:
msg = "Skipping detection(s) with no instance mask"
warnings.warn(msg)
continue
Expand Down

0 comments on commit 62763c8

Please sign in to comment.