Skip to content

Keep strict crop frame counts nonnegative for short intervals - #112

Open
antonsoo wants to merge 1 commit into
pyannote:mainfrom
antonsoo:fix/empty-window-crops
Open

antonsoo wants to merge 1 commit into
pyannote:mainfrom
antonsoo:fix/empty-window-crops

Conversation

@antonsoo

Copy link
Copy Markdown

For SlidingWindow(duration=0.025, step=0.01), samples(0.01, mode="strict") returns -1, although no frame fits. That negative count also reaches fixed-duration feature cropping: an interval at the start or beyond the end of the features raises ValueError: negative dimensions are not allowed.

Clamp the strict frame count to zero when the requested duration cannot contain a complete frame. Loose/center counts and ordinary strict counts are unchanged. Tests cover zero and short durations plus fixed crops before, within and after the available features.

Full suite: 71 pass on Python 3.12/NumPy 2.5.4; 69 pass with two optional IPython visualization skips on Python 3.11/NumPy 2.0.2. Ruff checks and formatting pass.

A separate workflow uses frame features from six recorded CMU Arctic utterances and independently enumerates fully contained windows. All 54 negative counts become zero, all 36 formerly failing boundary crops return the expected empty array, and 24 ordinary crops retain exactly the same selected frame values. No padding or alignment rule is changed for spans that contain frames.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T20:46:07.236800Z 532df71 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

1 participant