Skip to content

Instantly share code, notes, and snippets.

@ilan1987
ilan1987 / face_detection.py
Last active March 7, 2018 23:28
This is my script for changing the hightechzone video by replacing all faces with my face.
import cv2
import numpy as np
from scipy.spatial.distance import pdist,squareform
from matplotlib import pyplot as plt
from skimage.transform import resize
if __name__=='__main__':
picture_with_face_path=r'IlanAtCampNou.jpg'
video_path=r'Hightechzone_video.mp4'
face_cascade1 = cv2.CascadeClassifier(r'lbpcascade_frontalface_improved.xml')
face_cascade2=cv2.CascadeClassifier(r'haarcascade_frontalface_default.xml')