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

Function _save_image_tensor

src/sharp/utils/gsplat.py:35–37  ·  view source on GitHub ↗
(tensor: torch.Tensor, suffix: str)

Source from the content-addressed store, hash-verified

33 raise RuntimeError("We only support saving rendering of batch size = 1")
34
35 def _save_image_tensor(tensor: torch.Tensor, suffix: str):
36 np_array = tensor.permute(1, 2, 0).numpy()
37 io.save_image(np_array, (output_folder / filename).with_suffix(suffix))
38
39 color = (rendering.color[0].cpu() * 255.0).to(dtype=torch.uint8)
40 colorized_depth = vis.colorize_depth(rendering.depth[0], val_max=100.0)

Callers 1

write_renderingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected