def to_polyline(
        self,
        frame_size,
        classes_map=None,
        supercategory_map=None,
        tolerance=None,
        include_id=False,
    ):
        """Returns a :class:`fiftyone.core.labels.Polyline` representation of
        the object.

        Args:
            frame_size: the ``(width, height)`` of the image
            classes_map (None): a dict mapping class IDs to class labels
            supercategory_map (None): a dict mapping class names to category
                dicts
            tolerance (None): a tolerance, in pixels, when generating
                approximate polylines for instance masks. Typical values are
                1-3 pixels
            include_id (False): whether to include the COCO ID of the object as
                a label attribute

        Returns:
            a :class:`fiftyone.core.labels.Polyline`, or None if no
            segmentation data is available
        """
        if not self.segmentation:
            return None

        label, attributes = self._get_object_label_and_attributes(
            classes_map, supercategory_map, include_id
        )
        attributes.update(self.attributes)

        points = _get_polygons_for_segmentation(
            self.segmentation, frame_size, tolerance
        )

        return fol.Polyline(
            label=label,
            points=points,
            confidence=self.score,
            closed=False,
            filled=True,
            **attributes,
        )
Returns a :class:`fiftyone.core.labels.Polyline` representation of
        the object.

        Args:
            frame_size: the ``(width, height)`` of the image
            classes_map (None): a dict mapping class IDs to class labels
            supercategory_map (None): a dict mapping class names to category
                dicts
            tolerance (None): a tolerance, in pixels, when generating
                approximate polylines for instance masks. Typical values are
                1-3 pixels
            include_id (False): whether to include the COCO ID of the object as
                a label attribute

        Returns:
            a :class:`fiftyone.core.labels.Polyline`, or None if no
            segmentation data is available
        
fiftyone/utils/coco.py