Summary: Implements the training script of NeRF.
Reviewed By: nikhilaravi
Differential Revision: D25684439
fbshipit-source-id: 8b19b6dc282eb6bf6e46ec4476bb0f13a84c90dd
Summary: Implements the `Stats` class that handles logging of the training statistics.
Reviewed By: nikhilaravi
Differential Revision: D25684430
fbshipit-source-id: 920a1c65917ab5d047988494d92173da60cfd64b
Summary: Implements the main NeRF model class that controls the radiance field and its renderer
Reviewed By: nikhilaravi
Differential Revision: D25684419
fbshipit-source-id: fae45572daa6748c6234bd212f3e68110f778238
Summary: Implements the radiance field function of NeRF
Reviewed By: nikhilaravi
Differential Revision: D25684413
fbshipit-source-id: 4bf6dd5d22e6134a09f7b9f314536ec16670f737
Summary: An initial NeRF diff which sets up the folder structure and implements the raymarching algorithm of NeRF.
Reviewed By: nikhilaravi
Differential Revision: D25623990
fbshipit-source-id: ac6b05a9b866358bd4bbf44858f06859d8a6ebd1
Summary: Corner case where there's nothing to do in this function.
Reviewed By: nikhilaravi
Differential Revision: D26073476
fbshipit-source-id: eb061683ffe35c1ffa8384c422a1557a636d52cd
Summary: We were double counting some pairs in some cases. Specifically if four or more faces share an edge, then some of them were getting double counted. This is a minimal tweak to avoid that.
Reviewed By: nikhilaravi
Differential Revision: D26073477
fbshipit-source-id: a40032acf3044bb98dd91cb29904614ef64d5599
Summary:
Fixes the assertion that `p1` and `p2` have the same last dimension. The issue was that `D` is set to equal `p2.size(2)`, and then `D` is compared to `p2.size(2)`. The fix instead compares `D` to `p1.size(2).
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/524
Reviewed By: bottler
Differential Revision: D26008688
Pulled By: nikhilaravi
fbshipit-source-id: e32afe9da127d81b1a411d3c223b539a7400597b
Summary: We previously did not send an `up` vector in to plotly when visualization_cameras is supplied. This meant the image would have the default orientation instead of the correct one. Now we use the library function `camera_to_eye_at_up` to calculate the plotly position, which includes the `up` vector.
Reviewed By: nikhilaravi
Differential Revision: D25981183
fbshipit-source-id: abec72b349f3a5519209e0e6c0518133c3750807
Summary:
Plotly viewing from a specific camera location requires converting that location in to an (eye, at, up) specification. There may be other reasons to want to do this as well. I create a separate utility function for it.
I envisage more such utility functions for manipulating camera information, so I create a separate camera_utils.py file for such things.
Reviewed By: nikhilaravi
Differential Revision: D25981184
fbshipit-source-id: 0947bf98b212676c021f2fddf775bf436dee3487
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
Summary: Make `to` on Transform3D carry its member _transforms.
Reviewed By: nikhilaravi
Differential Revision: D25978611
fbshipit-source-id: 12b39e7a657f28d59ca60800bf9f4193a2c08197
Summary: Gradient calculation flags were not properly routed through the Python interface. This diff fixes this. In particular, gradients for focal length (only if no other camera gradients were calculated) and opacity were not calculated as required.
Reviewed By: gkioxari
Differential Revision: D25921202
fbshipit-source-id: 22cbae3bda886d81bb95878f0be45c2ddd29934c
Summary:
PyTorch versions 1.7.0 and 1.7.1 are between https://github.com/pytorch/pytorch/pull/43931 and https://github.com/pytorch/pytorch/pull/47404. In this gap, PyTorch always copies CC to nvcc_args, like PyTorch3D does. Newer nvcc versions are not happy with `-ccbin` being specified twice, even if it is specified twice the same. We update PyTorch3D so that it doesn't supply `-ccbin` in these cases.
Also tweak the detection of the current ccbin so that it is aware that `-ccbin foo` and `-ccbin=foo` are equivalent.
Reviewed By: theschnitz
Differential Revision: D25825468
fbshipit-source-id: b04e7718cf01820649518eedda99c399c732e8af
Summary:
Allow PLY files to not contain faces. Allow loading pointclouds with color, at least encoded according to the way of some cloudcompare examples.
TODO: Allow vertex normals to be read, and allow vertex colors to be written. Make the return type of load_ply something more user friendly, like a dict.
Noticed in https://github.com/facebookresearch/pytorch3d/issues/209
Reviewed By: nikhilaravi
Differential Revision: D22573314
fbshipit-source-id: 72ba1f7c6417f5dfc83f2ebf359eff017057635c
Summary:
In the original implementation, I had considered PLY properties where there are mixed types of elements in a property to be rare and basically unimportant, so the implementation is very naive.
If we want to support pointcloud PLY files, we need to handle at least the subcase where there are no lists efficiently because this seems to be very common there.
Reviewed By: nikhilaravi, gkioxari
Differential Revision: D22573315
fbshipit-source-id: db6f29446d4e555a2e2b37d38c8e4450d061465b
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
Summary: Implements a notebook that fits a volume to multiple views of the cow mesh.
Reviewed By: nikhilaravi
Differential Revision: D24553385
fbshipit-source-id: 367ca39e176b40df2c5946c9c05d3be824dc8d1c
Summary: Implemented a data structure for volumes.
Reviewed By: gkioxari
Differential Revision: D20342920
fbshipit-source-id: ccc23eaa183ed8a4e9cd7674b4dcf31e8a65c3c6
Summary: Extends `list_to_padded`/`padded_to_list` to work for tensors with an arbitrary number of input dimensions.
Reviewed By: nikhilaravi, gkioxari
Differential Revision: D23813969
fbshipit-source-id: 52c212a2ecdb3c4dfb6ac47217715e07998f37f1
Summary: Now we use iopath, we need to find it from its own channel.
Reviewed By: nikhilaravi
Differential Revision: D25710499
fbshipit-source-id: 1c67eb6d5b009d35b65a3acd3ebff6e0e45fecc4
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
Summary: Allowing usort, isort and black to coexist without fighting means we can't have imports commented as deprecated from the same module as other imports.
Reviewed By: nikhilaravi
Differential Revision: D25372970
fbshipit-source-id: 637f5a0025c0df9fbec47cba73ce5387f4f8b467
Summary: Add ioPath as a dependency of PyTorch3D in preparation for using the new PathManager.
Reviewed By: nikhilaravi
Differential Revision: D25372971
fbshipit-source-id: d8aa661d2de975e747dd494edc42bf843990cf68
Summary: Use a more recent PyTorch to build the documentation.
Reviewed By: nikhilaravi
Differential Revision: D25679756
fbshipit-source-id: 83d647f709337110d39886eaa6aad2565d740c6d
Summary: This fixes a corner case for multi-radius handling for the pulsar backend. The additional dimensionality check ensures that the batched parsing for radiuses is only performed when appropriate.
Reviewed By: bottler
Differential Revision: D25387708
fbshipit-source-id: c486dcf327f812265b7ca8ca5ef5c6a31e6d4549
Summary:
Defines a function to run marching cubes algorithm on a single or batch of 3D scalar fields. Returns a mesh's faces and vertices.
UPDATES (12/18)
- Input data is now specified as a (B, D, H, W) tensor as opposed to a (B, W, H, D) tensor. This will now be compatible with the Volumes datastructure.
- Add an option to return output vertices in local coordinates instead of world coordinates.
Also added a small fix to remove the dype for device in Transforms3D - if passing in a torch.device instead of str it causes a pyre error.
Reviewed By: jcjohnson
Differential Revision: D24599019
fbshipit-source-id: 90554a200319fed8736a12371cc349e7108aacd0
Summary: Fixes the index out of bound errors for texture sampling from a texture atlas: when barycentric coordinates are 1.0, the integer index into the (R, R) per face texture map is R (max can only be R-1).
Reviewed By: gkioxari
Differential Revision: D25543803
fbshipit-source-id: 82d0935b981352b49c1d95d5a17f9cc88bad0a82
Summary:
Similar to non square image rasterization for meshes, apply the same updates to the pointcloud rasterizer.
Main API Change:
- PointRasterizationSettings now accepts a tuple/list of (H, W) for the image size.
Reviewed By: jcjohnson
Differential Revision: D25465206
fbshipit-source-id: 7370d83c431af1b972158cecae19d82364623380