In this paper, we describe an algorithm for object recognition that explicitly models and estimates the posterior probability function, P(object/image). We have chosen a functional form of the posterior probability function that captures the joint statistics of local appearance and position on the object as well as the statistics of local appearance in the visual world at large. We use a discrete representation of local appearance consisting of approximately 10(6) patterns. We compute an estimate of P(object/image) in closed form by counting the frequency of occurrence of these patterns over various sets of training images. We have used this method for detecting human faces front frontal and profile views. The algorithm for frontal views has shown a detection rate of 93.0%,vith 88 false alarms on a set of 125 images containing 483 faces combining the MIT test set of Sung and Poggio with the CMU lest sets of Rowley, Baluja, and Kanade. The algorithm for detection of profile views has also demonstrated promising results.