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
Summary: We were importing torch, torchvision, PyTorch3D, and sys twice. This is just removing the duplicate (unneeded) imports
Reviewed By: theschnitz
Differential Revision: D24479270
fbshipit-source-id: 1048732f65242eb776c3eef537cb1ae58815c1eb
Summary: Take in a renderer with camera(s) and render the cameras as wireframes in the corresponding plotly plots
Reviewed By: nikhilaravi
Differential Revision: D24151706
fbshipit-source-id: f8e86d61f3d991500bafc0533738c79b96bda630
Summary: Change the two affected tutorials to use plot_scene and plot_batch_individually.
Reviewed By: nikhilaravi
Differential Revision: D24235480
fbshipit-source-id: ca9d73bfb7ccf733efaf16299c15927406d7f2aa
Summary: Importing from pytorch3d.visualization is wordy, so shortened the path to the vis module and updated the relevant imports.
Reviewed By: nikhilaravi
Differential Revision: D24116527
fbshipit-source-id: e0e4da7d48c5afedec07482d7be43362b6822445
Summary: Add examples of using the Plotly visualization functions to the corresponding tutorial notebooks.
Reviewed By: nikhilaravi
Differential Revision: D23879109
fbshipit-source-id: ea8c45aa6c828eb2f6ea2ae1c8846adc486f92e0
Summary:
Add a notebook demonstrating how to use Pytorch3D to render a textured mesh with the DensePose textures and the SMPL model
{F336408690}
Reviewed By: nikhilaravi
Differential Revision: D23784314
fbshipit-source-id: c92f32fb9b9468eb7ec26bf58dcabb1f26d92e7b
Summary:
Add cells to the rendering_colored_points tutorial showing how to initialize a renderer and compositor that will render pointclouds with a background color.
{F333731292}
{F334136799}
Reviewed By: nikhilaravi
Differential Revision: D23632503
fbshipit-source-id: e9ce0178b41e74baf912bd82ca1db41b680fc68f
Summary: Previously the tutorial code assumed that the reference image had a black background, resulting in an empty silhouette mask. Since the background is white, this change allows the model to find the correct silhouette mask.
Reviewed By: nikhilaravi, sbranson
Differential Revision: D23502202
fbshipit-source-id: c3a570f93efd480323f27cb081db0a9fb54be219
Summary:
Update the installation cells to import torch.
Replace use of deprecated Textures in deform tutorial.
Correct the deform tutorial's idea of its own name.
Fix typo in batched part of render_textured_meshes which meant only one mesh was being rendered with a batch of cameras.
Add an error check in the rasterizer to make the error friendly from such a mistake elsewhere.
Reviewed By: gkioxari
Differential Revision: D23345462
fbshipit-source-id: 1d5bd25db052f7ef687b7168d7aee5cc4dce8952
Summary:
Add a document to explain how to run the tutorials.
Fix API of TexturesVertex in fit_textured_mesh.
Prepare cuda 10.1 wheels (not 10.2) for linux to be available on pypi - this matches what colab has.
Change the tutorials to use these new wheels.
Reviewed By: gkioxari
Differential Revision: D23324479
fbshipit-source-id: 60e92a3f46a2d878f811b7703638f8d1dae143d9
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
Summary:
Refactor cameras
* CamerasBase was enhanced with `transform_points_screen` that transforms projected points from NDC to screen space
* OpenGLPerspective, OpenGLOrthographic -> FoVPerspective, FoVOrthographic
* SfMPerspective, SfMOrthographic -> Perspective, Orthographic
* PerspectiveCamera can optionally be constructred with screen space parameters
* Note on Cameras and coordinate systems was added
Reviewed By: nikhilaravi
Differential Revision: D23168525
fbshipit-source-id: dd138e2b2cc7e0e0d9f34c45b8251c01266a2063
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
Summary: Tutorial showing how to create a synthetic dataset by rendering a cow from multiple views, fit a mesh using a differential silhouette renderer, then fit a mesh using an RGB renderer.
Reviewed By: nikhilaravi
Differential Revision: D22513859
fbshipit-source-id: 24bdaac4ebec6dd01f98e2f5c702065f9335ff33
Summary: It's easier to understand code changes if we don't store the output in the notebooks. This is just a run of nbstripout on all the notebooks.
Reviewed By: nikhilaravi
Differential Revision: D22357375
fbshipit-source-id: bffdb426af2f676d448630d717658d609c224811
Summary: Fix to enable a mesh/point rasterizer to be initialized without having to specify the camera.
Reviewed By: jcjohnson, gkioxari
Differential Revision: D21362359
fbshipit-source-id: 4f84ea18ad9f179c7b7c2289ebf9422a2f5e26de
Summary:
Fix a bug which resulted in a rendering artifacts if the image size was not a multiple of 16.
Fix: Revert coarse rasterization to original implementation and only update fine rasterization to reverse the ordering of Y and X axis. This is much simpler than the previous approach!
Additional changes:
- updated mesh rendering end-end tests to check outputs from both naive and coarse to fine rasterization.
- added pointcloud rendering end-end tests
Reviewed By: gkioxari
Differential Revision: D21102725
fbshipit-source-id: 2e7e1b013dd6dd12b3a00b79eb8167deddb2e89a
Summary: Remove `bin_size` and `max_faces_per_pixel` from being specified. This means the coarse-to-fine rasterization will be used by default and will help avoid confusion with the naive version.
Reviewed By: jcjohnson
Differential Revision: D20908905
fbshipit-source-id: c181c88e844d888aa81a36870918307961dc1175
Summary:
Add a note about the difference between naive and coarse-to-fine rasterization to all the rendering tutorials.
Update the render pointclouds tutorial to wget the data file.
Reviewed By: gkioxari
Differential Revision: D20575257
fbshipit-source-id: a2806b9452438f97cb754f87e011c6e32e2545e4
Summary:
A few small website updates:
- changed the tutorials to point to the `stable` tag on github so we don't have to update the website each time we want to run them!
- changed the colab button
- re ran notebook cells to update the images for textured meshes
Once these fixes are landed I can build and publish the website.
Reviewed By: bottler
Differential Revision: D20484836
fbshipit-source-id: 603a05e752f631c60d1a3abb9adeb1b9b451ab98
Summary: Use a consistent case for PyTorch3D (matching the logo...): replace all occurrences of PyTorch3d with PyTorch3D across the codebase (including documentation and notebooks)
Reviewed By: wanyenlo, gkioxari
Differential Revision: D20427546
fbshipit-source-id: 8c7697f51434c51e99b7fe271935932c72a1d9b9
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:
Renamed shaders to be prefixed with Hard/Soft depending on if they use a probabalistic blending (Soft) or use the closest face (Hard).
There is some code duplication but I thought it would be cleaner to have separate shaders for each task rather than:
- inheritance (which we discussed previously that we want to avoid)
- boolean (hard/soft) or a string (hard/soft) - new blending functions other than the ones provided would need if statements in the current shaders which might get messy.
Also added a `flat_shading` function and a `FlatShader` - I could make this into a tutorial as it was really easy to add a new shader and it might be a nice showcase.
NOTE: There are a few more places where the naming will need to change (e.g the tutorials) but I wanted to reach a consensus on this before changing it everywhere.
Reviewed By: jcjohnson
Differential Revision: D19761036
fbshipit-source-id: f972f6530c7f66dc5550b0284c191abc4a7f6fc4
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
Summary:
Update all colab notebooks to:
- Install pytorch3d using pip install from github.
- Retrieve data using `wget`. I set the wget commands to save the files in the same directory structure as in the PyTorch3d repo so that the rest of the tutorial would work for running locally or on Colab.
This should resolve the issues on GitHub with running the colab notebooks.
Reviewed By: gkioxari
Differential Revision: D19827450
fbshipit-source-id: d7b338597ddfd9a84c24592d4dccd274cae11d05
Summary:
Set up landing page, docs page, and html versions of the ipython notebook tutorials.
Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/11
Reviewed By: gkioxari
Differential Revision: D19730380
Pulled By: nikhilaravi
fbshipit-source-id: 5df8d3f2ac2f8dce4d51f5d14fc336508c2fd0ea