Skip to content

Installation

Branko Kokanovic edited this page Feb 27, 2019 · 19 revisions

OK, once you are sure you have all needed requirements, this is how you can install FaceRecognition app. In general, you will need to install PDlib library (this is PHP wrapper for DLib) and FaceRecognition app (this app).

Easy way

(this section is not yet fully ready, please ignore it for now)

Ideally, you will want to use precompiled libraries. We prepared PDLib PHP library for Debian-based systems. If you have one, proceed. If you don't have it, take a look how to compile it yourself below. So, you will need to add this repo to your sources and to install it:

echo "deb [allow-insecure=yes] http://repo.delellis.com.ar/debian/pdlib ./" > /etc/apt/sources.list.d/pdlib.list
apt update
apt install php7.0-pdlib

(replace php7.0 above with php7.1 or php7.2, depending on which PHP version your Nextcloud is running on)

Once you did that, you can install FaceRecognition app from Nextcloud app store.

Head over to Usage to see where to start from there!

Hard way

Install DLib

First you need to install DLib library. You can follow procedure for your system, but here is quick overview if you are in hurry (taken from here). First, you need to have decent system, with:

  • support for C++11,
  • libx11-dev (on Ubuntu, install it with sudo apt-get install libx11-dev)
  • BLAS library (If no BLAS library is found, DLib's built-in BLAS will be used. However, if you install an optimized BLAS such as OpenBLAS or the Intel MKL your code will run faster. On Ubuntu you can install OpenBLAS by executing sudo apt-get install libopenblas-dev liblapack-dev)

After that, remember to install DLib as shared library:

git clone https://github.com/davisking/dlib.git
cd dlib/dlib
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
sudo make install

Install PDLib

You will have to have PHP dev libraries. On Ubuntu, they can be obtained with sudo apt-get install php7.x-dev.

Installing PDLib boils down to:

git clone https://github.com/goodspb/pdlib.git
cd pdlib
phpize
./configure
make
sudo make install

Now you need to configure your PHP installation to know for pdlib. Edit your php.ini and append content below to it:

[pdlib]
extension="pdlib.so"

Note that you can have 2 php.ini files, one for FPM, one for CLI. You need to change both of them! On Ubuntu, you can generally find them in /etc/php/7.x/cli/php.ini and /etc/php/7.x/fpm/php.ini.

If everything is working, you will see one line after you execute this:

$ php -m | grep pdlib
pdlib

Install FaceRecognition app

In general, there is no need to install FaceRecognition from source, please use Nextcloud app store. This is needed only if you want to change source code and to contribute (in which case - big welcome!:smile:). Here is how you can install it on Ubuntu:

sudo apt-get install git-core composer
cd nextcloud/apps/   # or whatever your path to Nextcloud is
git clone https://github.com/matiasdelellis/facerecognition.git
cd facerecognition/
make

If you have it manually installed and want to update to latest from master:

cd nextcloud/apps/facerecognition/
git pull
make

Congratulations, you should now have complete FaceRecognition set up!

Again, head over to Usage to see where to start from there.