class_docstr: VisionData is the base data object of deepcheck vision used as input to checks and suites.
  
  Parameters
  ----------
  batch_loader :
      A batch_loader which load a batch of data in an iterative manner. Batch loader batch output must be a
      dictionary in BatchOutputFormat format. The batch loader must provide SHUFFLED batches.
  task_type : str
      The task type of the data. can be one of the following: 'classification', 'semantic_segmentation',
      'object_detection', 'other'. For 'other', only image related checks (such as ImagePropertyOutliers) will be run.
  label_map : Dict[int, str], optional
      A dictionary mapping class ids to their names.
  dataset_name: str, optional
      Name of the dataset to use in the displays instead of "Train" or "Test".
  reshuffle_data: bool, default=True
      If True we will attempt to shuffle the batch loader. Only set this to False if the data is already shuffled.
class_docstr_tok: ["VisionData","is","the","base","data","object","of","deepcheck","vision","used","as","input","to","checks","and","suites",".","Parameters","--","--","--","--","--","batch_loader",":","A","batch_loader","which","load","a","batch","of","data","in","an","iterative","manner",".","Batch","loader","batch","output","must","be","a","dictionary","in","BatchOutputFormat","format",".","The","batch","loader","must","provide","SHUFFLED","batches",".","task_type",":","str","The","task","type","of","the","data",".","can","be","one","of","the","following",":","'classification","'",",","'semantic_segmentation","'",",","'object_detection","'",",","'other","'",".","For","'other","'",",","only","image","related","checks","(","such","as","ImagePropertyOutliers",")","will","be","run",".","label_map",":","Dict","[","int",",","str","]",",","optional","A","dictionary","mapping","class","ids","to","their","names",".","dataset_name",":","str",",","optional","Name","of","the","dataset","to","use","in","the","displays","instead","of","``","Train","''","or","``","Test","''",".","reshuffle_data",":","bool",",","default=True","If","True","we","will","attempt","to","shuffle","the","batch","loader",".","Only","set","this","to","False","if","the","data","is","already","shuffled","."]
docstr: Validate the VisionData functionalities implemented by the user and set which formatters were implemented.
docstr_tok: ["Validate","the","VisionData","functionalities","implemented","by","the","user","and","set","which","formatters","were","implemented","."]
code: def validate(self):
      """Validate the VisionData functionalities implemented by the user and set which formatters were implemented."""
      batch: BatchOutputFormat = next(iter(self._batch_loader))
      allowed_keys = {
          "images",
          "labels",
          "predictions",
          "additional_data",
          "embeddings",
          "image_identifiers",
      }
      if not isinstance(batch, dict) or not all(
          key in allowed_keys for key in batch.keys()
      ):
          raise ValidationError(
              "Batch loader batch output must be a dictionary containing a subset of the "
              f"following keys: {allowed_keys}."
          )
      length_dict = defaultdict()
  
      images = batch.get("images")
      if images is not None:
          self._has_images = True
          validate_images_format(images)
          length_dict["images"] = len(images)
  
      labels = batch.get("labels")
      if labels is not None:
          self._has_labels = True
          validate_labels_format(labels, self._task_type)
          length_dict["labels"] = len(labels)
  
      predictions = batch.get("predictions")
      if predictions is not None:
          self._has_predictions = True
          validate_predictions_format(predictions, self._task_type)
          if self._task_type == TaskType.CLASSIFICATION:
              if self.label_map and len(predictions[0]) != len(
                  self.label_map
              ):
                  raise ValidationError(
                      "Number of entries in proba does not match number of classes in label_map"
                  )
              if not self.label_map:
                  self.label_map = LabelMap(
                      {i: str(i) for i in range(len(predictions[0]))}
                  )
          length_dict["predictions"] = len(predictions)
  
      additional_data = batch.get("additional_data")
      if additional_data is not None:
          self._has_additional_data = True
          validate_additional_data_format(additional_data)
          length_dict["additional_data"] = len(additional_data)
  
      embeddings = batch.get("embeddings")
      if embeddings is not None:
          self._has_embeddings = True
          validate_embeddings_format(embeddings)
          length_dict["embeddings"] = len(embeddings)
  
      if (
          len(length_dict) == 0
      ):  # TODO: use doc link once docs are available
          raise ValidationError(
              "No data formatters were implemented, at least one of methods described in "
              "https://docs.deepchecks.com/stable/user-guide/vision/data-classes/VisionData.html"
              "must be implemented."
          )
  
      image_identifiers = batch.get("image_identifiers")
      if image_identifiers is not None:
          self._has_image_identifiers = True
          validate_image_identifiers_format(image_identifiers)
          length_dict["image_identifiers"] = len(image_identifiers)
  
      if len(set(length_dict.values())) > 1:
          raise ValidationError(
              "All formatter functions must return sequences of the same length. "
              f"The following lengths were found: {length_dict}"
          )
  
imports: import sys
  import typing
  from collections import defaultdict
  import numpy
  from typing_extensions import Literal
  from deepchecks.core.errors import DeepchecksValueError, ValidationError
  from deepchecks.core.serialization.html_display import HtmlDisplayableResult
  from deepchecks.utils.ipython import is_notebook, is_sphinx
  from deepchecks.vision.utils.detection_formatters import DEFAULT_PREDICTION_FORMAT
  from deepchecks.vision.utils.image_functions import draw_bboxes, draw_masks, prepare_thumbnail, random_color_dict
  from deepchecks.vision.vision_data import TaskType
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
  from deepchecks.vision.vision_data.format_validators import validate_additional_data_format, validate_embeddings_format, validate_image_identifiers_format, validate_images_format, validate_labels_format, validate_predictions_format
  from deepchecks.vision.vision_data.utils import BatchOutputFormat, LabelMap, get_class_ids_from_numpy_labels, get_class_ids_from_numpy_preds, shuffle_loader
label_desc: Use image node_id 4 for calling the VisionData obj's underlying member method code with example usage: obj.validate() without return types