7 Commits

Author SHA1 Message Date
Amitav Baruah
fc7a4cacc3 Fix plotly pointcloud visualization feature bug
Summary: If a pointcloud had less than pointcloud_max_points, the colors would not render. This diff fixes that.

Reviewed By: bottler

Differential Revision: D25099044

fbshipit-source-id: 47c3ddcdb4e06284b0a7966ffca1b973f394921f
2020-11-19 13:52:46 -08:00
Amitav Baruah
6c2fc685de Update subplot arrangement to support non-uniform grids
Summary: Previously, grids where the columns don't divide the number of plots evenly would error. Now, there'll just be a sparse last row.

Reviewed By: bottler

Differential Revision: D25069236

fbshipit-source-id: 9d2fd62f3d39bfebc07ce0a41718621fa69d6057
2020-11-18 15:47:01 -08:00
Amitav Baruah
005a334f99 Render PyTorch3d cameras in plotly
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
2020-10-20 17:16:17 -07:00
Amitav Baruah
035109675e Render plotly plot from PyTorch3D renderer POV
Summary:
Use a provided renderer's camera positions to render a plotly plot to match what the renderer would render for pointclouds and meshes.
- takes in a Cameras object for viewpoints
- for each subplot, will index into the Cameras object (or use the Cameras object, if len(viewpoint_cameras) == 1 and use the Cameras' eye and at vectors to set plotly's camera's corresponding values, the eye and center values.

Reviewed By: nikhilaravi

Differential Revision: D24094934

fbshipit-source-id: 48abcdb04c6909a172ba9f721522c3446952a089
2020-10-20 17:16:17 -07:00
Amitav Baruah
bf7aca320a Add wrapper function to plot batches
Summary:
- adds plot_batch_individually
- for each batched object, plots each object in its own subplot with other same-indexed elements of the other batched objects provided as input

Reviewed By: nikhilaravi

Differential Revision: D24258389

fbshipit-source-id: a80128e6e7a03a44c257b0598569159afadb2d39
2020-10-20 17:16:17 -07:00
Amitav Baruah
964893cdcb Refactor plot_meshes and plot_pointclouds to one generalizable API, plot_scene
Summary: Defines a function plot_scene that takes in a dictionary defining subplot and trace layouts for Mesh/Pointcloud objects and plots them. Also supports other plotly axis arguments and mesh lighting. Plot_batch_individually is a wrapper function that takes in one or multiple batched Meshes/Pointclouds and uses plot_scene to plot each element within a batch in an individual subplot, possibly sharing that subplot with traces of other individual elements of the other batched structures passed in.

Reviewed By: nikhilaravi

Differential Revision: D24235479

fbshipit-source-id: 9f669f1b186d55fe5c75552083316c0cf1387472
2020-10-20 17:16:17 -07:00
Amitav Baruah
5d65a0cf8c Rename visualization to vis
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
2020-10-06 15:55:05 -07:00