From fa0e1a6bcf61b1f6909ef99ed573ffacd7f13d9d Mon Sep 17 00:00:00 2001 From: Jaap de Ruyter Date: Thu, 15 Jan 2026 14:27:46 +0100 Subject: [PATCH] fix non-deterministic unintended failing of `test_coarse_dropout` 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. --- tests/pose_estimation_pytorch/other/test_custom_transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pose_estimation_pytorch/other/test_custom_transforms.py b/tests/pose_estimation_pytorch/other/test_custom_transforms.py index f312fc9978..875e05e80a 100644 --- a/tests/pose_estimation_pytorch/other/test_custom_transforms.py +++ b/tests/pose_estimation_pytorch/other/test_custom_transforms.py @@ -49,7 +49,7 @@ def test_coarse_dropout(): fake_image *= np.random.uniform(0, 255, size=fake_image.shape) fake_image = fake_image.astype(np.uint8) cd = transforms.CoarseDropout(max_height=0.9999, max_width=0.9999, p=1) - kpts = np.random.rand(10, 2) * 300 + kpts = np.random.rand(10, 2) * 298 + 1 aug_kpts = cd(image=fake_image, keypoints=kpts)["keypoints"] assert len(aug_kpts) == kpts.shape[0] assert np.isnan([c for kpt in aug_kpts for c in kpt]).all()