Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sharp/utils/gaussians.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,15 @@ def load_ply(path: Path) -> tuple[Gaussians3D, SceneMetaData]:
# Parse color space.
color_space_index = supplement_data.get("color_space", 1)
color_space = cs_utils.decode_color_space(color_space_index)
colors = torch.from_numpy(colors).view(1, -1, 3).float()

if color_space == "sRGB":
colors = cs_utils.sRGB2linearRGB(colors)

mean_vectors = torch.from_numpy(mean_vectors).view(1, -1, 3).float()
quaternions = torch.from_numpy(quaternions).view(1, -1, 4).float()
singular_values = torch.exp(torch.from_numpy(scale_logits).view(1, -1, 3)).float()
opacities = torch.sigmoid(torch.from_numpy(opacity_logits).view(1, -1)).float()
colors = torch.from_numpy(colors).view(1, -1, 3).float()

gaussians = Gaussians3D(
mean_vectors=mean_vectors,
Expand Down
2 changes: 1 addition & 1 deletion src/sharp/utils/gsplat.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def forward(

# Colorspace conversion.
if self.color_space == "sRGB":
pass
rendered_color = cs_utils.linearRGB2sRGB(rendered_color)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thêm color render alias

elif self.color_space == "linearRGB":
rendered_color = cs_utils.linearRGB2sRGB(rendered_color)
else:
Expand Down