import re


def get_frame_id(filename: str) -> int:
    """
    Parses a filename to find the ID of a frame. Example file name for frame with ID 17:
    `CAM2_000000000017_keypoints.json`.

    :param filename: Name of openpose frame file.
    :return: Frame ID as an integer.
    """
    pattern = "(?:^|\D)(\d+)\\_keypoints.json"
    m = re.findall(pattern, filename)
    frame_id = int(m[-1])

    return frame_id