pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

Pulsar unified interface update

Open classner opened this issue 3 years ago • 9 comments

This commit addresses several braking changes to PyTorch3d camera conventions that made the unified system unusable at the moment (see https://github.com/facebookresearch/pytorch3d/issues/1352 and https://github.com/facebookresearch/pytorch3d/issues/1276). This commit fixes all these problems and tests using the test case from https://github.com/facebookresearch/pytorch3d/issues/1352. The results are equivalent for FoVOrthographicCameras, OrthographicCameras, FoVPerspectiveCameras and PerspectiveCameras.

We used to have a test case for the unified interface for Pulsar that compared the rendering results with some 'ground truth' images. This test seems to have been removed, thus leading to these breaking changes remaining undiscovered for a long time. Would be great if we could revive that test case!

classner avatar Oct 26 '22 23:10 classner

Hi @classner!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Dec 03 '22 08:12 facebook-github-bot

Any updates on this PR? I'm getting "Pulsar only supports a single focal length! " And I hope this PR can fix it

chenyuntc avatar Aug 23 '23 16:08 chenyuntc

Hi @chenyuntc , @nlml - I have left Meta since opening this PR, maybe @bottler can have a look?

classner avatar Sep 09 '23 19:09 classner

@classner Hi! Sorry I think it would be easiest if you do actually fill in the CLA again. I can work around it though if you don't want to.

bottler avatar Sep 21 '23 11:09 bottler

Done!

classner avatar Sep 26 '23 03:09 classner

@bottler has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Sep 26 '23 11:09 facebook-github-bot

Hi.

I made 2 easy updates to this locally for some test problems:

  • Instances of focal_length_conf *= ... I replaced with out-of-place focal_length_conf = focal_length_conf * ... because there are cases where focal_length_conf is an expanded tensor.
  • New versions of tests/data/test_pulsar_simple_pointcloud_sphere_azimuth{90,0}.0_fovperspective.png because the points are slightly different sizes.

I think I can push these back to your branch if you want.

However I have a problem with test_camera_pixels.py. It tries to check that all the renderers are pixel-perfect in their interpretation of PerspectiveCameras, the most common camera object. This change breaks that test for the camera in ndc. I think that this code is assuming that width is greater than height, and that the fix is to replace width and height with max(width,height) and min(width, height) respectively in all the new code in this change. Do you agree? More generally, I think I'd expect this code to be symmetrical in width and height.

bottler avatar Oct 03 '23 12:10 bottler

Hmmm, in the renderer there is no assumption about the larger dimension in there - possibly in this preprocessing part? Worth a try looking at these scaling operations - they are mainly there to make Pulsar work well with the assumptions made in the PyTorch3D cameras, so you should have a better understanding than me about what those are at the various points. I might have snuck in a mistake there inadvertently.

classner avatar Oct 04 '23 20:10 classner