INNER CODE UNIT · Python
uid
jayin92/Skyfall-GS · gaussian_renderer/__init__.py:102
uid = min(6, len(pc.appearance_embeddings)-1)
# print(f"Using embedding from uid {uid}")
embedding = pc.appearance_embeddings[uid]
if pc.appearance_enabled and embedding is not None:
embedding_expanded = embedding[None].repeat(len(means2D), 1)
assert pc.appearance_mlp is not None
assert pc._embeddings is not None
colors_toned = pc.appearance_mlp(pc._embeddings, embedding_expanded, pc.get_features).clamp_max(1.0)
shdim = (pc.max_sh_degree + 1) ** 2
colors_toned = colors_toned.view(-1, shdim, 3).transpose(1, 2).contiguous().clamp_max(1.0)
dir_pp = (pc.get_xyz - viewpoint_camera.camera_center.repeat(pc.get_features.shape[0], 1))
dir_pp_normalized = dir_pp/dir_pp.norm(dim=1, keepdim=True)
colors_toned = eval_sh(pc.active_sh_degree, colors_toned, dir_pp_normalized)
colors_toned = torch.clamp_min(colors_toned + 0.5, 0.0)
colors_precomp = colors_toned
elif override_color is None: