Ejemplo n.º 1
0
    'mode': 's',
}

if config['mode'] == 's':
    feature = ('left_eye_center_x', 'left_eye_center_y', 'right_eye_center_x',
               'right_eye_center_y', 'nose_tip_x', 'nose_tip_y',
               'mouth_center_bottom_lip_x', 'mouth_center_bottom_lip_y')
    flip_indices = [(0, 2), (1, 3)]
else:
    feature = ()
    flip_indices = [(0, 2), (1, 3), (4, 8), (5, 9), (6, 10), (7, 11), (12, 16),
                    (13, 17), (14, 18), (15, 19), (22, 24), (23, 25)]

datas = LoadData(mode=0)
X_t, X_v, y_t, y_v = datas.loadNSplit(feature=feature,
                                      spec=('nose_tip_x', 'nose_tip_y',
                                            'mouth_center_bottom_lip_x',
                                            'mouth_center_bottom_lip_y'))
# Remove it when use normal cases
flip_indices = []

# ZCA whitening
if config['ZCA'] == True:
    from zca_whitening import zca_data
    X_t = zca_data(X_t, epsilon=1e-4)
    X_t = np.clip(X_t, -1, 1)
    X_v = zca_data(X_v, epsilon=1e-4)

print bcolors.BOLD + "Start training" + bcolors.ENDC

# for key, val in test.iteritems():
#     config['version'] = key