Latent variable models for visual activity understanding