fix: relax backgrounds shape assertion when packed=True#938
Open
jashshah999 wants to merge 1 commit into
Open
Conversation
When packed=True, means2d shape is (nnz, 2) so image_dims is empty. The assertion backgrounds.shape == () + (channels,) is wrong because backgrounds should be (C, channels) where C is the number of cameras. Relax the assertion to only check the last dimension matches channels when packed, since the batch dimensions vary. Fixes nerfstudio-project#826.
|
Thanks for your contribution! We haven't seen activity here in a while. If you're still interested, please let us know within 30 days — otherwise we'll close this out as we see fit. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When
packed=True,means2d.shapeis(nnz, 2)soimage_dims = means2d.shape[:-2]is(). The assertionbackgrounds.shape == () + (channels,)then requires backgrounds to be(channels,), but it should be(C, channels)whereCis the number of cameras (each image can have a different background).Fix
When packed, only check that the last dimension of backgrounds matches
channels. The batch dimensions vary depending on the number of cameras.Fixes #826.