(A similar question has been asked on superuser for answers related to applications. The question is posted here to gather programmable solutions for the same)
Look at OpenCV - one of the examples that comes with the distribution is for face detection.