def filter_points(points, shape):
    """
    Filter points which would be outside the image frame
    Arguments:
        points: Array containing the keypoints, shape: [N,2]
        shape: Image shape
    Returns: Array containing the filtered keypoints, shape: [M,2]
    """
    points = points[points[:,0] >= 0]
    points = points[points[:,1] >= 0]
    points = points[points[:,0] < shape[0]]
    points = points[points[:,1] < shape[1]]

    return points