def METHOD_NAME(self):
    label_image_indexes = [set() for _ in range(len(self.class_names))]
    for i, image in enumerate(self.data):
        for label_id in image['labels']:
            label_image_indexes[label_id].add(i)
    label_stat = [len(s) for s in label_image_indexes]
    self.min_image_num = min(label_stat[1:])
    sample_image_indexes = set()
    for image_indexes in label_image_indexes[1:]:
        image_indexes = np.array(list(image_indexes))
        sub = np.random.permutation(image_indexes)[:self.min_image_num]
        sample_image_indexes.update(sub)
    sample_data = [self.data[i] for i in sample_image_indexes]
    return sample_data