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

fix nerfstudio collate function #2965

Merged
merged 3 commits into from
May 6, 2024
Merged

Conversation

hturki
Copy link
Contributor

@hturki hturki commented Feb 27, 2024

This fixes the nerfstudio collate function in cases where metadata, distortion, or times isn't specified in the cameras structure to collate.

metadata = None

if batch[0].distortion_params is not None:
assert all(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this assertion for distortion_params is redundant since at the beginning of the function, we have

        assert all((cam.distortion_params is None for cam in batch)) or all(
            (cam.distortion_params is not None for cam in batch)

distortion_params = None

if batch[0].times is not None:
assert all((cam.times is not None for cam in batch)), "All cameras must have times present or absent."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this assert to the beginning of the function just like what we did for distortion_params?

metadata = {key: op([cam.metadata[key] for cam in batch], dim=0) for key in metadata_keys}
if batch[0].metadata is not None:
metadata_keys = batch[0].metadata.keys()
assert all(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this assert to the beginning of the function just like what we did for distortion_params?

@hturki
Copy link
Contributor Author

hturki commented May 2, 2024

@jb-ye hopefully the latest update addresses your PR feedback!

@jb-ye jb-ye merged commit f2a7380 into nerfstudio-project:main May 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants