code: def postprocess(self, res):
      output = []
      for data in res:
          classes = data.boxes.cls.tolist()
          names = data.names
  
          # Map to class names
          classes = map(lambda cls: names[int(cls)], classes)
  
          # Get a count of objects detected
          result = Counter(classes)
          output.append(dict(result))
  
      return output
  
file_path: serve/examples/object_detector/yolo/yolov8/custom_handler.py
imports: import logging
  import os
  from collections import Counter
  import torch
  from torchvision import transforms
  from ultralytics import YOLO
  from ts.torch_handler.object_detector import ObjectDetector
label_desc: Use image node_id 4 for calling the Yolov8Handler obj's underlying member method code with example usage: obj.postprocess(res) and returns: output