Skip to content

Latest commit

 

History

History
90 lines (78 loc) · 2.05 KB

18-install-dlib.md

File metadata and controls

90 lines (78 loc) · 2.05 KB

Install Dlib

How to Install Dlib Library on Raspberry Pi 3 Model B+

Prerequisite(s):

Update


Note: Wheel available for Python.

pi@raspberry:~ $ sudo pip install dlib

Note: Go to Step 4 and you are done!


1 - Create and Initialise Python Virtual Environment


pi@raspberry:~ $ sudo mkvirtualenv my-env -p python3
pi@raspberry:~ $ sudo workon my-env

2 - Install Dlib Prerequisite


(my-env) pi@raspberry:~ $ sudo apt-get update
(my-env) pi@raspberry:~ $ sudo apt-get upgrade
(my-env) pi@raspberry:~ $ sudo apt-get install -y build-essential \
    cmake \
    gfortran \
    git \
    wget \
    curl \
    graphicsmagick \
    libgraphicsmagick1-dev \
    libatlas-dev \
    libavcodec-dev \
    libavformat-dev \
    libboost-all-dev \
    libgtk-3-dev \
    libjpeg-dev \
    liblapack-dev \
    libswscale-dev \
    pkg-config \
    python3-dev \
    python3-numpy \
    python3-pip \
    zip
    
(my-env) pi@raspberry:~ $ sudo apt-get clean
(my-env) pi@raspberry:~ $ sudo pip3 install numpy
(my-env) pi@raspberry:~ $ sudo pip3 install scipy
(my-env) pi@raspberry:~ $ sudo pip3 install scikit-image

(my-env) pi@raspberry:~ $ sudo reboot

3 - Install Dlib


pi@raspberry:~ $ sudo workon my-env
(my-env) pi@raspberry:~ $ sudo git clone https://github.com/davisking/dlib.git
(my-env) pi@raspberry:~ $ cd dlib
(my-env) pi@raspberry:~ $ sudo python3 setup.py install --clean --compiler-flags "-mfpu=neon"

(my-env)pi@raspberry:~ $ sudo pip3 install face_recognition #OPTIONAL

4 - Verify Dlib Working Correctly


(my-env) pi@raspberry:~ $ python
>>> import dlib
>>> dlib.__version__
'19.5.1'
>>>

Ctrl+D