Skip to content

Conversation

@clement-pages
Copy link
Collaborator

No description provided.

@stale
Copy link

stale bot commented Aug 3, 2025

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.

@stale stale bot added the wontfix label Aug 3, 2025
@hbredin hbredin requested a review from Copilot August 25, 2025 07:25
@stale stale bot removed the wontfix label Aug 25, 2025
Copy link
Contributor

Copilot AI left a 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_on parameter 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.

Comment on lines +34 to 35
from scipy.ndimage import binary_dilation, binary_closing
import torch
Copy link

Copilot AI Aug 25, 2025

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.

Suggested change
from scipy.ndimage import binary_dilation, binary_closing
import torch
import torch
from scipy.ndimage import binary_dilation, binary_closing

Copilot uses AI. Check for mistakes.
Comment on lines +616 to +619
discrete_diarization.data = binary_closing(
discrete_diarization.data, structure=np.array([[True] * min_frames_on]).T
)

Copy link

Copilot AI Aug 25, 2025

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.

Suggested change
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
)

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a 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.

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.

2 participants