mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 15:28:49 +08:00
Merge pull request #21 from ethanweber/tancik/type_check
Add type checking
This commit is contained in:
3 files changed
+9
-7
No files matched your search
@@ -34,4 +34,4 @@ jobs:
|
|||||||
pylint mattport --max-line-length=120 --generated-members=numpy.*,torch.*,cv2.*,cv.* --good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W --disable=too-many-arguments --disable=fixme
|
pylint mattport --max-line-length=120 --generated-members=numpy.*,torch.*,cv2.*,cv.* --good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W --disable=too-many-arguments --disable=fixme
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest tests --ignore tests/nerf/test_ray_generator.py
|
pytest tests --ignore tests/nerf/test_ray_generator.py --typeguard-packages=mattport --torchtyping-patch-typeguard
|
||||||
Vendored
+3
-1
@@ -18,7 +18,9 @@
|
|||||||
"--src=${workspaceFolder}"
|
"--src=${workspaceFolder}"
|
||||||
],
|
],
|
||||||
"python.testing.pytestArgs": [
|
"python.testing.pytestArgs": [
|
||||||
"tests"
|
"--ignore=tests/nerf/test_ray_generator.py",
|
||||||
|
"--typeguard-packages=mattport",
|
||||||
|
"--torchtyping-patch-typeguard"
|
||||||
],
|
],
|
||||||
"python.testing.unittestEnabled": false,
|
"python.testing.unittestEnabled": false,
|
||||||
"python.testing.pytestEnabled": true,
|
"python.testing.pytestEnabled": true,
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ class Renderer(nn.Module):
|
|||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
field_output_dict: Dict["str", TensorType[..., "num_samples", "features"]],
|
field_output_dict: Dict["str", TensorType[..., "num_samples", -1]],
|
||||||
deltas: TensorType[..., "num_samples"],
|
deltas: TensorType[..., "num_samples"],
|
||||||
) -> TensorType[..., "out_dim"]:
|
) -> TensorType[..., "out_dim"]:
|
||||||
"""Composite samples along ray and render image
|
"""Composite samples along ray and render image
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
in_tensor (TensorType[..., "num_samples", "features"]): feature for each sample
|
in_tensor (TensorType[..., "num_samples", -1]): feature for each sample
|
||||||
deltas (TensorType[..., "num_samples"]): depth of each sample
|
deltas (TensorType[..., "num_samples"]): depth of each sample
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -50,13 +50,13 @@ class RGB(Renderer):
|
|||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
field_output_dict: Dict["str", TensorType[..., "num_samples", "features"]],
|
field_output_dict: Dict[str, TensorType[..., "num_samples", -1]],
|
||||||
deltas: TensorType[..., "num_samples"],
|
deltas: TensorType[..., "num_samples"],
|
||||||
) -> TensorType[..., "out_dim"]:
|
) -> TensorType[..., "out_dim"]:
|
||||||
"""Composite samples along ray and render color image
|
"""Composite samples along ray and render color image
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
in_tensor (TensorType[..., "num_samples", 3]): RGB for each sample
|
in_tensor (TensorType[..., "num_samples", -1]): RGB for each sample
|
||||||
deltas (TensorType[..., "num_samples"]): depth influence for each sample
|
deltas (TensorType[..., "num_samples"]): depth influence for each sample
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -88,7 +88,7 @@ class Depth(Renderer):
|
|||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
field_output_dict: Dict["str", TensorType[..., "num_samples", "features"]],
|
field_output_dict: Dict["str", TensorType[..., "num_samples", -1]],
|
||||||
deltas: TensorType[..., "num_samples"],
|
deltas: TensorType[..., "num_samples"],
|
||||||
) -> TensorType[..., "out_dim"]:
|
) -> TensorType[..., "out_dim"]:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
Reference in new issue
Block a user