1. 24 Jun, 2021 1 commit
    • Georgia Gkioxari's avatar
      refactor laplacian matrices · 07a5a68d
      Georgia Gkioxari authored
      Summary:
      Refactor of all functions to compute laplacian matrices in one file.
      Support for:
      * Standard Laplacian
      * Cotangent Laplacian
      * Norm Laplacian
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D29297466
      
      fbshipit-source-id: b96b88915ce8ef0c2f5693ec9b179fd27b70abf9
      07a5a68d
  2. 22 Jun, 2021 1 commit
    • 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
  3. 09 Jun, 2021 1 commit
    • 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
  4. 07 May, 2021 2 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
  5. 04 May, 2021 3 commits
    • 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
  6. 22 Jan, 2021 1 commit
    • Jeremy Reizenstein's avatar
      Allow single offset in offset_verts · ddebdfbc
      Jeremy Reizenstein authored
      Summary:
      It is common when trying things out to want to move a whole mesh or point cloud by the same amount. Here we allow the offset functions to broadcast.
      
      Also add a sanity check to join_meshes_as_scene which it is easy to call wrongly.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D25980593
      
      fbshipit-source-id: cdf1568e1317e3b81ad94ed4e608ba7eef81290b
      ddebdfbc
  7. 15 Dec, 2020 1 commit
  8. 25 Aug, 2020 1 commit
    • Jeremy Reizenstein's avatar
      align_corners and padding for TexturesUV · e25ccab3
      Jeremy Reizenstein authored
      Summary:
      Allow, and make default, align_corners=True for texture maps. Allow changing the padding_mode and set the default to be "border" which produces more logical results. Some new documentation.
      
      The previous behavior corresponds to padding_mode="zeros" and align_corners=False.
      
      Reviewed By: gkioxari
      
      Differential Revision: D23268775
      
      fbshipit-source-id: 58d6229baa591baa69705bcf97471c80ba3651de
      e25ccab3
  9. 17 Aug, 2020 1 commit
  10. 03 Jul, 2020 1 commit
    • Georgia Gkioxari's avatar
      fix pts scale, save ply · 2f0fd601
      Georgia Gkioxari authored
      Summary:
      Fix:
      * Scaling of point clouds for scalars
      * save_ply compatible cat
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D22298609
      
      fbshipit-source-id: abe94a5b64baf325587202d20adfc36912cc1478
      2f0fd601
  11. 23 May, 2020 1 commit
    • Georgia Gkioxari's avatar
      update padded in meshes · 1fb97f9c
      Georgia Gkioxari authored
      Summary:
      Three changes to Meshes
      
      1. `num_verts_per_mesh` and `num_faces_per_mesh` are assigned at construction time and are returned without the need for `compute_packed`
      2. `update_padded` updates `verts_padded` and shallow copies faces list and faces_padded and existing attributes from construction.
      3. `padded_to_packed_idx` does not need `compute_packed`
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D21653674
      
      fbshipit-source-id: dc6815a2e2a925fe4a834fe357919da2b2c14527
      1fb97f9c
  12. 11 Apr, 2020 1 commit
    • Georgia Gkioxari's avatar
      point mesh distances · 487d4d66
      Georgia Gkioxari authored
      Summary:
      Implementation of point to mesh distances. The current diff contains two types:
      (a) Point to Edge
      (b) Point to Face
      
      ```
      
      Benchmark                                       Avg Time(μs)      Peak Time(μs) Iterations
      --------------------------------------------------------------------------------
      POINT_MESH_EDGE_4_100_300_5000_cuda:0                2745            3138            183
      POINT_MESH_EDGE_4_100_300_10000_cuda:0               4408            4499            114
      POINT_MESH_EDGE_4_100_3000_5000_cuda:0               4978            5070            101
      POINT_MESH_EDGE_4_100_3000_10000_cuda:0              9076            9187             56
      POINT_MESH_EDGE_4_1000_300_5000_cuda:0               1411            1487            355
      POINT_MESH_EDGE_4_1000_300_10000_cuda:0              4829            5030            104
      POINT_MESH_EDGE_4_1000_3000_5000_cuda:0              7539            7620             67
      POINT_MESH_EDGE_4_1000_3000_10000_cuda:0            12088           12272             42
      POINT_MESH_EDGE_8_100_300_5000_cuda:0                3106            3222            161
      POINT_MESH_EDGE_8_100_300_10000_cuda:0               8561            8648             59
      POINT_MESH_EDGE_8_100_3000_5000_cuda:0               6932            7021             73
      POINT_MESH_EDGE_8_100_3000_10000_cuda:0             24032           24176             21
      POINT_MESH_EDGE_8_1000_300_5000_cuda:0               5272            5399             95
      POINT_MESH_EDGE_8_1000_300_10000_cuda:0             11348           11430             45
      POINT_MESH_EDGE_8_1000_3000_5000_cuda:0             17478           17683             29
      POINT_MESH_EDGE_8_1000_3000_10000_cuda:0            25961           26236             20
      POINT_MESH_EDGE_16_100_300_5000_cuda:0               8244            8323             61
      POINT_MESH_EDGE_16_100_300_10000_cuda:0             18018           18071             28
      POINT_MESH_EDGE_16_100_3000_5000_cuda:0             19428           19544             26
      POINT_MESH_EDGE_16_100_3000_10000_cuda:0            44967           45135             12
      POINT_MESH_EDGE_16_1000_300_5000_cuda:0              7825            7937             64
      POINT_MESH_EDGE_16_1000_300_10000_cuda:0            18504           18571             28
      POINT_MESH_EDGE_16_1000_3000_5000_cuda:0            65805           66132              8
      POINT_MESH_EDGE_16_1000_3000_10000_cuda:0           90885           91089              6
      --------------------------------------------------------------------------------
      
      Benchmark                                       Avg Time(μs)      Peak Time(μs) Iterations
      --------------------------------------------------------------------------------
      POINT_MESH_FACE_4_100_300_5000_cuda:0                1561            1685            321
      POINT_MESH_FACE_4_100_300_10000_cuda:0               2818            2954            178
      POINT_MESH_FACE_4_100_3000_5000_cuda:0              15893           16018             32
      POINT_MESH_FACE_4_100_3000_10000_cuda:0             16350           16439             31
      POINT_MESH_FACE_4_1000_300_5000_cuda:0               3179            3278            158
      POINT_MESH_FACE_4_1000_300_10000_cuda:0              2353            2436            213
      POINT_MESH_FACE_4_1000_3000_5000_cuda:0             16262           16336             31
      POINT_MESH_FACE_4_1000_3000_10000_cuda:0             9334            9448             54
      POINT_MESH_FACE_8_100_300_5000_cuda:0                4377            4493            115
      POINT_MESH_FACE_8_100_300_10000_cuda:0               9728            9822             52
      POINT_MESH_FACE_8_100_3000_5000_cuda:0              26428           26544             19
      POINT_MESH_FACE_8_100_3000_10000_cuda:0             42238           43031             12
      POINT_MESH_FACE_8_1000_300_5000_cuda:0               3891            3982            129
      POINT_MESH_FACE_8_1000_300_10000_cuda:0              5363            5429             94
      POINT_MESH_FACE_8_1000_3000_5000_cuda:0             20998           21084             24
      POINT_MESH_FACE_8_1000_3000_10000_cuda:0            39711           39897             13
      POINT_MESH_FACE_16_100_300_5000_cuda:0               5955            6001             84
      POINT_MESH_FACE_16_100_300_10000_cuda:0             12082           12144             42
      POINT_MESH_FACE_16_100_3000_5000_cuda:0             44996           45176             12
      POINT_MESH_FACE_16_100_3000_10000_cuda:0            73042           73197              7
      POINT_MESH_FACE_16_1000_300_5000_cuda:0              8292            8374             61
      POINT_MESH_FACE_16_1000_300_10000_cuda:0            19442           19506             26
      POINT_MESH_FACE_16_1000_3000_5000_cuda:0            36059           36194             14
      POINT_MESH_FACE_16_1000_3000_10000_cuda:0           64644           64822              8
      --------------------------------------------------------------------------------
      ```
      
      Reviewed By: jcjohnson
      
      Differential Revision: D20590462
      
      fbshipit-source-id: 42a39837b514a546ac9471bfaff60eefe7fae829
      487d4d66
  13. 29 Mar, 2020 1 commit
    • Patrick Labatut's avatar
      Address black + isort fbsource linter warnings · d57daa6f
      Patrick Labatut authored
      Summary: Address black + isort fbsource linter warnings from D20558374 (previous diff)
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20558373
      
      fbshipit-source-id: d3607de4a01fb24c0d5269634563a7914bddf1c8
      d57daa6f
  14. 23 Mar, 2020 1 commit
    • Jeremy Reizenstein's avatar
      use assertClose · 595aca27
      Jeremy Reizenstein authored
      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
      595aca27
  15. 17 Mar, 2020 1 commit
  16. 12 Mar, 2020 1 commit
    • Patrick Labatut's avatar
      Remove shebang line when not strictly required · 3c71ab64
      Patrick Labatut authored
      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
      3c71ab64
  17. 23 Jan, 2020 1 commit