MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / load_replica_gt

Function load_replica_gt

utils/readgt_replica.py:9–30  ·  view source on GitHub ↗
(dataset_path)

Source from the content-addressed store, hash-verified

7# TODO: don't know intrinsics
8
9def load_replica_gt(dataset_path):
10 results = {}
11 K = np.array([[600, 0, 599.5], [0, 600, 339.5], [0, 0, 1]])
12 # load all image names in 'image' folder
13 image_path = dataset_path + "/image/"
14 # load gt
15 data = np.loadtxt(dataset_path + '/traj.txt')
16 N = data.shape[0]
17 for i in range(N):
18 name = 'frame{:06d}.jpg'.format(i)
19 pose = data[i, :].reshape((4, 4))
20 # transform to world-2-camera
21 R = pose[:3, :3].T
22 t = - pose[:3, :3].T @ pose[:3, 3]
23 results[name] = {
24 "id": i,
25 "K": K,
26 "R": R,
27 "t": t,
28 "camera_id": 1
29 }
30 return results
31
32def load_replica_camera(dataset_path):
33 results = {}

Callers 2

4_test_unidepth.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected