Coder Social home page Coder Social logo

yuvalnirkin / face_swap Goto Github PK

View Code? Open in Web Editor NEW
819.0 49.0 202.0 251 KB

End-to-end, automatic face swapping pipeline

License: GNU General Public License v3.0

CMake 3.65% C++ 96.02% C 0.34%
face swap segmentation 3d-reconstruction fitting expressions

face_swap's People

Contributors

iacopomasi avatar rudychin avatar talhassner avatar yuvalnirkin 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

face_swap's Issues

conflict with Caffe(complied by gcc4.X), it confused me for a week !

I had tried many ways to compile this project in Ubuntu14.04,but all failed at the last.
I have no idea about how to compile it.

face_swap needs gcc5.0+ for supporting C++11/14
but my Caffe was compiled by gcc4.X,protobuf2.5 was installed from apt-get
face_swap make failed when linking, about protobuf

Linking CXX executable face_swap_batch
_sequence_face_landmarks.pb.cc:(.text+0x48e): undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&))'

sequence_face_landmarks.pb.cc:(.text+0xdab): undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::_cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::io::CodedOutputStream*)'

then, I tried to compile Caffe and Protobuf-2.5 with gcc5.5 from source
but Caffe was failed the same in linking

Linking CXX executable compute_image_mean
_compute_image_mean.cpp:(.text.startup+0x1bf): undefined reference to google::SetUsageMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In function std::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x43): undefined reference to google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In function std::_cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':

I was very confused about how to choose the gcc version to avoid the conflict?

always return cv:Mat()

when the app run here:
cv::Mat FaceSwap::blend(const cv::Mat& src, const cv::Mat& dst, const cv::Mat& dst_seg)
if (minc >= maxc || minr >= maxr) return cv::Mat();

blend always return cv:Mat(), I don't know what happen?
BTW: I finish port the great app to iOS platform, in the end run here and stop, return failstd::runtime_error: Face swap failed!

Thanks

John

Installation instructions no longer work

I tried following the Ubuntu 16.04 setup instructions and I am unable to install the dependencies. When installing boost, it shows unable to install 54 targets.

I am also unable to install to install Openblas by following the instructions in the setup guide.

Could you or anyone else just try following the instructions on Ubuntu 16.04 and update it so it works? It's a nice paper, but like most other papers, the provided code almost never works because of install issues or outdated libraries.

Thanks

Issues with installations

I am new to C++ and I want to setup the system on my Linux (Ubuntu 14.04) machine, but I am not able to install it.
Could you help me with an "easier" to-understand setup guide (basically more verbose) elaborating on the Use CMake and your favorite compiler to build and install the library point

/cc @YuvalNirkin @TalHassner

libraries may not be found correctly

i got a warning while buildning the cmake file on the cafee installation procedure "cmake -DCPU_ONLY=ON -DBUILD_python=OFF -DBUILD_python_layer=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. "

