code: def infer_on_batch(self, batch, model, device):
      nm_thrs = 0.2
      score_thrs = 0.7
      imgs = list(img.to(device) for img in batch[0])
      with torch.no_grad():
          preds = model(imgs)
      processed_pred = []
      for pred in preds:
          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
  from functools import partial
  import numpy
  import torch
  from PIL import Image
  import xml.etree.ElementTree
  import torchvision
  from torch import nn
  from torch.utils.data import Dataset, DataLoader
  from torchvision.models.detection import _utils
  from torchvision.models.detection.ssdlite import SSDLiteClassificationHead
  import albumentations
  from albumentations.pytorch import ToTensorV2
  import time
  import math
  from deepchecks.vision.detection_data import DetectionData
  from deepchecks.vision.suites import full_suite
label_desc: Use image node_id 3 for calling the TomatoData obj's underlying member method code with example usage: obj.infer_on_batch(batch, model, device) and returns: processed_pred