Summary: Indexing with a big matrix now fails with a ValueError, possibly because of pytorch improvements. Remove the testcase for it.
Reviewed By: davidsonic
Differential Revision: D42609741
fbshipit-source-id: 0a5a6632ed199cb942bfc4cc4ed347b72e491125
Summary:
According to the profiler trace D40326775, _check_valid_rotation_matrix is slow because of aten::all_close operation and _safe_det_3x3 bottlenecks. Disable the check by default unless environment variable PYTORCH3D_CHECK_ROTATION_MATRICES is set to 1.
Comparison after applying the change:
```
Profiling/Function get_world_to_view (ms) Transform_points(ms) specular(ms)
before 12.751 18.577 21.384
after 4.432 (34.7%) 9.248 (49.8%) 11.507 (53.8%)
```
Profiling trace:
https://pxl.cl/2h687
More details in https://docs.google.com/document/d/1kfhEQfpeQToikr5OH9ZssM39CskxWoJ2p8DO5-t6eWk/edit?usp=sharing
Reviewed By: kjchalup
Differential Revision: D40442503
fbshipit-source-id: 954b58de47de235c9d93af441643c22868b547d0
Summary:
This is quite a thin wrapper – not sure we need it. The motivation is that `Transform3d` is not as matrix-centric now, it can be converted to SE(3) logarithm equally easily.
It simplifies things like averaging cameras and getting axis-angle of camera rotation (previously, one would need to call `se3_log_map(cameras.get_world_to_camera_transform().get_matrix())`), now one fewer thing to call / discover.
Reviewed By: bottler
Differential Revision: D39928000
fbshipit-source-id: 85248d5b8af136618f1d08791af5297ea5179d19
Summary:
Previously, dtypes were not propagated correctly in composed transforms, resulting in errors when different dtypes were mixed. Even specifying a dtype in the constructor does not fix this. Neither does specifying the dtype for each composition function invocation (e.g. as a `kwarg` in `rotate_axis_angle`).
With the change, I also had to modify the default dtype of `RotateAxisAngle`, which was `torch.float64`; it is now `torch.float32` like for all other transforms. This was required because the fix in propagation broke some tests due to dtype mismatches.
This change in default dtype in turn broke two tests due to precision changes (calculations that were previously done in `torch.float64` were now done in `torch.float32`), so I changed the precision tolerances to be less strict. I chose the lowest power of ten that passed the tests here.
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1141
Reviewed By: patricklabatut
Differential Revision: D35192970
Pulled By: bottler
fbshipit-source-id: ba0293e8b3595dfc94b3cf8048e50b7a5e5ed7cf
Summary:
Add a test for Transform3d.stack, and make it work with composed transformations.
Fixes https://github.com/facebookresearch/pytorch3d/issues/1072 .
Reviewed By: patricklabatut
Differential Revision: D34211920
fbshipit-source-id: bfbd0895494ca2ad3d08a61bc82ba23637e168cc
Summary: Update all FB license strings to the new format.
Reviewed By: patricklabatut
Differential Revision: D33403538
fbshipit-source-id: 97a4596c5c888f3c54f44456dc07e718a387a02c
Summary:
Context: in the code we are releasing with CO3D dataset, we use `cuda()` on TensorProperties like Pointclouds and Cameras where we recursively move batch to a GPU. It would be good to push it to a release so we don’t need to depend on the nightly build.
Additionally, I aligned the logic of `.to("cuda")` without device index to the one of `torch.Tensor` where the current device is populated to index. It should not affect any actual use cases but some tests had to be changed.
Reviewed By: bottler
Differential Revision: D29659529
fbshipit-source-id: abe58aeaca14bacc68da3e6cf5ae07df3353e3ce
Summary: Deprecate the `so3_exponential_map()` function in favor of its alias `so3_exp_map()`: this aligns with the naming of `so3_log_map()` and the recently introduced `se3_exp_map()` / `se3_log_map()` pair.
Reviewed By: bottler
Differential Revision: D29329966
fbshipit-source-id: b6f60b9e86b2995f70b1fbeb16f9feea05c55de9
Summary: Make Transform3d.to() not ignore a different dtype when device is the same and no copy is requested. Fix other methods where dtype is ignored.
Reviewed By: nikhilaravi
Differential Revision: D28981171
fbshipit-source-id: 4528e6092f4a693aecbe8131ede985fca84e84cf
Summary:
Tidy uses of `torch.device` in `Transforms3d`:
- Allow `str` or `torch.device` in user-facing methods
- Consistently use `torch.device` for internal types
- Fix comparison of devices
Reviewed By: nikhilaravi
Differential Revision: D28929486
fbshipit-source-id: bd1d6cc7ede3d8fd549fd3224a9b07eec53f8164
Summary: Make `to` on Transform3D carry its member _transforms.
Reviewed By: nikhilaravi
Differential Revision: D25978611
fbshipit-source-id: 12b39e7a657f28d59ca60800bf9f4193a2c08197
Summary:
Allows to initialize a Transform3D object with a batch of user-defined transformation matrices:
```
t = Transform3D(matrix=torch.randn(2, 4, 4))
```
Reviewed By: nikhilaravi
Differential Revision: D20693475
fbshipit-source-id: dccc49b2ca4c19a034844c63463953ba8f52c1bc
Summary: The shebang line `#!<path to interpreter>` is only required for Python scripts, so remove it on source files for class or function definitions. Additionally explicitly mark as executable the actual Python scripts in the codebase.
Reviewed By: nikhilaravi
Differential Revision: D20095778
fbshipit-source-id: d312599fba485e978a243292f88a180d71e1b55a
Summary: Fixed the rotation matrices generated by the RotateAxisAngle class and updated the tests. Added documentation for Transforms3d to clarify the conventions.
Reviewed By: gkioxari
Differential Revision: D19912903
fbshipit-source-id: c64926ce4e1381b145811557c32b73663d6d92d1