isl-org / Open3D-ML

An extension of Open3D to address 3D Machine Learning tasks
Other
1.88k stars 321 forks source link

vis.visualize_dataset() labels are off (by one?) #225

Closed equant closed 3 years ago

equant commented 3 years ago

I ran some of the README.md example code using the KITTI dataset and noticed that the labels are wrong. I noticed this too with my custom dataset.

import open3d.ml as _ml3d
import open3d.ml.torch as ml3d # or open3d.ml.tf as ml3d

dataset = ml3d.datasets.SemanticKITTI(dataset_path='/media/equant/7fe7f0a0-e17f-46d2-82d3-e7a8c25200bb/work/SemanticKITTI/',
    test_split=[ '12' ],
    training_split=[ '10' ],
    validation_split=['08'],
    all_split=[ '08', '10', '12' ],
)   

# get the 'all' split that combines training, validation and test set
all_split = dataset.get_split('all')

# print the attributes of the first datum
print(all_split.get_attr(0))

# print the shape of the first point cloud
print(all_split.get_data(0)['point'].shape)

# show the first 100 frames using the visualizer
vis = ml3d.vis.Visualizer()
vis.visualize_dataset(dataset, 'all', indices=range(1))

With a little inspection I hope you can see that the labels reported are not correct. The points with the label "traffic-sign" correspond to what should be vegetation. What is labeled "trunk" are points that should be labeled "unlabeled". Etc.

Screenshot_2021-02-17_10-17-03

eVen-gits commented 3 years ago

I can confirm this. Similarly, if I run demo code in example on Torronto3D, it will fail if indices are not provided in vis.visualize_dataset(dataset, 'all').

It appears the problem arises as well in DatasetModel.__init__, line 270 - index out of bounds - as the indices dont seem to match.

I will try to provide more useful information, but I am barely just exploring for the first time.

sanskar107 commented 3 years ago

Thanks for reporting this issue. External contributions are welcomed.

sanskar107 commented 3 years ago

Copy of #243