mindspore.dataset.Dataset.get_class_indexing

Dataset.get_class_indexing()[source]

Return the class index.

Returns

dict, a str-to-int mapping from label name to index. dict, a str-to-list<int> mapping from label name to index for Coco ONLY. The second number in the list is used to indicate the super category.

Examples

>>> # dataset is an instance object of Dataset
>>> class_indexing = dataset.get_class_indexing()