diegocasmo / iis-project

0 stars 0 forks source link

Be able to read in facial landmark positions as input from Computer Vision group #14

Closed diegocasmo closed 6 years ago

diegocasmo commented 6 years ago

Notes:

tristaaan commented 6 years ago

So the input is an array of facial expressions?

We can figure out the principal components, but it will vary dataset to dataset.

diegocasmo commented 6 years ago

I'm also a bit confused about this, since PCA creates the principal components based on variance, which is dependent on the measurements :/

tristaaan commented 6 years ago

I think we have a good start on this in a branch, we need to resolve the accuracy drop (I imagine) we'll get when we take out PCA. Might sit on this a bit for Monday.

diegocasmo commented 6 years ago

I may be wrong, but I have been thinking about this, and maybe we won't need to take PCA out of the equation at all, instead we'll used it normally as we always do. PCA selects n components that have the largest possible variance (not n features!). So unless the input face is an outlier, this should be fine.

tristaaan commented 6 years ago

We need variance across a single column, one row gives no good results. Two rows not much better.

import numpy as np
from sklearn.decomposition import PCA
pca = PCA(n_components = 5, whiten = True)
principal_components = pca.fit_transform(np.array([[1,2,3,4,5,6,7,8,9,11]]))
principal_components
diegocasmo commented 6 years ago

This should help: https://github.com/scikit-learn/scikit-learn/blob/a24c8b464d094d2c468a16ea9f8bf8d42d949f84/sklearn/decomposition/base.py#L99. I think X is pca.components_.

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA.transform