Giter VIP home page Giter VIP logo

face_reconstruction's Introduction

Face missing parts reconstruction algorithm

The repository contains scripts that generate averaged depth image and reconstruct given image.

Sample dataset is located in dataset folder. It contains images of human faces of size 116x120. Images in test set have arbitrary distributed missing part.

1. Train samples

2. Reconstruction results

Original image Reconstructed using symmetry Reconstructed using average image
and symmetry

3. Requirements

  • Ubuntu 18.04
  • Python 3.7.4
  • numpy 1.17.2
  • pillow 6.2.0

4. Installation

1. Clone repository:

git clone https://github.com/Robator/face_reconstruction.git

2. Install dependencies:

pip install -r requirements.txt

5. How to run

1. Create average image:

python main.py train dataset/train

2. Reconstruct images

Reconstruct images in test folder run and store results in dataset/rec_images folder run:

python main.py test dataset/test --out=dataset/rec_images

6. Tests

To run tests run from the root directory:

./scripts/tests.sh

7. Algorithm description

When train is launched, an average image is created in the following way. At the first iteration, the average image equals to the first image(or the first batch). By default, batch size equals to 1 Next, the intersection area between the current and the average image is taken and average pixel values between current(or batch) and average image are calculated for each image in dataset.

When inferencing, the algorithm tries to replace white areas. For each such pixel symmetrical to vertical image line pixel value is used if it is not white otherwise value from an average image.

8. Limitations

  • In case face on an image to reconstruct is wider than on an average one and the missing area is in that place, hollows may appear

9. Contact

Contact me on Linkedin

face_reconstruction's People

Contributors

robator avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.