JPEG

class torchaug.transforms.JPEG(quality)[source]

Apply JPEG compression and decompression to the given images. The input is expected to be of a tensor of dtype uint8, on CPU, and have […, 3 or 1, H, W] shape, where … means an arbitrary number of leading dimensions.

Parameters:

quality (Union[int, Sequence[int]]) – JPEG quality, from 1 to 100. Lower means more compression. If quality is a sequence like (min, max), it specifies the range of JPEG quality to randomly select from (inclusive of both ends).

Returns:

image with JPEG compression.