Use Python 3.7 version.
The .xml file is the open-source dataset pre-trained to enable the face detection.
In this coding this file should be in the same directory as the python coding.
If webcam not On, changes '0' below to other number on coding
cam = cv2.VideoCapture(0)