code: def infer_on_images(original_images):
      """
      Returns the predictions for a batch of data. The expected format is an iterator of arrays, each array
      corresponding to a sample. Each array element is in a shape of [B, 6], where B is the number of bboxes in the
      predictions, and each bounding box is in the structure of [x, y, w, h, score, class_id].
  
      Note that model and device here are global variables, and are defined in the previous code block, as the collate
      function cannot recieve other arguments than the batch.
      """
      nm_thrs = 0.2
      score_thrs = 0.7
      imgs = list(img.to(device) for img in original_images)
      # Getting the predictions of the model on the batch
      with torch.no_grad():
          preds = model(imgs)
      processed_pred = []
      for pred in preds:
          # Performoing non-maximum suppression on the detections
          keep_boxes = torchvision.ops.nms(
              pred["boxes"], pred["scores"], nm_thrs
          )
          score_filter = pred["scores"][keep_boxes] > score_thrs
  
          # get the filtered result
          test_boxes = pred["boxes"][keep_boxes][score_filter].reshape(
              (-1, 4)
          )
          test_boxes[:, 2:] = (
              test_boxes[:, 2:] - test_boxes[:, :2]
          )  # xyxy to xywh
          test_labels = pred["labels"][keep_boxes][score_filter]
          test_scores = pred["scores"][keep_boxes][score_filter]
  
          processed_pred.append(
              torch.concat(
                  [
                      test_boxes,
                      test_scores.reshape((-1, 1)),
                      test_labels.reshape((-1, 1)),
                  ],
                  dim=1,
              )
          )
      return processed_pred
  
imports: import os
  import numpy
  import torch
  from torch.utils.data import DataLoader, Dataset
  import albumentations
  from albumentations.pytorch import ToTensorV2
  from PIL import Image
  import xml.etree.ElementTree
  import urllib.request
  import zipfile
  from functools import partial
  from torch import nn
  import torchvision
  from torchvision.models.detection import _utils
  from torchvision.models.detection.ssdlite import SSDLiteClassificationHead
  from deepchecks.vision.vision_data import BatchOutputFormat
  from deepchecks.vision.vision_data import VisionData
  from deepchecks.vision.suites import model_evaluation
label_desc: Use image node_id 3 for calling a global function with example usage: infer_on_images(original_images) and returns: processed_pred