class_docstr: 随机对输入图片进行水平翻转，注意该方法必须接在 AffineTransform 后
class_docstr_tok: ["\u968f\u673a\u5bf9\u8f93\u5165\u56fe\u7247\u8fdb\u884c\u6c34\u5e73\u7ffb\u8f6c\uff0c\u6ce8\u610f\u8be5\u65b9\u6cd5\u5fc5\u987b\u63a5\u5728","AffineTransform","\u540e"]
code: def __call__(self, image, target):
      if random.random() < self.p:
          # [h, w, c]
          image = np.ascontiguousarray(np.flip(image, axis=[1]))
          keypoints = target["keypoints"]
          visible = target["visible"]
          width = image.shape[1]
  
          # Flip horizontal
          keypoints[:, 0] = width - keypoints[:, 0] - 1
  
          # Change left-right parts
          for pair in self.matched_parts:
              keypoints[pair[0], :], keypoints[pair[1], :] = (
                  keypoints[pair[1], :],
                  keypoints[pair[0], :].copy(),
              )
  
              visible[pair[0]], visible[pair[1]] = (
                  visible[pair[1]],
                  visible[pair[0]].copy(),
              )
  
          target["keypoints"] = keypoints
          target["visible"] = visible
  
      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 RandomHorizontalFlip obj's underlying member method code with example usage: obj.__call__(image, target) and returns: image,  target