matiasdelellis / facerecognition

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

Force analyze files #739

Open 36grad opened 5 months ago

36grad commented 5 months ago

Add an option (--force_analyze_files) that enablee the user to explicitly (re-)analyze specific files.

- The  --force_analyze_files option allows the user to specify files that they want to analyze.
- The  --force_analyze_files (or -f) option can be used multiple times to analyze more than one file.
- The images must be given relative to the data/USER_ID/files folder and thus the --user_id option is required.
- The  --force_analyze_files option does not work together with sync-mode or cluster-mode.
- If no mode is specified by the user, defer-mode is enabled for a better user experience.
- Files that are specified using the  --force_analyze_files option are put at the front of the analysis queue and thus are analyzed first.
matiasdelellis commented 5 months ago

Hi @36grad Again, Thanks for this PR.

Can I ask you for a change in approach to the problem?. Instead of adding a force option, (which ultimately resets the file), wouldn't it be better to add an option to face:reset to reset files? 🥲

36grad commented 5 months ago

Yep, that is a good suggestion - I had worked initially based on the PHP code from the appstore version and when I pulled the latest source from the repository I saw that I had to add a code line where I reset the file's status - so this would have been a good approach in the first place. There's one thing, however, which I would be missing is having the option to explicitly analyze those files. If they're only reset there's still a huge number of files to be analyzed there's no way to tell when the reset files will be analyzed. Any ideas here?

matiasdelellis commented 5 months ago

If they're only reset there's still a huge number of files to be analyzed there's no way to tell when the reset files will be analyzed. Any ideas here?

MMm.. 🤔 In any case you could add a --path option and you become a hero!. :wink: In the end you will reuse a lot of what you made, but IMHO it makes makes more sense to reset and scan explicitly instead of forcing something.