The output says
"CMake Warning at examples/CMakeLists.txt:11 (add_executable):
Cannot generate a safe runtime search path for target
convert_mnist_siamese_data because files in some directories may conflict
with libraries in implicit directories:
runtime library [libglog.so.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /anaconda3/envs/faceswap/lib

runtime library [libgflags.so.2.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /anaconda3/envs/faceswap/lib

runtime library [libleveldb.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /anaconda3/envs/faceswap/lib
Some of these libraries may not be found correctly.

ImportError: ../face_swap_py.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

There was a error after I finished the Ubuntu Installation Guide.

When I using "import face_swap_py", it threw
ImportError: /home/python/code/face_swap/interfaces/python/face_swap_py.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

And the version of python is Python 2.7.15 |Anaconda, Inc.|. The "PYTHON_LIBRARIES" in the "Makefile" is default:PYTHON_LIBRARIES := boost_python-py27 python2.7.

So how can I to deal with this error?

QXcbConnection: Failed to initialize XRandr

When I try to run the demo. The following question occur.
I use the remote linux server by ssh in XShell. Anyone have some suggestion.

QXcbConnection: Failed to initialize XRandr
Could not initialize GLX
Aborted (core dumped)

I guess it is related with qt and opencv,but I don't know the detail , I am going to try.
Installing opencv, I don't sure if will the parameters -D WITH_QT=ON -D WITH_OPENGL=ON effect the function of qt ?

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D FORCE_VTK=ON -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" -D WITH_GDAL=ON -D WITH_XINE=ON -D BUILD_EXAMPLES=ON ..

I reinstall opencv with_QT and with_OPENGL, but the issue still exist. I had stuck two days, anyone can give the suggestion? I will very appreciate it.

"Qt5::Widgets", the target was not found.

My system is Ubuntu14.04
I download qt-everywhere-opensource-src-5.6.0 and install follow this https://wiki.qt.io/Building_Qt_5_from_Git
————————————
unzip it and :
./configure -prefix $PWD/qtbase -opensource -nomake tests (this took hours)
make
make install
————————————
but when i cmake "face_swap", error occurs :
————————————————————————————————————
`-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- regex
-- timer
-- Found OpenCV: /usr/local (found version "3.2.0") found components: highgui imgproc imgcodecs calib3d photo
-- C++11 activated.
CMake Warning at CMakeLists.txt:67 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.

-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- HDF5: Using hdf5 compiler wrapper to determine CXX configuration
-- Found HDF5: /usr/lib/x86_64-linux-gnu/libhdf5_cpp.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.11") found components: HL
-- Found HDF5: /usr/lib/x86_64-linux-gnu/libhdf5_cpp.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.11") found components: CXX
-- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "2.91.0")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Found GLEW: /usr/include
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.6")
-- Configuring done
CMake Error at face_swap_image/CMakeLists.txt:2 (add_executable):
Target "face_swap_image" links to target "Qt5::Widgets" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?

CMake Error at face_swap_batch/CMakeLists.txt:2 (add_executable):
Target "face_swap_batch" links to target "Qt5::Widgets" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
`
————————————————————————————————————
How can i add Qt5's path into the project ?
I tried "~/.bashrc" "/home/face_swap-master/CMakeLists.txt" , that don't help.
Qt5 path is "/home/qt-everywhere-opensource-src-5.6.0"

face_swap_image: command not found

Hello guys,

I'm trying to run

cd path/to/face_swap/bin
face_swap_image --cfg test.cfg

command to do the swapping but it produces the following error:
face_swap_image: command not found

Confict with OpenCV3.3.0

In OpenCV 3.3.0 and its contribs, it seems the functions like "cv2::face::createLBPHFaceRecognizer()" have been changed into "cv2::face::LBPHFaceRecognizer::create()"... and I've tried so many times and thought it was the compiling part went wrong... but it wasn't... so it would be nice to show that the version of OpenCV should below 3.3.0 :cry:

Not enough instructions to compile and run

Please provide more instructions to compile. Which cmake file to use it to compile. The results look good but the steps to compile is absent. The issue is for people who want to build and see the example first before learning ml. Thats how some type of people learn ml.

make fail because hdf5 c++ error

I have install hdf5-1.8.20 with c++ wrapper and i can run the c++ example code. But when compile face_swap, there is error with hdf5:
basel_3dmm.cpp:(.text+0x614):对‘H5::AbstractDs::getTypeClass() const’undefined reference

How do you install hdf5 c++ api?

the video generated by image2video is shaking .

Hello,
Our repository is Amazing!We can swap a whole video in 1 min!
When we use face_swap_image2video.cpp, we have a problem and hope your optimize opinion.
We found that when the video is playing, the face will shake somehow. Is there any good way to remove this sway?

Many thanks!

windows build

did you try to build on windows? i'm using vs2017 btw.

if yes, can you give some info to do that?

if no, is there a way to do that?

Bypassing face segmentation module?

Hi Yuval,

Thanks for sharing the code for your paper, really appreciate it. I am planning to use the results for a paper I am writing. However, I am unable to compile all the necessary dependencies correctly, mostly due to the face segmentation module. Is it possible to bypass the face segmentation module and provide the network pre-computed segmentation masks instead? This will be easier in my case as there is a python version of your segmentation model available (here: https://github.com/shaoanlu/face-segmentation-keras).

Also, is there a possibility of a python release of your model in the near future?

Regards,
Sandipan

error: ‘CV_FOURCC’ was not declared in this scope

[ 96%] Built target face_swap_single2many
/home/in3omnia/develop/faceswap/End-to-end automatic face swapping pipeline/face_swap_image2video/face_swap_image2video.cpp: In function ‘int main(int, char**)’:
/home/in3omnia/develop/faceswap/End-to-end automatic face swapping pipeline/face_swap_image2video/face_swap_image2video.cpp:282:87: error: ‘CV_FOURCC’ was not declared in this scope
                 cv::VideoWriter out_vid(curr_output_path, CV_FOURCC('H', '2', '6', '4'), tgt_fps, tgt_size);
                                                                                       ^
face_swap_image2video/CMakeFiles/face_swap_image2video.dir/build.make:62: recipe for target 'face_swap_image2video/CMakeFiles/face_swap_image2video.dir/face_swap_image2video.cpp.o' failed
make[2]: *** [face_swap_image2video/CMakeFiles/face_swap_image2video.dir/face_swap_image2video.cpp.o] Error 1
CMakeFiles/Makefile2:364: recipe for target 'face_swap_image2video/CMakeFiles/face_swap_image2video.dir/all' failed
make[1]: *** [face_swap_image2video/CMakeFiles/face_swap_image2video.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

face_swap/cv_gl/FBRender.h:13:10: fatal error: 'GL/glu.h' file not found

$ cmake ./
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:761 (message):
  Imported targets not available for Boost version 106600
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:49 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:761 (message):
  Imported targets not available for Boost version 106600
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:49 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:761 (message):
  Imported targets not available for Boost version 106600
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:49 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:761 (message):
  Imported targets not available for Boost version 106600
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:49 (find_package)


-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   timer
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- HDF5: Using hdf5 compiler wrapper to determine CXX configuration
-- Found HDF5: /usr/local/lib/libhdf5_cpp.dylib;/usr/local/lib/libhdf5.dylib;/usr/local/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.10.1") found components:  HL
-- Found HDF5: /usr/local/lib/libhdf5_cpp.dylib;/usr/local/lib/libhdf5.dylib;/usr/local/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.10.1") found components:  CXX
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/aidas/Projects/face_swap







$ make
[  4%] Building CXX object cv_gl/CMakeFiles/cv_gl.dir/FBRender.cpp.o
In file included from /Users/aidas/Projects/face_swap/cv_gl/FBRender.cpp:2:
/Users/aidas/Projects/face_swap/cv_gl/FBRender.h:13:10: fatal error: 'GL/glu.h' file not found
#include <GL/glu.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [cv_gl/CMakeFiles/cv_gl.dir/FBRender.cpp.o] Error 1
make[1]: *** [cv_gl/CMakeFiles/cv_gl.dir/all] Error 2
make: *** [all] Error 2

Looks like "GL/glu.h" is missing, but I have installed all the dependencies. Any help?

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

Hello,
The cmd is "./face_swap_batch --cfg test.cfg",and I get err below:
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

Can you give me some advises?Thanks!

some information:
face_swap-master/bin$ ./face_swap_batch --cfg test.cfg
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

face_swap-master/bin$ ldd face_swap_batch
linux-vdso.so.1 => (0x00007fffdb3fe000)
/home/anaconda2/lib/libmkl_rt.so (0x00007f7bd12fd000)
libQt5Widgets.so.5 => /home/anaconda2/lib/libQt5Widgets.so.5 (0x00007f7bd09f9000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f7bd0762000)
libGL.so.1 => /usr/lib/nvidia-375/libGL.so.1 (0x00007f7bd04d2000)
libGLEW.so => /usr/local/lib/libGLEW.so (0x00007f7bd0241000)
libdlib.so.19.4.99 => /usr/local/lib/libdlib.so.19.4.99 (0x00007f7bcfd09000)
libopencv_calib3d.so.3.2 => /usr/local/lib/libopencv_calib3d.so.3.2 (0x00007f7bcf96e000)
libopencv_features2d.so.3.2 => /usr/local/lib/libopencv_features2d.so.3.2 (0x00007f7bcf698000)
libopencv_photo.so.3.2 => /usr/local/lib/libopencv_photo.so.3.2 (0x00007f7bcf217000)
libcaffe.so.1.0.0-rc3 => /home/MLData/caffe-master/build/lib/libcaffe.so.1.0.0-rc3 (0x00007f7bceac6000)
libopencv_imgcodecs.so.3.2 => /usr/local/lib/libopencv_imgcodecs.so.3.2 (0x00007f7bce704000)
libopencv_imgproc.so.3.2 => /usr/local/lib/libopencv_imgproc.so.3.2 (0x00007f7bcced0000)
libopencv_core.so.3.2 => /usr/local/lib/libopencv_core.so.3.2 (0x00007f7bcba51000)
libboost_system.so.1.64.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.64.0 (0x00007f7bcb84c000)
libglog.so.0 => /usr/lib/x86_64-linux-gnu/libglog.so.0 (0x00007f7bcb614000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7bcb3f6000)
libhdf5.so.101 => /home/anaconda2/lib/libhdf5.so.101 (0x00007f7bcae33000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7bcab2d000)
libhdf5_cpp.so.101 => /home/anaconda2/lib/libhdf5_cpp.so.101 (0x00007f7bca8c6000)
libQt5Gui.so.5 => /home/anaconda2/lib/libQt5Gui.so.5 (0x00007f7bca09c000)
libQt5Core.so.5 => /home/anaconda2/lib/libQt5Core.so.5 (0x00007f7bc994e000)
libstdc++.so.6 => /home/anaconda2/lib/libstdc++.so.6 (0x00007f7bc963b000)
libgcc_s.so.1 => /home/anaconda2/lib/libgcc_s.so.1 (0x00007f7bc9424000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7bc905b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7bc8e57000)
libGLX.so.0 => /usr/lib/nvidia-375/libGLX.so.0 (0x00007f7bc8c26000)
libGLdispatch.so.0 => /usr/lib/nvidia-375/libGLdispatch.so.0 (0x00007f7bc893d000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7bc8734000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f7bc83ff000)
libpng16.so.16 => /home/anaconda2/lib/libpng16.so.16 (0x00007f7bc81bd000)
libjpeg.so.9 => /home/anaconda2/lib/libjpeg.so.9 (0x00007f7bc7f80000)
libcublas.so.8.0 => /usr/local/cuda/lib64/libcublas.so.8.0 (0x00007f7bc54e8000)
libcudnn.so.5 => /usr/local/lib/libcudnn.so.5 (0x00007f7bc0714000)
libcurand.so.8.0 => /usr/local/cuda/lib64/libcurand.so.8.0 (0x00007f7bbc79d000)
libcusolver.so.8.0 => /usr/local/cuda/lib64/libcusolver.so.8.0 (0x00007f7bb922f000)
libiomp5.so => /home/anaconda2/lib/libiomp5.so (0x00007f7bb8e85000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7bd1936000)
libopencv_flann.so.3.2 => /usr/local/lib/libopencv_flann.so.3.2 (0x00007f7bb8c28000)
libopencv_cudaimgproc.so.3.2 => /usr/local/lib/libopencv_cudaimgproc.so.3.2 (0x00007f7bb6f3c000)
libcudart.so.8.0 => /usr/local/cuda/lib64/libcudart.so.8.0 (0x00007f7bb6cd5000)
libopencv_cudaarithm.so.3.2 => /usr/local/lib/libopencv_cudaarithm.so.3.2 (0x00007f7badffa000)
libboost_thread.so.1.64.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.64.0 (0x00007f7baddd2000)
libgflags.so.2 => /usr/lib/x86_64-linux-gnu/libgflags.so.2 (0x00007f7badbb2000)
libprotobuf.so.13 => /usr/local/lib/libprotobuf.so.13 (0x00007f7bad75b000)
libhdf5_hl.so.100 => /home/anaconda2/lib/libhdf5_hl.so.100 (0x00007f7bad536000)
liblmdb.so.0 => /usr/lib/x86_64-linux-gnu/liblmdb.so.0 (0x00007f7bad324000)
libleveldb.so.1 => /usr/lib/x86_64-linux-gnu/libleveldb.so.1 (0x00007f7bad0d7000)
libopenblas.so.0 => /opt/OpenBLAS/lib/libopenblas.so.0 (0x00007f7bac19d000)
libpython2.7.so.1.0 => /home/anaconda2/lib/libpython2.7.so.1.0 (0x00007f7babda1000)
libboost_python.so.1.64.0 => /usr/lib/x86_64-linux-gnu/libboost_python.so.1.64.0 (0x00007f7babb54000)
libtiff.so.5 => /home/anaconda2/lib/libtiff.so.5 (0x00007f7bab8d5000)
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f7bab67e000)
libIlmImf.so.6 => /usr/lib/x86_64-linux-gnu/libIlmImf.so.6 (0x00007f7bab3ce000)
libHalf.so.6 => /usr/lib/x86_64-linux-gnu/libHalf.so.6 (0x00007f7bab18b000)
libz.so.1 => /usr/local/lib/libz.so.1 (0x00007f7baaf72000)
libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f7baad57000)
libicui18n.so.54 => /home/anaconda2/lib/./libicui18n.so.54 (0x00007f7baa8f2000)
libicuuc.so.54 => /home/anaconda2/lib/./libicuuc.so.54 (0x00007f7baa554000)
libicudata.so.54 => /home/anaconda2/lib/./libicudata.so.54 (0x00007f7ba8b2a000)
libgthread-2.0.so.0 => /home/anaconda2/lib/./libgthread-2.0.so.0 (0x00007f7ba8928000)
libglib-2.0.so.0 => /home/anaconda2/lib/./libglib-2.0.so.0 (0x00007f7ba8611000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f7ba83fe000)
libxcb.so.1 => /home/anaconda2/lib/libxcb.so.1 (0x00007f7ba81da000)
libopencv_cudafilters.so.3.2 => /usr/local/lib/libopencv_cudafilters.so.3.2 (0x00007f7b90c1f000)
libnppc.so.8.0 => /usr/local/cuda/lib64/libnppc.so.8.0 (0x00007f7b909af000)
libnppi.so.8.0 => /usr/local/cuda/lib64/libnppi.so.8.0 (0x00007f7b89f8b000)
libnpps.so.8.0 => /usr/local/cuda/lib64/libnpps.so.8.0 (0x00007f7b89594000)
libcufft.so.8.0 => /usr/local/cuda/lib64/libcufft.so.8.0 (0x00007f7b80745000)
libsnappy.so.1 => /usr/lib/libsnappy.so.1 (0x00007f7b8053e000)
libgfortran.so.3 => /home/anaconda2/lib/libgfortran.so.3 (0x00007f7b80235000)
libgomp.so.1 => /home/anaconda2/lib/libgomp.so.1 (0x00007f7b80026000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f7b7fe22000)
liblzma.so.5 => /home/anaconda2/lib/./liblzma.so.5 (0x00007f7b7fbfd000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f7b7f9a8000)
libIex.so.6 => /usr/lib/x86_64-linux-gnu/libIex.so.6 (0x00007f7b7f789000)
libIlmThread.so.6 => /usr/lib/x86_64-linux-gnu/libIlmThread.so.6 (0x00007f7b7f583000)
libpcre.so.1 => /home/anaconda2/lib/././libpcre.so.1 (0x00007f7b7f33f000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f7b7f13b000)

dlib error

I add system path dlib_DIR=E:\dlib-19.6\build\install\lib\cmake\dlib
but CMake still has error:

CMake Error at CMakeLists.txt:75 (find_package):
Could not find a configuration file for package "dlib" that is compatible
with requested version "".

The following configuration files were considered but not accepted:

E:/dlib-19.6/build/install/lib/cmake/dlib/dlibConfig.cmake, version: 19.6.0 (64bit)

error: 'make_unique' is not a member of 'std'

When i make on ubuntu14.04 like this:
—————

mkdir build
cd build
cmake ..
make all

—————
Error occurs:

**`[ 54%] Building CXX object face_swap/CMakeFiles/face_swap.dir/cnn_3dmm_expr.cpp.o
/home/face_swap-master/face_swap/cnn_3dmm_expr.cpp: In constructor 'face_swap::CNN3DMMExpr::CNN3DMMExpr(const string&, const string&, const string&, const string&, bool, bool, bool, int)':

/home/face_swap-master/face_swap/cnn_3dmm_expr.cpp:29:20: error: 'make_unique' is not a member of 'std'
         fservice = std::make_unique<FaceServices2>();
                    ^~~

/home/face_swap-master/face_swap/cnn_3dmm_expr.cpp:29:50: error: expected primary-expression before '>' token
         fservice = std::make_unique<FaceServices2>();
                                                  ^

/home/face_swap-master/face_swap/cnn_3dmm_expr.cpp:29:52: error: expected primary-expression before ')' token
         fservice = std::make_unique<FaceServices2>();
                                                    ^

make[2]: *** [face_swap/CMakeFiles/face_swap.dir/cnn_3dmm_expr.cpp.o] Error 1

make[1]: *** [face_swap/CMakeFiles/face_swap.dir/all] Error 2

make: *** [all] Error 2**
`

—————
I've searched on the Net , mostly said this's caused by a low g++(gcc)'s version, std::make_unique wasn't supposed until C++14.
But i 'm using g++ 6.3, not a old version.
—————
Being stucked here for 2days already , sad,grieved,helpless,despaired
u 2904522468 2402474229 fm 214 gp 0

—————
Without help , i am considering ending my poor life like this : (
1
—————
ps : All the dependencies have been satisfied except Qt5, but i made 3 changes and cmake successed:
1、IN face_swap/CMakeLists.txt
option(WITH_QT "Qt" ON) ——> option(WITH_QT "Qt" OFF)
2、IN face_swap/face_swap_batch/CMakeLists.txt
Qt5::Widgets ——># Qt5::Widgets
3、IN face_swap/face_swap_image/CMakeLists.txt
Qt5::Widgets ——># Qt5::Widgets

I don't know are there relationships between my modifications and such error, i don't think there are.

Can’t remove QT dependency

When running (on a server without a monitor) it throws this error:
QXcbConnection: Could not connect to display
Aborted (core dumped)

Setting WITH_QT to off in in CMakeLists.txt throws compilation errors due to linking to QT.

How van I disable QT support?

"QXcbConnection: Could not connect to display"

Hi, thanks for the code.

I am having trouble running the code. I successfully compilee the project, but when I try to run ./face_swap_image --cfg test.cfg, I get the following error:

QXcbConnection: Could not connect to display
Aborted

I am running the code inside a docker container.

Running demo fails

Running with face_swap_image with the demo images and configuration fails with this:

[libprotobuf WARNING google/protobuf/io/coded_stream.cc:537] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:78] The total number of bytes read was 537966743
I0102 07:25:51.460321 10570 net.cpp:744] Ignoring source layer data
I0102 07:25:51.460350 10570 net.cpp:744] Ignoring source layer data_data_0_split
I0102 07:25:51.562809 10570 net.cpp:744] Ignoring source layer loss
F0102 07:25:54.356940 10570 math_functions.cu:26] Check failed: status == CUBLAS_STATUS_SUCCESS (1 vs. 0)  CUBLAS_STATUS_NOT_INITIALIZED
*** Check failure stack trace: ***
Aborted (core dumped)

