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

Clustering faces #1475

Open
hauck-jvsh opened this issue Jan 14, 2023 · 5 comments · May be fixed by #1481
Open

Clustering faces #1475

hauck-jvsh opened this issue Jan 14, 2023 · 5 comments · May be fixed by #1481
Assignees

Comments

@hauck-jvsh
Copy link
Member

In order to improve #1472, an clustering algorithm should be used. I'm planing to implement a simple one, as the one presented here https://pyimagesearch.com/2018/07/09/face-clustering-with-python
Do you have any suggestions?

@lfcnassif
Copy link
Member

DBScan seems a good choice. If the python implementation performance is bad, for sure there are some java implementations out there, since it is a classic clustering algorithm. This would also avoid the need to manually install another python dependency, but since face detection already needs manual installation, I'm ok with it.

@hauck-jvsh
Copy link
Member Author

Now it is grouping the item by any face inside the item, but the information about what face is in the group is lost. Maybe there is another way to store this info.

@hauck-jvsh
Copy link
Member Author

The python lib is presenting the following error:
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata. OOOOOOOOOppenBLAS : Program is Terminated. Because you tried to allocate too many memory regions.

The current solution I found is to set the environment variable OPENBLAS_NUM_THREADS to 4.

@hauck-jvsh
Copy link
Member Author

Maybe the best solution is to change the python task to a java one, and mantain only the FaceRecognitionProcess as a python code. This would allow the use of a java DBScan lib for clustering, bypassing the python thread problems. What do you think?
@lfcnassif

@lfcnassif
Copy link
Member

This is possible, but I think it would improve performance just if the java library is multithreaded. I've found this in the past:
https://github.com/haifengl/smile

But it seems single threaded at first sight...

hauck-jvsh added a commit that referenced this issue Jan 17, 2023
…compiled;

Log the time spent extracting faces and the total time for grouping the faces;
hauck-jvsh added a commit that referenced this issue Jan 17, 2023
@hauck-jvsh hauck-jvsh linked a pull request Jan 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants