Instant-ngp fuse encoding with network (#171)

Instant-ngp fuse encoding with network
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-07-18 15:37:27 -07:00
1 parent 3df29717dd
commit 7c9b837ba9
4 files changed
+19 -25

No files matched your search

+1 -1
View File
@@ -91,7 +91,7 @@ class ImageDataset(torch.utils.data.Dataset):
def get_image(self, image_idx: int):
"""Returns a 3 channel image."""
image = torch.from_numpy(self.get_numpy_image(image_idx).astype("float32") / 255.0)
if self.alpha_color is not None:
if self.alpha_color is not None and image.shape[-1] == 4:
assert image.shape[-1] == 4
image = image[:, :, :3] * image[:, :, -1:] + self.alpha_color * (1.0 - image[:, :, -1:])
else: