updating defaultdict init

release/4.3a0
akrishnan86 2020-09-27 18:55:14 -07:00
parent fbb26eea07
commit 98404ad27e
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ def estimate_poses(relative_translations: gtsam.BinaryMeasurementsUnit3,
# Compute average of outlier weights. Each outlier weight is a map from a pair of Keys (camera IDs) to a weight, # Compute average of outlier weights. Each outlier weight is a map from a pair of Keys (camera IDs) to a weight,
# where weights are proportional to the probability of the edge being an outlier. # where weights are proportional to the probability of the edge being an outlier.
avg_outlier_weights = defaultdict(lambda: 0.0) avg_outlier_weights = defaultdict(float)
for outlier_weight_dict in outlier_weights: for outlier_weight_dict in outlier_weights:
for keypair, weight in outlier_weight_dict.items(): for keypair, weight in outlier_weight_dict.items():
avg_outlier_weights[keypair] += weight / len(outlier_weights) avg_outlier_weights[keypair] += weight / len(outlier_weights)