Skip to content

An app that auto-crops images around detected faces, then resizes them to a consistent 1024 × 1024 resolution

License

Notifications You must be signed in to change notification settings

RayHell/Image-Face-Centric-Cropper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Face-Centric Cropper

This application processes images by identifying faces and ensuring they remain central in the final output. It first crops the image to maximize the surrounding region while keeping the face at the center. The cropped image is then resized to a standard 1024×1024 resolution, ensuring the face remains undistorted and prominent. Ideal for creating consistent profile pictures or avatars from a collection of photographs.

Prerequisites

  • Python 3.8 or higher
  • Conda (Recommended for easy installation)

Installation

Windows:

1. Install Conda:

  • Download the Miniconda installer for Windows.
  • Run the installer and follow the on-screen instructions.

2. Set Up Environment:

conda create --name face_crop_env python=3.8
conda activate face_crop_env
conda install -c conda-forge dlib
pip install face_recognition Pillow

Linux:

1. Install Conda:

  • Download the Miniconda installer for Linux.
  • In the terminal, navigate to the directory where you downloaded the installer.
  • Make the installer executable: chmod +x Miniconda3-latest-Linux-x86_64.sh
  • Run the installer: ./Miniconda3-latest-Linux-x86_64.sh
  • Follow the on-screen instructions.

2. Set Up Environment:

conda create --name face_crop_env python=3.8
conda activate face_crop_env
conda install -c conda-forge dlib
pip install face_recognition Pillow

Usage

Place all the .jpg images you want to process inside the images folder. Then run the script:

conda activate face_crop_env
python image_processor.py

Windows user can also execute run.bat

Processed images will be saved in the cropped folder.

About

An app that auto-crops images around detected faces, then resizes them to a consistent 1024 × 1024 resolution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published