目录

torchvision

该库是 PyTorch 项目的一部分。PyTorch 是一个开源的机器学习框架。

本文档中描述的功能按发布状态进行分类:

Stable: These features will be maintained long-term and there should generally be no major performance limitations or gaps in documentation. We also expect to maintain backwards compatibility (although breaking changes can happen and notice will be given one release ahead of time).

Beta: Features are tagged as Beta because the API may change based on user feedback, because the performance needs to improve, or because coverage across operators is not yet complete. For Beta features, we are committing to seeing the feature through to the Stable classification. We are not, however, committing to backwards compatibility.

Prototype: These features are typically not available as part of binary distributions like PyPI or Conda, except sometimes behind run-time flags, and are at an early stage for feedback and testing.

The torchvision 包含了流行的计算机视觉数据集、模型架构和常用图像变换。

torchvision.get_image_backend()[source]

获取用于加载图像的包的名称

torchvision.set_image_backend(backend)[source]

指定用于加载图像的软件包。

Parameters:后端 (字符串) – 图像后端的名称。可选 {‘PIL’, ‘accimage’}. accimage 包使用了 Intel IPP 库。它通常比 PIL 更快,但不支持那么多操作。
torchvision.set_video_backend(backend)[source]

指定用于解码视频的软件包。

Parameters:后端 (字符串) – 视频后端的名称。可以是 {‘pyav’, ‘video_reader’} 中的一个。 pyav 包使用第三方的 PyAv 库。它是 FFmpeg 库的 Python 绑定。 video_reader 包在 FFmpeg 库之上包含了一个原生的 C++ 实现,并提供了一个 TorchScript 自定义操作符的 Python API。 它通常比 pyav 解码更快,但可能不够健壮。

文档

访问 PyTorch 的全面开发人员文档

查看文档

教程

获取面向初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并解答您的问题

查看资源