Conversation
There was a problem hiding this comment.
What if we rename this file as gamma_values.py or gamma_constants.py to make the name a little more descriptive?
| @@ -0,0 +1,12290 @@ | |||
| NU3 = 3 | |||
There was a problem hiding this comment.
Could you add a module docstring and explain where these values come from?
| @@ -0,0 +1,257 @@ | |||
| """ | |||
| Uncertainity aware rotation averaging. | |||
| def random_rotation() -> Rot3: | ||
| """Sample a random rotation by generating a sample from the 4d unit sphere.""" | ||
| q = np.random.randn(4) * 0.03 | ||
| # make unit-length quaternion |
There was a problem hiding this comment.
nit: capitalization and punctuation
# Make unit-length quaternion.
| global_rotations_init = initialize_global_rotations_using_mst( | ||
| num_images, {key: value for key, value in i2Ri1_dict.items() if value is not None} | ||
| ) | ||
| # global_rotations_init = [random_rotation() for _ in range(num_images)] |
There was a problem hiding this comment.
nit: can we remove the commented out code?
| ANGLE_AXIS_COVNORM = 8 | ||
|
|
||
|
|
||
| class MAGSACWeightBasedLoss(pyceres.LossFunction): |
There was a problem hiding this comment.
nit: can we add a 1-line docstring for this class?
| return _estimate_rotations_with_customized_loss_and_covariance_ceres(global_rotations_init, rotation_info_dict) | ||
|
|
||
|
|
||
| class RotationInfo(NamedTuple): |
There was a problem hiding this comment.
nit: can we add an Attributes section to describe each field here, and a 1-line sentence describing the class?
| ROTATION_ANGLE_ERROR_THRESHOLD_DEG = 2 | ||
|
|
||
|
|
||
| class TestUncertainityAwareRotationAveraging(unittest.TestCase): |
There was a problem hiding this comment.
nit: typo "Uncertainty"
| """Helper function to run the averagaing and assert w/ expected. | ||
|
|
||
| Args: | ||
| i2Ri1_input: relative rotations, which are input to the algorithm. |
There was a problem hiding this comment.
nit: capitalization
i2Ri1_input: Relative rotations, which are provided as input to the algorithm.
|
|
||
| self.__execute_test(i2Ri1_dict, expected_wRi_list) | ||
|
|
||
| # def test_simple_with_prior(self): |
There was a problem hiding this comment.
nit: should we remove this commented-out code?
| costs.append(cost) | ||
| problem.add_residual_block( | ||
| cost, | ||
| # pyceres.TrivialLoss(), |
There was a problem hiding this comment.
nit: can we remove this commented out code?
| self.weight_zero = self.one_over_sigma * self.gamma_difference | ||
| self.use_weight_inverse = inverse | ||
|
|
||
| def Evaluate(self, squared_residual, rho): |
There was a problem hiding this comment.
nit: can we add type annotations?
|
|
||
|
|
||
| class MAGSACWeightBasedLoss(pyceres.LossFunction): | ||
| def __init__(self, sigma, inverse=False): |
There was a problem hiding this comment.
nit: can we add type annotations?
No description provided.