Skip to content

Commit 2611eea

Browse files
YanNounfacebook-github-bot
authored andcommitted
feat: compare reconstructions
Summary: This Diff adds a small binary for producing metrics between two reconstructions. We also modify the generation of augment data so they're more realistic wrt. current algorithm and fixed a few bits here and there (save of reference_lla), and add MAD metrics Reviewed By: paulinus Differential Revision: D28380463 fbshipit-source-id: 4104adfc456fa01bbee967d7461b4310e5b5b47a
1 parent 776e10b commit 2611eea

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

opensfm/synthetic_data/synthetic_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,7 @@ def _copy_reconstruction(reconstruction: types.Reconstruction) -> types.Reconstr
124124

125125
def rmse(errors: np.ndarray) -> float:
126126
return np.sqrt(np.mean(errors ** 2))
127+
128+
129+
def mad(errors: np.ndarray) -> float:
130+
return np.median(np.absolute(errors - np.median(errors)))

opensfm/synthetic_data/synthetic_scene.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,19 @@ def compare(
407407
"ratio_cameras": completeness[0],
408408
"ratio_points": completeness[1],
409409
"absolute_position_rmse": sm.rmse(absolute_position),
410+
"absolute_position_mad": sm.mad(absolute_position),
410411
"absolute_rotation_rmse": sm.rmse(absolute_rotation),
412+
"absolute_rotation_mad": sm.mad(absolute_rotation),
411413
"absolute_points_rmse": sm.rmse(absolute_points),
414+
"absolute_points_mad": sm.mad(absolute_points),
412415
"absolute_gps_rmse": sm.rmse(absolute_gps),
416+
"absolute_gps_mad": sm.mad(absolute_gps),
413417
"aligned_position_rmse": sm.rmse(aligned_position),
418+
"aligned_position_mad": sm.mad(aligned_position),
414419
"aligned_rotation_rmse": sm.rmse(aligned_rotation),
415-
"aligned_points_rmse": sm.rmse(aligned_points),
420+
"aligned_rotation_mad": sm.mad(aligned_rotation),
416421
"aligned_gps_rmse": sm.rmse(aligned_gps),
422+
"aligned_gps_mad": sm.mad(aligned_gps),
423+
"aligned_points_rmse": sm.rmse(aligned_points),
424+
"aligned_points_mad": sm.mad(aligned_points),
417425
}

0 commit comments

Comments
 (0)