mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-14 20:03:49 +08:00
Change depth from float64 to float32 (#3453)
This commit is contained in:
1 parent
01d3f73e2c
commit
6da94443fd
1 file changed
+2
-2
@@ -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])
|
||||
Reference in new issue
Block a user