forked from ageitgey/face_recognition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.gpu
55 lines (38 loc) · 1.57 KB
/
Dockerfile.gpu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This is a sample Dockerfile you can modify to deploy your own app based on face_recognition on the GPU
# In order to run Docker in the GPU you will need to install Nvidia-Docker: https://github.com/NVIDIA/nvidia-docker
FROM nvidia/cuda:9.0-cudnn7-devel
# Install face recognition dependencies
RUN apt update -y && apt install -y software-properties-common
RUN apt update -y; apt install -y \
git \
cmake \
libsm6 \
libxext6 \
libxrender-dev \
wget
# Install python3
RUN apt install -y build-essential gdb lcov libbz2-dev libffi-dev \
libgdbm-dev liblzma-dev libncurses5-dev libreadline6-dev \
libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
RUN cd /tmp && \
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz && \
tar -xf Python-3.8.12.tgz && \
cd Python-3.8.12 && \
./configure --enable-optimizations && \
make install -j && \
python3 --version
# Install compilers
RUN apt install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt update -y; apt install -y gcc-6 g++-6
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 50
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 50
#Install dlib
RUN git clone -b 'v19.16' --single-branch https://github.com/davisking/dlib.git
RUN mkdir -p /dlib/build
RUN cmake -H/dlib -B/dlib/build -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1
RUN cmake --build /dlib/build
RUN python3.8 -m pip install scikit-build
RUN cd /dlib; python3.8 /dlib/setup.py install
# Install the face recognition package
RUN python3.8 -m pip install face_recognition opencv-python