Spaces:
Running on Zero
Running on Zero
multimodalart HF Staff
Learn2Splat ZeroGPU demo: app, vendored optgs, prebuilt sm_120 wheels
9196862 verified Download optgs/model/decoder/decoder_splatting_cuda.py from hugging-apps/learn2splat: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/spaces/hugging-apps/learn2splat/resolve/main/optgs/model/decoder/decoder_splatting_cuda.py
- Command line
-
hf download hf://spaces/hugging-apps/learn2splat/optgs/model/decoder/decoder_splatting_cuda.py
-
curl -L -o decoder_splatting_cuda.py https://huggingface.co/spaces/hugging-apps/learn2splat/resolve/main/optgs/model/decoder/decoder_splatting_cuda.py
1.66 kB
| from dataclasses import dataclass | |
| from typing import Literal | |
| from .cuda_splatting import render_cuda, render_depth_cuda | |
| from .splatting_cuda_decoder import SplattingCUDADecoder | |
| class InriaDecoderSplattingCUDACfg: | |
| name: Literal["inria"] | |
| scale_invariant: bool | |
| # False: pass scales+rotations and let the CUDA kernel compute the covariance | |
| # (matches 3DGS-LM byte-for-byte). True: precompute Python-side and pass | |
| # cov3D_precomp (~42 dB pixel drift from LM, slightly faster on repeat calls). | |
| use_covariances: bool = False | |
| class InriaDecoderSplattingCUDA(SplattingCUDADecoder[InriaDecoderSplattingCUDACfg]): | |
| """Inria diff_gaussian_rasterization backend. Only the rasterizer calls differ from the | |
| shared base; see splatting_cuda_decoder.SplattingCUDADecoder for the orchestration.""" | |
| def _raster(self, ext, intr, near, far, image_shape, bg, means, covars, shs, opacities, | |
| scales, rotations_wxyz, means2d_out, means2d_abs_out=None): | |
| # means2d_abs_out is FastGS-only; the inria backend has no abs-gradient and ignores it. | |
| return render_cuda( | |
| ext, intr, near, far, image_shape, bg, means, covars, shs, opacities, | |
| scale_invariant=self.cfg.scale_invariant, | |
| gaussian_scales=scales, | |
| gaussian_rotations=rotations_wxyz, | |
| means2d_out=means2d_out, | |
| ) | |
| def _raster_depth(self, ext, intr, near, far, image_shape, means, covars, opacities, mode): | |
| return render_depth_cuda( | |
| ext, intr, near, far, image_shape, means, covars, opacities, | |
| mode=mode, scale_invariant=self.cfg.scale_invariant, | |
| ) | |