def to_detections(self, extra_attrs=True):
        """Returns a :class:`fiftyone.core.labels.Detections` representation of
        the objects in the annotation.

        Args:
            extra_attrs (True): whether to load extra annotation attributes
                onto the imported labels. Supported values are:

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

        Returns:
            a :class:`fiftyone.core.labels.Detections`
        """
        if self.metadata is None:
            raise ValueError(
                "Must have metadata in order to convert to `Detections` format"
            )

        frame_size = (self.metadata.width, self.metadata.height)
        return fol.Detections(
            detections=[
                obj.to_detection(frame_size, extra_attrs=extra_attrs)
                for obj in self.objects
            ]
        )
Returns a :class:`fiftyone.core.labels.Detections` representation of
        the objects in the annotation.

        Args:
            extra_attrs (True): whether to load extra annotation attributes
                onto the imported labels. Supported values are:

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

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