Search Suggest

Face recognition - Nhận dang khuôn mặt (P2)

Ở phần 2 này sẽ là exam với thư viện Dlib



1. Build Dlib
DLib là một thư viện xử lý ảnh tương đương như OpenCV, tuy nhiên điểm khác ở đây là DLib sử dụng Deep Learning trong tính năng  Face recorgnition của họ, còn OpenCV chỉ là xử lý ảnh thông thường thôi.

Link source: dlib.net

1.1 Build cho PC

 
cd dlibsource
PREFIX=/home/linuxpc/dlib/x86/install

mkdir release
cd release
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DDLIB_NO_GUI_SUPPORT=1 \
-DDLIB_USE_CUDA=0 \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
..

make
make install



1.2 Build cho Raspberry PI
Tạo toolchain file: arm-gnueabi.toolchain-rpi.cmake
set( CMAKE_SYSTEM_NAME Linux )
set( CMAKE_SYSTEM_PROCESSOR arm )
set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc )
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ )



#export toolchain 
TOOLCHAIN_DIR=/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
export PATH=$PATH:${TOOLCHAIN_DIR}/bin

PREFIX=/home/linuxpc/dlib/rpi/install
TOOLCHAIN_FILE=/path/to/arm-gnueabi.toolchain-rpi.cmake

cd dlibsource
mkdir release
cd release
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE \
-DDLIB_NO_GUI_SUPPORT=1 \
-DDLIB_USE_CUDA=0 \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
..

make
make install




2. Face detection

https://github.com/eslinux/ImageProcessing/tree/master/DLib/face-detector


3. Face recorgnition

https://github.com/eslinux/ImageProcessing/tree/master/DLib/face-recognition


Đăng nhận xét