adjust_contrast¶
- 
torchvision.transforms.functional.adjust_contrast(img: torch.Tensor, contrast_factor: float) → torch.Tensor[source]¶
- Adjust contrast of an image. - Parameters
- img (PIL Image or Tensor) – Image to be adjusted. If img is torch Tensor, it is expected to be in […, 1 or 3, H, W] format, where … means it can have an arbitrary number of leading dimensions. 
- contrast_factor (float) – How much to adjust the contrast. Can be any non negative number. 0 gives a solid gray image, 1 gives the original image while 2 increases the contrast by a factor of 2. 
 
- Returns
- Contrast adjusted image. 
- Return type
- PIL Image or Tensor