Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Better Facial Recognition Clusters #14911

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aviv926
Copy link
Contributor

@aviv926 aviv926 commented Dec 24, 2024

I tried this guide on my library and the results were very promising, I thought I would make a guide that could help more people.
Maybe in the future it will be possible to make this process automatic 🤔

If it doesn't fit the documentation I will pass it on to Community Guides.

@mertalev I would like to know what you think about it and if you have any ideas for correction/improvement.

@aviv926 aviv926 added documentation Improvements or additions to documentation changelog:documentation labels Dec 24, 2024
Copy link
Contributor

github-actions bot commented Dec 24, 2024

📖 Documentation deployed to pr-14911.preview.immich.app

@bo0tzz
Copy link
Member

bo0tzz commented Dec 24, 2024

Would it make sense to apply some of this automatically on a rerun if the library has a large amount of assets?

@aviv926
Copy link
Contributor Author

aviv926 commented Dec 24, 2024

Would it make sense to apply some of this automatically on a rerun if the library has a large amount of assets?

Not without deleting all previously assigned name data.

@aviv926
Copy link
Contributor Author

aviv926 commented Dec 24, 2024

mertalev wrote that maybe in the future there will be a refresh button that can prevent this.
https://discord.com/channels/979116623879368755/991643870523830382/1299868293603131505

@mertalev
Copy link
Contributor

A generalization of this guide would be to use OPTICS instead of DBSCAN, which would basically cluster in order from the densest regions to the least dense. This guide is a valid alternative until something like that is implemented.

Once the reset jobs are complete, refine the recognition as follows:

- **Step 1:**
Return to **Minimum recognized faces** in Machine Learning Settings and lower the value to **8**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 -> 8 might get the right result for your library, but I think it's too subtle to work as a general recommendation. Maybe 20 -> 10 -> 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a test I did, setting the value too high to start with causes many faces to not be recognized (because 20 faces per person is too many), which causes people who look similar to other person to merge (false positives).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is going to vary by library, right? Some people will have large libraries where 10 vs 8 doesn't matter, some people will have burst photos, etc. You can adjust the text to recommend different numbers based on their library.

Comment on lines +35 to +36
Set this to **0.5**.
> This helps recognize more faces while avoiding false positives (non-faces).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending a different detection score is out of scope for this guide. A lower score risks false positives that are difficult to deal with once they exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand the reason you say this, I decided to point it out because in the test I did that once I obtained high-quality clusters even faces that are a little covered (and when the value is 0.6 they are not even recognized at all) manage to enter the high-quality cluster that is created and then there is no risk in faces that are not assigned to anyone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not have caused an issue for your library, but I've seen it cause non-faces to come up for others and things get very messy. A guide that shows how to get higher quality results shouldn't suggest things that can often cause lower quality results.


Perform the following:

1. **FACE DETECTION → Reset**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just resetting facial recognition is enough without the detection score change. If you do change the detection score, then you should only queue face detection and let it queue faces for recognition automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in fact it should run the job automatically as you mentioned, it's a bit old guide I wrote, and if I'm not mistaken at the time there was a "bug" that didn't run this job automatically. (If this is no longer the case then I will remove this part)

Comment on lines +74 to +76
## Outcome

This method creates high-quality face clusters for core faces and ensures the model can reliably add new faces as they appear in your library.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍I will remove this part soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:documentation documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants