Skip to content

p-zach/photo-standardize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

photo-standardize

Ever seen a fancy-shmancy "Meet the Team" page with crisp, matching photos of all the big-shot employees? Worry no more: photo-standardize has got you covered!


Features

requires Numpy and OpenCV

  • Single- or batch-image processing
  • Automatic facial detection and centering
  • Edge padding
  • Replacement of greenscreen with background image
  • Rotation
  • Grayscaling
  • Scaling
  • Circle masking

Examples

Before:

face3 face1 face2

After python standardize.py -f samples -r -15 -g -c -s 200 200:

img2 img0 img1

Before:

kid man trump

I couldn't find any great greenscreen images, OK?

After python standardize.py -f samples -c -s 200 200 -b skybg.jpg:

img3 img4 img5


Usage:

usage: standardize.py [-h] [-i IMGS] [-f FOLDER] [-o OUTPUT] [-p PADDING] [-b BACKGROUND] [-r ROTATION] [-g]
                      [-s SIZE SIZE] [-c]

Standardizes face images to create a uniform look.

optional arguments:
  -h, --help     show this help message and exit
  -i IMGS        paths to images to standardize
  -f FOLDER      path to a folder with images to standardize
  -o OUTPUT      name of output folder for standardized images
  -p PADDING     amount of pixels of padding around each face. default: 30
  -b BACKGROUND  path to background image. Images must be taken in front of a greenscreen for this option to work.
                 NOTE: ensure BG image is larger than greenscreen image
  -r ROTATION    rotate by the amount of degrees specified
  -g             makes images grayscale
  -s SIZE SIZE   scales all images to the specified X, Y value
  -c             outputs circular images

About

A tool for standardizing face photos.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages