code: def _count_classes_by_segment_in_image(
      labels: List[np.ndarray],
  ) -> List[int]:
      """Return a list containing the number of unique classes per image for semantic segmentation."""
      return [np.unique(label).shape[0] for label in labels]
  
file_path: deepchecks/deepchecks/vision/utils/label_prediction_properties.py
imports: from typing import List, Sequence, Union
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: _count_classes_by_segment_in_image(labels) and returns: unknown