Run the program like this:
python webcam.py haarcascade_frontalface_default.xml
If you want to understand how the code works, see here: https://realpython.com/blog/python/face-detection-in-python-using-a-webcam/
Update: Now supports OpenCV3. This change has been made by furetosan ( https://github.com/furetosan) and tested on Linux.
To run the OpenCV3 version, run webcam_cv3.py.