1. 02 Aug, 2024 1 commit
    • Rebecca Chen (Python)'s avatar
      Add "max" point reduction for chamfer distance · 44702fdb
      Rebecca Chen (Python) authored
      Summary:
      * Adds a "max" option for the point_reduction input to the
        chamfer_distance function.
      * When combining the x and y directions, maxes the losses instead
        of summing them when point_reduction="max".
      * Moves batch reduction to happen after the directions are
        combined.
      * Adds test_chamfer_point_reduction_max and
        test_single_directional_chamfer_point_reduction_max tests.
      
      Fixes  https://github.com/facebookresearch/pytorch3d/issues/1838
      
      Reviewed By: bottler
      
      Differential Revision: D60614661
      
      fbshipit-source-id: 7879816acfda03e945bada951b931d2c522756eb
      44702fdb
  2. 15 Aug, 2023 1 commit
    • Haritha Jayasinghe's avatar
      add None option for chamfer distance point reduction (#1605) · d84f274a
      Haritha Jayasinghe authored
      Summary:
      The `chamfer_distance` function currently allows `"sum"` or `"mean"` reduction, but does not support returning unreduced (per-point) loss terms. Unreduced losses could be useful if the user wishes to inspect individual losses, or perform additional modifications to loss terms before reduction. One example would be implementing a robust kernel over the loss.
      
      This PR adds a `None` option to the `point_reduction` parameter, similar to `batch_reduction`. In case of bi-directional chamfer loss, both the forward and backward distances are returned (a tuple of Tensors of shape `[D, N]` is returned). If normals are provided, similar logic applies to normals as well.
      
      This PR addresses issue https://github.com/facebookresearch/pytorch3d/issues/622.
      
      Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1605
      
      Reviewed By: jcjohnson
      
      Differential Revision: D48313857
      
      Pulled By: bottler
      
      fbshipit-source-id: 35c824827a143649b04166c4817449e1341b7fd9
      d84f274a
  3. 13 Jun, 2023 1 commit
  4. 26 May, 2022 1 commit
    • Jeremy Reizenstein's avatar
      chamfer for empty pointclouds #1174 · c6519f29
      Jeremy Reizenstein authored
      Summary: Fix divide by zero for empty pointcloud in chamfer. Also for empty batches. In process, needed to regularize num_points_per_cloud for empty batches.
      
      Reviewed By: kjchalup
      
      Differential Revision: D36311330
      
      fbshipit-source-id: 3378ab738bee77ecc286f2110a5c8dc445960340
      c6519f29
  5. 25 May, 2022 1 commit
    • Jeremy Reizenstein's avatar
      move targets · 34f648ed
      Jeremy Reizenstein authored
      Summary: Move testing targets from pytorch3d/tests/TARGETS to pytorch3d/TARGETS.
      
      Reviewed By: shapovalov
      
      Differential Revision: D36186940
      
      fbshipit-source-id: a4c52c4d99351f885e2b0bf870532d530324039b
      34f648ed
  6. 13 Apr, 2022 1 commit
    • Tim Hatch's avatar
      apply import merging for fbcode/vision/fair (2 of 2) · 34bbb3ad
      Tim Hatch authored
      Summary:
      Applies new import merging and sorting from µsort v1.0.
      
      When merging imports, µsort will make a best-effort to move associated
      comments to match merged elements, but there are known limitations due to
      the diynamic nature of Python and developer tooling. These changes should
      not produce any dangerous runtime changes, but may require touch-ups to
      satisfy linters and other tooling.
      
      Note that µsort uses case-insensitive, lexicographical sorting, which
      results in a different ordering compared to isort. This provides a more
      consistent sorting order, matching the case-insensitive order used when
      sorting import statements by module name, and ensures that "frog", "FROG",
      and "Frog" always sort next to each other.
      
      For details on µsort's sorting and merging semantics, see the user guide:
      https://usort.readthedocs.io/en/stable/guide.html#sorting
      
      Reviewed By: bottler
      
      Differential Revision: D35553814
      
      fbshipit-source-id: be49bdb6a4c25264ff8d4db3a601f18736d17be1
      34bbb3ad
  7. 10 Apr, 2022 1 commit
    • Georgia Gkioxari's avatar
      add L1 support for KNN & Chamfer · 67fff956
      Georgia Gkioxari authored
      Summary:
      Added L1 norm for KNN and chamfer op
      * The norm is now specified with a variable `norm` which can only be 1 or 2
      
      Reviewed By: bottler
      
      Differential Revision: D35419637
      
      fbshipit-source-id: 77813fec650b30c28342af90d5ed02c89133e136
      67fff956
  8. 04 Jan, 2022 1 commit
    • Jeremy Reizenstein's avatar
      Update license for company name · 9eeb456e
      Jeremy Reizenstein authored
      Summary: Update all FB license strings to the new format.
      
      Reviewed By: patricklabatut
      
      Differential Revision: D33403538
      
      fbshipit-source-id: 97a4596c5c888f3c54f44456dc07e718a387a02c
      9eeb456e
  9. 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
  10. 04 May, 2020 1 commit
    • Nikhila Ravi's avatar
      lint fixes · 0eca74fa
      Nikhila Ravi authored
      Summary:
      Ran the linter.
      TODO: need to update the linter as per D21353065.
      
      Reviewed By: bottler
      
      Differential Revision: D21362270
      
      fbshipit-source-id: ad0e781de0a29f565ad25c43bc94a19b1828c020
      0eca74fa
  11. 24 Apr, 2020 1 commit
    • Nikhila Ravi's avatar
      Cuda updates · c3d636dc
      Nikhila Ravi authored
      Summary:
      Updates to:
      - enable cuda kernel launches on any GPU (not just the default)
      - cuda and contiguous checks for all kernels
      - checks to ensure all tensors are on the same device
      - error reporting in the cuda kernels
      - cuda tests now run on a random device not just the default
      
      Reviewed By: jcjohnson, gkioxari
      
      Differential Revision: D21215280
      
      fbshipit-source-id: 1bedc9fe6c35e9e920bdc4d78ed12865b1005519
      c3d636dc
  12. 22 Apr, 2020 1 commit
    • Jeremy Reizenstein's avatar
      chamfer test consistency · 9e4bd2e5
      Jeremy Reizenstein authored
      Summary:
      Modify test_chamfer for more robustness. Avoid empty pointclouds, including where point_reduction is mean, for which we currently return nan (*), and so that we aren't looking at an empty gradient. Make sure we aren't using padding as points in the homogenous cases in the tests, which will lead to a tie between closest points and therefore a potential instability in the gradient - see https://github.com/pytorch/pytorch/issues/35699.
      
      (*) This doesn't attempt to fix the nan.
      
      Reviewed By: nikhilaravi, gkioxari
      
      Differential Revision: D21157322
      
      fbshipit-source-id: a609e84e25a24379c8928ff645d587552526e4af
      9e4bd2e5
  13. 15 Apr, 2020 1 commit
    • Nikhila Ravi's avatar
      Chamfer for Pointclouds object · 790eb8c4
      Nikhila Ravi authored
      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
      790eb8c4
  14. 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
  15. 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
  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