def parse_coco_categories(categories):
    """Parses the COCO categories list.

    Args:
        categories: a list of dict of the form::

            [
                ...
                {
                    "id": 2,
                    "name": "cat",
                    "supercategory": "animal",
                    "keypoints": ["nose", "head", ...],
                    "skeleton": [[12, 14], [14, 16], ...]
                },
                ...
            ]

    Returns:
        a tuple of

        -   classes_map: a dict mapping class IDs to labels
        -   supercategory_map: a dict mapping class labels to category dicts
    """
    classes_map = {
        c["id"]: c["name"] if "name" in c else str(c["id"]) for c in categories
    }
    supercategory_map = {c["name"]: c for c in categories}

    return classes_map, supercategory_map
Parses the COCO categories list.

    Args:
        categories: a list of dict of the form::

            [
                ...
                {
                    "id": 2,
                    "name": "cat",
                    "supercategory": "animal",
                    "keypoints": ["nose", "head", ...],
                    "skeleton": [[12, 14], [14, 16], ...]
                },
                ...
            ]

    Returns:
        a tuple of

        -   classes_map: a dict mapping class IDs to labels
        -   supercategory_map: a dict mapping class labels to category dicts
    
fiftyone/utils/coco.py