Skip to content

fix: relax backgrounds shape assertion when packed=True#938

Open
jashshah999 wants to merge 1 commit into
nerfstudio-project:mainfrom
jashshah999:fix-background-assertion
Open

fix: relax backgrounds shape assertion when packed=True#938
jashshah999 wants to merge 1 commit into
nerfstudio-project:mainfrom
jashshah999:fix-background-assertion

Conversation

@jashshah999

Copy link
Copy Markdown

What

When packed=True, means2d.shape is (nnz, 2) so image_dims = means2d.shape[:-2] is (). The assertion backgrounds.shape == () + (channels,) then requires backgrounds to be (channels,), but it should be (C, channels) where C is 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.

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.

@vince-brisebois vince-brisebois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(removed)

@gsplat-engage-bot

Copy link
Copy Markdown

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!

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.

assert on backgrounds.shape seems wrong in function "rasterize_to_pixels" when packed is True

2 participants