(
    new_size: Optional[Tuple[int, int]] = None, flip_horizontal: bool = False
)
return Compose(
        [
            RandomHorizontalFlip(p=0.5) if flip_horizontal else NoOp(),
            Resize(new_size) if new_size is not None else NoOp(),
            ToTensor(),
        ]
    )
obtain the image transforms required for the input data
    Args:
        new_size: size of the resized images (if needed, could be None)
        flip_horizontal: whether to randomly mirror input images during training
    Returns: requested transform object from TorchVision
obtain the image transforms required for the input data
    Args:
        new_size: size of the resized images (if needed, could be None)
        flip_horizontal: whether to randomly mirror input images during training
    Returns: requested transform object from TorchVision
obtain the image transforms required for the input data Args : new_size : size of the resized images ( if needed could be None ) flip_horizontal : whether to randomly mirror input images during training Returns : requested transform object from TorchVision
def get_transform(
    new_size: Optional[Tuple[int, int]] = None, flip_horizontal: bool = False
) -> Callable[[Image.Image], Tensor]:
    """
    obtain the image transforms required for the input data
    Args:
        new_size: size of the resized images (if needed, could be None)
        flip_horizontal: whether to randomly mirror input images during training
    Returns: requested transform object from TorchVision
    """
    return Compose(
        [
            RandomHorizontalFlip(p=0.5) if flip_horizontal else NoOp(),
            Resize(new_size) if new_size is not None else NoOp(),
            ToTensor(),
        ]
    )
def get_transform ( new_size : Optional [ Tuple [ int , int ] ] = None , flip_horizontal : bool = False ) -> Callable [ [ Image . Image ] , Tensor ] : return Compose ( [ RandomHorizontalFlip ( p = 0.5 ) if flip_horizontal else NoOp ( ) , Resize ( new_size ) if new_size is not None else NoOp ( ) , ToTensor ( ) , ] )