def ck_lm_pwa(datadir=None, ck_dataset=None, labeled_only=False):
    if not ck_dataset:
        ck_dataset = CKDataset(datadir)
    ref_lms = ck_dataset.data[10].landmarks[0]
    triangles = delaunay(ref_lms)
    X1_lst = []
    X2_lst = []
    y_lst = []
    for item in ck_dataset.data:
        landmarks = item.landmarks[-1]
        X1_lst.append(landmarks.flatten())
        orig_image = item.images[-1]
        item_lms = item.landmarks[-1]
        image = pwa.warpTriangle(orig_image, 
                                 item_lms[:, [1, 0]], ref_lms[:, [1, 0]],
                                 triangles, orig_image.shape)
        X2_lst.append(image.flatten())
        y_lst.append(item.label)
    X1 = np.vstack(X1_lst)
    X2 = np.vstack(X2_lst)
    y = np.array(y_lst)
    del ck_dataset
    if labeled_only:
        return X1[y != -1], X2[y != -1], y[y != -1]
    else:
        return X1, X2, y
Main module executor
dataset/ETHPy150Open dfdx/masque/masque/datasets.py/ck_lm_pwa--crossover with--dataset/ETHPy150Open jakev/dtf/src/dtf/core/cmds/local.py/local.execute