code: def augment_hsv(img, h_gain=0.5, s_gain=0.5, v_gain=0.5):
      # 这里可以参考我写的博文:https://blog.csdn.net/qq_37541097/article/details/119478023
      r = (
          np.random.uniform(-1, 1, 3) * [h_gain, s_gain, v_gain] + 1
      )  # random gains
      hue, sat, val = cv2.split(cv2.cvtColor(img, cv2.COLOR_BGR2HSV))
      dtype = img.dtype  # uint8
  
      x = np.arange(0, 256, dtype=np.int16)
      lut_hue = ((x * r[0]) % 180).astype(dtype)
      lut_sat = np.clip(x * r[1], 0, 255).astype(dtype)
      lut_val = np.clip(x * r[2], 0, 255).astype(dtype)
  
      img_hsv = cv2.merge(
          (
              cv2.LUT(hue, lut_hue),
              cv2.LUT(sat, lut_sat),
              cv2.LUT(val, lut_val),
          )
      ).astype(dtype)
      cv2.cvtColor(img_hsv, cv2.COLOR_HSV2BGR, dst=img)
  
imports: import math
  import os
  import random
  import shutil
  from pathlib import Path
  import cv2
  import numpy
  import torch
  from PIL import Image, ExifTags
  from torch.utils.data import Dataset
  from tqdm import tqdm
  from build_utils.utils import xyxy2xywh, xywh2xyxy
label_desc: Use image node_id 5 for calling a global function with example usage: augment_hsv(img, h_gain, s_gain, v_gain) without return types