Install 3DMM_CNN

2018-03-05  本文已影响661人  Reyuwei

Regressing Robust and Discriminative 3D Morphable Models with a very Deep Neural Network


Install code

<font color=red>** Follow the instructions on the github repo readme page. ↓↓↓↓↓ **</font>

<font color=green>//Green letters and comments are my own words, others are all from README.MD</font>

Data requirements

Before running the code, please, make sure to have all the required data in the following specific folder:

<font color=green>//After running the code, I only got Model_Shape.mat, but I found a Model_Expression.mat in the folder where it should be generated. It seems that this file comes with the original download. So I upload that one to the 3DMM_model folder. (Anyway, this file seems unnecessary to the demo code.)</font>

Installation

<font color=green>If you don't have apt-get install, use yum install instead.</font>

$ apt-get install cmake
$ #yum install cmake
(http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html)
$ apt-get install libboost-all-dev
$ #yum install boost-devel
$ sudo apt-get install freeglut3-dev
$ #yum install freeglut-devel

$ sudo apt-get install libglew-dev
$ #yum install glew-devel   #not sure, may need to build from source
$ sudo apt-get install libhdf5-dev
$ #yum install hdf5-devel
$ (http://dlib.net/)

<font color=green>
To get libdlib.so, do not follow the instructions on the offical website for Dlib. Use the following commands, which are originally from stackoverflow.
</font>

$ cd dlib
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

<font color=green>
libdlib.so will appear in build foler.
</font>

<font color=green>
DLIB_INCLUDE_DIR = /path/to/dlib-19.4
DLIB_LIB_DIR = /path/to/dlib-19.4/dlib/build
</font>

$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=../bin ..
$ make
$ make install

This code should generate TestVisualization in bin folder

Usage

3DMM fitting on a set of input images

$ Usage: python testBatchModel.py <inputList> <outputDir> <needCrop> <useLM>

where the parameters are the following:

Example for <inputList>:
<pre>
data/1.jpg
data/2.jpg
....
</pre>

Other errors I have encountered

$ export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"

//my markdown doesn't support cpp :(

<font color=green>After words: I finally managed to run the demo with two servers. I generated TestVisualization on a RedHat server. But I can't run the demo code. I copied TestVisualization to a Ubuntu server, with some other preparations, it works, miraculously! </font>

上一篇 下一篇

猜你喜欢

热点阅读