GithubHelp home page GithubHelp logo

swagatsbhuyan / facial-feature-detection-and-3d-reconstruction-with-texture-generation Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 73.97 MB

This repository has been built to detect facial features using the standard 68 landmark data file and will hence generate a 5 landmark coordinate system that will eventually be used by the 3D reconstruction scripts to generate an object file with built-in vector textures.

Python 73.20% Jupyter Notebook 26.80%

facial-feature-detection-and-3d-reconstruction-with-texture-generation's Introduction

Facial-Feature-Detection-and-3D-Reconstruction-with-Texture-Generation

This repository has been built to detect facial features using the standard 68 landmark data file and will hance generate a 5 landmark coordinate system that will eventually be used by the 3D reconstruction scripts to generate an object file with built-in vector textures.

System Requirements

Project uses below python packages:

  • NumPy : A fundamental package for scientific computing with Python.

  • OpenCV : A library of Python bindings designed to solve computer vision problems.

  • dlib : A toolkit for making real world machine learning and data analysis applications.

  • imutils : A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.

  • Reconstruction : Reconstructions can be done on both Windows and Linux. However, we suggest running on Linux because the rendering process is only supported on Linux currently. If you wish to run on Windows, you have to comment out the rendering part.

  • scipy

  • pillow

  • Tensorflow 1.4 ~ 1.12

  • Basel Face Model 2009 (BFM09) : Expression Basis (transferred from Facewarehouse by Guo et al.). The original BFM09 model does not handle expression variations so extra expression basis are needed.

  • tf mesh renderer : We use the library to render reconstruction images. Install the library via pip install mesh_renderer. Or you can follow the instruction of tf mesh render to install it using Bazel. Note that current rendering tool does not support tensorflow version higher than 1.13 and can only be used on Linux.

Installation

  1. Clone the repository:
git clone https://github.com/SwagatSBhuyan/Facial-Feature-Detection-and-3D-Reconstruction-with-Texture-Generation.git
cd Facial-Feature-Detection-and-3D-Reconstruction-with-Texture-Generation
  1. Download and install Python 3.6 or Anaconda 4 on your system as per your operating system Download Python Download Anaconda 4

please note: Follow the Anaconda Documentation properly to install the required Conda dependencies to run Python scripts and notebooks.

  1. Install the required python packages needed to run the scripts.

  2. Download the Basel Face Model. Due to the license agreement of Basel Face Model, you have to download the BFM09 model after submitting an application on its home page. After getting the access to BFM data, download "01_MorphableModel.mat" and put it into ./BFM subfolder.

  3. Download the Expression Basis provided by Guo et al. You can find a link named "CoarseData" in the first row of Introduction part in their repository. Download and unzip the Coarse_Dataset.zip. Put "Exp_Pca.bin" into ./BFM subfolder. The expression basis are constructed using Facewarehouse data and transferred to BFM topology.

  4. Download the trained reconstruction network, unzip it and put "FaceReconModel.pb" into ./network subfolder.

  5. Run Jupyter Notebook in Local Terminal:

jupyter notebook
  1. Insert desired images to render in the ./images folder in the root directory.

  2. Run the two lines of code already present inside the notebook:

!python 5_landmark_detection.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/image_1.jpg
!python main.py

please note: instead of 'image_1.jpg' you can insert the name of the desired image to reconstruct.

  1. check the ./output folder to acquire the generated .obj files with built-in vector textures, that can be rendered using softwares, such as meshlab.

Citation

Please cite the following paper if this model helps your research:

@inproceedings{deng2019accurate,
    title={Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set},
    author={Yu Deng and Jiaolong Yang and Sicheng Xu and Dong Chen and Yunde Jia and Xin Tong},
    booktitle={IEEE Computer Vision and Pattern Recognition Workshops},
    year={2019}
}

References

  1. @microsoft/Deep3DFaceReconstruction Deep 3D face Reconstruction GitHub
  2. @raviranjan0309/Detect-Facial-Features Detect Facial Features GitHub

facial-feature-detection-and-3d-reconstruction-with-texture-generation's People

Contributors

swagatsbhuyan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yingunjun

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.