Summary:
Efficient PnP algorithm to fit 2D to 3D correspondences under perspective assumption.
Benchmarked both variants of nullspace and pick one; SVD takes 7 times longer in the 100K points case.
Reviewed By: davnov134, gkioxari
Differential Revision: D20095754
fbshipit-source-id: 2b4519729630e6373820880272f674829eaed073
Summary: Made a CameraBase class. Added `unproject_points` method for each camera class.
Reviewed By: nikhilaravi
Differential Revision: D20373602
fbshipit-source-id: 7e3da5ae420091b5fcab400a9884ef29ad7a7343
Summary: Estimates normals of a point cloud.
Reviewed By: gkioxari
Differential Revision: D20860182
fbshipit-source-id: 652ec2743fa645e02c01ffa37c2971bf27b89cef
Summary: It seemed that even though the chamfer diff was rebased on top of the knn autograd diff, some of the final updates did not get applied. I'm really surprised that the sandcastle tests did not fail and prevent the diff from landing.
Reviewed By: gkioxari
Differential Revision: D21066156
fbshipit-source-id: 5216efe95180c1b6082d0bac404fa1920cfb7b02
Summary: knn is more general and faster than the nearest_neighbor code, so remove the latter.
Reviewed By: gkioxari
Differential Revision: D20816424
fbshipit-source-id: 75d6c44d17180752d0c9859814bbdf7892558158
Summary:
Allow Pointclouds objects and heterogenous data to be provided for Chamfer loss. Remove "none" as an option for point_reduction because it doesn't make sense and in the current implementation is effectively the same as "sum".
Possible improvement: create specialised operations for sum and cosine_similarity of padded tensors, to avoid having to create masks. sum would be useful elsewhere.
Reviewed By: gkioxari
Differential Revision: D20816301
fbshipit-source-id: 0f32073210225d157c029d80de450eecdb64f4d2
Summary: Remove `bin_size` and `max_faces_per_pixel` from being specified. This means the coarse-to-fine rasterization will be used by default and will help avoid confusion with the naive version.
Reviewed By: jcjohnson
Differential Revision: D20908905
fbshipit-source-id: c181c88e844d888aa81a36870918307961dc1175
Summary:
Pytorch 1.5 is coming soon. I imagine we will want the ability to upload conda packages for pytorch3d to anaconda cloud for each of pytorch 1.4 and pytorch 1.5. This change adds the dependent pytorch version to the name of the conda package to make that feasible.
As an example, a built package after this change will have a name like `linux-64/pytorch3d-0.1.1-py38_cu100_pyt14.tar.bz2`, instead of simply `linux-64/pytorch3d-0.1.1-py38_cu100.tar.bz2`.
Also some tiny cleanup of circleci config.
Other alternatives: (1) forcing users to update pytorch and pytorch3d together, (2) trying to get away with one build for multiple pytorch versions.
Reviewed By: nikhilaravi
Differential Revision: D20599039
fbshipit-source-id: 20164eda4a5141afed47b3596e559950d796ffc9
Summary: Interface and working implementation of ragged KNN. Benchmarks (which aren't ragged) haven't slowed. New benchmark shows that ragged is faster than non-ragged of the same shape.
Reviewed By: jcjohnson
Differential Revision: D20696507
fbshipit-source-id: 21b80f71343a3475c8d3ee0ce2680f92f0fae4de
Summary: The conda build process generates some files of its own, which we don't want to catch in our test for copyright notices.
Reviewed By: nikhilaravi, patricklabatut
Differential Revision: D20868566
fbshipit-source-id: 76a786a3eb9a674d59e630cc06f346e8b82258a4
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:
1. Introduced weights to Umeyama implementation. This will be needed for weighted ePnP but is useful on its own.
2. Refactored to use the same code for the Pointclouds mask and passed weights.
3. Added test cases with random weights.
4. Fixed a bug in tests that calls the function with 0 points (fails randomly in Pytorch 1.3, will be fixed in the next release: https://github.com/pytorch/pytorch/issues/31421 ).
Reviewed By: gkioxari
Differential Revision: D20070293
fbshipit-source-id: e9f549507ef6dcaa0688a0f17342e6d7a9a4336c
Summary: Do not create output files with invalid inputs to `save_{obj,ply}()`.
Reviewed By: bottler
Differential Revision: D20720282
fbshipit-source-id: 3b611a10da6f6eecacab2a1900bf16f89e2000aa
Summary:
Similar to D20392526, PLY files without vertices or faces should be allowed:
- a PLY with only vertices can represent a point cloud
- a PLY without any vertex or face is just empty
- a PLY with faces referencing inexistent vertices has invalid data
Reviewed By: gkioxari
Differential Revision: D20400330
fbshipit-source-id: 35a5f072603fd221f382c7faad5f37c3e0b49bb1
Summary:
Enable `black` + `isort` (via `pyfmt`) i.e. `BLACK` fbsource linter.
NOTE: the `BLACK` fbsource linter (and `black` itself) is (by design) ***not*** configurable. This forces aligning the existing options used by the tools invoked in `dev/linter.sh` (for 3rd party developers) with `BLACK` fbsource linting. Without this reconciliation, the different linters (used internally or by 3rd party developers) would simply conflict with each other resulting in artificial back-and-forth changes (for instance line width which `BLACK` forces to 88 characters).
Reviewed By: nikhilaravi
Differential Revision: D20558374
fbshipit-source-id: 614fa00664f8eb9d2de7438c29b807dfbf36ad20
Summary: Run linter after recent changes. Fix long comment in knn.h which clang-format has reflowed badly. Add crude test that code doesn't call deprecated `.type()` or `.data()`.
Reviewed By: nikhilaravi
Differential Revision: D20692935
fbshipit-source-id: 28ce0308adae79a870cb41a810b7cf8744f41ab8
Summary:
OBJ files without vertices or faces should be allowed:
- an OBJ with only vertices can represent a point cloud
- an OBJ without any vertex or face is just empty
- an OBJ with faces referencing inexistent vertices has invalid data
Reviewed By: gkioxari
Differential Revision: D20392526
fbshipit-source-id: e72c846ff1e5787fb11d527af3fefa261f9eb0ee
Summary:
Implements K-Nearest Neighbors with C++ and CUDA versions.
KNN in CUDA is highly nontrivial. I've implemented a few different versions of the kernel, and we heuristically dispatch to different kernels based on the problem size. Some of the kernels rely on template specialization on either D or K, so we use template metaprogramming to compile specialized versions for ranges of D and K.
These kernels are up to 3x faster than our existing 1-nearest-neighbor kernels, so we should also consider swapping out `nn_points_idx` to use these kernels in the backend.
I've been working mostly on the CUDA kernels, and haven't converged on the correct Python API.
I still want to benchmark against FAISS to see how far away we are from their performance.
Reviewed By: bottler
Differential Revision: D19729286
fbshipit-source-id: 608ffbb7030c21fe4008f330522f4890f0c3c21a
Summary: CPU-only builds should be fixed by this change
Reviewed By: nikhilaravi
Differential Revision: D20598014
fbshipit-source-id: df098ec4c6c93d38515172805fe57cac7463c506
Summary: use assertClose in some tests, which enforces shape equality. Fixes some small problems, including graph_conv on an empty graph.
Reviewed By: nikhilaravi
Differential Revision: D20556912
fbshipit-source-id: 60a61eafe3c03ce0f6c9c1a842685708fb10ac5b
Summary: By accident I think, we have been nudging people to install python 3.6. Using 3.8 is fine.
Reviewed By: nikhilaravi
Differential Revision: D20597240
fbshipit-source-id: 7fb778f1b84746db28b6eef763564af5c5fffcd7
Summary:
Add a note about the difference between naive and coarse-to-fine rasterization to all the rendering tutorials.
Update the render pointclouds tutorial to wget the data file.
Reviewed By: gkioxari
Differential Revision: D20575257
fbshipit-source-id: a2806b9452438f97cb754f87e011c6e32e2545e4
Summary: Add pattern linter for PyTorch3D and SlowFast, this will suggest typo fixes whenever the wrong case is accidentally used.
Reviewed By: wanyenlo
Differential Revision: D20498696
fbshipit-source-id: 1a3f4702bd0dbe06e81d0f301b3ea38ea62e7885
Summary:
Create extrinsic parameters from eye point.
Create the rotation and translation from an eye point, look-at point and up vector.
see:
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml
It is arguably easier to initialise a camera position as a point in the world rather than an angle.
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/65
Reviewed By: bottler
Differential Revision: D20419652
Pulled By: nikhilaravi
fbshipit-source-id: 9caa1330860bb8bde1fb5c3864ed4cde836a5d19
Summary:
A few small website updates:
- changed the tutorials to point to the `stable` tag on github so we don't have to update the website each time we want to run them!
- changed the colab button
- re ran notebook cells to update the images for textured meshes
Once these fixes are landed I can build and publish the website.
Reviewed By: bottler
Differential Revision: D20484836
fbshipit-source-id: 603a05e752f631c60d1a3abb9adeb1b9b451ab98
Summary: Use a consistent case for PyTorch3D (matching the logo...): replace all occurrences of PyTorch3d with PyTorch3D across the codebase (including documentation and notebooks)
Reviewed By: wanyenlo, gkioxari
Differential Revision: D20427546
fbshipit-source-id: 8c7697f51434c51e99b7fe271935932c72a1d9b9
Summary: D20426113 made a mistake, in that it added a dev tag to all conda builds. This makes the simplest fix, which is to never have the dev tag.
Reviewed By: nikhilaravi
Differential Revision: D20468541
fbshipit-source-id: adc71b58d59356834d33f65a75cf8ba84359bc74
Summary: Added a padded to packed utils function which takes either split sizes or a padding value to remove padded elements from a tensor.
Reviewed By: gkioxari
Differential Revision: D20454238
fbshipit-source-id: 180b807ff44c74c4ee9d5c1ac3b5c4a9b4be57c7
Summary:
This isn't the whole task, but it gets the version number into far fewer places.
The doc / website are separate.
Reviewed By: nikhilaravi
Differential Revision: D20426113
fbshipit-source-id: 5810d1eca58b443fcd5f46991dc2f0f26adedbd8