def get_gt_labels(self):
        """Get all ground-truth labels (categories).

        Returns:
            np.ndarray: categories for all images.
        """

        gt_labels = np.array(
            [self.get_data_info(i)['gt_label'] for i in range(len(self))])
        return gt_labels
Get all ground-truth labels (categories).

        Returns:
            np.ndarray: categories for all images.
        
mmpretrain/datasets/base_dataset.py