-
Notifications
You must be signed in to change notification settings - Fork 976
Filter out too short segments from diarization in the separation pipeline #1816
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
base: develop
Are you sure you want to change the base?
Filter out too short segments from diarization in the separation pipeline #1816
Conversation
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds filtering functionality to remove speech segments that are too short in the speaker diarization component of the speech separation pipeline.
- Adds a
min_duration_onparameter to control the minimum duration of speech segments - Implements morphological closing operation to filter out segments shorter than the threshold
- Updates import statements to include the necessary scipy.ndimage functions
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| from scipy.ndimage import binary_dilation, binary_closing | ||
| import torch |
Copilot
AI
Aug 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The import reorganization places scipy.ndimage import before torch import, breaking alphabetical ordering. Consider maintaining consistent import ordering for better code organization.
| from scipy.ndimage import binary_dilation, binary_closing | |
| import torch | |
| import torch | |
| from scipy.ndimage import binary_dilation, binary_closing |
| discrete_diarization.data = binary_closing( | ||
| discrete_diarization.data, structure=np.array([[True] * min_frames_on]).T | ||
| ) | ||
|
|
Copilot
AI
Aug 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new numpy array with np.array([[True] * min_frames_on]).T for each call is inefficient. Consider creating the structure array once outside the conditional or reusing it across calls.
| discrete_diarization.data = binary_closing( | |
| discrete_diarization.data, structure=np.array([[True] * min_frames_on]).T | |
| ) | |
| structure = np.array([[True] * min_frames_on]).T | |
| discrete_diarization.data = binary_closing( | |
| discrete_diarization.data, structure=structure | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
No description provided.