Search-Based Learning and Inference Framework for Computer Vision