class_docstr: Rescale colors between 0 and 1 to enhance contrast
  
  Parameters
  ----------
  randomize_blend_factor :
      Blend factor is random
  blend_factor:
      Ratio of the original color that is kept
class_docstr_tok: ["Rescale","colors","between","0","and","1","to","enhance","contrast","Parameters","--","--","--","--","--","randomize_blend_factor",":","Blend","factor","is","random","blend_factor",":","Ratio","of","the","original","color","that","is","kept"]
code: def __call__(self, data):
      assert hasattr(data, "rgb")
      assert data.rgb.max() <= 1 and data.rgb.min() >= 0
      if random.random() < 0.2:
          feats = data.rgb
          lo = feats.min(0, keepdims=True)[0]
          hi = feats.max(0, keepdims=True)[0]
          assert (
              hi.max() > 0
          ), "invalid color value. Color is supposed to be [0-255]"
  
          scale = 1.0 / (hi - lo)
  
          contrast_feats = (feats - lo) * scale
  
          blend_factor = (
              random.random()
              if self.randomize_blend_factor
              else self.blend_factor
          )
          data.rgb = (
              1 - blend_factor
          ) * feats + blend_factor * contrast_feats
      return data
  
imports: import random
  import torch
label_desc: Use image node_id 2 for calling the ChromaticAutoContrast obj's underlying member method code with example usage: obj.__call__(data) and returns: data