mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 20:02:49 +08:00
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:
parent
6c2fc685de
commit
fc7a4cacc3
@ -587,7 +587,9 @@ def _add_pointcloud_trace(
|
|||||||
|
|
||||||
color = None
|
color = None
|
||||||
if features is not 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
|
if features.shape[1] == 4: # rgba
|
||||||
template = "rgb(%d, %d, %d, %f)"
|
template = "rgb(%d, %d, %d, %f)"
|
||||||
rgb = (features[:, :3].clamp(0.0, 1.0) * 255).int()
|
rgb = (features[:, :3].clamp(0.0, 1.0) * 255).int()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user