diff --git a/DenseFace3D.cpp b/DenseFace3D.cpp index 1466796..adff544 100644 --- a/DenseFace3D.cpp +++ b/DenseFace3D.cpp @@ -23,8 +23,7 @@ along with DenseFace3D. If not, see . #include #include -#include "cv.h" -#include "highgui.h" +#include "opencv2/opencv.hpp" #include #include diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d5654e1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +FROM ubuntu:18.04 + +RUN apt-get update + +RUN apt-get install -y wget nano + +RUN apt-get install -y build-essential cmake pkg-config + +# OpenBLAS and X11 +RUN apt-get install -y libopenblas-dev liblapack-dev libx11-dev + +RUN apt-get install -y unzip + +# OpenGL +RUN apt-get install -y libgl1-mesa-dev + +# GLUT +RUN apt-get install -y freeglut3-dev + +# Boost +RUN apt-get install -y libboost-all-dev + +# Load OpenCV 4.x +RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip; \ +unzip opencv.zip; \ +cd opencv-4.x/; \ +mkdir build; \ +cd build/; \ +cmake ..; \ +cmake --build .; \ +make install; \ +ldconfig; \ +cd ../../; + +RUN rm opencv.zip + +# Load dlib 19.22 +RUN wget http://dlib.net/files/dlib-19.22.tar.bz2; \ + tar xvf dlib-19.22.tar.bz2; \ + cd dlib-19.22/; \ + mkdir build; \ + cd build; \ + cmake ..; \ + cmake --build . --config Release; \ + make install; \ + ldconfig; \ + cd ../../; + +RUN rm dlib-19.22.tar.bz2 + +RUN apt-get install -y bzip2 \ No newline at end of file diff --git a/OGL_OCV_common.cpp b/OGL_OCV_common.cpp index 465f660..42a789a 100644 --- a/OGL_OCV_common.cpp +++ b/OGL_OCV_common.cpp @@ -101,7 +101,7 @@ void copyImgToTex(const Mat& _tex_img, GLuint* texID, double* _twr, double* _thr if (tex_img.type() == region.type()) { tex_img.copyTo(region); } else if (tex_img.type() == CV_8UC1) { - cvtColor(tex_img, region, CV_GRAY2BGR); + cvtColor(tex_img, region, COLOR_GRAY2BGR); } else { tex_img.convertTo(region, CV_8UC3, 255.0); } diff --git a/README.md b/README.md index cb0adaf..49f9913 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,28 @@ Note: Please make sure `conn.txt` and `landmark.txt` and dlib's default face landmarking model file shape_predictor_68_face_landmarks.dat (download [here](http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2)) are in the same directory as the executable. +##### Installation with Docker +Install [Docker](https://www.docker.com/), clone project from git and build docker image: +```bash +docker build -t dense-face-3d:latest . +``` + +Then disable access to X server: +```bash +xhost + +``` + +Launch container with the following params to use GUI (do not forget to specify absolute path to project): +```bash +docker run -it --rm --privileged \ +--network host --tmpfs=/tmp \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -e DISPLAY=:0 -e QT_X11_NO_MITSHM=1 \ + -v :/DenseFace3D \ + --name=dense_container dense-face-3d:latest +``` +Then in container follow the installation instructions. + ##### Installation: `mkdir build` diff --git a/ThinPlateSpline.h b/ThinPlateSpline.h index 3a8701d..3470a23 100644 --- a/ThinPlateSpline.h +++ b/ThinPlateSpline.h @@ -65,7 +65,7 @@ class ThinPlateSpline { double bending_energy = 0.0; int p; boost::numeric::ublas::matrix mtx_l,mtx_v,mtx_orig_k,valid; - bool READY = FALSE; + bool READY = false; ThinPlateSpline(int p); void insert(const std::vector& x_coor, const std::vector& y_coor, const std::vector& z_coor); void calc_tps();