This example is written in Python 3 and uses the Open CV library and a Harr cascade classifier. You can install the python Open CV package as follows:
pip3 install opencv-python
You can obtain the Haar cascade classifier from: https://github.com/opencv/opencv/tree/master/data/haarcascades