-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Checklist
- I have searched for similar issues.
- I have tested with the latest development wheel.
- I have checked the release documentation and the latest documentation (for
mainbranch).
Describe the issue
When I try to plot a custom point cloud data with an additional attribute (classes attribute) with np.uint8 dtype, all my labels wrongly turn to zero. When using with the dtype np.int64, the plot works fine.
Steps to reproduce the bug
import numpy as np
import open3d.ml.torch as ml3d
# Correct
data = [
{
'name': 'test',
'points': np.array([
[0, 0, 0],
[0.1, 0, 0], [0.1, 0.1, 0],
[0.2, 0, 0], [0.2, 0.1, 0], [0.2, 0.2, 0]
]),
'classes': np.array([
1,
0, 0,
2, 2, 2
], dtype=np.int64)
}
]
lut = ml3d.vis.LabelLUT()
lut.add_label('zero', 0, [1, 0, 0])
lut.add_label('one', 1, [0, 1, 0])
lut.add_label('two', 2, [0, 0, 1])
vis = ml3d.vis.Visualizer()
vis.set_lut("classes", lut)
vis.visualize(data)
# Wrong
data = [
{
'name': 'test',
'points': np.array([
[0, 0, 0],
[0.1, 0, 0], [0.1, 0.1, 0],
[0.2, 0, 0], [0.2, 0.1, 0], [0.2, 0.2, 0]
]),
'classes': np.array([
1,
0, 0,
2, 2, 2
], dtype=np.uint8)
}
]
lut = ml3d.vis.LabelLUT()
lut.add_label('zero', 0, [1, 0, 0])
lut.add_label('one', 1, [0, 1, 0])
lut.add_label('two', 2, [0, 0, 1])
vis = ml3d.vis.Visualizer()
vis.set_lut("classes", lut)
vis.visualize(data)Error message
Using np.uint8, the plot is:
Where all points are wrongly in the classe zero (red)
Expected behavior
Its expected the plot with np.uint8 to be the same of the plot with np.int64. The result of the np.int64 is given bellow:
Open3D, Python and System information
- Operating system: Windows 11 (WSL Ubuntu 24.01)
- Python version: Python 3.12.3
- Open3D version: 0.19.0
- System type: x86_64
- Is this remote workstation?: no
- How did you install Open3D?: pip (with venv)Additional information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

