From 1b7d0942cca1a69d7bfe37b293429003b8ee96c0 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Wed, 15 Apr 2026 01:44:18 -0700 Subject: [PATCH] fix(utils/data_augmentation): correct dangling tgt_fov_max typo in sample_perspective The absolute-range clamp in sample_perspective was written as: tgt_fov_x_min, tgt_fov_max = max(...), min(..., tgt_fov_x_max) which shadowed the wrong name: tgt_fov_x_max was never overwritten, so the subsequent rng.uniform(..., tgt_fov_x_max) call silently bypassed the absolute maximum clamp and tgt_fov_max became a dangling local. Rename the target to tgt_fov_x_max so the absolute bound is actually applied when drawing tgt_fov_x. Closes #146. --- moge/utils/data_augmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moge/utils/data_augmentation.py b/moge/utils/data_augmentation.py index 9fc4c9d..ecf75f6 100644 --- a/moge/utils/data_augmentation.py +++ b/moge/utils/data_augmentation.py @@ -34,7 +34,7 @@ def sample_perspective( fov_range_relative_min, fov_range_relative_max = fov_range_relative tgt_fov_x_min = min(fov_range_relative_min * raw_fov_x, utils3d.focal_to_fov(utils3d.fov_to_focal(fov_range_relative_min * raw_fov_y) / tgt_aspect)) tgt_fov_x_max = min(fov_range_relative_max * raw_fov_x, utils3d.focal_to_fov(utils3d.fov_to_focal(fov_range_relative_max * raw_fov_y) / tgt_aspect)) - tgt_fov_x_min, tgt_fov_max = max(np.deg2rad(fov_range_absolute_min), tgt_fov_x_min), min(np.deg2rad(fov_range_absolute_max), tgt_fov_x_max) + tgt_fov_x_min, tgt_fov_x_max = max(np.deg2rad(fov_range_absolute_min), tgt_fov_x_min), min(np.deg2rad(fov_range_absolute_max), tgt_fov_x_max) tgt_fov_x = rng.uniform(min(tgt_fov_x_min, tgt_fov_x_max), tgt_fov_x_max) tgt_fov_y = utils3d.focal_to_fov(utils3d.np.fov_to_focal(tgt_fov_x) * tgt_aspect)