MCPcopy Index your code
hub / github.com/DSL-Lab/StreamSplat / main

Function main

train_decoder.py:25–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23import warnings
24
25def main():
26 set_seed(42)
27 os.environ["WANDB__SERVICE_WAIT"] = "300"
28
29 opt = tyro.cli(AllConfigs)
30
31 # Load dataset based on root_path
32 dataset_map = {
33 "co3d": Co3DDataset,
34 "re10k": Re10kDataset,
35 "davis": DavisDataset,
36 'vos': VOSDataset,
37 'combined': CombinedDataset
38 }
39
40 for key, Dataset in dataset_map.items():
41 if key in opt.root_path.lower():
42 dataset_nm = key
43 print(f"Loading dataset: {key}")
44 break
45 else:
46 raise ValueError(f"Dataset {opt.root_path} not supported")
47
48 # Batch size management
49 initial_batch_size = opt.batch_size
50 target_batch_size = opt.batch_size
51 warmup_epochs = 10
52 current_batch_size = initial_batch_size
53
54 torch.set_float32_matmul_precision('high')
55
56 accelerator = Accelerator(
57 mixed_precision=opt.mixed_precision,
58 gradient_accumulation_steps=opt.gradient_accumulation_steps,
59 )
60
61 train_dataset = Dataset(opt=opt, shuffle=True, training=True)
62 train_dataloader = torch.utils.data.DataLoader(
63 train_dataset,
64 batch_size=current_batch_size,
65 num_workers=opt.num_workers,
66 pin_memory=True,
67 shuffle=not isinstance(train_dataset, torch.utils.data.IterableDataset),
68 drop_last=True,
69 )
70
71 test_dataset = Dataset(opt=opt, shuffle=True, training=False)
72 test_dataloader = torch.utils.data.DataLoader(
73 test_dataset,
74 batch_size=opt.batch_size * 2,
75 shuffle=not isinstance(test_dataset, torch.utils.data.IterableDataset),
76 num_workers=0,
77 pin_memory=True,
78 drop_last=False,
79 )
80
81 model = SplatModel(opt)
82

Callers 1

train_decoder.pyFile · 0.70

Calls 9

state_dictMethod · 0.95
load_state_dictMethod · 0.95
trainMethod · 0.95
stepMethod · 0.95
SplatModelClass · 0.90
augment_batchFunction · 0.90
_freeze_predictorMethod · 0.80
backwardMethod · 0.45

Tested by

no test coverage detected