matiasdelellis / facerecognition

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

php test fails and no face pictures displayed #376

Closed christianaubry closed 3 years ago

christianaubry commented 4 years ago

Hi, I guess I must have missed a step but can't figure out what... Thx for your help.

Expected behaviour

PHP test sucessfull Display list of faces on Face Recognition app after succesfull analysis

Actual behaviour

PHP test fails Nothing shown on the Face Recgnition user page

Steps to reproduce

  1. Successfull instalation od dlib, pdlib and activation of the app. Enable face analysis for the user 'Christian'
  2. Model importation and selection (I tried all models)
  3. Run test php fails, python looks successfull (see result bellow)
  4. Started manual analysis with background task (see results bellow)
  5. Successfull progression displayed in the Face Recognition Admin page. Message at the bottom: L'analyse est terminée - 21images ont été analysées
  6. No face picture displayed in the personal Face Recognition page. Message: Vos amis n’ont pas encore été reconnus Veuillez patienter

Server configuration

Virtual Machine, 1 vCPU, Intel Xeon E51620V2, 4GB Ram

First we try to open the models... Done

Processing file: input/Big Bang Theory.jpg Number of faces detected: 0 Processing file: input/Big Bang Theory.png Number of faces detected: 4 Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done

python3 scripts/face_detect.py Welcome to pdlib min test suite for Facerecognition app

First we try to open the models... Done

Processing file: input/Big Bang Theory.jpg Number of faces detected: 6 Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Processing file: input/Big Bang Theory.png Number of faces detected: 7 Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done


* **PHP version:**
7.4.3  (Mem limit 2GB)

* **Web server:**
Apache

* **Database:**
mysql 10.3.25

* **Nextcloud version:**
19.0.4

### Client configuration

* **Browser:**
Firefox 82 on Windows10
Chrome 86 on Windows10

* **Operating system:**

### Logs
No error ...

#### Background task log with debug.

sudo -u www-data php /var/www/html/occ face:background_job -u Christian -t 90 1/10 - Executing task CheckRequirementsTask (Check all requirements) 2/10 - Executing task CheckCronTask (Check that service is started from either cron or from command) 3/10 - Executing task LockTask (Acquire lock so that only one background task can run) 4/10 - Executing task DisabledUserRemovalTask (Purge all the information of a user when disable the analysis.) 5/10 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB) 6/10 - 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:

sudo -u www-data php /var/www/html/occ face:background_job -u Christian -t 90 1/10 - Executing task CheckRequirementsTask (Check all requirements) 2/10 - Executing task CheckCronTask (Check that service is started from either cron or from command) 3/10 - Executing task LockTask (Acquire lock so that only one background task can run) 4/10 - Executing task DisabledUserRemovalTask (Purge all the information of a user when disable the analysis.) 5/10 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB) 6/10 - Executing task CreateClustersTask (Create new persons or update existing persons) Face clustering will be created for the first time. 5 faces found for clustering 5 persons found after clustering 7/10 - Executing task AddMissingImagesTask (Crawl for missing images for each user and insert them in DB) 8/10 - Executing task EnumerateImagesMissingFacesTask (Find all images which don't have faces generated for them) 9/10 - Executing task ImageProcessingTask (Process all images to extract faces) NOTE: Starting face recognition. If you experience random crashes after this point, please look FAQ at https://github.com/matiasdelellis/facerecognition/wiki/FAQ 10/10 - Executing task UnlockTask (Release obtained lock)

</details>

#### Web server error log
none

#### Nextcloud log (data/nextcloud.log)

none



#### Browser log
<details>
<summary>Browser log</summary>
matiasdelellis commented 4 years ago

Hi @christianaubry

It is rare that the python test shows more expensive than phh, however, it is not necessarily an error. 😕

In these cases, I would not recommend installing dlib with pip3. Try our packages. https://github.com/matiasdelellis/facerecognition/wiki/Installation#ubuntu-focal

About "No face picture displayed in the personal Face Recognition page.", that is because the process only found 5 faces, and I group them individually.

6/10 - Executing task CreateClustersTask (Create new persons or update existing persons)
    Face clustering will be created for the first time.
    5 faces found for clustering
    5 persons found after clustering

The persons view only suggests adding names to people with more than one face.. Try open the Photos/2020-08-22 13-00-04.jpeg image, and assign names with the right sidebar, and then you should already see them in our application.

christianaubry commented 4 years ago

Thx Mathias, It actually does not change anything. Tried to recompile dlib, try to use the Easy Way of installing pdlib I always endup with the same result. Anyway as you wrote the analysis works in NextCloud when checking individual photos. I will run a larger sample of pictures to see how it group faces. The detection is not very sensitive even with extremly low confidence and high resotution temp files, tested in mode 1 and 4 with exact same result whatever the confidence is.

matiasdelellis commented 4 years ago

Please, test at least 50 photos with faces.. and increase the temp image size..

fuco809 commented 3 years ago

i have a similar issue. occ background_job command runs successfully, added about 50 pictures for testing to my user. progress and stats seems ok. but i cannot see any picture in my face page

sudo -u www-data php7.4 occ face:progress

+--------+-----------+-----+ | Images | Remaining | ETA | +--------+-----------+-----+ | 66 | 0 | - | +--------+-----------+-----+

sudo -u www-data php7.4 occ face:stats

+-------------------------------+--------+-------+---------+ | User | Images | Faces | Persons | +-------------------------------+--------+-------+---------+ | MYUSER** | 59 | 48 | 29 |

grafik

is there any log for debugging?

matiasdelellis commented 3 years ago

Hi @fuco809 Please, open browser inspector and search clusters query.. you should see something like: imagen

matiasdelellis commented 3 years ago

Hi @christianaubry I just discovered a couple of bugs in the the tests..

Basically, the images were very small, but the python test enlarged them.. that's why php couldn't find faces, and python did. :disappointed:

Please try the test again. if you find the faces in the test, it means that pdlib works fine.

Next, if Nextcloud Facerecognition does not find faces, you must enlarge the size of the temporary images option. Thanks.. :grimacing:

fuco809 commented 3 years ago

I tried to check the clusters but they are empty

response: {"enabled":true,"clusters":[]}

after waiting a while some of my pics are now regocnised, but i added more after that and they are not shown. (clusters still empty)

after rerunning the command several times and after about one hour the cluster ist being created.

sudo -u www-data php7.4 occ face:background_job -u MYUSER -t 900

... 6/10 - Executing task CreateClustersTask (Create new persons or update existing persons) Face clustering will be recreated with new information or changes 66 faces found for clustering 33 persons found after clustering ...

what is the normal processing time between Step 9 (ImageprocessingTask) and Step 6 (build/update Clusters) ?

matiasdelellis commented 3 years ago

Hi @fuco809

what is the normal processing time between Step 9 (ImageprocessingTask) and Step 6 (build/update Clusters) ?

Need 25 faces without clustering, or two hours since the last clustering.

Wait or add more photos ..

ftrentini commented 3 years ago

Look, I may talking nonsense, but first time I tested facerecog with a few ppl, it worked alright. Then I scanned all my library (200+K pics) and the faces never appear. After a few days of testing, purging, reinstalling, I discovered that was nginx timeout. The script took a little more than a minute to run and nginx drops the connection and gives the proxy timeout error (504, I guess). Then I increased both script timeout from both nginx and php.ini from 60 to something like 3600 and it worked. AFAIK, apache has this 60s limit too.