"launcher/vscode:/vscode.git/clone" did not exist on "9ecfa16b12c13ac6ed136929258829208ed8afc5"
  1. 22 Jun, 2021 2 commits
    • Patrick Labatut's avatar
      License lint codebase · af93f348
      Patrick Labatut authored
      Summary: License lint codebase
      
      Reviewed By: theschnitz
      
      Differential Revision: D29001799
      
      fbshipit-source-id: 5c59869911785b0181b1663bbf430bc8b7fb2909
      af93f348
    • Patrick Labatut's avatar
      Lint codebase · 7e43f29d
      Patrick Labatut authored
      Summary: Lint codebase
      
      Reviewed By: bottler
      
      Differential Revision: D29263057
      
      fbshipit-source-id: ac97f01d2a79fead3b09c2cbb21b50ce688a577d
      7e43f29d
  2. 21 Jun, 2021 7 commits
    • Jeremy Reizenstein's avatar
      remove requires_grad from random rotations · ce60d4b0
      Jeremy Reizenstein authored
      Summary: Because rotations and (rotation) quaternions live on curved manifolds, it doesn't make sense to optimize them directly. Having a prominent option to require gradient on random ones may cause people to try, and isn't particularly useful.
      
      Reviewed By: theschnitz
      
      Differential Revision: D29160734
      
      fbshipit-source-id: fc9e320672349fe334747c5b214655882a460a62
      ce60d4b0
    • Jeremy Reizenstein's avatar
      Test gltf texture without renderer. · 31c448a9
      Jeremy Reizenstein authored
      Summary:
      Change the cow gltf loading test to validate the texture values and not to validate the renderer output because it has an unstable pixel.
      
      Also a couple of lints.
      
      Reviewed By: patricklabatut
      
      Differential Revision: D29131260
      
      fbshipit-source-id: 5e11f066a2a638588aacb09776cc842173ef669f
      31c448a9
    • Jeremy Reizenstein's avatar
      Fix save_ply with noncontiguous faces · 354a1808
      Jeremy Reizenstein authored
      Summary: As noted in #710, save_ply was failing with some values of the faces tensor. It was assuming the faces were contiguous in using view() to change them. Here we avoid doing that.
      
      Reviewed By: patricklabatut
      
      Differential Revision: D29159655
      
      fbshipit-source-id: 47214a7ce915bab8d81f109c2b97cde464fd57d8
      354a1808
    • David Novotny's avatar
      Conversion from OpenCV cameras · 8006842f
      David Novotny authored
      Summary: Implements a conversion function between OpenCV and PyTorch3D cameras.
      
      Reviewed By: patricklabatut
      
      Differential Revision: D28992470
      
      fbshipit-source-id: dbcc9f213ec293c2f6938261c704aea09aad3c90
      8006842f
    • David Novotny's avatar
      SE3 exponential and logarithm maps. · b2ac2655
      David Novotny authored
      Summary:
      Implements the SE3 logarithm and exponential maps.
      (this is a second part of the split of D23326429)
      
      Outputs of `bm_se3`:
      ```
      Benchmark         Avg Time(μs)      Peak Time(μs) Iterations
      --------------------------------------------------------------------------------
      SE3_EXP_1                738             885            678
      SE3_EXP_10               717             877            698
      SE3_EXP_100              718             847            697
      SE3_EXP_1000             729            1181            686
      --------------------------------------------------------------------------------
      
      Benchmark          Avg Time(μs)      Peak Time(μs) Iterations
      --------------------------------------------------------------------------------
      SE3_LOG_1               1451            2267            345
      SE3_LOG_10              2185            2453            229
      SE3_LOG_100             2217            2448            226
      SE3_LOG_1000            2455            2599            204
      --------------------------------------------------------------------------------
      ```
      
      Reviewed By: patricklabatut
      
      Differential Revision: D27852557
      
      fbshipit-source-id: e42ccc9cfffe780e9cad24129de15624ae818472
      b2ac2655
    • David Novotny's avatar
      SO3 improvements for stable gradients. · 9f14e82b
      David Novotny authored
      Summary:
      Improves so3 functions to make gradient computation stable:
      - Instead of `torch.acos`, uses `acos_linear_extrapolation` which has finite gradients of reasonable magnitude for all inputs.
      - Adds tests for the latter.
      
      The tests of the finiteness of the gradient in `test_so3_exp_singularity`, `test_so3_exp_singularity`, `test_so3_cos_bound` would fail if the `so3` functions would call `torch.acos` instead of `acos_linear_extrapolation`.
      
      Reviewed By: bottler
      
      Differential Revision: D23326429
      
      fbshipit-source-id: dc296abf2ae3ddfb3942c8146621491a9cb740ee
      9f14e82b
    • David Novotny's avatar
      Linearly extrapolated acos. · dd45123f
      David Novotny authored
      Summary:
      Implements a backprop-safe version of `torch.acos` that linearly extrapolates the function outside bounds.
      
      Below is a plot of the extrapolated acos for different bounds:
      {F611339485}
      
      Reviewed By: bottler, nikhilaravi
      
      Differential Revision: D27945714
      
      fbshipit-source-id: fa2e2385b56d6fe534338d5192447c4a3aec540c
      dd45123f
  3. 18 Jun, 2021 3 commits
  4. 17 Jun, 2021 1 commit
    • Patrick Labatut's avatar
      Increase code coverage of shader · a8610e9d
      Patrick Labatut authored
      Summary: Increase code coverage of shader and re-include them in code coverage test
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D29097503
      
      fbshipit-source-id: 2791989ee1562cfa193f3addea0ce72d6840614a
      a8610e9d
  5. 15 Jun, 2021 1 commit
    • Nikhila Ravi's avatar
      Bug fix in rendering clipped meshes · c75ca04c
      Nikhila Ravi authored
      Summary:
      There was a bug when `z_clip_value` is not None but there are no faces which are actually visible in the image due to culling.  In `rasterize_meshes.py` a function `convert_clipped_rasterization_to_original_faces` is called to convert the clipped face indices etc back to the unclipped versions, but the case where there is no clipping was not handled correctly.
      
      Fixes Github Issue #632
      
      Reviewed By: bottler
      
      Differential Revision: D29116150
      
      fbshipit-source-id: fae82a0b4848c84b3ed7c7b04ef5c9848352cf5c
      c75ca04c
  6. 14 Jun, 2021 2 commits
    • Nikhila Ravi's avatar
      Lighting broadcasting bug fix · bc8361fa
      Nikhila Ravi authored
      Summary: Fixed multiple issues with shape broadcasting in lighting, shading and blending and updated the tests.
      
      Reviewed By: bottler
      
      Differential Revision: D28997941
      
      fbshipit-source-id: d3ef93f979344076b1d9098a86178b4da63844c8
      bc8361fa
    • Patrick Labatut's avatar
      Increase code coverage of subdivide_meshes · 780e2315
      Patrick Labatut authored
      Summary: Increase code coverage of subdivide_meshes and re-include it in code coverage test
      
      Reviewed By: bottler
      
      Differential Revision: D29097476
      
      fbshipit-source-id: 3403ae38a90c4b53f24188eed11faae202a235b5
      780e2315
  7. 11 Jun, 2021 2 commits
    • Nikhila Ravi's avatar
      Culling to frustrum bug fix · a0f79318
      Nikhila Ravi authored
      Summary:
      When `z_clip_value = None` and faces are outside the view frustum the shape of one of the tensors in `clip.py` is incorrect.
      
      `faces_num_clipped_verts` should be (F,) but it was (F,3).  Added a new test to ensure this case is handled.
      
      Reviewed By: bottler
      
      Differential Revision: D29051282
      
      fbshipit-source-id: 5f4172ba4d4a75d928404dde9abf48aef18c68bd
      a0f79318
    • Nikhila Ravi's avatar
      textures dimension check · ef162539
      Nikhila Ravi authored
      Summary:
      When textures are set on `Meshes` we need to check if the dimensions actually match that of the verts/faces in the mesh. There was a github issue where someone tried to set the attribute after construction of the `Meshes` object and ran into an error when trying to sample textures.
      
      The desired usage is to initialize the class with the textures (not set an attribute afterwards) but in any case we need to check the dimensions match before sampling textures.
      
      Reviewed By: bottler
      
      Differential Revision: D29020249
      
      fbshipit-source-id: 9fb8a5368b83c9ec53652df92b96fc8b2613f591
      ef162539
  8. 09 Jun, 2021 6 commits
    • Patrick Labatut's avatar
      Make Transform3d.to() not ignore dtype · 44508ed0
      Patrick Labatut authored
      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
      44508ed0
    • Patrick Labatut's avatar
      Tidy uses of torch.device in Volumes · 1f9661e1
      Patrick Labatut authored
      Summary:
      Tidy uses of `torch.device` in `Volumes`:
      - Allow `str` or `torch.device` in `Volumes.to()` method
      - Consistently use `torch.device` for internal type
      - Fix comparison of devices
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28970876
      
      fbshipit-source-id: c640cc22ced684a54cc450ac38a0f4b3435d47be
      1f9661e1
    • Patrick Labatut's avatar
      Tidy uses of torch.device in Pointclouds · 1db40ac5
      Patrick Labatut authored
      Summary:
      Tidy uses of `torch.device` in `Pointclouds`:
      - Allow `str` or `torch.device` in `Pointclouds.to()` method
      - Consistently use `torch.device` for internal type
      - Fix comparison of devices
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28970221
      
      fbshipit-source-id: 3ca7104d4c0d9b20b0cff4f00e3ce931c5f1528a
      1db40ac5
    • Patrick Labatut's avatar
      Tidy uses of torch.device in Meshes · 633d66f1
      Patrick Labatut authored
      Summary:
      Tidy uses of `torch.device` in `Meshes`:
      - Allow `str` or `torch.device` in `Meshes.to()` method
      - Consistently use `torch.device` for internal type
      - Fix comparison of devices
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28969461
      
      fbshipit-source-id: 16d3c1f5458954bb11fdf0efea88542e94dccd7a
      633d66f1
    • Patrick Labatut's avatar
      Tidy uses of torch.device in Transform3d · 13a0110b
      Patrick Labatut authored
      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
      13a0110b
    • Nikhila Ravi's avatar
      Alpha channel to return the mask · a15c33a3
      Nikhila Ravi authored
      Summary: Updated the alpha channel in the `hard_rgb_blend` function to return the mask of the pixels which have overlapping mesh faces.
      
      Reviewed By: bottler
      
      Differential Revision: D29001604
      
      fbshipit-source-id: 22a2173d769f2d3ad34892d68ceb628f073bca22
      a15c33a3
  9. 08 Jun, 2021 1 commit
    • Jeremy Reizenstein's avatar
      cuda 11 problems with test_normal_consistency · 7204a4ca
      Jeremy Reizenstein authored
      Summary:
      One test hits problems with CUDA 11.1 and pytorch 1.8. This seems to be a known bug, so we just run that test on the cpu in the problematic cases.
      
      Note - the full test run is much slower with cuda 11.1 than 10.2, but this is known.
      
      Reviewed By: patricklabatut
      
      Differential Revision: D28938933
      
      fbshipit-source-id: cf8ed84cd10a0b52d8f4292edbef7bd4844fea65
      7204a4ca
  10. 04 Jun, 2021 2 commits
  11. 26 May, 2021 4 commits
    • Jeremy Reizenstein's avatar
      Experimental glTF reading · ed6983ea
      Jeremy Reizenstein authored
      Summary: Experimental data loader for taking the default scene from a GLB file and converting it to a single mesh in PyTorch3D.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D25900167
      
      fbshipit-source-id: bff22ac00298b83a0bd071ae5c8923561e1d81d7
      ed6983ea
    • Jeremy Reizenstein's avatar
      ambient lighting · 0e85652f
      Jeremy Reizenstein authored
      Summary:
      Specific object to represent light which is 100% everywhere. Sometimes lighting is irrelevant, for example when viewing a mesh which has lighting already baked in.
      
      This is not primarily aiming for a performance win but I think the test which has changed might be a bit faster.
      
      Reviewed By: theschnitz
      
      Differential Revision: D26405151
      
      fbshipit-source-id: 82eae55de0bee918548a3eaf031b002cb95e726c
      0e85652f
    • Jeremy Reizenstein's avatar
      rotate_on_spot · 61e38de0
      Jeremy Reizenstein authored
      Summary: Function to relatively rotate a camera position. Also document how to relatively translate a camera position.
      
      Reviewed By: theschnitz
      
      Differential Revision: D25900166
      
      fbshipit-source-id: 2ddaf06ee7c5e2a2e973c04d7dee6ccb61c6ff84
      61e38de0
    • Jeremy Reizenstein's avatar
      Deduplicate texture maps when joining · e12a0813
      Jeremy Reizenstein authored
      Summary:
      If you join several meshes which have TexturesUV textures using join_meshes_as_scene then we amalgamate all the texture images in to a single one. This now checks if some of the images are equal (i.e. the tensors are the same tensor, in the `is` sense; they have the same `id` in Python) and only uses one copy if they are.
      
      I have an example of a massive scene made of several textured meshes with some shared, where this makes the difference between fitting the data on the GPU and not.
      
      Reviewed By: theschnitz
      
      Differential Revision: D25982364
      
      fbshipit-source-id: a8228805f38475c796302e27328a340d9b56c8ef
      e12a0813
  12. 07 May, 2021 3 commits
    • Jeremy Reizenstein's avatar
      avoid running tests twice · 0ca839cc
      Jeremy Reizenstein authored
      Summary: Avoid test files explicitly importing TestCase objects from each other, because doing so causes the tests to be discovered twice by unittest discover. This means moving a few static functions out of their classes. I noticed this while trying to fix failures from yesterday.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28194679
      
      fbshipit-source-id: ac6e6585603bd4ef9c098cdd56891d94f8923ba6
      0ca839cc
    • Jeremy Reizenstein's avatar
      test_meshes numeric fixes · e3624b4e
      Jeremy Reizenstein authored
      Summary:
      A couple of tests are failing in open source after my changes yesterday because of numerical issues calculating normals. In particular we have meshes with very few vertices and several faces, where the normals should be zero but end up non-negligible after F.normalize. I have no idea why the different environments produce different results, so that the tests are passing internally.
      
      An example. Consider a mesh with the following faces:
      ```
      tensor([[4, 0, 2],
              [4, 1, 2],
              [3, 1, 0],
              [1, 3, 1],
              [3, 0, 1],
              [4, 0, 0],
              [4, 0, 2]])
      ```
      At vertex 3, there is one zero-area face and there are two other faces, which are back-to-back with each other. This vertex should have zero normal. The open source calculation produces a small but nonzero normal which varies unpredictably with changes in scale/offset, which can cause test failures.
      
      In this diff, the main change is to increase the number of vertices to make this less likely to happen. Also a small change to init_mesh to make it not generate a batch of empty meshes.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28220984
      
      fbshipit-source-id: 79fdc62e5f5f8836de5a3a9980cfd6fe44590359
      e3624b4e
    • Daisy's avatar
      Handle header has no newline or space after OFF. (#665) · 5241b7dd
      Daisy authored
      Summary:
      Allow a line like `OFF10 10 10` as the start of an OFF file. Such things apparently occur in ModelNet40.
      
      This resolves https://github.com/facebookresearch/pytorch3d/issues/663.
      
      Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/665
      
      Test Plan: New test
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D28180006
      
      Pulled By: bottler
      
      fbshipit-source-id: 7f474c6a262e32da012217e09f76e8672a7f0278
      5241b7dd
  13. 04 May, 2021 6 commits
    • Jeremy Reizenstein's avatar
      PLY load normals · 6fa66f55
      Jeremy Reizenstein authored
      Summary: Add ability to load normals when they are present in a PLY file.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D26458971
      
      fbshipit-source-id: 658270b611f7624eab4f5f62ff438038e1d25723
      6fa66f55
    • Jeremy Reizenstein's avatar
      has_verts_normals for Meshes · 66b97a0c
      Jeremy Reizenstein authored
      Summary: Add ability to ask a Meshes if it already has normals. If it does, then requesting normals will not trigger a calculation. MeshesFormatInterpreters will therefore be able to decide whether to save normals.
      
      Reviewed By: theschnitz, nikhilaravi
      
      Differential Revision: D27765261
      
      fbshipit-source-id: 7c87dbf999d5616d20f5eb2c01039ee5ff65a830
      66b97a0c
    • Jeremy Reizenstein's avatar
      Allow setting verts_normals on Meshes · 2bbca5f2
      Jeremy Reizenstein authored
      Summary: Add ability to set the vertex normals when creating a Meshes, so that the pluggable loaders can return them from a file.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D27765258
      
      fbshipit-source-id: b5ddaa00de3707f636f94d9f74d1da12ecce0608
      2bbca5f2
    • Jeremy Reizenstein's avatar
      avoid recalculating normals for simple move · 502f15ac
      Jeremy Reizenstein authored
      Summary: If offset_verts_ is used to move meshes with a single vector, the normals won't change so don't need to recalculate. I am planning to allow user-specified vertex normals. This change means that user-specified vertex normals won't get overwritten when they don't need to be.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D27765256
      
      fbshipit-source-id: f6e4d308ac9ac023030325cb75a18d39b966cf88
      502f15ac
    • Jeremy Reizenstein's avatar
      PLY color scaling · e9f4e0d0
      Jeremy Reizenstein authored
      Summary: When a PLY file contains colors in byte format, these are now scaled from 0..255 to [0,1], as they should be
      
      Reviewed By: gkioxari
      
      Differential Revision: D27765254
      
      fbshipit-source-id: 526b5f5149d5e8cbffd7412b411be52c935fa4ad
      e9f4e0d0
    • Jeremy Reizenstein's avatar
      PLY TexturesVertex loading · 6c3fe952
      Jeremy Reizenstein authored
      Summary:
      Include TexturesVertex colors when loading and saving Meshes to PLY files.
      
      A couple of other improvements to the internals of ply_io, including using `None` instead of empty tensors for some missing data.
      
      Reviewed By: gkioxari
      
      Differential Revision: D27765260
      
      fbshipit-source-id: b9857dc777c244b9d7d6643b608596d31435ecda
      6c3fe952