PYA-1783: Add multichannel support#117
Closed
MatiasDiBernardo wants to merge 2 commits into
Closed
Conversation
`load_rttm(..., keep_channel=True)` returns a nested
{uri: {channel: Annotation}} dict (1-based channel, field pyannote#3 of the RTTM
spec) instead of merging every channel into a single Annotation.
`RTTMLoader` now returns the annotation of `file["channel"]` when the
ProtocolFile provides one, and otherwise merges all channels as before.
Fully backward compatible: the default `keep_channel=False`, and a missing
`channel` key in RTTMLoader, reproduce the previous behavior. Adds tests
covering both the legacy and channel-aware paths.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
We'll discuss this offline but I believe this brings a breaking change for
I believe the new proposed behavior makes more sense but the ins and outs need to be discussed. |
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.
Optional multichannel support in RTTM loading
What
The RTTM channel field (column #3) was parsed but discarded. This adds an opt-in way to keep it, so a multichannel recording (telephone, per-headset,source-separated) can expose one reference
Annotationper channel.API
load_rttm(path, keep_channel=True)→ nested{uri: {channel: Annotation}}. Defaultkeep_channel=Falseis unchanged.RTTMLoaderreturns the annotation offile["channel"]when the ProtocolFile provides one; otherwise it merges all channels (previous behavior).Key example
Given this RTTM (column #3 is the channel):
Without
keep_channel(default — unchanged): all channels merge into one Annotation.With
keep_channel=True— one Annotation per channel:At the protocol level, the same distinction is driven by a
channelkey on the file:Tests
tests/test_loader.py(+ a multichannel fixture) covers the default/merged path, thekeep_channelshape and content,RTTMLoaderchannel selection and its backward-compatible default, and lazychannelresolution throughProtocolFile.uv run pytest testsis green.