def to_detection(self):
        """Converts this shape to a :class:`fiftyone.core.labels.Detection`.

        Returns:
            a :class:`fiftyone.core.labels.Detection`
        """
        if len(self.points) == 4:
            # Bounding box
            xtl, ytl, xbr, ybr = self.points
            width, height = self.frame_size
            bbox = [
                xtl / width,
                ytl / height,
                (xbr - xtl) / width,
                (ybr - ytl) / height,
            ]
        else:
            bbox = None

        label = fol.Detection(
            label=self.label, bounding_box=bbox, index=self.index
        )
        self._set_attributes(label)

        if len(self.points) > 4:
            # 3D cuboid
            label.location = self.points[:3]
            label.rotation = self.points[3:6]
            label.dimensions = self.points[6:9]

        return label
Converts this shape to a :class:`fiftyone.core.labels.Detection`.

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