1. 19 Dec, 2023 1 commit
    • Hassan Lotfi's avatar
      Submeshing TexturesUV · 8a27590c
      Hassan Lotfi authored
      Summary: Implement `submeshes` for TexturesUV. Fix what Meshes.submeshes passes to the texture's submeshes function to make this possible.
      
      Reviewed By: bottler
      
      Differential Revision: D52192060
      
      fbshipit-source-id: 526734962e3376aaf75654200164cdcebfff6997
      8a27590c
  2. 04 Dec, 2023 1 commit
    • Jeremy Reizenstein's avatar
      lint · 83bacda8
      Jeremy Reizenstein authored
      Summary: Fix recent flake complaints
      
      Reviewed By: MichaelRamamonjisoa
      
      Differential Revision: D51811912
      
      fbshipit-source-id: 65183f5bc7058da910e4d5a63b2250ce8637f1cc
      83bacda8
  3. 29 Jun, 2022 1 commit
  4. 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
  5. 15 May, 2022 1 commit
    • John Reese's avatar
      apply import merging for fbcode (11 of 11) · 3b230064
      John Reese 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: lisroach
      
      Differential Revision: D36402260
      
      fbshipit-source-id: 7cb52f09b740ccc580e61e6d1787d27381a8ce00
      3b230064
  6. 11 Apr, 2022 1 commit
    • Krzysztof Chalupka's avatar
      Submesh 4/n: TexturesVertex submeshing · 22f86072
      Krzysztof Chalupka authored
      Summary: Add submeshing capability for meshes with TexturesVertex.
      
      Reviewed By: bottler
      
      Differential Revision: D35448534
      
      fbshipit-source-id: 6d16a31a5bfb24ce122cf3c300a7616bc58353d1
      22f86072
  7. 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
  8. 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
  9. 11 Jun, 2021 1 commit
    • 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
  10. 26 May, 2021 1 commit
    • 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
  11. 07 May, 2021 1 commit
    • 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
  12. 25 Jan, 2021 1 commit
    • Jeremy Reizenstein's avatar
      textures device consistency · d173a2f8
      Jeremy Reizenstein authored
      Summary: Ensure that `mesh2 = mesh.to(device)` doesn't change the device of `mesh.textures`.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D25978610
      
      fbshipit-source-id: 0558cd62132965d8693ebeea05e42b8c1d16cfbf
      d173a2f8
  13. 29 Oct, 2020 1 commit
    • Jeremy Reizenstein's avatar
      remove texture_vis test · 0e5f4f76
      Jeremy Reizenstein authored
      Summary: This recently added test is sensitive to the version of PIL because of different algorithms to draw ellipses/circles. Remove it as there is no obvious safe way to test this. Replace with a test for the underlying centres_for_image().
      
      Reviewed By: theschnitz
      
      Differential Revision: D24622465
      
      fbshipit-source-id: e46d7384df491c71ac87ba8bbbce89507ac40080
      0e5f4f76
  14. 27 Oct, 2020 1 commit
    • Jeremy Reizenstein's avatar
      images for debugging TexturesUV · aa4cc0ad
      Jeremy Reizenstein authored
      Summary: New methods to directly plot a TexturesUV map with its used points, using PIL and matplotlib.
      
      Reviewed By: gkioxari
      
      Differential Revision: D23782968
      
      fbshipit-source-id: 692970857b5be13a35a3175dc82ac03963a73555
      aa4cc0ad
  15. 06 Oct, 2020 1 commit
    • Georgia Gkioxari's avatar
      add texture vertex sampling functionality to textures · e651a429
      Georgia Gkioxari authored
      Summary: Enhance every texture type with `faces_verts_textures_packed` that allows users to query the texture of each vertex in mesh
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D24058778
      
      fbshipit-source-id: 19d0e3a244fa96aae462c47bf52e07dfd3b7c6f0
      e651a429
  16. 25 Aug, 2020 2 commits
    • Jeremy Reizenstein's avatar
      amalgamate meshes with texture into a single scene · 909dc835
      Jeremy Reizenstein authored
      Summary:
      Add a join_scene method to all the textures to allow the join_mesh function to include textures. Rename the join_mesh function to join_meshes_as_scene.
      
      For TexturesAtlas, we now interpolate if the user attempts to have the resolution vary across the batch. This doesn't look great if the resolution is already very low.
      
      For TexturesUV, a rectangle packing function is required, this does something simple.
      
      Reviewed By: gkioxari
      
      Differential Revision: D23188773
      
      fbshipit-source-id: c013db061a04076e13e90ccc168a7913e933a9c5
      909dc835
    • 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
  17. 22 Aug, 2020 1 commit
    • Nikhila Ravi's avatar
      Tutorials textures updates and fix bug in extending meshes with uv textures · 90f6a005
      Nikhila Ravi authored
      Summary:
      Found a bug in extending textures with vertex uv coordinates. This was due to the padded -> list conversion of vertex uv coordinates i.e.                 The number of vertices in the mesh and in verts_uvs can differ
      e.g. if a vertex is shared between 3 faces, it can
      have up to 3 different uv coordinates. Therefore we cannot convert directly from padded to list using _num_verts_per_mesh
      
      Reviewed By: bottler
      
      Differential Revision: D23233595
      
      fbshipit-source-id: 0c66d15baae697ead0bdc384f74c27d4c6539fc9
      90f6a005
  18. 21 Aug, 2020 1 commit
    • Jeremy Reizenstein's avatar
      Fix batching bug from TexturesUV packed ambiguity, other textures tidyup · 9a50cf80
      Jeremy Reizenstein authored
      Summary:
      faces_uvs_packed and verts_uvs_packed were only used in one place and the definition of the former was ambiguous. This meant that the wrong coordinates could be used for meshes other than the first in the batch. I have therefore removed both functions and build their common result inline. Added a test that a simple batch of two meshes is rendered consistently with the rendering of each alone. This test would have failed before.
      
      I hope this fixes https://github.com/facebookresearch/pytorch3d/issues/283.
      
      Some other small improvements to the textures code.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D23161936
      
      fbshipit-source-id: f99b560a46f6b30262e07028b049812bc04350a7
      9a50cf80
  19. 17 Aug, 2020 1 commit
  20. 29 Jul, 2020 1 commit
    • Nikhila Ravi's avatar
      Texturing API updates · a3932960
      Nikhila Ravi authored
      Summary:
      A fairly big refactor of the texturing API with some breaking changes to how textures are defined.
      
      Main changes:
      - There are now 3 types of texture classes: `TexturesUV`, `TexturesAtlas` and `TexturesVertex`. Each class:
         - has a `sample_textures` function which accepts the `fragments` from rasterization and returns `texels`. This means that the shaders will not need to know the type of the mesh texture which will resolve several issues people were reporting on GitHub.
        -  has a `join_batch` method for joining multiple textures of the same type into a batch
      
      Reviewed By: gkioxari
      
      Differential Revision: D21067427
      
      fbshipit-source-id: 4b346500a60181e72fdd1b0dd89b5505c7a33926
      a3932960
  21. 13 Jul, 2020 1 commit
    • Justin Johnson's avatar
      CUDA kernel for interpolate_face_attributes · 26d2cc24
      Justin Johnson authored
      Summary: When rendering meshes with Phong shading, interpolate_face_attributes was taking up a nontrivial fraction of the overall shading time. This diff replaces our Python implementation of this function with a CUDA implementation.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D21610763
      
      fbshipit-source-id: 2bb362a28f698541812aeab539047264b125ebb8
      26d2cc24
  22. 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
  23. 17 Mar, 2020 1 commit
  24. 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
  25. 11 Mar, 2020 1 commit
    • Jeremy Reizenstein's avatar
      getitem for textures · fb97ab10
      Jeremy Reizenstein authored
      Summary: Make Meshes.__getitem__ carry texture information to the new mesh.
      
      Reviewed By: gkioxari
      
      Differential Revision: D20283976
      
      fbshipit-source-id: d9ee0580c11ac5b4384df9d8158a07e6eb8d00fe
      fb97ab10
  26. 29 Feb, 2020 1 commit
    • Nikhila Ravi's avatar
      Barycentric clipping in the renderer and flat shading · ff19c642
      Nikhila Ravi authored
      Summary:
      Updates to the Renderer to enable barycentric clipping. This is important when there is blurring in the rasterization step.
      
      Also added support for flat shading.
      
      Reviewed By: jcjohnson
      
      Differential Revision: D19934259
      
      fbshipit-source-id: 036e48636cd80d28a04405d7a29fcc71a2982904
      ff19c642
  27. 23 Jan, 2020 1 commit