def point8_to_joints(points, num_p=18):
    """
    Converts Nx2 nparray to the list of joints

    :param points:
    :param num_p:
    :return: list of joints [[(x1,y1), (x2,y2), ...], []]
    """
    l = points.shape[0] // num_p

    all = []
    for i in range(l):
        skel = []
        for j in range(num_p):
            idx = i * num_p + j
            x = points[idx, 0]
            y = points[idx, 1]

            if x <= 0 or y <= 0 or x > 2000 or y > 2000:
                skel.append(None)
            else:
                skel.append((x, y))

        all.append(skel)
    return all