code: def __call__(self, image, target):
      if random.random() < self.p:
          kps = target["keypoints"]
          vis = target["visible"]
          upper_kps = []
          lower_kps = []
  
          # 对可见的keypoints进行归类
          for i, v in enumerate(vis):
              if v > 0.5:
                  if i in self.upper_body_ids:
                      upper_kps.append(kps[i])
                  else:
                      lower_kps.append(kps[i])
  
          # 50%的概率选择上或下半身
          if random.random() < 0.5:
              selected_kps = upper_kps
          else:
              selected_kps = lower_kps
  
          # 如果点数太少就不做任何处理
          if len(selected_kps) > 2:
              selected_kps = np.array(selected_kps, dtype=np.float32)
              xmin, ymin = np.min(selected_kps, axis=0).tolist()
              xmax, ymax = np.max(selected_kps, axis=0).tolist()
              w = xmax - xmin
              h = ymax - ymin
              if w > 1 and h > 1:
                  # 把w和h适当放大点，要不然关键点处于边缘位置
                  xmin, ymin, w, h = scale_box(
                      xmin, ymin, w, h, (1.5, 1.5)
                  )
                  target["box"] = [xmin, ymin, w, h]
  
      return image, target
  
imports: import math
  import random
  from typing import Tuple
  import cv2
  import numpy
  import torch
  from torchvision.transforms import functional
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling the HalfBody obj's underlying member method code with example usage: obj.__call__(image, target) and returns: image,  target