HDF5 compile error

I come across the same question like #17.
I changed references in CMakeLists.txt to libhdf5_cpp.so. But the error still exist. could you describe the detail how to change the CMakeList.txt?

Found HDF5: /usr/local/hdf5/lib/libhdf5_hl.so;/usr/local/hdf5/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.20")

../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function face_swap::readH5Dataset(H5::H5File const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': basel_3dmm.cpp:(.text+0x604): undefined reference to H5::CommonFG::openDataSet(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
basel_3dmm.cpp:(.text+0x614): undefined reference to H5::AbstractDs::getTypeClass() const' basel_3dmm.cpp:(.text+0x62d): undefined reference to H5::DataSet::getSpace() const'
basel_3dmm.cpp:(.text+0x645): undefined reference to H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const' basel_3dmm.cpp:(.text+0x67e): undefined reference to H5::DSetMemXferPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x69c): undefined reference to H5::DataSpace::DataSpace(int, unsigned long long const*, unsigned long long const*)' basel_3dmm.cpp:(.text+0x6a3): undefined reference to H5::PredType::NATIVE_FLOAT'
basel_3dmm.cpp:(.text+0x6d4): undefined reference to H5::DataSet::read(void*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const' basel_3dmm.cpp:(.text+0x6e0): undefined reference to H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x6ed): undefined reference to H5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x6f9): undefined reference to H5::DataSet::~DataSet()'
basel_3dmm.cpp:(.text+0x721): undefined reference to H5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x732): undefined reference to H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x743): undefined reference to H5::DataSet::~DataSet()' ../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function face_swap::Basel3DMM::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
basel_3dmm.cpp:(.text+0x135f): undefined reference to H5::Exception::dontPrint()' basel_3dmm.cpp:(.text+0x1366): undefined reference to H5::FileAccPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x1370): undefined reference to H5::FileCreatPropList::DEFAULT' basel_3dmm.cpp:(.text+0x13b3): undefined reference to H5::H5File::H5File(char const*, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
basel_3dmm.cpp:(.text+0x1a59): undefined reference to H5::H5File::~H5File()' basel_3dmm.cpp:(.text+0x1d5c): undefined reference to H5::H5File::~H5File()'
basel_3dmm.cpp:(.text+0x1dc6): undefined reference to H5::Exception::getDetailMsg[abi:cxx11]() const' basel_3dmm.cpp:(.text+0x1e39): undefined reference to H5::DataSetIException::~DataSetIException()'
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function H5::DataSetIException::DataSetIException(H5::DataSetIException const&)': basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x1f): undefined reference to H5::Exception::Exception(H5::Exception const&)'
basel_3dmm.cpp:(.text.ZN2H517DataSetIExceptionC2ERKS0[ZN2H517DataSetIExceptionC5ERKS0]+0x26): undefined reference to vtable for H5::DataSetIException' ../face_swap/libface_swap.a(basel_3dmm.cpp.o):(.data.DW.ref._ZTIN2H517DataSetIExceptionE[DW.ref._ZTIN2H517DataSetIExceptionE]+0x0): undefined reference to typeinfo for H5::DataSetIException'
collect2: error: ld returned 1 exit status
face_swap_image/CMakeFiles/face_swap_image.dir/build.make:166: recipe for target 'face_swap_image/face_swap_image' failed
make[2]: *** [face_swap_image/face_swap_image] Error 1
CMakeFiles/Makefile2:253: recipe for target 'face_swap_image/CMakeFiles/face_swap_image.dir/all' failed
make[1]: *** [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

OpenCV installation error

I'm trying to install opencv using the commands specified in the wiki:

sudo apt-get install -y cmake
sudo apt-get install -y unzip
wget https://github.com/opencv/opencv/archive/3.2.0.zip
unzip 3.2.0.zip
rm 3.2.0.zip
cd opencv-3.2.0
mkdir build
cd build
cmake -DWITH_TBB=ON -DWITH_XINE=ON ..
make -j8
sudo make install
sudo ldconfig

But I get this error:

In file included from /home/rickwierenga/dir/opencv-3.2.0/modules/core/src/hal_internal.cpp:49:0:
/home/rickwierenga/dir/opencv-3.2.0/build/opencv_lapack.h:2:10: fatal error: LAPACKE_H_PATH-NOTFOUND/lapacke.h: No such file or directory
 #include "LAPACKE_H_PATH-NOTFOUND/lapacke.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:522: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/hal_internal.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/hal_internal.cpp.o] Error 1
CMakeFiles/Makefile2:1289: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

I'm on Ubuntu 18.04 LTS.

Thanks in advance.

"No module named face_swap_py", when I use python interface

Hello Yuval,
You do an excellent job in face swap. And I have a question when invoking python interface after compiling.

import face_swap_py as fspy

I do this at the path of 'face_swap_py.pyd' but it report error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named face_swap_py

It also doesn't work after adding
"export PYTHONPATH=/home/hq/project/face_swap_YuvalNirkin/interfaces/python:$PYTHONPATH" in "~/.bashrc" file.

Could you give me some advices, thanks a lot.
Johnson

Face Swap cmake error

when i run the command‘cmake -DWITH_BOOST_STATIC=OFF -DBUILD_INTERFACE_PYTHON=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_APPS=ON -DBUILD_TESTS=OFF cmake -DCMAKE_INSTALL_PREFIX=~/installations/face_swap -DCMAKE_BUILD_TYPE=Release ..’

an error occurs as follow:


CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.

Boost version: 1.65.1

Boost include path: /usr/local/include

Could not find the following Boost libraries:

      boost_python
      boost_numpy

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
interfaces/python/CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/dell/face_swap/build/CMakeFiles/CMakeOutput.log".
See also "/home/dell/face_swap/build/CMakeFiles/CMakeError.log".

so what can I do to deal with this problem?

CMake (find_package) Caffe Error

Hi all.

I have my Caffe includes in /usr/include/caffe and library object at /usr/lib/libcaffe.so.1.0.0 (linked to by libcaffe.so).
If you want to see other file paths from my Caffe installation, see this gist.

Okay, so from a zsh prompt on Linux I run cmake -DWITH_BOOST_STATIC=OFF -DBUILD_INTERFACE_PYTHON=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_APPS=ON -DBUILD_TESTS=OFF cmake -DCMAKE_INSTALL_PREFIX=~/installations/face_swap -DCMAKE_BUILD_TYPE=Release ..

And I get this CMake output:

-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/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/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Boost version: 1.69.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   timer
--   thread
--   chrono
--   system
--   date_time
--   atomic
-- Found OpenCV: /usr (found version "4.1.0") found components:  highgui imgproc imgcodecs calib3d photo 
CMake Error at CMakeLists.txt:73 (find_package):
  By not providing "FindCaffe.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Caffe", but
  CMake did not find one.

  Could not find a package configuration file provided by "Caffe" with any of
  the following names:

    CaffeConfig.cmake
    caffe-config.cmake

  Add the installation prefix of "Caffe" to CMAKE_PREFIX_PATH or set
  "Caffe_DIR" to a directory containing one of the above files.  If "Caffe"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/home/jeff/code/vendor/face_swap/build/CMakeFiles/CMakeOutput.log".
See also "/home/jeff/code/vendor/face_swap/build/CMakeFiles/CMakeError.log".

Segmentation fault (core dumped) when running the demo

Hi,
I met this error when running the demo
I0921 13:13:41.511903 1711 net.cpp:242] This network produces output score
I0921 13:13:41.511961 1711 net.cpp:255] Network initialization done.
I0921 13:13:43.045377 1711 net.cpp:744] Ignoring source layer data
I0921 13:13:43.045660 1711 net.cpp:744] Ignoring source layer data_data_0_split
I0921 13:13:43.154325 1711 net.cpp:744] Ignoring source layer loss
Segmentation fault (core dumped)

