mmdetection3d icon indicating copy to clipboard operation
mmdetection3d copied to clipboard

[Feature] Custom classes for Det3DDataset

Open mbspng opened this issue 4 months ago • 1 comments

What is the feature?

Look at the code here:

https://github.com/open-mmlab/mmdetection3d/blob/fe25f7a51d36e3702f961e198894580d83c4387b/mmdet3d/datasets/det3d_dataset.py#L105

It says

        if metainfo is not None and 'classes' in metainfo:
            # we allow to train on subset of self.METAINFO['classes']
            # map unselected labels to -1
            self.label_mapping = {
                i: -1
                for i in range(len(self.METAINFO['classes']))
            }
            self.label_mapping[-1] = -1
            for label_idx, name in enumerate(metainfo['classes']):
                ori_label = self.METAINFO['classes'].index(name)
                self.label_mapping[ori_label] = label_idx

That is pretty ridiculous. It took me forever to realize this hard-coded nonsense was preventing my dataset from working, due to labels specific to my use-case. Why is this hard-coded? I am not finding any way to use a dataset with labels other than the original. Of course, I could map my labels to the labels of the original dataset. That would be silly though and, even worse, if I have more classes than the original dataset I am out of luck again!

How is anybody supposed to use this for their own use-case? It is useless if it hard-coded for the original dataset!

Any other context?

No response

mbspng avatar Oct 17 '24 08:10 mbspng