def generate_mean_face(): print("generating mean face shapes") mean_exp = np.load(('../data/{}/MeanFace_data.npy').format('disentangle')) try: os.makedirs('../data/FWH/Mean_Face') except: pass for i in range(47): V2M2(get_mesh('../data/disentangle/Mean_Face.obj', mean_exp[i]+cross_id), '../data/FWH/Mean_Face/shape_{}.obj'.format(i), ref_name = '../data/disentangle/Mean_Face.obj') write_align_mesh('../data/FWH/Mean_Face/shape_{}.obj'.format(i), '../data/disentangle/Mean_Face.obj', '../data/FWH/Mean_Face/shape_{}.obj'.format(i), index = np.loadtxt('front_part_v.txt',dtype=int))
def generate_dr_feature(): print("generating dr feature") for j in range(1,151): try: os.makedirs('../data/FWH/Tester_{}'.format(j)) except: pass for i in range(47): print('dealing with Tester_{}, Shape_{}'.format(j,i)) write_align_mesh('../data/FaceWarehouse_Data/Tester_{}/Blendshape/shape_{}.obj'.format(j,i), '../data/FWH/Mean_Face/shape_{}.obj'.format(i), #'../data/disentangle/Mean_Face.obj', '../data/FWH/Tester_{}/shape_{}.obj'.format(j,i), index = np.loadtxt('front_part_v.txt',dtype=int)) dr_feature = get_dr('../data/disentangle/Mean_Face.obj', '../data/FWH/Tester_{}/shape_{}.obj'.format(j,i)) dr_feature.tofile('../data/FWH/Tester_{}/face_{}.dat'.format(j,i))