-
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
Pulsar unified interface update #1369
base: main
Are you sure you want to change the base?
Conversation
This commit addresses several braking changes to PyTorch3d camera conventions that made the unified system unusable at the moment (see facebookresearch#1352 and facebookresearch#1276). This commit fixes all these problems and tests using the test case from facebookresearch#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!
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. ProcessIn 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 If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Any updates on this PR? |
@@ -266,7 +270,10 @@ def _extract_intrinsics( # noqa: C901 | |||
afov = kwargs.get("fov", cameras.fov)[cloud_idx] | |||
if kwargs.get("degrees", cameras.degrees): | |||
afov *= math.pi / 180.0 |
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.
@classner This operation shouldn't be in-place I think!
Replacing afov *= math.pi / 180.0
with afov = afov * math.pi / 180.0
fixed issues with my code.
Thanks for this PR by the way!
Hi @chenyuntc , @nlml - I have left Meta since opening this PR, maybe @bottler can have a look? |
@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. |
Done! |
@bottler has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi. I made 2 easy updates to this locally for some test problems:
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. |
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. |
Error "Pulsar only supports a single focal length! " on consecutive renders. Suggestion to fix it: Replacing focal_length_conf = kwargs.get("focal_length", cameras.focal_length)[ with focal_length_conf = kwargs.get("focal_length", cameras.focal_length)[ And similar to other accesses to the camera parameters since they seem to get in-place updated in the _extract_intrinsics function. |
This commit addresses several braking changes to PyTorch3d camera conventions that made the unified system unusable at the moment (see #1352 and #1276). This commit fixes all these problems and tests using the test case from #1352. The results are equivalent for
FoVOrthographicCameras
,OrthographicCameras
,FoVPerspectiveCameras
andPerspectiveCameras
.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!