def process_coco_keypoints(keypoints):
    """Process a list of keypoints into xy format, since the coco
        keypoints format is (x,y,v). If v is 0(i.e not labelled) then
        it is not included in the return

    Arguments:
        keypoints (list): A flattened list of keypoints where each one is
            in x,y,v format

    Returns:
        processed_idx (list): List of keypoints of the format
            [[x1,y1],[x2,y2], ...]

    """
    processed_keypoints = []
    for i in range(0, len(keypoints), 3):
        if keypoints[i + 2] != 0:
            # reason for adding by 0.5 is b/c
            # https://github.com/facebookresearch/detectron2/pull/175#issuecomment-551202163
            processed_keypoints.append(
                [keypoints[i] + 0.5, keypoints[i + 1] + 0.5])
    return processed_keypoints