Spaces:
Running on Zero
Running on Zero
Download src/model/decoder/decoder.py from ACOM7/Just_For_PLC_Test: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/ACOM7/Just_For_PLC_Test/resolve/main/src/model/decoder/decoder.py
- Command line
-
hf download hf://spaces/ACOM7/Just_For_PLC_Test/src/model/decoder/decoder.py
-
curl -L -o decoder.py https://huggingface.co/spaces/ACOM7/Just_For_PLC_Test/resolve/main/src/model/decoder/decoder.py
1.16 kB
| from abc import ABC, abstractmethod | |
| from dataclasses import dataclass | |
| from typing import Generic, Literal, TypeVar | |
| from jaxtyping import Float | |
| from torch import Tensor, nn | |
| from ..types import Gaussians | |
| DepthRenderingMode = Literal[ | |
| "depth", | |
| "log", | |
| "disparity", | |
| "relative_disparity", | |
| ] | |
| class DecoderOutput: | |
| color: Float[Tensor, "batch view 3 height width"] | |
| depth: Float[Tensor, "batch view height width"] | None | |
| alpha: Float[Tensor, "batch view height width"] | None | |
| lod_rendering: dict | None | |
| T = TypeVar("T") | |
| class Decoder(nn.Module, ABC, Generic[T]): | |
| cfg: T | |
| def __init__(self, cfg: T) -> None: | |
| super().__init__() | |
| self.cfg = cfg | |
| def forward( | |
| self, | |
| gaussians: Gaussians, | |
| extrinsics: Float[Tensor, "batch view 4 4"], | |
| intrinsics: Float[Tensor, "batch view 3 3"], | |
| near: Float[Tensor, "batch view"], | |
| far: Float[Tensor, "batch view"], | |
| image_shape: tuple[int, int], | |
| depth_mode: DepthRenderingMode | None = None, | |
| ) -> DecoderOutput: | |
| pass | |