encode_jpeg¶
-
torchvision.io.
encode_jpeg
(input: torch.Tensor, quality: int = 75) → torch.Tensor[source]¶ Takes an input tensor in CHW layout and returns a buffer with the contents of its corresponding JPEG file.
- Parameters
input (Tensor[channels, image_height, image_width])) – int8 image tensor of
c
channels, wherec
must be 1 or 3.quality (int) – Quality of the resulting JPEG file, it must be a number between 1 and 100. Default: 75
- Returns
- A one dimensional int8 tensor that contains the raw bytes of the
JPEG file.
- Return type
output (Tensor[1])