def cohn_kanade_shapes(datadir=None, labeled_only=False, faces=True):
    datadir = datadir or data_dir()
    landmarks = []
    labels = []
    # lm_dir = 'face_landmarks' if faces else 'landmarks'
    for lm_name in os.listdir(os.path.join(datadir, 'face_landmarks')):
        label_name = lm_name.replace('.txt', '_emotion.txt')
        lm_path = os.path.join(datadir, 'face_landmarks', lm_name)
        label_path = os.path.join(datadir, 'labels', label_name)
        landmarks.append(read_landmarks(lm_path).flatten())
        if os.path.exists(label_path):
            labels.append(read_label(label_path))
        else:
            labels.append(-1)
    X, y = (np.vstack(landmarks), np.hstack(labels))
    X = normalize(X)
    if labeled_only:
        return X[y != -1], y[y != -1]
    else:
        return X, y
Loads annotations and labels from CK+ dataset
dataset/ETHPy150Open dfdx/masque/masque/datasets.py/cohn_kanade_shapes