GithubHelp home page GithubHelp logo

anhttran / extreme_3d_faces Goto Github PK

View Code? Open in Web Editor NEW
785.0 52.0 184.0 63.41 MB

Extreme 3D Face Reconstruction: Looking Past Occlusions

License: Other

Python 11.52% CMake 6.37% Shell 0.12% C++ 69.70% C 4.14% Makefile 7.84% Dockerfile 0.30%
face 3d 3d-face reconstruction face-reconstruction 3d-face-reconstruction occlusion bump bump-maps details

extreme_3d_faces's Introduction

Extreme 3D Face Reconstruction: Seeing Through Occlusions

Please note that the main part of the code has been released, though we are still testing it to fix possible glitches. Thank you.

Python and C++ code for realistic 3D face modeling from single image using our shape and detail regression networks published in CVPR 2018 [1] (follow the link to our PDF which has many, many more reconstruction results.)

This page contains end-to-end demo code that estimates the 3D facial shape with realistic details directly from an unconstrained 2D face image. For a given input image, it produces standard ply files of the 3D face shape. It accompanies the deep networks described in our paper [1] and [2]. The occlusion recovery code, however, will be published in a future release. We also include demo code and data presented in [1].

Dependencies

Data requirements

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

Note that we modified the model files from the 3DMM-CNN paper. Therefore, if you generated these files before, you need to re-create them for this code.

Installation

There are 2 options below to compile our code:

Installation with Docker (recommended)

	docker build -t extreme-3dmm-docker .

Installation without Docker on Linux

The steps below have been tested on Ubuntu Linux only:

  • Install Python2.7
  • Install the required third-party packages:
	sudo apt-get install -y libhdf5-serial-dev libboost-all-dev cmake libosmesa6-dev freeglut3-dev
	wget http://dlib.net/files/dlib-19.6.tar.bz2
	tar xvf dlib-19.6.tar.bz2
	cd dlib-19.6/
	mkdir build
	cd build
	cmake ..
	cmake --build . --config Release
	sudo make install
	cd ..
  • Install PyTorch
  • Install other required third-party Python packages:
	pip install opencv-python torchvision scikit-image cvbase pandas mmdnn dlib
  • Config Dlib and HDF5 path in CMakefiles.txt, if needed
  • Build C++ code
	mkdir build;
	cd build; \
	cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=../demoCode ..;
	make;
	make install;
	cd ..

This code should generate TestBump in demoCode folder

Usage

Start docker container

If you compile our code with Docker, you need to start a Docker container to run our code. You also need to set up a shared folder to transfer input/output data between the host computer and the container.

  • Prepare the shared folder on the host computer. For example, /home/ubuntu/shared
  • Copy input data (if needed) to the shared folder
  • Start container:
	nvidia-docker run --rm -ti --ipc=host --privileged -v /home/ubuntu/shared:/shared extreme-3dmm-docker bash

Now folder /home/ubuntu/shared on your host computer will be mounted to folder /shared inside the container

3D face modeling with realistic details from a set of input images

  • Go into demoCode folder. The demo script can be used from the command line with the following syntax:
$ Usage: python testBatchModel.py <inputList> <outputDir>

where the parameters are the following:

  • <inputList> is a text file containing the paths to each of the input images, one in each line.
  • <outputDir> is the path to the output directory, where ply files are stored.

An example for <inputList> is demoCode/testImages.txt

../data/test/03f245cb652c103e1928b1b27028fadd--smith-glasses-too-faced.jpg
../data/test/20140420_011855_News1-Apr-25.jpg
....

The output 3D models will be <outputDir>/<imageName>_<postfix>.ply with <postfix> = <modelType>_<poseType>. <modelType> can be "foundation", "withBump" (before soft-symmetry),"sparseFull" (soft-symmetry on the sparse mesh), and "final". <poseType> can be "frontal" or "aligned" (based on the estimated pose). The final 3D shape has <postfix> as "final_frontal". You can config the output models in code before compiling.

The PLY files can be displayed using standard off-the-shelf 3D (ply file) visualization software such as MeshLab.

Sample command:

	python testBatchModel.py testImages.txt /shared

Note that our occlusion recovery code is not included in this release.

