MCPcopy Create free account
hub / github.com/BIT-MJY/CVTNet / load_poses

Function load_poses

tools/utils/utils.py:4–21  ·  view source on GitHub ↗
(pose_path)

Source from the content-addressed store, hash-verified

2import numpy as np
3
4def load_poses(pose_path):
5 poses = []
6 try:
7 if '.txt' in pose_path:
8 with open(pose_path, 'r') as f:
9 lines = f.readlines()
10 for line in lines:
11 T_w_cam0 = np.fromstring(line, dtype=float, sep=' ')
12 T_w_cam0 = T_w_cam0.reshape(3, 4)
13 T_w_cam0 = np.vstack((T_w_cam0, [0, 0, 0, 1]))
14 poses.append(T_w_cam0)
15 else:
16 poses = np.load(pose_path)['arr_0']
17
18 except FileNotFoundError:
19 print('Ground truth poses are not avaialble.')
20
21 return np.array(poses)
22
23
24def load_calib(calib_path):

Calls

no outgoing calls

Tested by

no test coverage detected