Inference And Learning Algorithms With Applications To 3D Indoor Scene Understanding