docstr: Process corresponding label and resize the ground truth bounding boxes
  to match the dimension of the resizes image.
docstr_tok: ["Process","corresponding","label","and","resize","the","ground","truth","bounding","boxes","to","match","the","dimension","of","the","resizes","image","."]
code: def __process_label(
      self, label: np.ndarray, image_width: int, image_height: int
  ) -> torch.Tensor:
      """
      Process corresponding label and resize the ground truth bounding boxes
      to match the dimension of the resizes image.
      """
      # max_box = 50
      scaling_factor = min(
          self.__net_width / image_width,
          self.__net_width / image_height,
      )
      # bs = torch.zeros((max_box, 6))
      bs = torch.zeros((len(label), 6))
      if label.size > 0:
          nlabels = torch.from_numpy(label)
          labels = self.__xywhn2xyxy(nlabels, image_width, image_height)
          # scale bounding box to match new image size
          labels[:, [1, 3]] = (labels[:, [1, 3]] * scaling_factor) + (
              self.__net_width - (image_width * scaling_factor)
          ) / 2
          labels[:, [2, 4]] = (labels[:, [2, 4]] * scaling_factor) + (
              self.__net_width - (image_height * scaling_factor)
          ) / 2
  
          # convert x1, y1, x2, y2 to center_x, center_y, width, height
          label_copy = labels.clone()
          labels[:, 1] = (label_copy[:, 3] + label_copy[:, 1]) / 2
          labels[:, 2] = (label_copy[:, 4] + label_copy[:, 2]) / 2
          labels[:, 3] = label_copy[:, 3] - label_copy[:, 1]
          labels[:, 4] = label_copy[:, 4] - label_copy[:, 2]
  
          # scale labels by new image dimension
          labels[:, 1:5] /= self.__net_width
          bs[:, 1:] = labels[:, :]
      return bs
  
imports: import os
  import warnings
  from typing import Tuple, List
  import cv2
  import numpy
  import torch
  from torch.utils.data import Dataset
  from torchvision import transforms
  from ....yolov3.utils import prepare_image
label_desc: Use image node_id 8 for calling the LoadImagesAndLabels obj's underlying member method code with example usage: obj.__process_label(label, image_width, image_height) and returns: bs