1224 Commits

Author SHA1 Message Date
Jeremy Reizenstein
a12612a48f doc rgbd point cloud
Summary: docstring and shape fix

Reviewed By: shapovalov

Differential Revision: D42609661

fbshipit-source-id: fd50234872ad61b5452821eeb89d51344f70c957
2023-01-24 15:26:52 -08:00
Roman Shapovalov
d561f1913e Cleaning up camera difficulty
Summary: We don’t see much value in reporting metrics by camera difficulty while supporting that in new datasets is quite painful, hence deprecating training cameras in the data API and ignoring in evaluation.

Reviewed By: bottler

Differential Revision: D42678879

fbshipit-source-id: aad511f6cb2ca82745f31c19594e1d80594b61d7
2023-01-23 10:38:56 -08:00
David Novotny
1de2d0c820 render_flyaround allow forwarding args from visualize_reconstruction
Summary: Allows to send kwargs to render_flyaround from visualize_reconstruction

Reviewed By: bottler, shapovalov

Differential Revision: D41157683

fbshipit-source-id: 74d8d7de4e991a31b14e72d76de5efdb8ab4b2c5
2023-01-23 06:52:48 -08:00
myla
b95535c8b7 Fixing bug in rasterizer.py caused by duplicate line (#1421)
Summary:
The file [rasterizer.py](de3a474d2b/pytorch3d/renderer/mesh/rasterizer.py (L201)) contains a duplicate line before the check if the projection_transform exists. This causes an exception in the case that a projection transform matrix is already provided. The corresponding lines should be (and are already) in the else case of the if-statement.

Removing these lines fixes the bug and produces the desired behavior.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1421

Reviewed By: shapovalov

Differential Revision: D42450999

Pulled By: bottler

fbshipit-source-id: f7464e87ec9ff8768455656324b0b008132c8a54
2023-01-19 05:49:56 -08:00
Jeremy Reizenstein
dcced4fa29 test fixes
Reviewed By: shapovalov

Differential Revision: D42545069

fbshipit-source-id: e25fb4049dcebd715df43bab3ce813ecb5f85abe
2023-01-17 06:11:56 -08:00
Jeremy Reizenstein
84851c8312 camera iteration #1408
Summary: Use IndexError so that a camera object is an iterable

Reviewed By: shapovalov

Differential Revision: D42312021

fbshipit-source-id: 67c417d5f1398e8b30a6944468eda057b4ceb444
2023-01-16 08:52:52 -08:00
Jeremy Reizenstein
b7e3b7b16c rendered_mesh_dataset improvements
Summary: Allow choosing the device and the distance

Reviewed By: shapovalov

Differential Revision: D42451605

fbshipit-source-id: 214f02d09da94eb127b3cc308d5bae800dc7b9e2
2023-01-16 07:46:41 -08:00
Jeremy Reizenstein
acc60db4f4 INSTALL.md clarification
Summary: Add fvcore and iopath explicitly. As mentioned in #1416.

Reviewed By: shapovalov

Differential Revision: D42451365

fbshipit-source-id: 0d8d2ead3f15dea6abef221fd5df2b4774abc83f
2023-01-16 07:41:46 -08:00
Moritz Kampelmuehler
aa5b31d857 Add nvidia channel for cudatoolkit (#1402)
Summary:
nvidia channel is required for installing cudatoolkit

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1402

Reviewed By: davidsonic

Differential Revision: D42208583

Pulled By: bottler

fbshipit-source-id: 83d0e63efcf7772b778ca909fd9b14d28829c5b6
2023-01-15 08:57:18 -08:00
yurimalheiros
1b4b67fd7f Minor fixes to the Fit Mesh tutorial (#1423)
Summary:
- Fix the numbers in the headers. Currently, there are no header number 2, the tutorial jump from 1 to 3.
- Clean some unnecessary code.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1423

Reviewed By: shapovalov

Differential Revision: D42478609

Pulled By: bottler

fbshipit-source-id: c49fc10b7d38c3573c92fea737101e6c06bbea38
2023-01-15 08:56:12 -08:00
Jeremy Reizenstein
9fb452db5c builds for pytorch 1.13.1
Reviewed By: davidsonic

Differential Revision: D42315355

fbshipit-source-id: f5ced5270e5a7b4a162ee930fc51dee0469d51fc
2023-01-12 14:27:43 -08:00
Jeremy Reizenstein
3cf3998ea5 assume Python 3.8+
Summary: Remove workarounds for Python 3.7

Reviewed By: davidsonic

Differential Revision: D42451534

fbshipit-source-id: 461dd311f3bccf7bef120ffe0b97fbbd173d95be
2023-01-12 14:25:40 -08:00
Jeremy Reizenstein
d71105f5e5 lints
Summary: lint fixes

Reviewed By: davidsonic

Differential Revision: D42451530

fbshipit-source-id: 120bdd58fc074a713895df15df4e9efa9ea0a420
2023-01-12 14:23:39 -08:00
Jeremy Reizenstein
3388d3f0aa Windows fix for marching cubes #1398
Summary: See https://github.com/facebookresearch/pytorch3d/issues/1398 .

Reviewed By: davidsonic

Differential Revision: D42139493

fbshipit-source-id: 972fc33b9c3017554ce704f2f10190eba406b7c8
2022-12-20 04:07:04 -08:00
Jeremy Reizenstein
3145dd4d16 version 0.7.2
Summary: version number

Reviewed By: davidsonic

Differential Revision: D42072729

fbshipit-source-id: 50adaac4daca7786479d33e218d15e941a725bb6
v0.7.2
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
6c053a6cea Update notebooks for 0.7.2
Summary: Expect pytorch 1.13

Reviewed By: davidsonic

Differential Revision: D42072731

fbshipit-source-id: 13ba4e7de18060dc4e5c0e10f850f17a88750fc9
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
3bbe26124a README.md and INSTALL.md updates
Summary: misc updates

Reviewed By: davidsonic

Differential Revision: D42072730

fbshipit-source-id: fc885d14346083bd6493f18e9d965b35a8d4bdfd
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
c773830b88 fix and pythonify conda build (#1394)
Summary:
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1394

The bash logic for building conda packages became fiddly to edit. We need to switch cuda-toolkit to pytorch-cuda when PyTorch>=1.12 which was going to be a pain, so here I rewrite the code in python and do it.

Reviewed By: shapovalov

Differential Revision: D42036406

fbshipit-source-id: 8bb80c2f7545477182b23fc97c8514dcafcee176
2022-12-15 03:22:07 -08:00
Jeremy Reizenstein
b7a316232a fix saved glb length
Summary: Make GLB files report their own length correctly. They were off by 28.

Reviewed By: davidsonic

Differential Revision: D41838340

fbshipit-source-id: 9cd66e8337c142298d5ae1d7c27e51fd812d5c7b
2022-12-13 05:34:45 -08:00
generatedunixname89002005307016
de3a474d2b suppress errors in vision/fair/pytorch3d
Differential Revision: D41897914

fbshipit-source-id: 675f4ad6938bc12d295bbb63a69e3ff98b319a9a
2022-12-09 18:50:58 -08:00
Jeremy Reizenstein
a4a29b013b remove python 3.7 builds
Summary: Python 3.7 not needed any more

Reviewed By: shapovalov

Differential Revision: D41841033

fbshipit-source-id: c0cfd048c70e6b9e47224ab8cddcd6b5f4fc5597
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
e7851f7c79 Mac builds: python 3.10, pytorch 1.13
Summary: All mac builds now pytorch 1.13

Reviewed By: shapovalov

Differential Revision: D41841035

fbshipit-source-id: b932eb2fefed77ae22f9757f9bd628ce12b11fad
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
20a774e266 builds for PyTorch 1.13.0
Summary: Add builds for current pytorch

Reviewed By: shapovalov

Differential Revision: D41841034

fbshipit-source-id: 4a58515bd5c83b26f14763a3cec9279e905391d2
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
91b4c04c64 small readme update
Summary: followup D41534315 (5add065f8a)

Reviewed By: shapovalov

Differential Revision: D41842250

fbshipit-source-id: 54413e30880717f083fdc7acbce2eb3e646ffb94
2022-12-08 09:46:09 -08:00
Jiali Duan
cc2840eb44 Write meshes to GLB
Summary: Write the amalgamated mesh from the Mesh module to glb. In this version, the json header and the binary data specified by the buffer are merged into glb. The image texture attributes are added.

Reviewed By: bottler

Differential Revision: D41489778

fbshipit-source-id: 3af0e9a8f9e9098e73737a254177802e0fb6bd3c
2022-12-05 01:25:43 -08:00
David Novotny
dba48fb410 Add tutorial links to main README.md
Summary: <See title>

Reviewed By: bottler

Differential Revision: D41534604

fbshipit-source-id: 20111db87083b2cce7374cc2bd223ae220d7b010
2022-11-30 07:02:01 -08:00
David Novotny
5add065f8a Readme updates
Summary:
Running:
- clearly points users to experiment.py/visualize_reconstruction.py
Reproducing:
- Adds NeRF training on Blender
- Adds CO3Dv2 configs

Reviewed By: bottler

Differential Revision: D41534315

fbshipit-source-id: e85f5f1eafed8c35c9e91d748a04f238509cf8ec
2022-11-30 07:02:01 -08:00
Jeremy Reizenstein
a2c6af9250 more code blocks for readthedocs
Summary: More rst syntax fixes

Reviewed By: davidsonic

Differential Revision: D40977328

fbshipit-source-id: a3a3accbf2ba7cd9c84a0a82d0265010764a9d61
2022-11-29 03:13:40 -08:00
David Novotny
94f321fa3d render_flyaround bugfix
Summary: Fixes a bug which would crash render_flyaround anytime  visualize_preds_keys is adjusted

Reviewed By: shapovalov

Differential Revision: D41124462

fbshipit-source-id: 127045a91a055909f8bd56c8af81afac02c00f60
2022-11-28 04:36:41 -08:00
David Novotny
35f8cb9430 Downgrade "Assigning param_group " msg to DEBUG
Summary: <See title>

Reviewed By: bottler

Differential Revision: D41534524

fbshipit-source-id: 9c39198b9b8d5fc95f857b03ad39bfe0bd720cbb
2022-11-28 02:58:15 -08:00
David Novotny
c3a6ab02da Bug-fix visualize reconstruction
Summary:
Addresses the following issue:
https://github.com/facebookresearch/pytorch3d/issues/1345#issuecomment-1272881244

I.e., when installed from conda, `pytorch3d_implicitron_visualizer` crashes since it invokes `main()` while `main` requires a single positional arg `argv`.

Reviewed By: shapovalov

Differential Revision: D41533497

fbshipit-source-id: e53a923eb8b2f0f9c0e92e9c0866d9cb310c4799
2022-11-25 10:30:01 -08:00
Jeremy Reizenstein
60ab1cdb72 make x_enabled compulsory
Summary: Optional[some_configurable] won't autogenerate the enabled flag

Reviewed By: shapovalov

Differential Revision: D41522104

fbshipit-source-id: 555ff6b343faf6f18aad2f92fbb7c341f5e991c6
2022-11-24 09:38:02 -08:00
Jiali Duan
1706eb8216 Simplify MC C++ hashing logic
Summary: To be consistent with CUDA hashing, the diff replaces boost hasher with a simplified hasher for storing unique global edge_ids.

Reviewed By: kjchalup

Differential Revision: D41140382

fbshipit-source-id: 2ce598e5edcf6369fe13bd15d1f5e014b252027b
2022-11-15 19:42:04 -08:00
Jiali Duan
8b8291830e Marching Cubes cuda extension
Summary:
Torch CUDA extension for Marching Cubes
- MC involving 3 steps:
  - 1st forward pass to collect vertices and occupied state for each voxel
  - Compute compactVoxelArray to skip non-empty voxels
  - 2nd pass to genereate interpolated vertex positions and faces by marching through the grid
- In contrast to existing MC:
   - Bind each interpolated vertex with a global edge_id to address floating-point precision
   - Added deduplication process to remove redundant vertices and faces

Benchmarks (ms):

| N / V(^3)      | python          | C++             |   CUDA   | Speedup |
| 2 / 20          |    12176873  |       24338     |     4363   | 2790x/5x|
| 1 / 100          |     -             |    3070511     |   27126   |    113x    |
| 2 / 100          |     -             |    5968934     |   53129   |    112x    |
| 1 / 256          |     -             |  61278092     | 430900   |    142x    |
| 2 / 256          |     -             |125687930     | 856941   |    146x   |

Reviewed By: kjchalup

Differential Revision: D39644248

fbshipit-source-id: d679c0c79d67b98b235d12296f383d760a00042a
2022-11-15 19:42:04 -08:00
Jeremy Reizenstein
9a0b0c2e74 renderer and vis readthedocs #1363
Summary: Autogenerate docs for the renderer too. This will be helpful but make a slightly ugly TOC

Reviewed By: kjchalup

Differential Revision: D40977315

fbshipit-source-id: 10831de3ced68080cb5671c5dc31d4da8500f761
2022-11-15 14:10:22 -08:00
Daniel L. Lu
d0fbe2cb63 fix typo pucuda.gl --> pycuda.gl (#1379)
Summary:
Every time I try to run code, I get this warning:

```
  warnings.warn("Can't import pucuda.gl, not importing MeshRasterizerOpenGL.")
```

Of course, `pucuda` is a typo of `pycuda`.

This PR fixes the typo

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1379

Reviewed By: kjchalup

Differential Revision: D41295562

Pulled By: bottler

fbshipit-source-id: 2bfa2a2dbe20a5347861d36fbff5094994c1253d
2022-11-15 12:02:44 -08:00
Roman Shapovalov
719c33a7f9 Fix: visualisation with Enums fields in Configurables
Summary:
Enum fields cause the following to crash since they are loaded as strings:
```
config = OmegaConf.load(autodumped_cfg_file)
Experiment(**config)
```

It would be good to come up with the general solution but for now just fixing the visualisation script.

Reviewed By: bottler

Differential Revision: D41140426

fbshipit-source-id: 71c1c6b1fffe3b5ab1ca0114cfa3f0d81160278f
2022-11-08 15:58:41 -08:00
Roman Shapovalov
f3c1e0837c MC rasterize supports heterogeneous bundle; refactoring of bundle-to-padded
Summary:
Rasterize MC was not adapted to heterogeneous bundles.

There are some caveats though:
1) on CO3D, we get up to 18 points per image, which is too few for a reasonable visualisation (see below);
2) rasterising for a batch of 100 is slow.

I also moved the unpacking code close to the bundle to be able to reuse it.

{F789678778}

Reviewed By: bottler, davnov134

Differential Revision: D41008600

fbshipit-source-id: 9f10f1f9f9a174cf8c534b9b9859587d69832b71
2022-11-07 13:43:31 -08:00
Jeremy Reizenstein
7be49bf46f allow dots in param_groups
Summary:
Allow a module's param_group member to specify overrides to the param groups of its members or their members.
Also logging for param group assignments.

This allows defining `params.basis_matrix` in the param_groups of a voxel_grid.

Reviewed By: shapovalov

Differential Revision: D41080667

fbshipit-source-id: 49f3b0e5b36e496f78701db0699cbb8a7e20c51e
2022-11-07 06:41:40 -08:00
Jeremy Reizenstein
a1f2ded58a voxel_grid_implicit_function scaffold fixes
Summary: Fix indexing of directions after filtering of points by scaffold.

Reviewed By: shapovalov

Differential Revision: D40853482

fbshipit-source-id: 9cfdb981e97cb82edcd27632c5848537ed2c6837
2022-11-03 05:46:31 -07:00
David Novotny
e4a3298149 CO3Dv2 multi-category extension
Summary:
Allows loading of multiple categories.
Multiple categories are provided in a comma-separated list of category names.

Reviewed By: bottler, shapovalov

Differential Revision: D40803297

fbshipit-source-id: 863938be3aa6ffefe9e563aede4a2e9e66aeeaa8
2022-11-02 13:55:25 -07:00
Jeremy Reizenstein
c54e048666 more readthedocs
Summary: Quote formats, spelling

Reviewed By: shapovalov

Differential Revision: D40913734

fbshipit-source-id: d6dea65d5204b3c463c656a07ef9b447b7be6a0a
2022-11-02 05:19:15 -07:00
David Novotny
f7ac7b604a readthedocs fixes
Summary: Fixes readthedocs. Sphinx build looks good.

Reviewed By: bottler

Differential Revision: D40893196

fbshipit-source-id: bf00384b921d4ef54e64745ed39172358c2f9bb3
2022-11-01 05:46:13 -07:00
Jeremy Reizenstein
cd113efd98 Add implicitron to readthedocs
Summary: Try to document implicitron. Most of this is autogenerated.

Reviewed By: shapovalov

Differential Revision: D40623742

fbshipit-source-id: 453508277903b7d987b1703656ba1ee09bc2c570
2022-10-31 14:44:41 -07:00
Jeremy Reizenstein
322c8f2f50 make lpips optional
Summary: So that lpips isn't needed in readthedocs

Reviewed By: shapovalov

Differential Revision: D40859351

fbshipit-source-id: 58933bd3b71e78e658fbce56c3663b11ee2331f6
2022-10-31 14:44:41 -07:00
David Novotny
eff0aad15a Bugfix - normalize emitted ray directions after substraction
Summary: The bug lead to non-coinciding origins of the rays emitted from perspective cameras when unit_directions=True

Reviewed By: bottler

Differential Revision: D40865610

fbshipit-source-id: 398598e9e919b53e6bea179f0400e735bbb5b625
2022-10-31 14:00:49 -07:00
David Novotny
bea84a6fcd voxel_grid_if -> remove union type from the settings.
Summary: see title

Reviewed By: shapovalov

Differential Revision: D40803670

fbshipit-source-id: 211189167837af577d6502a698e2f3fb3aec3e30
2022-10-31 11:37:43 -07:00
Roman Shapovalov
f711c4bfe9 Fix parameters not wrapped with nn.Parameter, antialiasing compatibility
Summary: Some things fail if a parameter is not wraped; in particular, it prevented other tensors moving to GPU.

Reviewed By: bottler

Differential Revision: D40819932

fbshipit-source-id: a23b38ceacd7f0dc131cb0355fef1178e3e2f7fd
2022-10-31 01:43:00 -07:00
Jeremy Reizenstein
88620b6847 attempt to fix doc build #1363
Summary: installing from git: is failing

Reviewed By: shapovalov

Differential Revision: D40635668

fbshipit-source-id: 604ba5425e14caeabe4e178bf7f851f2163419bd
2022-10-27 07:26:36 -07:00
generatedunixname89002005307016
db7c80bf76 upgrade pyre version in fbcode/vision - batch 2
Differential Revision: D40695068

fbshipit-source-id: 9944a872d93a9dac348b252a0f8bf9c7e6f929f3
2022-10-25 22:42:06 -07:00