Scene-Dependent Prediction in Latent Space for Video Anomaly Detection and Anticipation