I run the code in both GPU and CPU mode, using a computer with K40 GPU.
Did someone meet this error?

Thank you!

Rotation and Translation doesn't seem right

I'm not sure what's wrong. I've dug into the code, I'm wondering is it because it rotates first before translation in face_swap/face_renderer.cpp?

The output doesn't seem right. (compared to images in the paper and #1 )
brad_pitt_01_bruce_willis_01
brad_pitt_01_795

I've tried out specifying translation manually, i.e. glTranslatef(vecT.at<float>(0)+100, vecT.at<float>(1), vecT.at<float>(2)); and it works.
I've tried applying translation before rotation and rotate to a specific degree, i.e. glRotatef(90, 0, 0, 1);, and it works as expected (The mesh will rotate counter-clockwise for 90 degrees)

Do you know where I should dig in to fix this up?

Thanks

ubuntu run out of memory

environment:
ubuntu 18.04 with 4cpu 8G ram, no gpu
python2.7

question:
when i run the application: face_swap_image, it killed by the system because of out of memory, is there any problem or how much memory should i use to run the application?

undefined reference to `boost::chrono::steady_clock::now()'

When i :

cmake .. 
make all

I met:

[ 90%] Built target face_swap_image
[ 95%] Linking CXX executable face_swap_batch
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::start()':
cpu_timer.cpp:(.text+0x81d): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::stop()':
cpu_timer.cpp:(.text+0x945): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::elapsed() const':
cpu_timer.cpp:(.text+0xa49): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::resume()':
cpu_timer.cpp:(.text+0xb40): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::auto_cpu_timer::auto_cpu_timer(std::ostream&, short)':
cpu_timer.cpp:(.text+0xc85): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o):cpu_timer.cpp:(.text+0xd2e): more undefined references to `boost::chrono::steady_clock::now()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [face_swap_batch/face_swap_batch] Error 1
make[1]: *** [face_swap_batch/CMakeFiles/face_swap_batch.dir/all] Error 2
make: *** [all] Error 2

There really no appropriate solutions to this , so i come here again.
This is my dir "/usr/local/lib":
1
There are “libboost_chrono.a” and "libboost_chrono.so" .
So why boost::chrono::steady_clock::now() is undefined? It should be recognized .
8472-1f301100004-51

I am finding the below issue on (cmake find_face_landmarks) while using your code in c++,mac system #13

Mac-mini:face_swap-master mani$ make
[ 20%] Building CXX object sequence_face_landmarks/CMakeFiles/sequence_face_landmarks.dir/sequence_face_landmarks.cpp.o
In file included from /Users/mani/Downloads/face_swap-master/find_face_landmarks-master/sequence_face_landmarks/sequence_face_landmarks.cpp:20:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/image_processing/render_face_detections.h:7:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/array2d/../geometry/../image_processing/../gui_widgets.h:13:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/gui_widgets/widgets.h:16:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/gui_widgets/drawable.h:10:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/gui_widgets/../gui_core.h:14:
In file included from /usr/local/Cellar/dlib/19.7/include/dlib/gui_core/xlib.h:4:
/usr/local/Cellar/dlib/19.7/include/dlib/gui_core/gui_core_kernel_2.h:11:2: error: "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code. Turn DLIB_NO_GUI_SUPPORT off if you want to use it."
#error "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code. Turn DLIB_NO_GUI_SUPPORT off if you want to use it."
^
/usr/local/Cellar/dlib/19.7/include/dlib/gui_core/gui_core_kernel_2.h:12:2: error: "Also make sure you have libx11-dev installed on your system"
#error "Also make sure you have libx11-dev installed on your system"
^
2 errors generated.
make[2]: *** [sequence_face_landmarks/CMakeFiles/sequence_face_landmarks.dir/sequence_face_landmarks.cpp.o] Error 1
make[1]: *** [sequence_face_landmarks/CMakeFiles/sequence_face_landmarks.dir/all] Error 2
make: *** [all] Error 2

