Skip to content

Instantly share code, notes, and snippets.

@mcclux
mcclux / detect_crop.py
Last active November 9, 2022 10:17
Python script using dlib to detect and save faces from a set of source images
import os
import sys
import dlib
import matplotlib.pyplot as plt
from PIL import Image
# adjust these variables as necessary
# dirname is the directory relative to the script where the files to detect a face and crop live
dirname = "source"