code: def get_slice_bboxes(
      image_height: int,
      image_width: int,
      slice_height: Optional[int] = None,
      slice_width: Optional[int] = None,
      auto_slice_resolution: bool = True,
      overlap_height_ratio: float = 0.2,
      overlap_width_ratio: float = 0.2,
  ) -> List[List[int]]:
      """Slices `image_pil` in crops.
      Corner values of each slice will be generated using the `slice_height`,
      `slice_width`, `overlap_height_ratio` and `overlap_width_ratio` arguments.
  
      Args:
          image_height (int): Height of the original image.
          image_width (int): Width of the original image.
          slice_height (int, optional): Height of each slice. Default None.
          slice_width (int, optional): Width of each slice. Default None.
          overlap_height_ratio(float): Fractional overlap in height of each
              slice (e.g. an overlap of 0.2 for a slice of size 100 yields an
              overlap of 20 pixels). Default 0.2.
          overlap_width_ratio(float): Fractional overlap in width of each
              slice (e.g. an overlap of 0.2 for a slice of size 100 yields an
              overlap of 20 pixels). Default 0.2.
          auto_slice_resolution (bool): if not set slice parameters such as slice_height and slice_width,
              it enables automatically calculate these params from image resolution and orientation.
  
      Returns:
          List[List[int]]: List of 4 corner coordinates for each N slices.
              [
                  [slice_0_left, slice_0_top, slice_0_right, slice_0_bottom],
                  ...
                  [slice_N_left, slice_N_top, slice_N_right, slice_N_bottom]
              ]
      """
      slice_bboxes = []
      y_max = y_min = 0
  
      if slice_height and slice_width:
          y_overlap = int(overlap_height_ratio * slice_height)
          x_overlap = int(overlap_width_ratio * slice_width)
      elif auto_slice_resolution:
          (
              x_overlap,
              y_overlap,
              slice_width,
              slice_height,
          ) = get_auto_slice_params(
              height=image_height, width=image_width
          )
      else:
          raise ValueError(
              "Compute type is not auto and slice width and height are not provided."
          )
  
      while y_max < image_height:
          x_min = x_max = 0
          y_max = y_min + slice_height
          while x_max < image_width:
              x_max = x_min + slice_width
              if y_max > image_height or x_max > image_width:
                  xmax = min(image_width, x_max)
                  ymax = min(image_height, y_max)
                  xmin = max(0, xmax - slice_width)
                  ymin = max(0, ymax - slice_height)
                  slice_bboxes.append([xmin, ymin, xmax, ymax])
              else:
                  slice_bboxes.append([x_min, y_min, x_max, y_max])
              x_min = x_max - x_overlap
          y_min = y_max - y_overlap
      return slice_bboxes
  
imports: import concurrent.futures
  import logging
  import os
  import time
  from pathlib import Path
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  from PIL import Image
  from shapely.errors import TopologicalError
  from tqdm import tqdm
  from sahi.annotation import BoundingBox, Mask
  from sahi.utils.coco import Coco, CocoAnnotation, CocoImage, create_coco_dict
  from sahi.utils.cv import IMAGE_EXTENSIONS_LOSSLESS, IMAGE_EXTENSIONS_LOSSY, read_image_as_pil
  from sahi.utils.file import load_json, save_json
label_desc: Use image node_id 1 for calling a global function with example usage: get_slice_bboxes(image_height, image_width, slice_height, slice_width, auto_slice_resolution, overlap_height_ratio, overlap_width_ratio) and returns: slice_bboxes