Unverified Commit c31c3d7e authored by Alykhan Tejani's avatar Alykhan Tejani Committed by GitHub
Browse files

add docs for grayscale + random grayscale transforms (#333)

* add docs for grayscale + random grayscale transforms
parent 627ce703
......@@ -26,6 +26,10 @@ Transforms on PIL Image
.. autoclass:: RandomSizedCrop
.. autoclass:: Grayscale
.. autoclass:: RandomGrayscale
.. autoclass:: FiveCrop
.. autoclass:: TenCrop
......
......@@ -633,13 +633,14 @@ class RandomRotation(object):
class Grayscale(object):
"""Convert image to grayscale.
Args:
num_output_channels (int): (1 or 3) number of channels desired for output image
Returns:
PIL Image: grayscale version of the input
if num_output_channels == 1 : returned image is single channel
if num_output_channels == 3 : returned image is 3 channel with r == g == b
PIL Image: Grayscale version of the input.
- If num_output_channels == 1 : returned image is single channel
- If num_output_channels == 3 : returned image is 3 channel with r == g == b
"""
......@@ -659,16 +660,15 @@ class Grayscale(object):
class RandomGrayscale(object):
"""Randomly convert image to grayscale with a probability of p (default 0.1).
Args:
p (float): probability that image should be converted to grayscale.
Returns:
PIL Image: grayscale version of the input image with probability p
and unchanged with probability (1-p)
- if input image is 1 channel:
grayscale version is 1 channel
- if input image is 3 channel:
grayscale version is 3 channel with r == g == b
PIL Image: Grayscale version of the input image with probability p and unchanged
with probability (1-p).
- If input image is 1 channel: grayscale version is 1 channel
- If input image is 3 channel: grayscale version is 3 channel with r == g == b
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment