Skip to content

Instantly share code, notes, and snippets.

View sumon328's full-sized avatar

sumon328

  • Bangladesh
View GitHub Profile
@sumon328
sumon328 / extract_features.py
Created August 16, 2020 16:23 — forked from Justin-Heer/extract_features.py
extract_features
def extract_features(iDirName, cnn_model):
# get face detector from dlib and initialize the face aligner
detector = dlib.get_frontal_face_detector()
# open the video file
iFramePaths = [os.path.join(iDirName, iFramePath) for iFramePath in os.listdir(iDirName)]
# an empty list to hold the results
features = []
# process each frame