Summary:
Converts the directory specified to use the Ruff formatter in pyfmt
ruff_dog
If this diff causes merge conflicts when rebasing, please run
`hg status -n -0 --change . -I '**/*.{py,pyi}' | xargs -0 arc pyfmt`
on your diff, and amend any changes before rebasing onto latest.
That should help reduce or eliminate any merge conflicts.
allow-large-files
Reviewed By: bottler
Differential Revision: D66472063
fbshipit-source-id: 35841cb397e4f8e066e2159550d2f56b403b1bef
Summary:
Benchmarking. We only use num_faces=2 for splatter, because as far as I can see one would never need to use more. Pose optimization and mesh optimization experiments (see next two diffs) showed that Splatter with 2 faces beats Softmax with 50 and 100 faces in terms of accuracy.
Results: We're slower at 64px^2. At 128px and 256px, we're slower than Softmax+50faces, but faster than Softmax+100faces. We're also slower at 10 faces/pix, but expectation as well as results show that more then 2 faces shouldn't be necessary. See also more results in .https://fburl.com/gdoc/ttv7u7hp
Reviewed By: jcjohnson
Differential Revision: D36210575
fbshipit-source-id: c8de28c8a59ce5fe21a47263bd43d2757b15d123
Summary: Update all FB license strings to the new format.
Reviewed By: patricklabatut
Differential Revision: D33403538
fbshipit-source-id: 97a4596c5c888f3c54f44456dc07e718a387a02c
Summary: Updated the alpha channel in the `hard_rgb_blend` function to return the mask of the pixels which have overlapping mesh faces.
Reviewed By: bottler
Differential Revision: D29001604
fbshipit-source-id: 22a2173d769f2d3ad34892d68ceb628f073bca22
Summary:
Small fix to the softmax blending function.
To avoid overflow in the exponential for the softmax, the exponent is shifted by the maximum value. In the final calculation of the color there is a weighted sum between the pixel color and the background color - in order for the sum to be correct, the background color also needs to be handled in the same way witt the shifted exponent.
Reviewed By: gkioxari
Differential Revision: D23148301
fbshipit-source-id: 86066586ee7d3ce7bd4a2076b12ce191fbd151a7
Summary:
C++/CUDA implementation of forward and backward passes for the sigmoid alpha blending function.
This is slightly faster than the vectorized implementation in Python, but more importantly uses less memory due to fewer tensors being created.
Reviewed By: gkioxari
Differential Revision: D19980671
fbshipit-source-id: 0779055d2c68b1f20fb0870e60046077ef4613ff
Summary: Adds support to hard_rgb_blend and hard blending shaders in shader.py (HardPhongShader, HardGouraudShader, and HardFlatShader) for changing the background color on which objects are rendered
Reviewed By: nikhilaravi
Differential Revision: D21746062
fbshipit-source-id: 08001200f4339d6a69c52405c6b8f4cac9f3f56e
Summary:
Ran the linter.
TODO: need to update the linter as per D21353065.
Reviewed By: bottler
Differential Revision: D21362270
fbshipit-source-id: ad0e781de0a29f565ad25c43bc94a19b1828c020
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
Summary:
## Updates
- Defined the world and camera coordinates according to this figure. The world coordinates are defined as having +Y up, +X left and +Z in.
{F230888499}
- Removed all flipping from blending functions.
- Updated the rasterizer to return images with +Y up and +X left.
- Updated all the mesh rasterizer tests
- The expected values are now defined in terms of the default +Y up, +X left
- Added tests where the triangles in the meshes are non symmetrical so that it is clear which direction +X and +Y are
## Questions:
- Should we have **scene settings** instead of raster settings?
- To be more correct we should be [z clipping in the rasterizer based on the far/near clipping planes](https://github.com/ShichenLiu/SoftRas/blob/master/soft_renderer/cuda/soft_rasterize_cuda_kernel.cu#L400) - these values are also required in the blending functions so should we make these scene level parameters and have a scene settings tuple which is available to the rasterizer and shader?
Reviewed By: gkioxari
Differential Revision: D20208604
fbshipit-source-id: 55787301b1bffa0afa9618f0a0886cc681da51f3
Summary:
Changed `torch.cumprod` to `torch.prod` in blending functions and added more tests and benchmark tests.
This should fix the issue raised on GitHub.
Reviewed By: gkioxari
Differential Revision: D20163073
fbshipit-source-id: 4569fd37be11aa4435a3ce8736b55622c00ec718
Summary:
BlendParams background_color is immutable , type hint as a sequence allows setting new values in constructor.
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/64
Reviewed By: bottler
Differential Revision: D20068911
Pulled By: nikhilaravi
fbshipit-source-id: c580a7654dca25629218513841aa16d9d1055588