def extract_2D_keypoints(visibility_mask):
    """ Extract 2D keypoints.

    # Arguments
        visibility_mask: Numpy array of size (num_keypoints, 3).

    # Returns
        keypoints2D: numpy array of size (num_keypoints, 1).
        keypoints_visibility_mask: numpy array of size (num_keypoints, 1).
    """
    keypoints2D = visibility_mask[:, :2]
    keypoints_visibility_mask = visibility_mask[:, 2] == 1
    return keypoints2D, keypoints_visibility_mask