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
This commit is contained in:
Amitav Baruah 2020-11-19 13:51:17 -08:00 committed by Facebook GitHub Bot
parent 6c2fc685de
commit fc7a4cacc3

View File

@ -587,7 +587,9 @@ def _add_pointcloud_trace(
color = None
if features is not None:
features = features[indices]
if indices is not None:
# Only select features if we selected vertices above
features = features[indices]
if features.shape[1] == 4: # rgba
template = "rgb(%d, %d, %d, %f)"
rgb = (features[:, :3].clamp(0.0, 1.0) * 255).int()