diff --git a/nerfstudio/data/utils/data_utils.py b/nerfstudio/data/utils/data_utils.py index 11ce74d9d..51d57da67 100644 --- a/nerfstudio/data/utils/data_utils.py +++ b/nerfstudio/data/utils/data_utils.py @@ -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])