Learning of Graphical Models and Efficient Inference for Object Class Recognition