code: def set_slice_images(
      self, images, slice_size=[640, 640], overlap_ratio=[0.25, 0.25]
  ):
      self.image_dir = images
      ori_records = self._load_images()
      try:
          import sahi
          from sahi.slicing import slice_image
      except Exception as e:
          logger.error(
              "sahi not found, plaese install sahi. "
              "for example: `pip install sahi`, see https://github.com/obss/sahi."
          )
          raise e
  
      sub_img_ids = 0
      ct = 0
      ct_sub = 0
      records = []
      for i, ori_rec in enumerate(ori_records):
          im_path = ori_rec["im_file"]
          slice_image_result = sahi.slicing.slice_image(
              image=im_path,
              slice_height=slice_size[0],
              slice_width=slice_size[1],
              overlap_height_ratio=overlap_ratio[0],
              overlap_width_ratio=overlap_ratio[1],
          )
  
          sub_img_num = len(slice_image_result)
          for _ind in range(sub_img_num):
              im = slice_image_result.images[_ind]
              rec = (
                  {
                      "image": im,
                      "im_id": np.array([sub_img_ids + _ind]),
                      "h": im.shape[0],
                      "w": im.shape[1],
                      "ori_im_id": np.array([ori_rec["im_id"][0]]),
                      "st_pix": np.array(
                          slice_image_result.starting_pixels[_ind],
                          dtype=np.float32,
                      ),
                      "is_last": 1 if _ind == sub_img_num - 1 else 0,
                  }
                  if "image" in self.data_fields
                  else {}
              )
              records.append(rec)
          ct_sub += sub_img_num
          ct += 1
      logger.info(
          "{} samples and slice to {} sub_samples.".format(ct, ct_sub)
      )
      self.roidbs = records
  
imports: import os
  import copy
  import numpy
  from paddle.io import Dataset
  from ppdet.core.workspace import register, serializable
  from ppdet.utils.download import get_dataset_path
  from ppdet.data import source
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 9 for calling the ImageFolder obj's underlying member method code with example usage: obj.set_slice_images(images, slice_size, overlap_ratio) without return types