“…Shape_predictor_68_face_landmarks.dat --alarm alarm.wav import the necessary packages From scipy.spatial import distance as dist From imutils.video import videostream From imutils import face_utils From threading import thread Import numpy as np Import playsound Import argparse Import imutils Import time Import dlib Import cv2 Defsound_alarm(path): Play an alarm sound Playsound.playsound(path) Defeye_aspect_ratio(eye): Compute the euclidean distances between the two sets of Vertical eye landmarks (x, y)-coordinates A = dist.euclidean(eye [1], eye [5]) B = dist.euclidean(eye [2], eye [4]) Compute the euclidean distance between the horizontal Eye landmark (x, y)-coordinates C = dist.euclidean(eye[0], eye [3]) Compute the eye aspect ratio ear = (a + b) / (2.0 * c) Return the eye aspect ratio return ear construct the argument parse and parse the arguments ap = argparse. argumentparser() Ap.add_argument("-p", "--shape-predictor", required=true, Help="path to facial landmark predictor") Ap.add_argument("-a", "--alarm", type=str, default="", Help="path alarm .wav file") Ap.add_argument("-w", "--webcam", type=int, default=0, Help="index of webcam on system") Args = vars(ap.…”