Ubuntu中cuda版dlib安装

 

# 安装dlib
sudo apt-get install libboost-all-dev
sudo apt-get install cmake
sudo pip install dlib

# 安装cv2
pip install opencv-python

# 68个特征点检测模型下载地址
http://sourceforge.net/projects/dclib/files/dlib/v18.10/shape_predictor_68_face_landmarks.dat.bz2
# 解压
bzip2 -d shape_predictor_68_face_landmarks.dat.bz2

# 安装cuda版dlib
sudo apt-get install libopenblas-dev liblapack-dev
git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build
cd build
cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1
cmake --build .
cd ..
python setup.py install
# 验证
import dlib
print(dlib.DLIB_USE_CUDA)
print(dlib.cuda.get_num_devices())
# 若输出为True则表示dlib可以使用cuda

 

你可能感兴趣的:(在阿里的日子,dlib)