code: def _rgb_to_hsv(img):
      maxc = ivy.max(img, axis=-3)
      minc = ivy.min(img, axis=-3)
  
      is_equal = ivy.equal(maxc, minc)
      one_divisor = ivy.ones_like(maxc)
      c_delta = maxc - minc
      s = c_delta / ivy.where(is_equal, one_divisor, maxc)
  
      r, g, b = img[0], img[1], img[2]
      c_delta_divisor = ivy.where(is_equal, one_divisor, c_delta)
  
      rc = (maxc - r) / c_delta_divisor
      gc = (maxc - g) / c_delta_divisor
      bc = (maxc - b) / c_delta_divisor
  
      hr = ivy.where((maxc == r), bc - gc, ivy.zeros_like(maxc))
      hg = ivy.where(
          ((maxc == g) & (maxc != r)),
          rc - bc + 2.0,
          ivy.zeros_like(maxc),
      )
      hb = ivy.where(
          ((maxc != r) & (maxc != g)),
          gc - rc + 4.0,
          ivy.zeros_like(maxc),
      )
  
      h = (hr + hg + hb) / 6.0 + 1.0
      h = h - ivy.trunc(h)
  
      return ivy.stack([h, s, maxc], axis=-3)
  
file_path: ivy/ivy/functional/frontends/paddle/vision/transforms.py
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes, with_unsupported_device_and_dtypes
  from ..tensor.tensor import Tensor
  from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 5 for calling a global function with example usage: _rgb_to_hsv(img) and returns: ivy