class_docstr: Implementation of random image Solarization.
  
  Utilizes the integrated image operation `solarize` from Pillow. Solarization
  inverts all pixel values above a threshold (default: 128).
  
  Attributes:
      probability:
          Probability to apply the transformation
      threshold:
          Threshold for solarization.
class_docstr_tok: ["Implementation","of","random","image","Solarization",".","Utilizes","the","integrated","image","operation","`","solarize","`","from","Pillow",".","Solarization","inverts","all","pixel","values","above","a","threshold","(","default",":","128",")",".","Attributes",":","probability",":","Probability","to","apply","the","transformation","threshold",":","Threshold","for","solarization","."]
docstr: Solarizes the given input image
  
  Args:
      sample:
          PIL image to which solarize will be applied.
  
  Returns:
      Solarized image or original image.
docstr_tok: ["Solarizes","the","given","input","image","Args",":","sample",":","PIL","image","to","which","solarize","will","be","applied",".","Returns",":","Solarized","image","or","original","image","."]
code: def __call__(self, sample: PILImage) -> PILImage:
      """Solarizes the given input image
  
      Args:
          sample:
              PIL image to which solarize will be applied.
  
      Returns:
          Solarized image or original image.
  
      """
      prob = np.random.random_sample()
      if prob < self.prob:
          # return solarized image
          return ImageOps.solarize(sample, threshold=self.threshold)
      # return original image
      return sample
  
imports: import numpy
  from PIL import ImageOps
  from PIL.Image import Image
label_desc: Use image node_id 2 for calling the RandomSolarization obj's underlying member method code with example usage: obj.__call__(sample) and returns: sample, ImageOps