Learn2Splat / optgs /dataset /view_sampler /view_sampler_all.py
SteEsp's picture
Add Docker-based Learn2Splat demo (viser GUI)
78d2329 verified
from dataclasses import dataclass
from typing import Literal
import torch
from jaxtyping import Float, Int64
from torch import Tensor
from .view_sampler import ViewSampler
@dataclass
class ViewSamplerAllCfg:
name: Literal["all"]
class ViewSamplerAll(ViewSampler[ViewSamplerAllCfg]):
def _sample_impl(
self,
scene: str,
extrinsics: Float[Tensor, "view 4 4"],
intrinsics: Float[Tensor, "view 3 3"],
device: torch.device = torch.device("cpu"),
**kwargs,
) -> tuple[
Int64[Tensor, " context_view"], # indices for context views
Int64[Tensor, " target_view"], # indices for target views
]:
v, _, _ = extrinsics.shape
all_frames = torch.arange(v, device=device)
return all_frames, all_frames
@property
def num_context_views(self) -> int:
return 0
@property
def num_target_views(self) -> int:
return 0