Machine learning method based on a bag of key poses model and temporal alignment