Skip to content

Commit

Permalink
_HasMedia mixin in Detection class, too
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Nov 18, 2024
1 parent 653badf commit 229296b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fiftyone/core/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class _NoDefault(object):
no_default = _NoDefault()


class _HasMedia(object):
"""Mixin for :class:`Label` classes that contain a media field."""

_MEDIA_FIELD = None


class Label(DynamicEmbeddedDocument):
"""Base class for labels.
Expand Down Expand Up @@ -388,7 +394,7 @@ class Classifications(_HasLabelList, Label):
logits = fof.VectorField()


class Detection(_HasAttributesDict, _HasID, Label):
class Detection(_HasAttributesDict, _HasID, _HasMedia, Label):
"""An object detection.
Args:
Expand Down Expand Up @@ -1054,12 +1060,6 @@ class Keypoints(_HasLabelList, Label):
keypoints = fof.ListField(fof.EmbeddedDocumentField(Keypoint))


class _HasMedia(object):
"""Mixin for :class:`Label` classes that contain a media field."""

_MEDIA_FIELD = None


class Segmentation(_HasID, _HasMedia, Label):
"""A semantic segmentation for an image.
Expand Down

0 comments on commit 229296b

Please sign in to comment.