Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions torchvision/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import random
import warnings
from collections.abc import Sequence
from typing import List, Optional, Tuple
from typing import List, Optional, Tuple, Union

import torch
from torch import Tensor
Expand Down Expand Up @@ -1172,7 +1172,13 @@ class ColorJitter(torch.nn.Module):
or use an interpolation that generates negative values before using this function.
"""

def __init__(self, brightness=0, contrast=0, saturation=0, hue=0):
def __init__(
self,
brightness: Union[float, Tuple[float, float]] = 0,
contrast: Union[float, Tuple[float, float]] = 0,
saturation: Union[float, Tuple[float, float]] = 0,
hue: Union[float, Tuple[float, float]] = 0,
) -> None:
super().__init__()
_log_api_usage_once(self)
self.brightness = self._check_input(brightness, "brightness")
Expand Down