From eaf4c024525d026e66d8c38faf21e9bf85fbc99d Mon Sep 17 00:00:00 2001 From: Ayush Baid Date: Mon, 27 May 2024 22:49:06 -0700 Subject: [PATCH] Bump up shonan optimality threshold param This commit passes in the optimality treshold explicitly from GTSFM: a value of `-1e-5` compared to `-1e-4` default value. I tried using 0 and `1e-5` (value used in paper for large datasets) but even the unit tests are taking up a lot of time with higher thresholds. --- gtsfm/averaging/rotation/shonan.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtsfm/averaging/rotation/shonan.py b/gtsfm/averaging/rotation/shonan.py index 209aaaa7f..f2beaef61 100644 --- a/gtsfm/averaging/rotation/shonan.py +++ b/gtsfm/averaging/rotation/shonan.py @@ -35,6 +35,9 @@ _DEFAULT_TWO_VIEW_ROTATION_SIGMA = 1.0 +# The threshold for the smallest eigenvalue check in GTSAM. Defaults to -1e-4 in GTSAM. +_OPTIMALITY_THRESHOLD = -1e-5 + class ShonanRotationAveraging(RotationAveragingBase): """Performs Shonan rotation averaging.""" @@ -66,6 +69,7 @@ def __get_shonan_params(self) -> ShonanAveragingParameters3: shonan_params = ShonanAveragingParameters3(lm_params) shonan_params.setUseHuber(True) shonan_params.setCertifyOptimality(False) + shonan_params.setOptimalityThreshold(_OPTIMALITY_THRESHOLD) return shonan_params def __measurements_from_2view_relative_rotations(