class_docstr: Check if the average image brightness (or bbox location if applicable) is similar between train and test set.
  
  The check computes the average grayscale image per dataset (train and test) and compares the resulting images.
  Additionally, in case of an object detection task, the check will compare the average locations of the bounding
  boxes between the datasets.
  
  Parameters
  ----------
  {additional_check_init_params:2*indent}
class_docstr_tok: ["Check","if","the","average","image","brightness","(","or","bbox","location","if","applicable",")","is","similar","between","train","and","test","set",".","The","check","computes","the","average","grayscale","image","per","dataset","(","train","and","test",")","and","compares","the","resulting","images",".","Additionally",",","in","case","of","an","object","detection","task",",","the","check","will","compare","the","average","locations","of","the","bounding","boxes","between","the","datasets",".","Parameters","--","--","--","--","--","{","additional_check_init_params:2","*","indent","}"]
docstr: Convert label batch to batch of images where pixels inside the bboxes are white and the rest are black.
docstr_tok: ["Convert","label","batch","to","batch","of","images","where","pixels","inside","the","bboxes","are","white","and","the","rest","are","black","."]
code: def _label_to_image_batch(
      self, label_batch: List[np.ndarray], image_batch: List[np.ndarray]
  ) -> List[np.ndarray]:
      """Convert label batch to batch of images where pixels inside the bboxes are white and the rest are black."""
      return_bbox_image_batch = []
      for image, label in zip(image_batch, label_batch):
          return_bbox_image_batch.append(
              self._label_to_image(label, image.shape[:2])
          )
      return return_bbox_image_batch
  
imports: from collections import defaultdict
  from typing import Iterable, List, Optional, Tuple
  import cv2
  import numpy
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from deepchecks.core import CheckResult, DatasetKind
  from deepchecks.vision._shared_docs import docstrings
  from deepchecks.vision.base_checks import TrainTestCheck
  from deepchecks.vision.context import Context
  from deepchecks.vision.utils.image_functions import apply_heatmap_image_properties, numpy_grayscale_to_heatmap_figure
  from deepchecks.vision.vision_data import TaskType
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
label_desc: Use image node_id 8 for calling the HeatmapComparison obj's underlying member method code with example usage: obj._label_to_image_batch(label_batch, image_batch) and returns: return_bbox_image_batch