Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Mip-Splatting implementation #274

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion examples/datasets/colmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(
self.image_names = image_names # List[str], (num_images,)
self.image_paths = image_paths # List[str], (num_images,)
self.camtoworlds = camtoworlds # np.ndarray, (num_images, 4, 4)
self.worldtocams = np.linalg.inv(camtoworlds) # np.ndarray, (num_images, 4, 4)
self.camera_ids = camera_ids # List[int], (num_images,)
self.Ks_dict = Ks_dict # Dict of camera_id -> K
self.params_dict = params_dict # Dict of camera_id -> params
Expand Down Expand Up @@ -254,7 +255,8 @@ def __getitem__(self, item: int) -> Dict[str, Any]:
K = self.parser.Ks_dict[camera_id].copy() # undistorted K
params = self.parser.params_dict[camera_id]
camtoworlds = self.parser.camtoworlds[index]

worldtocams = self.parser.worldtocams[index]

if len(params) > 0:
# Images are distorted. Undistort them.
mapx, mapy = (
Expand All @@ -277,6 +279,7 @@ def __getitem__(self, item: int) -> Dict[str, Any]:
data = {
"K": torch.from_numpy(K).float(),
"camtoworld": torch.from_numpy(camtoworlds).float(),
"worldtocam": torch.from_numpy(worldtocams).float(),
"image": torch.from_numpy(image).float(),
"image_id": item, # the index of the image in the dataset
}
Expand Down
Loading