def to_keypoints(
        self,
        frame_size,
        classes_map=None,
        supercategory_map=None,
        include_id=False,
    ):
        """Returns a :class:`fiftyone.core.labels.Keypoint` 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
            include_id (False): whether to include the COCO ID of the object as
                a label attribute

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

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

        width, height = frame_size

        points = []
        visible = []
        for x, y, v in fou.iter_batches(self.keypoints, 3):
            if v == 0:
                points.append((float("nan"), float("nan")))
            else:
                points.append((x / width, y / height))

            visible.append(v)
        if "visible" in attributes:
            logger.debug(
                "Found a custom attribute named 'visible' which is a "
                "reserved name. Ignoring the custom attribute"
            )
            attributes.pop("visible")

        return fol.Keypoint(
            label=label, points=points, visible=visible, **attributes
        )
Returns a :class:`fiftyone.core.labels.Keypoint` 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
            include_id (False): whether to include the COCO ID of the object as
                a label attribute

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