MCPcopy Create free account
hub / github.com/apple/ml-sharp / render_cli

Function render_cli

src/sharp/cli/render.py:39–67  ·  view source on GitHub ↗

Predict Gaussians from input images.

(input_path: Path, output_path: Path, verbose: bool)

Source from the content-addressed store, hash-verified

37)
38@click.option("-v", "--verbose", is_flag=True, help="Activate debug logs.")
39def render_cli(input_path: Path, output_path: Path, verbose: bool):
40 """Predict Gaussians from input images."""
41 logging_utils.configure(logging.DEBUG if verbose else logging.INFO)
42
43 if not torch.cuda.is_available():
44 LOGGER.error("Rendering a checkpoint requires CUDA.")
45 exit(1)
46
47 output_path.mkdir(exist_ok=True, parents=True)
48
49 params = camera.TrajectoryParams()
50
51 if input_path.suffix == ".ply":
52 scene_paths = [input_path]
53 elif input_path.is_dir():
54 scene_paths = list(input_path.glob("*.ply"))
55 else:
56 LOGGER.error("Input path must be either directory or single PLY file.")
57 exit(1)
58
59 for scene_path in scene_paths:
60 LOGGER.info("Rendering %s", scene_path)
61 gaussians, metadata = load_ply(scene_path)
62 render_gaussians(
63 gaussians=gaussians,
64 metadata=metadata,
65 params=params,
66 output_path=(output_path / scene_path.stem).with_suffix(".mp4"),
67 )
68
69
70def render_gaussians(

Callers

nothing calls this directly

Calls 2

load_plyFunction · 0.90
render_gaussiansFunction · 0.85

Tested by

no test coverage detected