How to "reset" Recognize and start from scratch

I had the problem that the Recognize app was working a bit sluggish with the mixed approach of having buttons in the app administration and the instructions with occ commands. None of it was working well, and also not the combination of it.

I had it up and running once, the it somehow got stuck and did not recognize new faces. So i decided to “reset” the app, remove all existing faces and clusters and start from scratch. This did not work at all. I ended up with a Recognize app that only recognized new photos and only added the new faces to the clusters. The old photos, around 130k, were not recognized anymore, not even after waiting a few weeks.

So I made a backup of all database tables with “oc_recognize_”, then truncated those and started all over. Also this did not work. But i found some recognize entries in the “occ_appconfig” table of nextcloud itself with already filled in values for “clusterFaces.lastRun”, “faces.lastFile”, “Imagenet.lastFile”, “movienet.lastFile”, “musicnn.lastFile”, landmarks.lastFile" and set them all to zero (0).

It seems that Recognize “remembers” forever in the “oc_appconfig” table where it last stopped and what it recognized already, making it impossible with app buttons or occ commands to start all over, since it clearly just continues with the newly uploaded pictures. In other words: there is NO (easy available) hard reset!

Once I tuncated all “oc_recognize*” tables and ADDITIONALLY deleted the last run Files from “oc_appconfig”, Recognize finally started all over again and now (after 4 days!) has all the files to recognize in place and shows faces from old photos again.

This app might needs some serious overhaul and some better explanation parts, in my opinion :confused:

ps: If you try this, please make a backup of your existing database tables and values first! Good luck!

1 Like

This is not the case. Let’s avoid spreading falsehoods and ask questions before drawing conclusions.

There is an easily available hard reset and it’s even documented in the admin settings of recognize:

In order to reset recognize:

  1. clear all currently scheduled background jobs:

occ recognize:clear-background-jobs

(and wait for any currently running cron.php instances to stop)

  1. delete all faces and face clusters:

occ recognize:reset-faces

  1. remove all tags from files tagged by recognize:

occ recognize:reset-tags

  1. (optionally) Delete all tags used by recognize

occ recognize:cleanup-tags

Then, to trigger the background-job crawler for all files again, run

occ recognize:recrawl

or run

occ recognize:classify

which will do a full synchronous run over all files and will take a long time.

If these steps don’t work, the next step is to file an issue on GitHub - nextcloud/recognize: 👁 👂 Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres

:blue_heart:

(The appconfig flags you mentioned are only there for debugging purposes)

3 Likes

And that exactly is the problem: those step did not work, repeatedly.

Can you point me to your issue on github, where you outline what you did and what didn’t work?