Face recognition - installing missing libraries

I would like to use the face recognition app but I can’t due to missing library.
My nextcloud is installed on Ubuntu. how do I install the missing libraries?

  • This app cannot be installed because the following dependencies are not fulfilled:
    • The library pdlib is not available.
    • The library bz2 is not available.

The missing libs are probably dlib and pdlib.

You can find a manual installation here:

Just follow these two instructions:

Install Dlib as shared library

git clone (copy this link) GitHub - davisking/dlib: A toolkit for making real world machine learning and data analysis applications in C++
cd dlib/dlib
mkdir build
cd build
sudo make install


git clone (copy this link) GitHub - goodspb/pdlib: PHP extension for Dlib.
cd pdlib
./configure --enable-debug
# you may need to indicate the dlib install location
# PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --enable-debug
sudo make install

after that, the facerecognition should be installable in the app store.

there are also precompiled libs available for some ubuntu and other linux versions:

you might check these instructions here, if your dlib andpdlib are not compiled or installed correctly:

i have tried what you posted and looked at your links. i keep getting an error make: *** [Makefile:208: pdlib.lo] Error 1
at the last step

Did you try to install precompiled libs for Ubuntu also?

yes i have. this is the complete error. ~/pdlib$ make
/bin/bash /home/josh/pdlib/libtool --mode=compile g++ -I. -I/home/josh/pdlib -I/home/josh/pdlib/include -I/home/josh/pdlib/main -I/home/josh/pdlib -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -DZEND_COMPILE_DL_EXT=1 -c /home/josh/pdlib/pdlib.cc -o pdlib.lo -MMD -MF pdlib.dep -MT pdlib.lo
libtool: compile: unable to infer tagged configuration
libtool: error: specify a tag with ‘–tag’
make: *** [Makefile:208: pdlib.lo] Error 1
i think this is because i need to use -std=c++14 but its trying to compile with c++11 and i dont know how to change it

yes, i had the same problem. patch it like this:

ok i got the pdlibs compiled and installed correctly. thank you for your help.

now i ran the test and its saying my php-bz2 is not installed. do i have to configure it or add it to something?
sudo apt-get install php-bz2
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
php-bz2 is already the newest version (2:8.1+92+ubuntu22.04.1+deb.sury.org+1).
The following packages were automatically installed and are no longer required:
javascript-common libaccinj64-11.5 libcub-dev libcublas11 libcublaslt11 libcudart11.0 libcufft10 libcufftw10 libcupti-dev libcupti-doc libcupti11.5 libcurand10
libcusolver11 libcusolvermg11 libcusparse11 libegl-dev libgl-dev libgl1-mesa-dev libgles-dev libgles1 libglvnd-core-dev libglvnd-dev libglx-dev libjs-jquery
libjs-sphinxdoc libjs-underscore libnppc11 libnppial11 libnppicc11 libnppidei11 libnppif11 libnppig11 libnppim11 libnppist11 libnppisu11 libnppitc11 libnpps11
libnvblas11 libnvidia-egl-wayland1 libnvjpeg11 libnvrtc-builtins11.5 libnvrtc11.2 libnvtoolsext1 libnvvm4 libopengl-dev libtbb-dev libtbb12 libtbbmalloc2
libthrust-dev libvdpau-dev node-html5shiv nsight-compute nsight-compute-target nvidia-cuda-gdb nvidia-cuda-toolkit-doc nvidia-opencl-dev ocl-icd-opencl-dev
opencl-c-headers opencl-clhpp-headers
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

PASS Check for pdlib presence [tests/001.phpt]
PASS Basic tests for chinese_whispers [tests/chinese_whispers_basic.phpt]
PASS Edge given in edges array for chinese_whispers functions is associative array [tests/chinese_whispers_edge_associative_array_error.phpt]
PASS Edge elements given in edges array for chinese_whispers functions are not of long type [tests/chinese_whispers_edge_elements_not_long.phpt]
PASS Edge given in edges array for chinese_whispers functions is not having all values to be arrays with 2 elements [tests/chinese_whispers_edge_not_2_element_error.phpt]
PASS Edge given in edges array is not array for chinese_whispers functions [tests/chinese_whispers_edge_not_array_error.phpt]
PASS Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
PASS Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt]
PASS Testing CnnFaceDetection constructor with model that do not exist [tests/cnn_face_detection_ctor_model_not_found_error.phpt]
PASS Frontal face detection. [tests/dlib_face_detection.phpt]
PASS Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
PASS Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
**SKIP Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt] reason: bz2 extension missing

PASS Basic tests for dlib_vector_length [tests/vector_length.phpt]
PASS Just test php extension version [tests/version.phpt]

sudo apt install php-bz2

That should be all :slight_smile:

I’ve got the PDlib compiled and passing, but have the issue running php-bz2. I am running nginx with Postgres, and PHP 8.1. It appears that the bz2 needs to be compiled to the specific PHP version. The nginx uses php-fpm, but don’t know whether that is relevant or not. The compile of PDlib went flawlessly and I got the tests passing:

Exts skipped    :    0
Exts tested     :   16

Number of tests :   15                14
Tests skipped   :    1 (  6.7%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Tests passed    :   14 ( 93.3%) (100.0%)
Time taken      :    2 seconds

I’ll post more from the test results after I ensure that the text doesn’t contain IPs, etc.


Here, too, finally got the Face Recognition to install. bz2 was found earlier within the Wiki.

Tried locating sources, but found this faster.

Thanks for the prior info from your endeavors to get this done. Trying to get facial recoginition with a family server. Hard to get the siblings on board and this could be it.