import cv2 import dlib import time def get_mouth(img): img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) width_w, height_h = img_gray.shape[0], img_gray.shape[1] detector = dlib.get_frontal_face_detector() predictor = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat'