GithubHelp home page GithubHelp logo

bipolar713 / beyond3dmm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiangyuzhu-open/beyond3dmm

0.0 0.0 0.0 57.58 MB

Beyond 3DMM Space: Towards Fine-grained 3D Face Reconstruction, ECCV, 2020

License: BSD 2-Clause "Simplified" License

C++ 5.86% Python 92.05% MATLAB 0.40% Cython 1.69%

beyond3dmm's Introduction

Beyond 3DMM Space: Towards Fine-grained 3D Face Reconstruction

demo

[Updates]

  • The code and model of FGNet is released.
  • The dataset of FG3D is released.

Introduction

This repo releases the code and data in the paper published in ECCV 2020: Beyond 3DMM Space: Towards Fine-grained 3D Face Reconstruction (http://www.cbsr.ia.ac.cn/users/xiangyuzhu/papers/2020beyond.pdf).

The reconstruction results of widely used 3DMM lose the fine-grained geometry and look different from real faces. We propose a Fine-Grained reconstruction Network (FGNet) that can concentrate on shape modification and generate reconstruction results with fine-grained geometry.

Getting started

Requirements

  • PyTorch >= 0.4.1 (PyTorch v1.1.0 is tested successfully on macOS and Linux.)
  • Python >= 3.6 (Numpy, Scipy, Matplotlib)
  • Dlib (Dlib is optionally for face and landmarks detection. There is no need to use Dlib if you can provide face bouding bbox and landmarks. Besides, you can try the two-step inference strategy without initialized landmarks.)
  • OpenCV (Python version, for image IO operations.)
  • Cython (For accelerating depth and PNCC render.)
  • Platform: Linux or macOS (Windows is not tested.)
# installation structions
sudo pip3 install torch torchvision # for cpu version. more option to see https://pytorch.org
sudo pip3 install numpy scipy matplotlib
sudo pip3 install dlib==19.5.0 # 19.15+ version may cause conflict with pytorch in Linux, this may take several minutes. If 19.5 version raises errors, you may try 19.15+ version.
sudo pip3 install opencv-python
sudo pip3 install cython

In addition, I strongly recommend using Python3.6+ instead of older version for its better design.

Usage

  1. Clone this repo (this may take some time as it is a little big)

  2. Download the following large models to models/

    https://github.com/XiangyuZhu-open/models/blob/fdb595cc1061fefe077d2f168924430adedbfe70/_checkpoint_epoch_22.pth.tar https://github.com/XiangyuZhu-open/models/blob/fdb595cc1061fefe077d2f168924430adedbfe70/shape_predictor_68_face_landmarks.dat

  3. Build cython module (just one line for building)

    cd MM3D/cython
    python3 setup.py build_ext -i
    

    This is for accelerating depth estimation and PNCC render since Python is too slow in for loop.

  4. Run the main.py with arbitrary image as input

    python3 main.py -f examples/images/test.jpg
    

    If you can see these output log in terminal, you run it successfully.

    Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning.
    Lossy conversion from float64 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning.
    1/1
    There are 1 images...
    => loading checkpoint 'models/_checkpoint_epoch_22.pth.tar'
    begin testing
    end
    

Fine-grained 3D Face (FG3D) Data

FG3D

FG3D are constructed from FRGC, BP4D and CASIA-3D. We register and out-of-plane augment the three datasets, generating a large 3D dataset with 213,367 samples. Among FG3D, 90% subjects are used as the training set and the rest 10% subjects are the testing set.

[BaiduYun] (Extract Code: 4r84). [GoogleDrive]

beyond3dmm's People

Contributors

xiangyuzhu-open 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.