def from_labeled_image(
        cls, metadata, detections, path=None, filename=None, extra_attrs=True
    ):
        """Creates a :class:`VOCAnnotation` instance for the given labeled
        image data.

        Args:
            metadata: a :class:`fiftyone.core.metadata.ImageMetadata` instance
                for the image
            detections: a :class:`fiftyone.core.labels.Detections`
            path (None): the absolute path to the image
            filename (None): the filename of the image
            extra_attrs (True): whether to include extra object attributes.
                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:`VOCAnnotation`
        """
        objects = []
        for detection in detections.detections:
            obj = VOCObject.from_detection(
                detection, metadata, extra_attrs=extra_attrs
            )
            objects.append(obj)

        return cls(
            path=path, filename=filename, metadata=metadata, objects=objects
        )
Creates a :class:`VOCAnnotation` instance for the given labeled
        image data.

        Args:
            metadata: a :class:`fiftyone.core.metadata.ImageMetadata` instance
                for the image
            detections: a :class:`fiftyone.core.labels.Detections`
            path (None): the absolute path to the image
            filename (None): the filename of the image
            extra_attrs (True): whether to include extra object attributes.
                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:`VOCAnnotation`
        
fiftyone/utils/voc.py