Skip to content

k8sautom8/headshots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Professional Headshot Cropper

A Python script that automatically crops photos into professional headshots using face detection. Optimized for Apple Silicon (M4 Mac Mini).

Features

  • Automatic face detection using OpenCV's Haar Cascade classifier
  • Professional headshot dimensions (800x1000 pixels, 4:5 aspect ratio)
  • Intelligent cropping with proper padding around the face
  • Processes all images in the input folder automatically
  • Saves cropped headshots to the output folder

Setup

  1. Activate the virtual environment:

    source venv/bin/activate
  2. Install dependencies (if not already installed):

    pip install -r requirements.txt

Usage

  1. Place your photos in the input folder
  2. Run the script:
    python crop_headshots.py
  3. Find your cropped headshots in the output folder

Output

  • Each processed image will be saved as [original_filename]_headshot.jpg
  • Standard headshot dimensions: 800x1000 pixels
  • High quality JPEG output (95% quality)

Notes

  • The script detects the largest face in each image
  • If no face is detected, it will perform a center crop
  • The script maintains professional headshot proportions with appropriate padding above the head and around the face

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages