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

Face cluster #1481

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Face cluster #1481

wants to merge 11 commits into from

Conversation

hauck-jvsh
Copy link
Member

Group similar faces and create a bookmark for each group. Maybe this could be enhanced if there is an API to change the itens, saving the group of each face in a metadata.
Closes #1475

@lfcnassif
Copy link
Member

Thank you @hauck-jvsh! Yes, #1185 is planned, I think it is needed for this and other features.

@hauck-jvsh
Copy link
Member Author

I found the reason it is taking a lot of time during the process and not so much otherwise.
if pingExternalProcess(proc): #from threading import Thread #t = Thread(target=log_stderr, args=(proc,)) #t.daemon = True #t.start() return proc
Comment those lines and the times will be:

Time(s) to extract 36895 faces 6.684337139129639
Time(s) to group similar faces: 9.375169515609741

I think that it is creating a huge amount of threads and they are overwhelming the JVM.

@hauck-jvsh
Copy link
Member Author

Actually it speed up the hole processing in this case. I think that the problem occurs when there is a lot of erros during the face extraction.

@lfcnassif
Copy link
Member

lfcnassif commented Jan 20, 2023

Hum... very interesting! I think that block was created to read stderr of the created external processes to avoid blocking them if they write too many errors to stderr, possibly there is a better way to do this, maybe reusing the same Thread to read stderr of several processes, not sure how to implement it in python...

@lfcnassif
Copy link
Member

lfcnassif commented Jan 20, 2023

Possibly the huge slowdown was caused by python GIL...

@fmpfeifer, do you have any suggestion on how to ignore stderr of external processes started from python without using threads and without blocking the main thread that started the external processes?

@lfcnassif
Copy link
Member

Actually that block is used to log stderr, not ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clustering faces
2 participants