for idx in range(len(Xc)):
x = trim_zeros_frames(Xc[idx])
Xc[idx][:len(x)] = np.apply_along_axis(paramgen.transform, 1, x)
// Finally we can get aligned X
for idx in range(len(X_aligned)):
x = X[idx][refined_paths[idx]]
After Change
XY = np.concatenate((X_aligned, Y_aligned),
axis=-1).reshape(-1, X.shape[-1] * 2)
gmm.fit(XY)
paramgen = MLParameterGeneration(gmm, X.shape[-1])
for idx in range(len(Xc)):
x = trim_zeros_frames(Xc[idx])
Xc[idx][:len(x)] = paramgen.transform(x)