<jupyter_start><jupyter_text>[Reference](https://towardsdatascience.com/facial-mapping-landmarks-with-dlib-python-160abcf7d672)<jupyter_code>from matplotlib import pyplot as plt
from imutils import face_utils
import dlib
import cv2<jupyter_output><empty_output><jupyter_text>Vamos inicializar um detector de faces (HOG) para então let's go code an faces detector(HOG) and after detect the  landmarks on this detected face p = our pre-treined model directory, on my case, it's on the same script's diretory.<jupyter_code>p = "shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(p)

cap = cv2.VideoCapture(0)<jupyter_output><empty_output><jupyter_text>Getting out image by webcam<jupyter_code>_, image = cap.read()
plt.imshow(image)<jupyter_output><empty_output><jupyter_text>Converting the image to gray scale<jupyter_code>gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)<jupyter_output><empty_output><jupyter_text>Get faces into webcam's image<jupyter_code>rects = detector(gray, 0)
rects<jupyter_output><empty_output><jupyter_text>For each detected face, find the landmark.<jupyter_code>for (i, rect) in enumerate(rects):
        # Make the prediction and transfom it to numpy array
        shape = predictor(gray, rect)
        shape = face_utils.shape_to_np(shape)
    
        # Draw on our image, all the finded cordinate points (x,y) 
        for (x, y) in shape:
            cv2.circle(image, (x, y), 2, (0, 255, 0), -1)
plt.imshow(image)
cv2.destroyAllWindows()
cap.release()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10364321608040201, 'fraction_numerical': 0.015703517587939697, 'mean_word_length': 5.926086956521739, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '620889', 'license': 'MIT', 'n_tokens_mistral': 595, 'n_tokens_neox': 562, 'n_words': 130, 'path': 'Test/FaceLandmark.ipynb', 'repo_name': 'SM-Play/Research', 'size': '1592'}