mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 07:05:44 +08:00
Final typing fixes + add Pyright to CI (#1944)
* knocking out a couple * Fix more errors * Add pyright * Remove some unnecessary cv2 type ignores, warning on missing imports (for missing tinycudann) * Minor annotation fixes * Update docs * Drop `None` from temporal distortion output --------- Co-authored-by: Brent Yi <yibrenth@gmail.com>
This commit is contained in:
1 parent
08e3a1f1a6
commit
2b0831b6d4
28 files changed
+110
-71
No files matched your search
@@ -61,7 +61,7 @@ def get_depth_image_from_path(
|
||||
height: int,
|
||||
width: int,
|
||||
scale_factor: float,
|
||||
interpolation: int = cv2.INTER_NEAREST, # type: ignore
|
||||
interpolation: int = cv2.INTER_NEAREST,
|
||||
) -> torch.Tensor:
|
||||
"""Loads, rescales and resizes depth images.
|
||||
Filepath points to a 16-bit or 32-bit depth image, or a numpy array `*.npy`.
|
||||
@@ -78,9 +78,9 @@ def get_depth_image_from_path(
|
||||
"""
|
||||
if filepath.suffix == ".npy":
|
||||
image = np.load(filepath) * scale_factor
|
||||
image = cv2.resize(image, (width, height), interpolation=interpolation) # type: ignore
|
||||
image = cv2.resize(image, (width, height), interpolation=interpolation)
|
||||
else:
|
||||
image = cv2.imread(str(filepath.absolute()), cv2.IMREAD_ANYDEPTH) # type: ignore
|
||||
image = cv2.imread(str(filepath.absolute()), cv2.IMREAD_ANYDEPTH)
|
||||
image = image.astype(np.float64) * scale_factor
|
||||
image = cv2.resize(image, (width, height), interpolation=interpolation) # type: ignore
|
||||
image = cv2.resize(image, (width, height), interpolation=interpolation)
|
||||
return torch.from_numpy(image[:, :, np.newaxis])
|
||||
Reference in new issue
Block a user