This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import cv2 | |
import numpy as np | |
import dlib | |
# Load the descriptors | |
descriptors = np.load(r"C:\Users\felipe.cunha\Documents\venv\cv2\CelebrityDoppelganger\descriptors.npy", | |
allow_pickle=True) | |
# Rearrange data, each 128 items corresponds to one image descriptor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from urllib.error import HTTPError, URLError | |
import dlib | |
import cv2 | |
import numpy as np | |
import urllib.request | |
from socket import timeout | |
def enroll(im, face): | |
status = "pass" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import dlib | |
def faceLandmarks(im): | |
# Path for the detection model, you can download it from here: https://github.com/italojs/facial-landmarks-recognition/blob/master/shape_predictor_68_face_landmarks.dat | |
PREDICTOR_PATH = r"C:\Users\felipe.cunha\Documents\venv\cv2\week1-pyton\data\models\shape_predictor_68_face_landmarks.dat" | |
# Create object to detect the face |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import dlib | |
import faceBlendCommon as face | |
import numpy as np | |
# Load Image | |
im = cv2.imread("cv2/images/girl.jpg") | |
# Detect face landmarks | |
PREDICTOR_PATH = r"C:\Users\felipe.cunha\Documents\venv\cv2\week1-pyton\data\models\shape_predictor_68_face_landmarks.dat" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3.6 -m venv venv | |
$ source venv/bin/activate | |
(venv)$ pip install pylivetrader |