Change depth from float64 to float32 (#3453)

This commit is contained in:
Nicholas Pfaff authored and GitHub committed 2024-09-28 16:51:05 -07:00
1 parent 01d3f73e2c
commit 6da94443fd
1 file changed
+2 -2
+2 -2
View File
@@ -78,10 +78,10 @@ def get_depth_image_from_path(
Depth image torch tensor with shape [height, width, 1].
"""
if filepath.suffix == ".npy":
image = np.load(filepath) * scale_factor
image = np.load(filepath).astype(np.float32) * scale_factor
image = cv2.resize(image, (width, height), interpolation=interpolation)
else:
image = cv2.imread(str(filepath.absolute()), cv2.IMREAD_ANYDEPTH)
image = image.astype(np.float64) * scale_factor
image = image.astype(np.float32) * scale_factor
image = cv2.resize(image, (width, height), interpolation=interpolation)
return torch.from_numpy(image[:, :, np.newaxis])