MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / depth_read_kitti

Function depth_read_kitti

eval_code/recons/utils/depth.py:81–92  ·  view source on GitHub ↗
(filename: str)

Source from the content-addressed store, hash-verified

79
80
81def depth_read_kitti(filename: str):
82 # loads depth map D from png file
83 # and returns it as a numpy array,
84 # for details see readme.txt
85 img_pil = Image.open(filename)
86 depth_png = np.array(img_pil, dtype=int)
87 # make sure we have a proper 16bit depth map here.. not 8bit!
88 assert np.max(depth_png) > 255
89
90 depth = depth_png.astype(float) / 256.0
91 depth[depth_png == 0] = -1.0
92 return depth
93
94def depth_read_nyu(filename: str):
95 return np.load(filename)

Callers 1

depth.pyFile · 0.85

Calls 1

openMethod · 0.80

Tested by

no test coverage detected