From 6da94443fd7ba6114197944a20a8b2de7c1b838d Mon Sep 17 00:00:00 2001 From: Nicholas Pfaff <53228351+nepfaff@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:51:05 -0400 Subject: [PATCH] Change depth from float64 to float32 (#3453) --- nerfstudio/data/utils/data_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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])