MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / __init__

Method __init__

model/model_utils.py:525–552  ·  view source on GitHub ↗
(self, opt: Options, **model_kwargs)

Source from the content-addressed store, hash-verified

523
524class SplatPredictor(nn.Module):
525 def __init__(self, opt: Options, **model_kwargs):
526 super().__init__()
527 self.opt = opt
528 self.decoder = SplatDecoder(opt, **model_kwargs)
529 self.patch_size = opt.patch_size
530
531 # # Upsampler
532 self.decoder_ratio = opt.decoder_ratio
533 if self.decoder_ratio > 0:
534 self.gaussian_upsampler = GaussianUpsampler(width=opt.hidden_dim,
535 ch_decay=2,
536 up_ratio=(2**self.decoder_ratio),
537 low_channels=opt.decoder_dim,
538 window_size=opt.window_size,
539 opt=opt)
540 transformer_dim = self.gaussian_upsampler.out_channels
541 else:
542 transformer_dim = opt.hidden_dim
543
544 self.gs_predictor = GSPredictor(opt, **model_kwargs)
545 self.gs_predictor.predictor.keep_dynamic = True # keep dynamic for post combination
546
547 if opt.use_dino:
548 self.condition_encoder = Dinov2Wrapper(model_name="dinov2_vitb14_reg")
549 self.condition_dim = 768
550
551 self.gs_dynamic_predictor = GSDynamicDecoder(opt, transformer_dim=self.gs_predictor.predictor.embed_dim, bias=True)
552 self.encoder_proj = nn.Linear(192, 192, bias=False) # hard code for now
553
554 def state_dict(self, **kwargs):
555 # remove the condition encoder from the state dict

Callers

nothing calls this directly

Calls 6

GaussianUpsamplerClass · 0.90
Dinov2WrapperClass · 0.90
SplatDecoderClass · 0.85
GSPredictorClass · 0.85
GSDynamicDecoderClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected