write_jpeg¶
- torchvision.io.write_jpeg(input: Tensor, filename: str, quality: int = 75)[來源]¶
以 CHW 版面配置取得輸入張量,並將其儲存為 JPEG 檔案。
- 參數:
input (Tensor[channels, image_height, image_width]) – int8 影像張量,具有
c
個通道,其中c
必須為 1 或 3。filename (str 或
pathlib.Path
) – 儲存影像的路徑。quality (int) – 產生的 JPEG 檔案品質,必須是介於 1 到 100 之間的數字。預設值:75