slowfast/datasets/ptv_datasets.py
def change_brightness(x,max_b=60):
    """
    Randomly changes the brightness by some delta_b.
    Args:
        x: A tensor of the clip's  frames with shape:
            (channel, time, height, width).
        max_b: maximum value of intensity to add/subtract from the clip

    Returns:
        x_hat (Tensor): clip with modified brightness

    """
    b = random.randint(-max_b,max_b)
    x_hat = x+b
    x_hat = x_hat.clip(0,255)
    return x_hat

    Randomly changes the brightness by some delta_b.
    Args:
        x: A tensor of the clip's  frames with shape:
            (channel, time, height, width).
        max_b: maximum value of intensity to add/subtract from the clip

    Returns:
        x_hat (Tensor): clip with modified brightness

    
Randomly changes the brightness by some delta_b.
Randomly changes the brightness by some delta_b .
def change_brightness(x,max_b=60):
    b = random.randint(-max_b,max_b)
    x_hat = x+b
    x_hat = x_hat.clip(0,255)
    return x_hat
def change_brightness ( x , max_b = 60 ) : b = random . randint ( - max_b , max_b ) x_hat = x + b x_hat = x_hat . clip ( 0 , 255 ) return x_hat
Randomly changes the brightness by some delta_b.
Randomly changes the brightness by some delta_b .
"""
    Randomly changes the brightness by some delta_b.
    Args:
        x: A tensor of the clip's  frames with shape:
            (channel, time, height, width).
        max_b: maximum value of intensity to add/subtract from the clip

    Returns:
        x_hat (Tensor): clip with modified brightness

    """
x_hat (Tensor): clip with modified brightness
x_hat ( Tensor ) : clip with modified brightness
x
A tensor of the clip's  frames with shape:
(channel, time, height, width).
A tensor of the clip ' s frames with shape : ( channel time height width ) .
max_b
maximum value of intensity to add/subtract from the clip
maximum value of intensity to add / subtract from the clip