Demo code and data in our paper

  • Go into demoCode folder. The demo script can be used from the command line with the following syntax:
$ Usage: ./testPaperResults.sh

Before exiting the docker container, remember to save your output data to the shared folder.

Citation

If you find this work useful, please cite our paper [1] with the following bibtex:

@inproceedings{tran2017extreme,
  title={Extreme {3D} Face Reconstruction: Seeing Through Occlusions},
  author={Tran, Anh Tuan and Hassner, Tal and Masi, Iacopo and Paz, Eran and Nirkin, Yuval and Medioni, G\'{e}rard},
  booktitle={IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)},
  year=2018
}

References

[1] A. Tran, T. Hassner, I. Masi, E. Paz, Y. Nirkin, G. Medioni, "Extreme 3D Face Reconstruction: Seeing Through Occlusions", IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, June 2018

[2] A. Tran, T. Hassner, I. Masi, G. Medioni, "Regressing Robust and Discriminative 3D Morphable Models with a very Deep Neural Network", CVPR 2017

Changelog

  • Dec. 2018, Convert to Dockerfile
  • Dec. 2017, First Release

License and Disclaimer

Please, see the LICENSE here

Contacts

If you have any questions, drop an email to [email protected] , [email protected] and [email protected] or leave a message below with GitHub (log-in is needed).

extreme_3d_faces's People

Contributors

anhttran avatar apoorva-sriv avatar iacopomasi avatar talhassner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extreme_3d_faces's Issues

Real time use?

Hi, and thank you for making this code available.
Is it possible to run in real time from a Webcam input?
What fps could I expect from this?
(without saving the mesh file)

Thanks!

GPU RAM size required to run bump maps.

Dear authors, thank you for your great work. I test the code on my server with the provided dockfile. However, the program complains "out of memory" when regressing bump maps. Can you kindly inform me of the memory size of your testing GPU? Thank you.

fatal error: cv.h: No such file or directory #include "cv.h"

I was trying to execute the steps mentioned and I am stuck due to the below error. It looks like opencv issue but I am not able to figure out the fix. Appreciate any help. Thanks!

In file included from Projects/ExtremeFaces/extreme_3d_faces/modules/CvGl/FBRender.cpp:2:0: Projects/ExtremeFaces/extreme_3d_faces/modules/CvGl/FBRender.h:21:10: fatal error: cv.h: No such file or directory #include "cv.h" ^~~~~~ compilation terminated. modules/CvGl/CMakeFiles/CvGl.dir/build.make:62: recipe for target 'modules/CvGl/CMakeFiles/CvGl.dir/FBRender.cpp.o' failed make[2]: *** [modules/CvGl/CMakeFiles/CvGl.dir/FBRender.cpp.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'modules/CvGl/CMakeFiles/CvGl.dir/all' failed make[1]: *** [modules/CvGl/CMakeFiles/CvGl.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

Ubuntu can't get into graphic interface.

After installing OpenGL, the server enters the password on the standby page, and the flash screen returns to the input password interface. It can not enter the graphical interface, but the terminal can operate. Is it because of GPU?

Build failed at 92% with No rule to make target error

Scanning dependencies of target TestBump
[ 92%] Building CXX object config/CMakeFiles/TestBump.dir/__/main.cpp.o
make[2]: *** No rule to make target '/home/ubuntu/Downloads/opencv-2.4.9/release/lib/libopencv_ts.a', needed by 'bin/TestBump'.  Stop.
CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed
make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Tried with both the branches master as well as linux. The complete setup was followed. Let me know if something is missing

RuntimeError: cuda runtime error (2) : out of memory at c:\programdata\miniconda3\conda-bld\pytorch_1524539825236\work\aten\src\thc\generic/THCStorage.cu:58

We ran into the following error with the program on a GeForce GTX 1050 (2 GB, laptop):

RuntimeError: cuda runtime error (2) : out of memory at c:\programdata\miniconda3\conda-bld\pytorch_1524539825236\work\aten\src\thc\generic/THCStorage.cu:58

Your paper says you used a desktop system with GeForce GTX 1080, which has an 8 GB frame buffer. What is the minimum frame buffer needed to run the program?

