1. 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
  2. 10 Feb, 2022 1 commit
  3. 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
  4. 24 Jun, 2021 1 commit
    • Nikhila Ravi's avatar
      Save UV texture with obj mesh · 542e2e7c
      Nikhila Ravi authored
      Summary: Add functionality to to save an `.obj` file with associated UV textures: `.png` image and `.mtl` file as well as saving verts_uvs and faces_uvs to the `.obj` file.
      
      Reviewed By: bottler
      
      Differential Revision: D29337562
      
      fbshipit-source-id: 86829b40dae9224088b328e7f5a16eacf8582eb5
      542e2e7c
  5. 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
  6. 20 Apr, 2021 1 commit
  7. 13 Apr, 2021 1 commit
    • Jeremy Reizenstein's avatar
      lint fixes · c18ee9d4
      Jeremy Reizenstein authored
      Summary: Lint after recent changes.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D27682328
      
      fbshipit-source-id: 285d159010d886e4e97902995adbdff875fd3c19
      c18ee9d4
  8. 09 Apr, 2021 3 commits
    • Jeremy Reizenstein's avatar
      spelling · 124bb5e3
      Jeremy Reizenstein authored
      Summary: Collection of spelling things, mostly in docs / tutorials.
      
      Reviewed By: gkioxari
      
      Differential Revision: D26101323
      
      fbshipit-source-id: 652f62bc9d71a4ff872efa21141225e43191353a
      124bb5e3
    • Rong Rong (AI Infra)'s avatar
      Get rid of duplicate test data directory initialization · dd834392
      Rong Rong (AI Infra) authored
      Summary: Simplify finding the data directories in the tests.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D27634293
      
      fbshipit-source-id: dc308a7c86c41e6fae56a2ab58187c9f0335b575
      dd834392
    • Rong Rong (AI Infra)'s avatar
      Extract finding directories for test data · 1216b576
      Rong Rong (AI Infra) authored
      Summary: Make common functions for finding directories where test data is found, instead of lots of tests using their own `__file__`  while trying to get ./tests/data and the tutorials data.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D27633701
      
      fbshipit-source-id: 1467bb6018cea16eba3cab097d713116d51071e9
      1216b576
  9. 12 Feb, 2021 1 commit
  10. 07 Jan, 2021 1 commit
    • Jeremy Reizenstein's avatar
      add existing mesh formats to pluggable · 89532a87
      Jeremy Reizenstein authored
      Summary: We already have code for obj and ply formats. Here we actually make it available in `IO.load_mesh` and `IO.save_mesh`.
      
      Reviewed By: theschnitz, nikhilaravi
      
      Differential Revision: D25400650
      
      fbshipit-source-id: f26d6d7fc46c48634a948eea4d255afad13b807b
      89532a87
  11. 24 Dec, 2020 1 commit
    • Jeremy Reizenstein's avatar
      PathManager passing · 25c065e9
      Jeremy Reizenstein authored
      Summary:
      Make no internal functions inside pytorch3d/io interpret str paths except using a PathManager from iopath which they have been given. This means we no longer use any global PathManager object and we no longer use fvcore's deprecated file_io.
      
      To preserve the APIs, various top level functions create their own default-initialized PathManager object if they are not provided one.
      
      Reviewed By: theschnitz
      
      Differential Revision: D25372969
      
      fbshipit-source-id: c176ee31439645fa54a157d6f1aef18b09501569
      25c065e9
  12. 07 Oct, 2020 1 commit
    • Nikhila Ravi's avatar
      Fix texture atlas for objs which only have material properties · f5383a7e
      Nikhila Ravi authored
      Summary:
      Fix for GitHub issue #381.
      
      The example mesh provided in the issue only had material properties but no texture image. The current implementation of texture atlassing generated an atlas using both the material properties and the texture image but only worked if there was a texture image and associated vertex uv coordinates. I have now modified the texture atlas creation so that it doesn't require an image and can work with materials which only have material properties.
      
      Reviewed By: gkioxari
      
      Differential Revision: D24153068
      
      fbshipit-source-id: 63e9d325db09a84b336b83369d5342ce588a9932
      f5383a7e
  13. 01 Oct, 2020 1 commit
    • Patrick Labatut's avatar
      Fix a few linting warnings · 8219a52c
      Patrick Labatut authored
      Summary: Fix a few linting warnings
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20720810
      
      fbshipit-source-id: c5b6a25fdd7971cc8743b54bbe162464a874071d
      8219a52c
  14. 23 Sep, 2020 1 commit
    • andrijazz's avatar
      resouces filenames with spaces (#358) · b1eee579
      andrijazz authored
      Summary:
      I'm constantly encountering 3D models with resources that have spaces in their filenames (especially on Windows) and therefore they can't be loaded in pytorch3d. Let me know what you think.
      
      Thanks
      
      Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/358
      
      Reviewed By: bottler
      
      Differential Revision: D23798492
      
      Pulled By: nikhilaravi
      
      fbshipit-source-id: 4d85b7ee05339486d2e5ef53a531f8e6052251c5
      b1eee579
  15. 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
  16. 09 Jun, 2020 1 commit
    • Luya Gao's avatar
      Adding join_mesh in pytorch3d.structures.meshes · e053d7c4
      Luya Gao authored
      Summary: Adding a function in pytorch3d.structures.meshes to join multiple meshes into a Meshes object representing a single mesh. The function currently ignores all textures.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D21876908
      
      fbshipit-source-id: 448602857e9d3d3f774d18bb4e93076f78329823
      e053d7c4
  17. 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
  18. 01 May, 2020 1 commit
    • Jeremy Reizenstein's avatar
      Joining mismatched texture maps on CUDA #175 · 0c595dcf
      Jeremy Reizenstein authored
      Summary:
      Use nn.functional.interpolate instead of a TorchVision transform to resize texture maps to a common value. This works on all devices. This fixes issue #175.
      
      Also fix the condition so it only happens when needed.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D21324510
      
      fbshipit-source-id: c50eb06514984995bd81f2c44079be6e0b4098e4
      0c595dcf
  19. 24 Apr, 2020 1 commit
    • Nikhila Ravi's avatar
      Update load obj and compare with SoftRas · c9267ab7
      Nikhila Ravi authored
      Summary:
      Updated the load obj function to support creating of a per face texture map using the information in an .mtl file. Uses the approach from in SoftRasterizer.
      
      Currently I have ported in the SoftRasterizer code but this is only to help with comparison and will  be deleted before landing. The ShapeNet Test data will also be deleted.
      
      Here is the [Design doc](https://docs.google.com/document/d/1AUcLP4QwVSqlfLAUfbjM9ic5vYn9P54Ha8QbcVXW2eI/edit?usp=sharing).
      
      ## Added
      - texture atlas creation functions in PyTorch based on the SoftRas cuda implementation
      - tests to compare SoftRas vs PyTorch3D implementation to verify it matches (using real shapenet data with meshes consisting of multiple textures)
      - benchmarks tests
      
      ## Remaining todo:
      - add more tests for obj io to test the new functions and the two texturing options
      - replace the shapenet data with the output from SoftRas saved as a file.
      
      # MAIN FILES TO REVIEW
      
      - `obj_io.py`
      - `test_obj_io.py` [still some tests to be added but have comparisons with SoftRas for now]
      
      The reference SoftRas implementations are in `softras_load_obj.py` and `load_textures.cu`.
      
      Reviewed By: gkioxari
      
      Differential Revision: D20754859
      
      fbshipit-source-id: 42ace9dfb73f26e29d800c763f56d5b66c60c5e2
      c9267ab7
  20. 30 Mar, 2020 1 commit
    • Jeremy Reizenstein's avatar
      join_meshes_as_batch · b64fe513
      Jeremy Reizenstein authored
      Summary: rename join_meshes to join_meshes_as_batch.
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20671293
      
      fbshipit-source-id: e84d6a67d6c1ec28fb5e52d4607db8e92561a4cd
      b64fe513
  21. 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
  22. 28 Mar, 2020 1 commit
    • Patrick Labatut's avatar
      Fix saving / loading empty OBJ files · 3061c5b6
      Patrick Labatut authored
      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
      3061c5b6
  23. 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
  24. 13 Mar, 2020 1 commit
    • Patrick Labatut's avatar
      Add more complex mesh I/O benchmarks · d91c1d36
      Patrick Labatut authored
      Summary: Add more complex mesh I/O benchmarks: simple yet non-trivial procedural donut mesh
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20390726
      
      fbshipit-source-id: b28b7e3a7f1720823c6bd24faabf688bb0127b7d
      d91c1d36
  25. 12 Mar, 2020 3 commits
    • Patrick Labatut's avatar
      Simplify mesh I/O benchmarking methods · 94fc862f
      Patrick Labatut authored
      Summary: Rename mesh I/O benchmarking methods: always (re-)create file-like object and directly return a lambda
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20390723
      
      fbshipit-source-id: b45236360869cccdf3d5458a0aafb3ebe269babe
      94fc862f
    • Patrick Labatut's avatar
      Rename mesh I/O benchmarks and associated methods · 797e468e
      Patrick Labatut authored
      Summary:
      Rename mesh I/O benchmarks and associated methods:
      - add `simple` qualifier (benchmark on more realistic mesh data to be added later)
      - align naming between OBJ and PLY
      - prefix with `bm_` to make the benchmarking purpose clear(er)
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D20390764
      
      fbshipit-source-id: 7714520abfcfe1125067f3c52f7ce19bca359574
      797e468e
    • 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
  26. 13 Feb, 2020 1 commit
    • Jeremy Reizenstein's avatar
      Single function to load meshes from OBJs. join_meshes. · 8fe65d5f
      Jeremy Reizenstein authored
      Summary:
      Create the textures and the Meshes object from OBJ files in a single call.
      
      There is functionality in OBJ files (like normals) which is ignored by this function.
      
      Reviewed By: gkioxari
      
      Differential Revision: D19691699
      
      fbshipit-source-id: e26442ed80ff231b65b17d6c54c9d41e22b4e4a3
      8fe65d5f
  27. 31 Jan, 2020 1 commit
    • Georgia Gkioxari's avatar
      load texture flag · 659ad343
      Georgia Gkioxari authored
      Summary: Add flag for loading textures
      
      Reviewed By: nikhilaravi
      
      Differential Revision: D19664437
      
      fbshipit-source-id: 3cc4e6179df9b7e24efff9e7da3b164253f1d775
      659ad343
  28. 23 Jan, 2020 1 commit