Type and docs fixes (#1170)

This commit is contained in:
Brent Yi authored and GitHub committed 2022-12-26 09:04:24 -07:00
1 parent b375727f7e
commit 5495a8e146
2 files changed
+12 -10

No files matched your search

+3 -3
View File
@@ -67,7 +67,7 @@ class NerfactoModelConfig(ModelConfig):
"""How far along the ray to start sampling.""" """How far along the ray to start sampling."""
far_plane: float = 1000.0 far_plane: float = 1000.0
"""How far along the ray to stop sampling.""" """How far along the ray to stop sampling."""
background_color: Literal["background", "last_sample"] = "last_sample" background_color: Literal["random", "last_sample"] = "last_sample"
"""Whether to randomize the background color.""" """Whether to randomize the background color."""
num_levels: int = 16 num_levels: int = 16
"""Number of levels of the hashmap for the base mlp.""" """Number of levels of the hashmap for the base mlp."""
@@ -75,8 +75,8 @@ class NerfactoModelConfig(ModelConfig):
"""Maximum resolution of the hashmap for the base mlp.""" """Maximum resolution of the hashmap for the base mlp."""
log2_hashmap_size: int = 19 log2_hashmap_size: int = 19
"""Size of the hashmap for the base mlp""" """Size of the hashmap for the base mlp"""
num_proposal_samples_per_ray: Tuple[int] = (256, 96) num_proposal_samples_per_ray: Tuple[int, ...] = (256, 96)
"""Number of samples per ray for the proposal network.""" """Number of samples per ray for each proposal network."""
num_nerf_samples_per_ray: int = 48 num_nerf_samples_per_ray: int = 48
"""Number of samples per ray for the nerf network.""" """Number of samples per ray for the nerf network."""
proposal_update_every: int = 5 proposal_update_every: int = 5
+9 -7
View File
@@ -57,7 +57,7 @@ class ExportPointCloud(Exporter):
bounding_box_min: Tuple[float, float, float] = (-1, -1, -1) bounding_box_min: Tuple[float, float, float] = (-1, -1, -1)
"""Minimum of the bounding box, used if use_bounding_box is True.""" """Minimum of the bounding box, used if use_bounding_box is True."""
bounding_box_max: Tuple[float, float, float] = (1, 1, 1) bounding_box_max: Tuple[float, float, float] = (1, 1, 1)
"""Minimum of the bounding box, used if use_bounding_box is True.""" """Maximum of the bounding box, used if use_bounding_box is True."""
num_rays_per_batch: int = 32768 num_rays_per_batch: int = 32768
"""Number of rays to evaluate per batch. Decrease if you run out of memory.""" """Number of rays to evaluate per batch. Decrease if you run out of memory."""
std_ratio: float = 10.0 std_ratio: float = 10.0
@@ -314,18 +314,20 @@ class ExportMarchingCubesMesh(Exporter):
raise NotImplementedError("Marching cubes not implemented yet.") raise NotImplementedError("Marching cubes not implemented yet.")
Commands = Union[ Commands = tyro.conf.FlagConversionOff[
Annotated[ExportPointCloud, tyro.conf.subcommand(name="pointcloud")], Union[
Annotated[ExportTSDFMesh, tyro.conf.subcommand(name="tsdf")], Annotated[ExportPointCloud, tyro.conf.subcommand(name="pointcloud")],
Annotated[ExportPoissonMesh, tyro.conf.subcommand(name="poisson")], Annotated[ExportTSDFMesh, tyro.conf.subcommand(name="tsdf")],
Annotated[ExportMarchingCubesMesh, tyro.conf.subcommand(name="marching-cubes")], Annotated[ExportPoissonMesh, tyro.conf.subcommand(name="poisson")],
Annotated[ExportMarchingCubesMesh, tyro.conf.subcommand(name="marching-cubes")],
]
] ]
def entrypoint(): def entrypoint():
"""Entrypoint for use with pyproject scripts.""" """Entrypoint for use with pyproject scripts."""
tyro.extras.set_accent_color("bright_yellow") tyro.extras.set_accent_color("bright_yellow")
tyro.cli(tyro.conf.FlagConversionOff[Commands]).main() tyro.cli(Commands).main()
if __name__ == "__main__": if __name__ == "__main__":