Skip to content

Commit 86e5b03

Browse files
committed
minor, bugs in compute metric for tum pose & skipping certain sequences for traj eval
1 parent 29bbdfb commit 86e5b03

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dust3r/pose_eval.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,20 @@ def eval_pose_estimation_dist(args, model, device, img_path, save_dir=None, mask
193193
f.write(f'{rpe_trans:.5f}\n')
194194
f.write(f'{rpe_rot:.5f}\n')
195195

196-
except RuntimeError as e:
196+
except Exception as e:
197197
if 'out of memory' in str(e):
198198
# Handle OOM
199199
torch.cuda.empty_cache() # Clear the CUDA memory
200200
with open(error_log_path, 'a') as f:
201201
f.write(f'OOM error in sequence {seq}, skipping this sequence.\n')
202202
print(f'OOM error in sequence {seq}, skipping...')
203+
elif 'Degenerate covariance rank' in str(e) or 'Eigenvalues did not converge' in str(e):
204+
# Handle Degenerate covariance rank exception and Eigenvalues did not converge exception
205+
with open(error_log_path, 'a') as f:
206+
f.write(f'Exception in sequence {seq}: {str(e)}\n')
207+
print(f'Traj evaluation error in sequence {seq}, skipping.')
203208
else:
204-
raise e # Rethrow if it's not an OOM error
209+
raise e # Rethrow if it's not an expected exception
205210

206211
# Aggregate results across all processes
207212
if misc.is_dist_avail_and_initialized():

dust3r/utils/vo_eval.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ def load_traj(gt_traj_file, traj_format="sintel", skip=0, stride=1, num_frames=N
107107
elif traj_format in ["tum", "tartanair"]:
108108
traj = file_interface.read_tum_trajectory_file(gt_traj_file)
109109
xyz = traj.positions_xyz
110-
# shift -1 column -> w in back column
111-
quat = np.roll(traj.orientations_quat_wxyz, -1, axis=1)
110+
quat = traj.orientations_quat_wxyz
112111
timestamps_mat = traj.timestamps
113112
traj_tum = np.column_stack((xyz, quat))
114113
else:

0 commit comments

Comments
 (0)