def to_detection(self, frame_size, extra_attrs=True):
        """Returns a :class:`fiftyone.core.labels.Detection` representation of
        the object.

        Args:
            frame_size: the ``(width, height)`` of the image
            extra_attrs (True): whether to include extra annotation attributes
                on the object. Supported values are:

                -   ``True``: include all extra attributes found
                -   ``False``: do not include extra attributes
                -   a name or list of names of specific attributes to include

        Returns:
            a :class:`fiftyone.core.labels.Detection`
        """
        label = self.name
        bounding_box = self.bndbox.to_detection_format(frame_size)

        if extra_attrs == True:
            attributes = self.attributes
        elif extra_attrs == False:
            attributes = {}
        else:
            if etau.is_str(extra_attrs):
                extra_attrs = [extra_attrs]

            attributes = {
                name: self.attributes.get(name, None) for name in extra_attrs
            }

        return fol.Detection(
            label=label, bounding_box=bounding_box, **attributes
        )
Returns a :class:`fiftyone.core.labels.Detection` representation of
        the object.

        Args:
            frame_size: the ``(width, height)`` of the image
            extra_attrs (True): whether to include extra annotation attributes
                on the object. Supported values are:

                -   ``True``: include all extra attributes found
                -   ``False``: do not include extra attributes
                -   a name or list of names of specific attributes to include

        Returns:
            a :class:`fiftyone.core.labels.Detection`
        
fiftyone/utils/voc.py