I applied it on faces with little revisions:
First, in building of the combine model, 'dpdr' may be too large for a real application. I replaced it by averaging submatrix in the big loop.
Second, 'svds' in pca may cause unexpected mistake... I use svd instead, though it may slower...