Bypass the inferences of full zero mask chunks - #1982
Open
danhayoun wants to merge 2 commits into
Open
Conversation
Bypass the inferences of full zero mask chunks
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem :
There is a lot of full zero masks infered by the embedding model. Because the number of speakers searched for by chunk is fixed, many times there won't be as many speakers inside as the number we search. This creates those empty masks. They take unnecessary time to pass through inference of the embedding model. For example, I counted the number of empty masks I got on an audio of around ~10 min with 2 speakers on it. 60% of the masks generated where fully at zero.
Suggestion :
They take quite a time to infer with no real necessity, as they are at the end always assigned to 'NaN'. That's why I suggest to detect the empty masks and directly map them to NaN and not pass them through inference.
Numerics :
For an audio of 10 min, 2 speakers, without my add-on it takes around 10.2s to run the full diarization pipeline, average on 10 tries.
For the same audio, with my add-on it takes around 7.5s, average on 10 tries.
Note :
Although the diarization initally serves to audios with many speakers, because it was integrated in many more projects (mostly due to being added on WhisperX), many audios actually passing by the diarization may contain just one speaker, increasing the number of full-zero masks.