Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions DenseFace3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ along with DenseFace3D. If not, see <http://www.gnu.org/licenses/>.
#include <iostream>
#include <fstream>

#include "cv.h"
#include "highgui.h"
#include "opencv2/opencv.hpp"

#include <dlib/opencv.h>
#include <opencv2/highgui/highgui.hpp>
Expand Down
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion OGL_OCV_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ABSOLUTE PATH TO PROJECT>:/DenseFace3D \
--name=dense_container dense-face-3d:latest
```
Then in container follow the installation instructions.

##### Installation:

`mkdir build`
Expand Down
2 changes: 1 addition & 1 deletion ThinPlateSpline.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ThinPlateSpline {
double bending_energy = 0.0;
int p;
boost::numeric::ublas::matrix<double> mtx_l,mtx_v,mtx_orig_k,valid;
bool READY = FALSE;
bool READY = false;
ThinPlateSpline(int p);
void insert(const std::vector<long>& x_coor, const std::vector<long>& y_coor, const std::vector<long>& z_coor);
void calc_tps();
Expand Down