Skip to content

fix non-deterministic unintended failing of test_coarse_dropout#3182

Merged
deruyter92 merged 3 commits intoDeepLabCut:mainfrom
deruyter92:jaap/fix_failing_dropout_test
Jan 23, 2026
Merged

fix non-deterministic unintended failing of test_coarse_dropout#3182
deruyter92 merged 3 commits intoDeepLabCut:mainfrom
deruyter92:jaap/fix_failing_dropout_test

Conversation

@deruyter92
Copy link
Copy Markdown
Collaborator

This PR fixes a small issue in one of the pytests testing the dropout transformation.

problem:
The test fails non-deterministically because of an issue in the test implementation unrelated to the codebase.
Dropout is applied over nearly (!) the entire image (e,g. max_width=.9999), to test that randomly placed keypoints always become nan. However, the boundaries for the randomly generated keypoints exceeded the boundaries of the dropout. In rare cases the test fails when the keypoints are placed at the border of the image.

changes:
Fixed test implementation: keypoints are randomly generated at maximally 1 pixel distance of the image border.

dropout is applied over nearly (!) the entire image (e,g. max_width=.9999), to test that randomly placed keypoints always become nan. However, the boundaries for the randomly generated keypoints exceeded the boundaries of the dropout.

This is now fixed by generating keypoints maximally within 1 pixel distance of the image border.
@deruyter92 deruyter92 requested a review from MMathisLab January 21, 2026 17:06
@deruyter92 deruyter92 added the bug Something isn't working label Jan 21, 2026
@deruyter92 deruyter92 merged commit 85911cb into DeepLabCut:main Jan 23, 2026
15 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants