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

Allow retaining or trimming channels in trim_to_supervisions #852

Merged
merged 5 commits into from
Oct 12, 2022

Conversation

desh2608
Copy link
Collaborator

Consider AMI IHM as an example. For each session, we create a multi-cut with 4 channels (1 channel per speaker), and each supervision segment corresponds to one of the 4 channels (based on who the speaker is). If we then want to use this data to train an ASR system, we can call trim_to_supervisions(). Currently, the resulting cuts would still contain 4 channels. This PR allows the user to trim the channels to the supervisions (by default), or ignore channel while trimming.

@@ -394,6 +394,7 @@ def trim_to_supervisions(
keep_overlapping: bool = True,
min_duration: Optional[Seconds] = None,
context_direction: Literal["center", "left", "right", "random"] = "center",
ignore_channel: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about keep_all_channels: bool = False? ignore_channel is a little vague for me, but I'm not sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that seems reasonable. I'll change it.

@pzelasko pzelasko added this to the v1.9 milestone Oct 12, 2022
@pzelasko pzelasko merged commit ebdacc5 into lhotse-speech:master Oct 12, 2022
@desh2608 desh2608 deleted the trim_channel branch November 2, 2023 19:18
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