Hybrid Generative Models for 2D and 3D Computer Vision