matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
519 stars 47 forks source link

Nextcloud AIO with external model: Call to undefined function: dlib_vector_length() #782

Closed nordscan closed 2 weeks ago

nordscan commented 2 weeks ago

After sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ face:background_job -u user

i get

Error: Call to undefined function OCA\FaceRecognition\BackgroundJob\Tasks\dlib_vector_length()

its a missing dlib in nextcloud-aio-nextcloud kontajner or in external model??

Expected behaviour

Call to undefined function OCA\FaceRecognition\BackgroundJob\Tasks\dlib_vector_length()

Server configuration

Logs

Background task log with debug.

sudo -u apache php occ -vvv face:background_job ``` sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ face:background_job 1/8 - Executing task CheckRequirementsTask (Check all requirements) 2/8 - Executing task CheckCronTask (Check that service is started from either cron or from command) 3/8 - Executing task DisabledUserRemovalTask (Purge all the information of a user when disable the analysis.) 4/8 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB) 5/8 - Executing task CreateClustersTask (Create new persons or update existing persons) Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Face clustering will be recreated with new information or changes There are 7693 faces for clustering An unhandled exception has been thrown: Error: Call to undefined function OCA\FaceRecognition\BackgroundJob\Tasks\dlib_vector_length() in /var/www/html/custom_apps/facerecognition/lib/BackgroundJob/Tasks/CreateClustersTask.php:337 Stack trace: #0 /var/www/html/custom_apps/facerecognition/lib/BackgroundJob/Tasks/CreateClustersTask.php(177): OCA\FaceRecognition\BackgroundJob\Tasks\CreateClustersTask->getNewClusters(Array) #1 /var/www/html/custom_apps/facerecognition/lib/BackgroundJob/Tasks/CreateClustersTask.php(90): OCA\FaceRecognition\BackgroundJob\Tasks\CreateClustersTask->createClusterIfNeeded('nordscan') #2 /var/www/html/custom_apps/facerecognition/lib/BackgroundJob/BackgroundService.php(150): OCA\FaceRecognition\BackgroundJob\Tasks\CreateClustersTask->execute(Object(OCA\FaceRecognition\BackgroundJob\FaceRecognitionContext)) #3 /var/www/html/custom_apps/facerecognition/lib/Command/BackgroundCommand.php(192): OCA\FaceRecognition\BackgroundJob\BackgroundService->execute(0, false, NULL, NULL, 'default-mode') #4 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\FaceRecognition\Command\BackgroundCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #5 /var/www/html/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #6 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FaceRecognition\Command\BackgroundCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #7 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #8 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #9 /var/www/html/console.php(102): OC\Console\Application->run() #10 /var/www/html/occ(11): require_once('/var/www/html/c...') #11 {main}n ```

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Insert your Nextcloud log here ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
nordscan commented 2 weeks ago

Temporary solution

sudo docker exec -it nextcloud-aio-nextcloud bash

apk add --no-cache --upgrade make cmake gcc g++ php82-dev libx11-dev openblas-dev re2c ffmpeg-dev libjpeg-turbo-dev
mkdir temp
cd /temp
git clone https://github.com/davisking/dlib.git
cd dlib/dlib
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
make install
cd /temp
git clone https://github.com/goodspb/pdlib.git
cd pdlib
phpize
./configure --enable-debug
make
make install

then

nano /usr/local/etc/php/conf.d/pdlib.ini add there `extension="pdlib.so"

image

Check PHP

php -m | grep pdlib

image

Test DLib

cd /temp
git clone https://github.com/matiasdelellis/pdlib-min-test-suite.git
cd pdlib-min-test-suite
make php-test

image