In a photo, closed eyes can occur for a number of reasons, such as the blinding light of a camera’s flash, a mistimed blink, or some other unexpected event. A single individual with closed eyes greatly reduces the picture’s quality and worth, prompting a retake. However, retaking the picture doesn’t ensure that all eyes will be open; a retake is just as much at risk as the initial image. All-eyes attempts to solve this problem using face and closed eye detection, local images, and in-painting to achieve a natural replacement.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
All-eyes is created with Python and OpenCV. If you do not have Python installed on your machine, please see Python's Installation Guides.
- Clone this repository with the following command:
git clone https://github.com/elliotBraem/all-eyes
- Optional: Create a virtual environment for OpenCV with the name all-eyes and enter the environment.
mkvirtualenv all-eyes -p python3
workon all-eyes
- Run setup.py to install the project and dependencies:
python setup.py install
After installing the project:
- Place multiple retakes of the same group picture in the directory (or provide custom path in next step):
all-eyes/resources/images
- Run the following command:
python all_eyes [-b base image] [-i image directory]
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Locate a face in an image
- Locate the eyes on a face
- Preliminary eye matching
- Preliminary open/closed implementation
- Distinguish between closed eyes and open eyes
- Identify the same set of eyes (open or closed) in the image sequence
- Apply the replacement to the closed eyes
- Inpaint the replacment eye
- Improved, natural inpainting
- Elliot Braem
- Connor Waity
- Natalie Brooks
- Austen Baker
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Special thanks to Adrian Rosebrock of pyimagesearch. Aspects of this project are largly influenced by his articles: