-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
metadata = None | ||
|
||
if batch[0].distortion_params is not None: | ||
assert all( |
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
@jb-ye hopefully the latest update addresses your PR feedback! |
This fixes the nerfstudio collate function in cases where metadata, distortion, or times isn't specified in the cameras structure to collate.