RuntimeError: CUDNN_STATUS_EXECUTION_FAILED

root@74a4066c1b48:/app/demoCode# python testBatchModel.py /shared/img_list.txt /shared/3d_output/

Prepare image /shared/cute_boy.jpg:
Number of faces detected: 1
CNN Model loaded to regress 3D Shape and Texture!
Loaded the Basel Face Model to write the 3D output!
Processing image: /shared/3d_output/imgs/cute_boy.png
Traceback (most recent call last):
File "testBatchModel.py", line 168, in
features = net(im).data.cpu().numpy()
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "../CNN/shape_model.py", line 239, in forward
conv1 = self.conv1(conv1_pad)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/conv.py", line 282, in forward
self.padding, self.dilation, self.groups)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 90, in conv2d
return f(input, weight, bias)
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED

I have two 2080 card and ubuntu 16.04 but these is a error CUDNN_STATUS_EXECUTION_FAILED when I run program in Dock. I need help

Doesnt compile with Opencv3

file: ./modules/PoseExpr/src/FaceServices2.cpp
needs to work with newer API SubDiv2D as legacy module has been discontinued in opencv3.

TestBump Issue

I think modules/TestBump is missing in your github.
when i build i can see Message below :

[ 14%] Built target CvGl
[ 85%] Built target PoseExprLib
[ 92%] Linking CXX executable ../bin/TestBump
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
config/CMakeFiles/TestBump.dir/build.make:127: recipe for target 'bin/TestBump' failed
make[2]: *** [bin/TestBump] Error 1
CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed
make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Could you tell me What is the problem?

Please update code to work with current NVIDIA driver, thanks!

Based on documentation, when I install extreme_3d_faces using the command:

docker build -t extreme-3dmm-docker .

I got 1/13 passed, 2/13 failed:

Step 1/13 : FROM mxnet/python:1.1.0_nccl
...
Step 2/13 : RUN apt-get update
...
Get:11 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages [619 kB]
Err:12 http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
Connection failed
Fetched 7725 kB in 12min 1s (10.7 kB/s)
Reading package lists...
E: Failed to fetch http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/Packages Connection failed
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100

fatal error: dlib/image_processing/frontal_face_detector.h: No such file or directory

Download dlib-19.13, python setup.py install. 'import dlib' in python is fine

and then i update Dlib directory paths (DLIB_INCLUDE_DIR and DLIB_LIB_DIR) in CMakeLists.txt.
set (DLIB_INCLUDE_DIR "/home/AnLan/3D/dlib-19.13")
However, there's no folder named "/...../dlib-19.13/shared_build/dlib", so I make it ""/...../dlib-19.13/build/dlib"".

then make it...

the error is :
..../3dmm_cnn/modules/PoseExpr/include/DlibWrapper.h:7:57: fatal error: dlib/image_processing/frontal_face_detector.h: No such file or directory
#include <dlib/image_processing/frontal_face_detector.h>
^
compilation terminated.
config/CMakeFiles/TestVisualization.dir/build.make:62: recipe for target 'config/CMakeFiles/TestVisualization.dir//main.cpp.o' failed
make[2]: *** [config/CMakeFiles/TestVisualization.dir/
/main.cpp.o] Error 1
CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestVisualization.dir/all' failed
make[1]: *** [config/CMakeFiles/TestVisualization.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

but i can find 'dlib/image_processing/frontal_face_detector.h'.

I am looking for a solution. Thanks in advance.

get 3d reconstructed faces with facial fine details

Dear author,
@anhttran

For unknown reasons, my 3d reconstructed faces don't have fine details.
this is an image shown in your paper:
image

this is what I get by run python testBatchModel.py testImages.txt /shared
8845981467_6945cef32a_b.ply
image
image

I don't know why my results don't have the facial fine details.

Could you please kindly tell me how to add the fine details to the 3d reconstructed faces?

Best,
Heyuan

TypeError: data type "floattrimBaselFace.py64" not understood

When I run python trimBaselFace.py of /3DMM_model directory, it come out TypeError: data type "floattrimBaselFace.py64" not understood, who can tell me how to solve it.

(extreme3D) event@event2:~/Documents/extreme_3d_faces-master/3DMM_model$ python trimBaselFace.py
Traceback (most recent call last):
File "trimBaselFace.py", line 104, in
shapeEV = convert(shapeEV)
File "trimBaselFace.py", line 27, in convert
new = data.reshape(data.shape[0],1).astype('floattrimBaselFace.py64')
TypeError: data type "floattrimBaselFace.py64" not understood

How to solve the `_GLOBAL__sub_I__ZN11DlibWrapperC2EPc' problem?

Hi,
Thank you for your work.
And finally I compiled all files succeed. But there is a link error can not solve.
Can you check the issue?

$make
[ 14%] Built target CvGl
[ 85%] Built target PoseExprLib
[ 92%] Linking CXX executable ../bin/TestBump
../modules/PoseExpr/libPoseExprLib.a(DlibWrapper.cpp.o): In function _GLOBAL__sub_I__ZN11DlibWrapperC2EPc': DlibWrapper.cpp:(.text.startup+0x46): undefined reference to USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2'
CMakeFiles/TestBump.dir/__/main.cpp.o: In function _GLOBAL__sub_I__Z6loadLMPKc': main.cpp:(.text.startup+0x18ba): undefined reference to USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/TestBump] Error 1
make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2
make: *** [all] Error 2

BaselFaceModel.mat not found

When running the code I receive the following error. I used docker to install on ubuntu 18.04 and have put the required basel file (01_moprhableModel.mat) in the 3DMM dir but receive this error.

CNN Model loaded to regress 3D Shape and Texture!
Traceback (most recent call last):
File "testBatchModel.py", line 148, in
model = scipy.io.loadmat(BFM_path,squeeze_me=True,struct_as_record=False)
File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 207, in loadmat
MR, file_opened = mat_reader_factory(file_name, appendmat, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 62, in mat_reader_factory
byte_stream, file_opened = _open_file(file_name, appendmat)
File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 37, in _open_file
return open(file_like, 'rb'), True
IOError: [Errno 2] No such file or directory: '../3DMM_model/BaselFaceModel_mod.mat'

Libdl.so missing DSO from command line (undefined reference)

I've been porting this code to work with opencv3. So far I have made it through most of the compilation but I keep getting this error when its almost complete. I have looked at a number of occurances of this issue but none of the solutions have worked for me as yet. Any help would be greatly appreciated then, once the OpenCV3 version is working I'd be happy to share my code.

So far I've tried:
-creating the symbolic link to libdl.so manually (as this solved a few similar errors I had earlier in the compliation)
-adding -ldl as a flag, and in the cmakelists

  • rearranging the order of the included libraries as that has been known to have an effect

so far nothing has worked.
any advice?

[ 92%] Linking CXX executable ../bin/TestBump /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libhdf5.a(H5PL.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status config/CMakeFiles/TestBump.dir/build.make:149: recipe for target 'bin/TestBump' failed make[2]: *** [bin/TestBump] Error 1 CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

AssertionError: Torch not compiled with CUDA enabled

Today,I run the script jush like:/demoCode# python testBatchModel.py /home/hero/infile.txt /root/rsx,and I met a problem:

Prepare image /home/hero/xiaoluo.jpg:
Number of faces detected: 1
Skipping
file path too short
CNN Model loaded to regress 3D Shape and Texture!
('> Processing image: ', '/root/rsx/imgs/xiaoluo.png', ' ', 'xiaoluo.png', ' ', '1/1')
Regress bump maps
Traceback (most recent call last):
File "testBatchModel.py", line 183, in
bumpMapRegressor.estimateBump(bumpModel_path, data_out + "/imList.txt", data_out + "/bump/")
File "/root/faces/extreme_3d_faces/demoCode/bumpMapRegressor.py", line 332, in estimateBump
net.cuda()
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 216, in cuda
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 146, in _apply
module._apply(fn)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 146, in _apply
module._apply(fn)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 152, in _apply
param.data = fn(param.data)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 216, in
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python2.7/dist-packages/torch/_utils.py", line 69, in cuda
return new_type(self.size()).copy
(self, async)
File "/usr/local/lib/python2.7/dist-packages/torch/cuda/init.py", line 453, in _lazy_new
_lazy_init()
File "/usr/local/lib/python2.7/dist-packages/torch/cuda/init.py", line 152, in _lazy_init
_check_driver()
File "/usr/local/lib/python2.7/dist-packages/torch/cuda/init.py", line 74, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

I don't kown how to resolve it, Besides,I changed testBatchModel.py,

load net

try:
caffe.set_mode_cpu()
#caffe.set_mode_gpu()
#caffe.set_device(GPU_ID)
pass
except Exception as ex:
print('> Could not setup Caffe in GPU ' +str(GPU_ID) + ' - Error: ' + ex)
print('> Reverting into CPU mode')
caffe.set_mode_cpu()

Opening mean average image

Could you help me?

Removing facial fine details (wrinkles, etc)

Hi,
Thank you for sharing your work.
Is there any way to remove the facial fine details like wrinkles from 3D reconstructed face, and keep the facial expression in the same time?
By the way, I've read the paper. Although it's seem to me that fine details and expression don't related much to each other, just want to make sure.

Thank you,
tlsy

Running ZBuffer instead of Mex_ZBuffer

I am using Mac version of Matlab. So in 3DDFA Expression Model, there is an alternative Matlab version of Z_Buffer to Mex_ZBufferC.mexw64. However, the parameters list are not exactly the same:

ZBuffer(s2d, vertex, tri, texture, img_src)

where in Mex_ZBuffer.m, we have,

Mex_ZBuffer(projectedVertex, tri, texture, img_src)

what is exactly s2d here? And how do we get it? Thanks!

terminate called after throwing an instance of 'H5::FileIException'

root@ea21a7cb96ec:/app/bin# ./TestBump -batch /shared/imList.txt /shared/3D/ /shared/shape /shared/bump /shared/bump ../3DMM_model/BaselFaceModel_mod.h5 ../dlib_model/shape_predictor_68_face_landmarks.dat /shared/imgs /shared/imgs/ 1 load ../3DMM_model/BaselFaceModel_mod.h5 terminate called after throwing an instance of 'H5::FileIException'

Hello, i'm facing this problem when a tried to run the TestBump code. Could you help me to find a solution? Thank you so much

BaselFace.cpp:(.text+0xc): undefined reference to `H5::DSetAccPropList::DEFAULT'

Scanning dependencies of target CvGl
[ 7%] Building CXX object modules/CvGl/CMakeFiles/CvGl.dir/FBRender.cpp.o
[ 14%] Linking CXX static library libCvGl.a
[ 14%] Built target CvGl
Scanning dependencies of target PoseExprLib
[ 21%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/utility.cpp.o
[ 28%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/epnp.cpp.o
[ 35%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFace.cpp.o
[ 42%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFaceEstimator.cpp.o
[ 50%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FTModel.cpp.o
[ 57%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FImRenderer.cpp.o
[ 64%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/RenderModel.cpp.o
[ 71%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FaceServices2.cpp.o
[ 78%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/DlibWrapper.cpp.o
[ 85%] Linking CXX static library libPoseExprLib.a
[ 85%] Built target PoseExprLib
Scanning dependencies of target TestBump
[ 92%] Building CXX object config/CMakeFiles/TestBump.dir/__/main.cpp.o
[100%] Linking CXX executable ../bin/TestBump
../modules/PoseExpr/libPoseExprLib.a(BaselFace.cpp.o): In function readH5Dataset(H5::H5File const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': BaselFace.cpp:(.text+0xc): undefined reference to H5::DSetAccPropList::DEFAULT'
BaselFace.cpp:(.text+0x91): undefined reference to `H5::H5Location::openDataSet(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, H5::DSetAccPropList const&) const'
collect2: error: ld returned 1 exit status
config/CMakeFiles/TestBump.dir/build.make:126: recipe for target 'bin/TestBump' failed
make[2]: *** [bin/TestBump] Error 1
CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed
make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

When I followed the steps to the third-to-last command 'make', I got the above errors.
I tried to add the link libraries hdf5_cpp and hdf5 in the CMakeFiles.txt file, but it still failed.

minor bug maybe

In modules/PoseExpr/src/FaceServices2.cpp, line 390
I think it should be as followed (init with 0)

cv::Mat out(2*M+EM+RENDER_PARAMS_COUNT,1,CV_32F,cv::Scalar(0));

as when I check the different output of the same data, this function computeGradient sometimes gives me a mat containing some NANs

image

missing files in output

Thanks for sharing your code! I followed the instructions to run with docker and managed to run the democode with no errors but there are no ply files showing in any of the ouput folders (3d, bump, shape). My terminal shows that the images were all processed correctly and I can see the .pts and image with landmarks photos saved in imgs folder where the original images are located. Any idea what happened to the ply files? Thanks!

bump making

I made the data set of bump according to the contents of your paper 4.1. I use the formula (3) in 4.1 to calculate, why the picture I get is strange, not just like the bump graph generated by using the code you provided, is there something wrong? Hope you can give me some guidance, thank you!

Getting libblas.so error during install

make[2]: *** No rule to make target '/usr/lib/libblas.so', needed by 'bin/TestBump'. Stop. CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

I can see that libblas is located at "/usr/lib/x86_64-linux-gnu" but I'm completely new to Ubuntu and have no idea how to update paths.

BaselFace.cpp:(.text+0x7a): undefined reference to `H5::H5Location::openDataSet(std::string const&) const'

I intend to run the code on a public server with CUDA 8.0 preinstalled in /usr/local and dlib-19.15, hdf5-1.10.1 installed in my user directory ( /home/user )

Got errors while build 'make'

wanghanjing@lhtserver-2:~/extreme_3d_faces/build$ make
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Scanning dependencies of target CvGl
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[  7%] Building CXX object modules/CvGl/CMakeFiles/CvGl.dir/FBRender.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 14%] Linking CXX static library libCvGl.a
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 14%] Built target CvGl
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Scanning dependencies of target PoseExprLib
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 21%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/utility.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 28%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/epnp.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 35%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFace.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 42%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFaceEstimator.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 50%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FTModel.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 57%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FImRenderer.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 64%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/RenderModel.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 71%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/FaceServices2.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 78%] Building CXX object modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/DlibWrapper.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 85%] Linking CXX static library libPoseExprLib.a
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 85%] Built target PoseExprLib
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Scanning dependencies of target TestBump
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 92%] Building CXX object config/CMakeFiles/TestBump.dir/__/main.cpp.o
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[100%] Linking CXX executable ../bin/TestBump
/usr/bin/cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
../modules/PoseExpr/libPoseExprLib.a(DlibWrapper.cpp.o): In function `_GLOBAL__sub_I__ZN11DlibWrapperC2EPc':
DlibWrapper.cpp:(.text.startup+0x46): undefined reference to `USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2'
CMakeFiles/TestBump.dir/__/main.cpp.o: In function `_GLOBAL__sub_I__Z6loadLMPKc':
main.cpp:(.text.startup+0x18ca): undefined reference to `USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2'
../modules/PoseExpr/libPoseExprLib.a(BaselFace.cpp.o): In function `readH5Dataset(H5::H5File const&, std::string const&)':
BaselFace.cpp:(.text+0x7a): undefined reference to `H5::H5Location::openDataSet(std::string const&) const'
../modules/PoseExpr/libPoseExprLib.a(BaselFace.cpp.o): In function `BaselFace::load(std::string const&)':
BaselFace.cpp:(.text+0x306c): undefined reference to `H5::Exception::getDetailMsg() const'
collect2: error: ld returned 1 exit status
config/CMakeFiles/TestBump.dir/build.make:128: recipe for target 'bin/TestBump' failed
make[2]: *** [bin/TestBump] Error 1
CMakeFiles/Makefile2:196: recipe for target 'config/CMakeFiles/TestBump.dir/all' failed
make[1]: *** [config/CMakeFiles/TestBump.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Could anyone help to figure out what's going wrong in the procedure?
With thanks and appreciation

The output of cmake is attached as follows:

wanghanjing@lhtserver-2:~/extreme_3d_faces/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=../bin -D BOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF ..
cmake: /usr/local/anaconda3/lib/libcurl.so.4: no version information available (required by cmake)
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/local/anaconda3/bin/cc
-- Check for working C compiler: /usr/local/anaconda3/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/anaconda3/bin/c++
-- Check for working CXX compiler: /usr/local/anaconda3/bin/cQ++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: /usr/local/cuda-8.0 (found suitable exact version "8.0") 
OpenCV information:
  OpenCV_INCLUDE_DIRS: /home/wanghanjing/opencv-2.4.13.6/build;/home/wanghanjing/opencv-2.4.13.6/include;/home/wanghanjing/opencv-2.4.13.6/include/opencv;/home/wanghanjing/opencv-2.4.13.6/modules/core/include;/home/wanghanjing/opencv-2.4.13.6/modules/flann/include;/home/wanghanjing/opencv-2.4.13.6/modules/imgproc/include;/home/wanghanjing/opencv-2.4.13.6/modules/highgui/include;/home/wanghanjing/opencv-2.4.13.6/modules/features2d/include;/home/wanghanjing/opencv-2.4.13.6/modules/calib3d/include;/home/wanghanjing/opencv-2.4.13.6/modules/ml/include;/home/wanghanjing/opencv-2.4.13.6/modules/video/include;/home/wanghanjing/opencv-2.4.13.6/modules/legacy/include;/home/wanghanjing/opencv-2.4.13.6/modules/objdetect/include;/home/wanghanjing/opencv-2.4.13.6/modules/photo/include;/home/wanghanjing/opencv-2.4.13.6/modules/gpu/include;/home/wanghanjing/opencv-2.4.13.6/modules/ocl/include;/home/wanghanjing/opencv-2.4.13.6/modules/nonfree/include;/home/wanghanjing/opencv-2.4.13.6/modules/contrib/include;/home/wanghanjing/opencv-2.4.13.6/modules/stitching/include;/home/wanghanjing/opencv-2.4.13.6/modules/superres/include;/home/wanghanjing/opencv-2.4.13.6/modules/ts/include;/home/wanghanjing/opencv-2.4.13.6/modules/videostab/include
  OpenCV_LIBRARIES: opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   system
Boost information:
  Boost_INCLUDE_DIRS: /usr/include
  Boost_LIBRARIES: /usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_system.so
  Boost_LIBRARY_DIRS: /usr/lib/x86_64-linux-gnu
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
OPENMP FOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wanghanjing/extreme_3d_faces/build

How to blend the bump map

Hello, Sir,

I would like to use the network to regression bump map! But i don`t know how to blend the bump map, do you have any idea?

I look forward you can help me! Thanks you so much!

Projection parameters.

Dear authors, thank you for releasing the great codes. I am trying to assign texture to each vertex on the 3D mesh.
Basically, I recorded the value of variable _k as camera intrinsics and vecR/vecT as object poses at the end of function FaceServices2::combineBump. Then I project each vertex to images with the camera and pose parameters, colors at the projected position of the corresponding image is used as vertex color. However, the results look incorrect (see below). So do I use the projection parameters correctly?

Camera models and coordinates of extreme_3d_faces

Hi,anhttran,
First thank you for the open source code on the github of extreme_3d_faces,I ran your code and got a nice and robust model(pointcloud).
Since I want to project texture to the model, I project the model using the perspective projection below:
Pointcloud = rshape+t;
z= pointcloud.z
u= -pointcloud.x/ pointcloud.z
f+w/2;
v= pointcloud.y/ pointcloud.z*f+h/2;
with f=1000,w=h=500;
But my result is wrong, Pixel Coordinates u & v get very large or negative, can you tell me where is wrong?or the camera model I throught is right?
Anyone who knows this can help me? Thank you very much.

Ivy

‘Rodrigues’ is not a member of ‘cv’

By trying to build it, this error appears:

extreme_3d_faces-master/modules/PoseExpr/src/BaselFaceEstimator.cpp:224:2: error: ‘Rodrigues’ is not a member of ‘cv’

However, I have installed OpenCV with extra modules. Do you know how i can fix it?
Thank you.

Unable to Dowload the basal Face Model

in the README.md file, under the "data requirements" there is a link to download the basal face model, which appears to be broken.

"This site cant be reached. faces.cs.unbias.ch's sercer IP address could not be found."

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.