class_docstr: Randomly adjust saturation.
  Follows the implementation in `fb.resnet.torch
  <https://github.com/facebook/fb.resnet.torch/blob/master/datasets/transforms.lua#L218>`__.
class_docstr_tok: ["Randomly","adjust","saturation",".","Follows","the","implementation","in","`","fb.resnet.torch","<","https",":","\/\/github.com\/facebook\/fb.resnet.torch\/blob\/master\/datasets\/transforms.lua","#","L218",">","`","__","."]
code: def _augment(self, img, v):
      old_dtype = img.dtype
      m = cv2.COLOR_RGB2GRAY if self.rgb else cv2.COLOR_BGR2GRAY
      grey = cv2.cvtColor(img, m)
      ret = img * v + (grey * (1 - v))[:, :, np.newaxis]
      if self.clip or old_dtype == np.uint8:
          ret = np.clip(ret, 0, 255)
      return ret.astype(old_dtype)
  
imports: import numpy
  import cv2
  from ...utils.develop import log_deprecated
  from .base import PhotometricAugmentor
label_desc: Use image node_id 3 for calling the Saturation obj's underlying member method code with example usage: obj._augment(img, v) and returns: ret