Repository navigation
fix(vad): apply the offline dynamic silence schedule per frame - #3833
Open
lingfengyao wants to merge 1 commit into
Open
lingfengyao wants to merge 1 commit into
lingfengyao wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Related to #3832
Offline FsmnVADStreaming.inference advanced the dynamic silence schedule once per 60 s chunk. As a result, only the 1850 ms and 50 ms thresholds were used, and segmentation depended on where chunk boundaries fell (see #3832 and #3644).
This PR looks up the schedule in DetectOneFrame from the current segment's duration (cur_frm_idx - confirmed_start_frame + 1, as for max_single_segment_time). The per-chunk accumulate/reset logic in inference() is removed. dynamic_silence, silence_schedule and max_end_silence_time keep their meaning, and DynamicStreamingVAD (dynamic_silence=False) is unaffected.
Type of change
Validation
python -m compileall funasr examples testsNotes for reviewers
Default offline segments become longer (median ~29 s on TED-LIUM, versus ~2 s before), because the schedule now works as designed. CER on concatenated AISHELL-1 improves, from 1.936% to 1.625%. If shorter defaults are preferred, I think that belongs in DEFAULT_SILENCE_SCHEDULE as a separate change.