Make error,Help!

Hello,
When I make the projcect, it is wrong.The information below.Can you give me some suggestion.Thanks.


Make:
face_swap-master/build$ make
[ 9%] Built target cv_gl
[ 50%] Built target iris_sfs
[ 81%] Built target face_swap
[ 86%] Linking CXX executable face_swap_image
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::readH5Dataset(H5::H5File
make[2]: *** [face_swap_image/face_swap_image] Error 1
make[1]: *** [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2
make: *** [all] Error 2

problem

where can i find or get face_swap_py

protobuf version conflict

When I build finish and run face_swap_image --cfg test.cfg
I got this error as bellow.
[libprotobuf FATAL google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)

I have remove the libprotobuf-dev and protobuf-compiler from system and rebuild all the dependencies. But it is the same. Can you give me some advice?

  • Ubuntu 16.04
  • Boost 1.58
  • Qt 5.9
  • OpenCV 3.2
  • GLEW 2.0
  • Eigen 3.0.0
  • dlib 18
  • find_face_landmarks 1.1
  • face_segmentation 0.9
  • Caffe 1.0

failed to use the python interface

I failed to use the python interface after successful compilation.
Got the error message blow:
/home/imageim/installations/face_swap/interfaces/python/face_swap_py.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

I am sure that I compile the code with python blind. I compile caffe and opencv without cuda. The python version is 2.7.
I googled this problem, someone said that it is because the python version does not match the boost version when compiling caffe, but I am sure the version match.

install error

thank you for sharing the code!
In "make -j4" display error:

/root/face_swap_lib/face_swap/face_swap/cnn_3dmm_expr.cpp: In constructor 'face_
swap::CNN3DMMExpr::CNN3DMMExpr(const string&, const string&, const string&, cons
t string&, bool, bool, bool, int)':
/root/face_swap_lib/face_swap/face_swap/cnn_3dmm_expr.cpp:29:20: error: 'make_un
ique' is not a member of 'std'
fservice = std::make_unique();
^
/root/face_swap_lib/face_swap/face_swap/cnn_3dmm_expr.cpp:29:50: error: expected
primary-expression before '>' token
fservice = std::make_unique();
^
/root/face_swap_lib/face_swap/face_swap/cnn_3dmm_expr.cpp:29:52: error: expected
primary-expression before ')' token
fservice = std::make_unique();
^
make[2]: *** [face_swap/CMakeFiles/face_swap.dir/cnn_3dmm_expr.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp: In constructo
r 'face_swap::FaceSwapEngineImpl::FaceSwapEngineImpl(const string&, const string
&, const string&, const string&, const string&, const string&, const string&, co
nst string&, bool, bool, bool, int)':
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:47:21: error:m
ake_unique' is not a member of 'std'
m_cnn_3dmm_expr = std::make_unique(
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:47:49: error:e
xpected primary-expression before '>' token
m_cnn_3dmm_expr = std::make_unique(
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:53:17: error:m
ake_unique' is not a member of 'std'
m_face_seg = std::make_unique(seg_deploy_path,
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:53:41: error:e
xpected primary-expression before '>' token
m_face_seg = std::make_unique(seg_deploy_path,
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:57:18: error:m
ake_unique' is not a member of 'std'
m_basel_3dmm = std::make_unique();
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:57:44: error:e
xpected primary-expression before '>' token
m_basel_3dmm = std::make_unique();
^
/root/face_swap_lib/face_swap/face_swap/face_swap_engine_impl.cpp:57:46: error:e
xpected primary-expression before ')' token
m_basel_3dmm = std::make_unique();
^
make[2]: *** [face_swap/CMakeFiles/face_swap.dir/face_swap_engine_impl.cpp.o] Er
ror 1
make[1]: *** [face_swap/CMakeFiles/face_swap.dir/all] Error 2
make: *** [all] Error 2

I don't what happened. my system is centos. I sure install all Dependencies

Where to fetch the model of "model_3dmm_h5"

Hi, thanks for your wonderful work.

When I try to reproduce the result of this work, I do not know where to find the 3dmm h5 model ( I can find the .dat model).

Would some guys tell me where I can download this model. Thanks a lot!

make warning about glew and qt

When I make the project. I come across the following question. Anyone have suggestion how to solve the question?
In file included from /usr/local/Qt-5.8.0/include/QtGui/QOpenGLContext:1:0,
from /home/songxinhui/face_swap/face_swap_image/face_swap_image.cpp:27:
/usr/local/Qt-5.8.0/include/QtGui/qopenglcontext.h:55:2: warning: #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined [-Wcpp]
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
^
/usr/local/Qt-5.8.0/include/QtGui/qopenglcontext.h:56:2: warning: #warning To use GLEW with Qt, do not include <qopengl.h> or after glew.h [-Wcpp]
#warning To use GLEW with Qt, do not include <qopengl.h> or after glew.h
^
[ 90%] Linking CXX executable face_swap_image
[ 90%] Built target face_swap_image
[ 95%] Building CXX object face_swap_batch/CMakeFiles/face_swap_batch.dir/face_swap_batch.cpp.o
In file included from /usr/local/Qt-5.8.0/include/QtGui/QOpenGLContext:1:0,
from /home/songxinhui/face_swap/face_swap_batch/face_swap_batch.cpp:29:
/usr/local/Qt-5.8.0/include/QtGui/qopenglcontext.h:55:2: warning: #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined [-Wcpp]
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
^
/usr/local/Qt-5.8.0/include/QtGui/qopenglcontext.h:56:2: warning: #warning To use GLEW with Qt, do not include <qopengl.h> or after glew.h [-Wcpp]
#warning To use GLEW with Qt, do not include <qopengl.h> or after glew.h

HDF5 compilation issue

Getting stuck at 90% when HDF5 is referenced.
This is on Ubuntu 16.04 with HDF5 v 1.8.20.

cmake .
CMake outputs:
-- Found HDF5: /usr/local/lib/libhdf5_hl.so;/usr/local/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.20")

cmake --build .
Build results in this error:

[ 90%] Linking CXX executable face_swap_image
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::readH5Dataset(H5::H5File const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
basel_3dmm.cpp:(.text+0x604): undefined reference to `H5::CommonFG::openDataSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
basel_3dmm.cpp:(.text+0x614): undefined reference to `H5::AbstractDs::getTypeClass() const'
basel_3dmm.cpp:(.text+0x62d): undefined reference to `H5::DataSet::getSpace() const'
basel_3dmm.cpp:(.text+0x645): undefined reference to `H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const'
basel_3dmm.cpp:(.text+0x67e): undefined reference to `H5::DSetMemXferPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x69c): undefined reference to `H5::DataSpace::DataSpace(int, unsigned long long const*, unsigned long long const*)'
basel_3dmm.cpp:(.text+0x6a3): undefined reference to `H5::PredType::NATIVE_FLOAT'
basel_3dmm.cpp:(.text+0x6d4): undefined reference to `H5::DataSet::read(void*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const'
basel_3dmm.cpp:(.text+0x6e0): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x6ed): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x6f9): undefined reference to `H5::DataSet::~DataSet()'
basel_3dmm.cpp:(.text+0x721): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x732): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x743): undefined reference to `H5::DataSet::~DataSet()'
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::Basel3DMM::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
basel_3dmm.cpp:(.text+0x135f): undefined reference to `H5::Exception::dontPrint()'
basel_3dmm.cpp:(.text+0x1366): undefined reference to `H5::FileAccPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x1370): undefined reference to `H5::FileCreatPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x13b3): undefined reference to `H5::H5File::H5File(char const*, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
basel_3dmm.cpp:(.text+0x1a59): undefined reference to `H5::H5File::~H5File()'
basel_3dmm.cpp:(.text+0x1d5c): undefined reference to `H5::H5File::~H5File()'
basel_3dmm.cpp:(.text+0x1dc6): undefined reference to `H5::Exception::getDetailMsg[abi:cxx11]() const'
basel_3dmm.cpp:(.text+0x1e39): undefined reference to `H5::DataSetIException::~DataSetIException()'
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `H5::DataSetIException::DataSetIException(H5::DataSetIException const&)':
basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x1f): undefined reference to `H5::Exception::Exception(H5::Exception const&)'
basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x26): undefined reference to `vtable for H5::DataSetIException'
../face_swap/libface_swap.a(basel_3dmm.cpp.o):(.data.DW.ref._ZTIN2H517DataSetIExceptionE[DW.ref._ZTIN2H517DataSetIExceptionE]+0x0): undefined reference to `typeinfo for H5::DataSetIException'
collect2: error: ld returned 1 exit status
face_swap_image/CMakeFiles/face_swap_image.dir/build.make:172: recipe for target 'face_swap_image/face_swap_image' failed
make[2]: *** [face_swap_image/face_swap_image] Error 1
CMakeFiles/Makefile2:253: recipe for target 'face_swap_image/CMakeFiles/face_swap_image.dir/all' failed
make[1]: *** [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

HDF5 is installed into /usr/local

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.