Probabilistic models of vision and max-margin methods