Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Detect Faces In Images and Generate Profile Photos

Project description


Generate profile photos for all faces in a given image


Source image


demo image demo image demo image


demo image demo image demo image


  • Python 3
  • OpenCV
  • NumPy


pip install opencv-python roundface

Project Setup

  • Clone repo
  • CD in project
  • Create python virtual environment: python -m venv venv
  • Activate virtual environment: venv/bin/activate or venv\Scripts\activate
  • Install requirements with pip: pip install -r requirement.txt


roundface - s <path to image file or folder>

python - s <path to image file or folder>

More Options:

-g or --grey Integer. 1 or 0. Specifies whether resulting photos should be greyed out.

- sz or --size Integer. Desired output size in pixels

- r or --radius Integer (Float). e.g 1.2 for 20% more than the default radius.

Faces that can't fit a particular radius will be skipped


roundface -s z://home/photos
roundface -s z://home/photos/myself.jpg
roundface -s vacation/photos - sz 400 -g 1
roundface -s vacation/photos - sz 400 -r 1.0

python -s z://home/photos
python -s z://home/photos/myself.jpg
python -s vacation/photos - sz 400 -g 1
python -s vacation/photos - sz 400 -r 1.0

A folder named roundface will in created in the same location as the image source. It will contain the output photos.


Towards Data Science

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for roundface, version 0.0.17
Filename, size File type Python version Upload date Hashes
Filename, size roundface-0.0.17-py3-none-any.whl (5.3 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size roundface-0.0.17.tar.gz (5.3 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page