Skip to content

Automatically rotates images to their proper orientation based on detected faces.

Notifications You must be signed in to change notification settings

dsposito/auto-image-rotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto Image Rotator

Overview

This app uses the OpenCV and Dlib computer vision libraries to auto rotate images based on detected human faces.

This is useful for auto rotating images in bulk that do not contain EXIF orientation meta data (e.g., scanned photos).

Currently, this is only effective for images that contain one or more face. In the future, advanced CNN techniques could be implemented to auto correct the rotation for any photo.

title

Setup

Docker

  1. Install Docker so we can build and run the app

  2. Build the app's Docker image (this takes a few minutes to complete while it builds Dlib's native C extension for Python):

docker-compose build app

Usage

After the one-time setup, rotating a directory of images is as simple as running this command:

IMAGES_PATH=/path/to/your/images/folder docker-compose run app

By default, rotated images are saved as new files with a *-rotated filename pattern in your IMAGES_PATH directory. If you're comfortable overwriting your original files with rotated versions you may prefix the command with the OVERWRITE_FILES param like so:

IMAGES_PATH=/path/to/your/images/folder OVERWRITE_FILES=1 docker-compose run app

About

Automatically rotates images to their proper orientation based on detected faces.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published