diff --git a/totrans/vis017_02.yaml b/totrans/vis017_02.yaml index bfb4db5d3360c2719ff6d6c4c2cd44ed48c64e04..17dba96746437cf8d4c6086e6a5d4718c68af98e 100644 --- a/totrans/vis017_02.yaml +++ b/totrans/vis017_02.yaml @@ -1,156 +1,229 @@ - en: Transforming and augmenting images + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 转换和增强图像 - en: 原文:[https://pytorch.org/vision/stable/transforms.html](https://pytorch.org/vision/stable/transforms.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 无论您是新手还是已经熟悉Torchvision转换,我们鼓励您从[开始使用转换v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py)开始,以了解新的v2转换可以做什么。 - en: Torchvision supports common computer vision transformations in the `torchvision.transforms` and `torchvision.transforms.v2` modules. Transforms can be used to transform or augment data for training or inference of different tasks (image classification, detection, segmentation, video classification). + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/transforms.html](https://pytorch.org/vision/stable/transforms.html) - en: '[PRE0]' + id: totrans-3 prefs: [] type: TYPE_PRE + zh: '[PRE0]' - en: '[PRE1]' + id: totrans-4 prefs: [] type: TYPE_PRE + zh: '[PRE1]' - en: Transforms are typically passed as the `transform` or `transforms` argument to the [Datasets](datasets.html#datasets). + id: totrans-5 prefs: [] type: TYPE_NORMAL + zh: Torchvision支持在`torchvision.transforms`和`torchvision.transforms.v2`模块中的常见计算机视觉转换。转换可用于转换或增强数据,用于不同任务的训练或推断(图像分类、检测、分割、视频分类)。 - en: Start here[](#start-here "Permalink to this heading") + id: totrans-6 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 转换通常作为`transform`或`transforms`参数传递给[数据集](datasets.html#datasets)。开始阅读[](#start-here + "Permalink to this heading") - en: Whether you’re new to Torchvision transforms, or you’re already experienced with them, we encourage you to start with [Getting started with transforms v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py) in order to learn more about what can be done with the new v2 transforms. + id: totrans-7 prefs: [] type: TYPE_NORMAL + zh: 然后,浏览本页下面的部分以获取一般信息和性能提示。可在[API参考](#v2-api-ref)中列出可用的转换和功能。 - en: Then, browse the sections in below this page for general information and performance tips. The available transforms and functionals are listed in the [API reference](#v2-api-ref). + id: totrans-8 prefs: [] type: TYPE_NORMAL + zh: '## V1还是V2?我应该使用哪个?' - en: 'More information and tutorials can also be found in our [example gallery](auto_examples/index.html#gallery), e.g. [Transforms v2: End-to-end object detection/segmentation example](auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py) or [How to write your own v2 transforms](auto_examples/transforms/plot_custom_transforms.html#sphx-glr-auto-examples-transforms-plot-custom-transforms-py).' + id: totrans-9 prefs: [] type: TYPE_NORMAL + zh: 更多信息和教程也可以在我们的[示例库](auto_examples/index.html#gallery)中找到,例如[转换v2:端到端目标检测/分割示例](auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py)或[如何编写自己的v2转换](auto_examples/transforms/plot_custom_transforms.html#sphx-glr-auto-examples-transforms-plot-custom-transforms-py)。 - en: '## Supported input types and conventions[](#supported-input-types-and-conventions "Permalink to this heading")' + id: totrans-10 prefs: [] type: TYPE_NORMAL + zh: '## 支持的输入类型和约定' - en: Most transformations accept both [PIL](https://pillow.readthedocs.io) images and tensor inputs. Both CPU and CUDA tensors are supported. The result of both backends (PIL or Tensors) should be very close. In general, we recommend relying on the tensor backend [for performance](#transforms-perf). The [conversion transforms](#conversion-transforms) may be used to convert to and from PIL images, or for converting dtypes and ranges. + id: totrans-11 prefs: [] type: TYPE_NORMAL + zh: 大多数转换接受[PIL](https://pillow.readthedocs.io)图像和张量输入。支持CPU和CUDA张量。两个后端(PIL或张量)的结果应该非常接近。一般来说,我们建议依赖张量后端[以获得更好的性能](#transforms-perf)。[转换转换](#conversion-transforms)可用于转换为PIL图像,或用于转换dtype和范围。 - en: Tensor image are expected to be of shape `(C, H, W)`, where `C` is the number of channels, and `H` and `W` refer to height and width. Most transforms support batched tensor input. A batch of Tensor images is a tensor of shape `(N, C, H, W)`, where `N` is a number of images in the batch. The [v2](#v1-or-v2) transforms generally accept an arbitrary number of leading dimensions `(..., C, H, W)` and can handle batched images or batched videos. + id: totrans-12 prefs: [] type: TYPE_NORMAL + zh: 张量图像的形状应为`(C, H, W)`,其中`C`是通道数,`H`和`W`分别是高度和宽度。大多数转换支持批量张量输入。一批张量图像是形状为`(N, + C, H, W)`的张量,其中`N`是批量中的图像数量。[v2](#v1-or-v2)转换通常接受任意数量的前导维度`(..., C, H, W)`,并且可以处理批量图像或批量视频。 - en: '### Dtype and expected value range[](#dtype-and-expected-value-range "Permalink to this heading")' + id: totrans-13 prefs: [] type: TYPE_NORMAL + zh: '### Dtype和预期值范围' - en: The expected range of the values of a tensor image is implicitly defined by the tensor dtype. Tensor images with a float dtype are expected to have values in `[0, 1]`. Tensor images with an integer dtype are expected to have values in `[0, MAX_DTYPE]` where `MAX_DTYPE` is the largest value that can be represented in that dtype. Typically, images of dtype `torch.uint8` are expected to have values in `[0, 255]`. + id: totrans-14 prefs: [] type: TYPE_NORMAL + zh: 张量图像的值的预期范围由张量dtype隐式定义。具有浮点dtype的张量图像的值应在`[0, 1]`范围内。具有整数dtype的张量图像的值应在`[0, + MAX_DTYPE]`范围内,其中`MAX_DTYPE`是该dtype中可以表示的最大值。通常,dtype为`torch.uint8`的图像的值应在`[0, + 255]`范围内。 - en: 'Use [`ToDtype`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype "torchvision.transforms.v2.ToDtype") to convert both the dtype and range of the inputs. ## V1 or V2? Which one should I use?[](#v1-or-v2-which-one-should-i-use "Permalink to this heading")' + id: totrans-15 prefs: [] type: TYPE_NORMAL + zh: 使用[`ToDtype`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype + "torchvision.transforms.v2.ToDtype")来转换输入的dtype和范围。 - en: '**TL;DR** We recommending using the `torchvision.transforms.v2` transforms instead of those in `torchvision.transforms`. They’re faster and they can do more things. Just change the import and you should be good to go. Moving forward, new features and improvements will only be considered for the v2 transforms.' + id: totrans-16 prefs: [] type: TYPE_NORMAL + zh: '**TL;DR** 我们建议使用`torchvision.transforms.v2`转换,而不是`torchvision.transforms`中的转换。它们更快,功能更强大。只需更改导入,您就可以开始使用。未来,新功能和改进将仅考虑v2转换。' - en: 'In Torchvision 0.15 (March 2023), we released a new set of transforms available in the `torchvision.transforms.v2` namespace. These transforms have a lot of advantages compared to the v1 ones (in `torchvision.transforms`):' + id: totrans-17 prefs: [] type: TYPE_NORMAL + zh: 在Torchvision 0.15(2023年3月)中,我们发布了一组新的转换,可在`torchvision.transforms.v2`命名空间中使用。与v1中的转换相比,这些转换具有许多优势: - en: 'They can transform images **but also** bounding boxes, masks, or videos. This provides support for tasks beyond image classification: detection, segmentation, video classification, etc. See [Getting started with transforms v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py) and [Transforms v2: End-to-end object detection/segmentation example](auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py).' + id: totrans-18 prefs: - PREF_UL type: TYPE_NORMAL + zh: 它们可以转换图像**还可以**边界框、蒙版或视频。这为超出图像分类的任务提供了支持:检测、分割、视频分类等。请参阅[开始使用转换v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py)和[转换v2:端到端目标检测/分割示例](auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py)。 - en: They support more transforms like [`CutMix`](generated/torchvision.transforms.v2.CutMix.html#torchvision.transforms.v2.CutMix "torchvision.transforms.v2.CutMix") and [`MixUp`](generated/torchvision.transforms.v2.MixUp.html#torchvision.transforms.v2.MixUp "torchvision.transforms.v2.MixUp"). See [How to use CutMix and MixUp](auto_examples/transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py). + id: totrans-19 prefs: - PREF_UL type: TYPE_NORMAL + zh: 它们支持更多的转换,如[`CutMix`](generated/torchvision.transforms.v2.CutMix.html#torchvision.transforms.v2.CutMix + "torchvision.transforms.v2.CutMix")和[`MixUp`](generated/torchvision.transforms.v2.MixUp.html#torchvision.transforms.v2.MixUp + "torchvision.transforms.v2.MixUp")。请参阅[如何使用CutMix和MixUp](auto_examples/transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py)。 - en: They’re [faster](#transforms-perf). + id: totrans-20 prefs: - PREF_UL type: TYPE_NORMAL + zh: 它们更快(#transforms-perf)。 - en: They support arbitrary input structures (dicts, lists, tuples, etc.). + id: totrans-21 prefs: - PREF_UL type: TYPE_NORMAL + zh: 它们支持任意输入结构(字典、列表、元组等)。 - en: Future improvements and features will be added to the v2 transforms only. + id: totrans-22 prefs: - PREF_UL type: TYPE_NORMAL + zh: 未来的改进和功能将仅添加到v2转换中。 - en: 'These transforms are **fully backward compatible** with the v1 ones, so if you’re already using tranforms from `torchvision.transforms`, all you need to do to is to update the import to `torchvision.transforms.v2`. In terms of output, there might be negligible differences due to implementation differences. ## Performance considerations[](#performance-considerations "Permalink to this heading")' + id: totrans-23 prefs: [] type: TYPE_NORMAL + zh: 这些转换与v1版本完全兼容,因此如果您已经使用`torchvision.transforms`中的转换,您只需要更新导入为`torchvision.transforms.v2`。在输出方面,由于实现差异可能会有微不足道的差异。##性能考虑[](#performance-considerations + "跳转到此标题的永久链接") - en: 'We recommend the following guidelines to get the best performance out of the transforms:' + id: totrans-24 prefs: [] type: TYPE_NORMAL + zh: 我们建议以下准则以获得最佳性能: - en: Rely on the v2 transforms from `torchvision.transforms.v2` + id: totrans-25 prefs: - PREF_UL type: TYPE_NORMAL + zh: 依赖于`torchvision.transforms.v2`中的v2转换 - en: Use tensors instead of PIL images + id: totrans-26 prefs: - PREF_UL type: TYPE_NORMAL + zh: 使用张量而不是PIL图像 - en: Use `torch.uint8` dtype, especially for resizing + id: totrans-27 prefs: - PREF_UL type: TYPE_NORMAL + zh: 使用`torch.uint8`数据类型,特别是用于调整大小 - en: Resize with bilinear or bicubic mode + id: totrans-28 prefs: - PREF_UL type: TYPE_NORMAL + zh: 使用双线性或双三次插值模式调整大小 - en: 'This is what a typical transform pipeline could look like:' + id: totrans-29 prefs: [] type: TYPE_NORMAL + zh: 这是一个典型的转换流水线可能看起来像: - en: '[PRE2]' + id: totrans-30 prefs: [] type: TYPE_PRE + zh: '[PRE2]' - en: The above should give you the best performance in a typical training environment that relies on the [`torch.utils.data.DataLoader`](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader "(in PyTorch v2.2)") with `num_workers > 0`. + id: totrans-31 prefs: [] type: TYPE_NORMAL + zh: 上述内容应该为依赖于`torch.utils.data.DataLoader`(https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader + "(在PyTorch v2.2中)")且`num_workers > 0`的典型训练环境提供最佳性能。 - en: Transforms tend to be sensitive to the input strides / memory format. Some transforms will be faster with channels-first images while others prefer channels-last. Like `torch` operators, most transforms will preserve the memory format of the input, @@ -160,16 +233,25 @@ memory format variable (e.g. on [`Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize "torchvision.transforms.v2.Normalize")). Note that we’re talking about **memory format**, not [tensor shape](#conventions). + id: totrans-32 prefs: [] type: TYPE_NORMAL + zh: 转换往往对输入步幅/内存格式敏感。一些转换在通道优先图像上速度更快,而其他转换则更喜欢通道最后。与`torch`操作符一样,大多数转换将保留输入的内存格式,但由于实现细节,这并不总是被尊重。如果您追求最佳性能,您可能需要进行一些实验。在单个转换上使用[`torch.compile()`](https://pytorch.org/docs/stable/generated/torch.compile.html#torch.compile + "(在PyTorch v2.2中)")也有助于分解内存格式变量(例如在[`Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize + "torchvision.transforms.v2.Normalize")上)。请注意,我们谈论的是**内存格式**,而不是[张量形状](#conventions)。 - en: 'Note that resize transforms like [`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize "torchvision.transforms.v2.Resize") and [`RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop "torchvision.transforms.v2.RandomResizedCrop") typically prefer channels-last input and tend **not** to benefit from [`torch.compile()`](https://pytorch.org/docs/stable/generated/torch.compile.html#torch.compile "(in PyTorch v2.2)") at this time. ## Transform classes, functionals, and kernels[](#transform-classes-functionals-and-kernels "Permalink to this heading")' + id: totrans-33 prefs: [] type: TYPE_NORMAL + zh: 请注意,像[`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize + "torchvision.transforms.v2.Resize")和[`RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop + "torchvision.transforms.v2.RandomResizedCrop")这样的调整大小转换通常更喜欢通道最后的输入,并且目前**不**受益于[`torch.compile()`](https://pytorch.org/docs/stable/generated/torch.compile.html#torch.compile + "(在PyTorch v2.2中)")。##转换类、功能和内核[](#transform-classes-functionals-and-kernels "跳转到此标题的永久链接") - en: Transforms are available as classes like [`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize "torchvision.transforms.v2.Resize"), but also as functionals like [`resize()`](generated/torchvision.transforms.v2.functional.resize.html#torchvision.transforms.v2.functional.resize "torchvision.transforms.v2.functional.resize") in the `torchvision.transforms.v2.functional` @@ -177,15 +259,25 @@ "(in PyTorch v2.2)") package which defines both classes and functional equivalents in [`torch.nn.functional`](https://pytorch.org/docs/stable/nn.html#module-torch.nn.functional "(in PyTorch v2.2)"). + id: totrans-34 prefs: [] type: TYPE_NORMAL + zh: 转换可作为类([`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize + "torchvision.transforms.v2.Resize"))和functionals([`resize()`](generated/torchvision.transforms.v2.functional.resize.html#torchvision.transforms.v2.functional.resize + "torchvision.transforms.v2.functional.resize"))在`torchvision.transforms.v2.functional`命名空间中。这与[`torch.nn`](https://pytorch.org/docs/stable/nn.html#module-torch.nn + "(在PyTorch v2.2)")包非常相似,后者在[`torch.nn.functional`](https://pytorch.org/docs/stable/nn.html#module-torch.nn.functional + "(在PyTorch v2.2)")中定义了类和功能等效项。 - en: The functionals support PIL images, pure tensors, or [TVTensors](tv_tensors.html#tv-tensors), e.g. both `resize(image_tensor)` and `resize(boxes)` are valid. + id: totrans-35 prefs: [] type: TYPE_NORMAL + zh: functionals支持PIL图像、纯张量或[TVTensors](tv_tensors.html#tv-tensors),例如`resize(image_tensor)`和`resize(boxes)`都是有效的。 - en: Note + id: totrans-36 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: Random transforms like [`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop "torchvision.transforms.v2.RandomCrop") will randomly sample some parameter each time they’re called. Their functional counterpart ([`crop()`](generated/torchvision.transforms.v2.functional.crop.html#torchvision.transforms.v2.functional.crop @@ -193,8 +285,12 @@ and thus have a slighlty different parametrization. The `get_params()` class method of the transforms class can be used to perform parameter sampling when using the functional APIs. + id: totrans-37 prefs: [] type: TYPE_NORMAL + zh: 像[`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop + "torchvision.transforms.v2.RandomCrop")这样的随机转换每次调用时都会随机抽样一些参数。它们的功能对应项([`crop()`](generated/torchvision.transforms.v2.functional.crop.html#torchvision.transforms.v2.functional.crop + "torchvision.transforms.v2.functional.crop"))不进行任何随机抽样,因此具有略有不同的参数化。当使用功能API时,可以使用transforms类的`get_params()`类方法执行参数抽样。 - en: 'The `torchvision.transforms.v2.functional` namespace also contains what we call the “kernels”. These are the low-level functions that implement the core functionalities for specific types, e.g. `resize_bounding_boxes` or ``resized_crop_mask`. @@ -203,571 +299,962 @@ are **not** public!). Kernels are only really useful if you want [torchscript support](#transforms-torchscript) for types like bounding boxes or masks. ## Torchscript support[](#torchscript-support "Permalink to this heading")' + id: totrans-38 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.transforms.v2.functional`命名空间还包含我们称之为“内核”的内容。这些是实现特定类型的核心功能的低级函数,例如`resize_bounding_boxes`或`resized_crop_mask`。它们是公开的,尽管没有文档记录。查看[代码](https://github.com/pytorch/vision/blob/main/torchvision/transforms/v2/functional/__init__.py)以查看可用的函数(请注意,以下划线开头的函数**不**是公开的!)。如果您想要对像边界框或掩码这样的类型进行[torchscript支持](#transforms-torchscript),内核才真正有用。## + Torchscript支持[](#torchscript-support "跳转到此标题")' - en: 'Most transform classes and functionals support torchscript. For composing transforms, use [`torch.nn.Sequential`](https://pytorch.org/docs/stable/generated/torch.nn.Sequential.html#torch.nn.Sequential "(in PyTorch v2.2)") instead of [`Compose`](generated/torchvision.transforms.v2.Compose.html#torchvision.transforms.v2.Compose "torchvision.transforms.v2.Compose"):' + id: totrans-39 prefs: [] type: TYPE_NORMAL + zh: 大多数转换类和functionals都支持torchscript。对于组合转换,请使用[`torch.nn.Sequential`](https://pytorch.org/docs/stable/generated/torch.nn.Sequential.html#torch.nn.Sequential + "(在PyTorch v2.2)")而不是[`Compose`](generated/torchvision.transforms.v2.Compose.html#torchvision.transforms.v2.Compose + "torchvision.transforms.v2.Compose"): - en: '[PRE3]' + id: totrans-40 prefs: [] type: TYPE_PRE + zh: '[PRE3]' - en: Warning + id: totrans-41 prefs: [] type: TYPE_NORMAL + zh: 警告 - en: v2 transforms support torchscript, but if you call `torch.jit.script()` on a v2 **class** transform, you’ll actually end up with its (scripted) v1 equivalent. This may lead to slightly different results between the scripted and eager executions due to implementation differences between v1 and v2. + id: totrans-42 prefs: [] type: TYPE_NORMAL + zh: v2转换支持torchscript,但是如果您在v2 **类**转换上调用`torch.jit.script()`,实际上会得到其(脚本化的)v1等效项。由于v1和v2之间的实现差异,这可能导致脚本化和急切执行之间略有不同的结果。 - en: If you really need torchscript support for the v2 transforms, we recommend scripting the **functionals** from the `torchvision.transforms.v2.functional` namespace to avoid surprises. + id: totrans-43 prefs: [] type: TYPE_NORMAL + zh: 如果您真的需要v2转换的torchscript支持,我们建议对`torchvision.transforms.v2.functional`命名空间中的**functionals**进行脚本化,以避免意外。 - en: Also note that the functionals only support torchscript for pure tensors, which are always treated as images. If you need torchscript support for other types like bounding boxes or masks, you can rely on the [low-level kernels](#functional-transforms). + id: totrans-44 prefs: [] type: TYPE_NORMAL + zh: 还要注意,functionals仅支持纯张量的torchscript,这些张量始终被视为图像。如果您需要对像边界框或掩码等其他类型进行torchscript支持,可以依赖于[低级内核](#functional-transforms)。 - en: For any custom transformations to be used with `torch.jit.script`, they should be derived from `torch.nn.Module`. + id: totrans-45 prefs: [] type: TYPE_NORMAL + zh: 对于要与`torch.jit.script`一起使用的自定义转换,它们应该派生自`torch.nn.Module`。 - en: 'See also: [Torchscript support](auto_examples/others/plot_scripted_tensor_transforms.html#sphx-glr-auto-examples-others-plot-scripted-tensor-transforms-py). ## - V2 API reference - Recommended[](#v2-api-reference-recommended "Permalink to - this heading")' + V2 API reference - Recommended[](#v2-api-reference-recommended "Permalink to this + heading")' + id: totrans-46 prefs: [] type: TYPE_NORMAL + zh: 另请参阅:[Torchscript支持](auto_examples/others/plot_scripted_tensor_transforms.html#sphx-glr-auto-examples-others-plot-scripted-tensor-transforms-py)。## + V2 API参考-推荐[](#v2-api-reference-recommended "跳转到此标题") - en: Geometry[](#geometry "Permalink to this heading") + id: totrans-47 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 几何[](#geometry "跳转到此标题") - en: Resizing[](#resizing "Permalink to this heading") + id: totrans-48 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 调整大小[](#resizing "跳转到此标题") - en: '| [`v2.Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize "torchvision.transforms.v2.Resize")(size[, interpolation, max_size, ...]) | Resize the input to the given size. |' + id: totrans-49 prefs: [] type: TYPE_TB + zh: '[`v2.Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize + "torchvision.transforms.v2.Resize")(size[, interpolation, max_size, ...]) | 将输入调整为给定大小。' - en: '| [`v2.ScaleJitter`](generated/torchvision.transforms.v2.ScaleJitter.html#torchvision.transforms.v2.ScaleJitter "torchvision.transforms.v2.ScaleJitter")(target_size[, scale_range, ...]) | Perform Large Scale Jitter on the input according to ["Simple Copy-Paste is a Strong Data Augmentation Method for Instance Segmentation"](https://arxiv.org/abs/2012.07177). |' + id: totrans-50 prefs: [] type: TYPE_TB + zh: '[`v2.ScaleJitter`](generated/torchvision.transforms.v2.ScaleJitter.html#torchvision.transforms.v2.ScaleJitter + "torchvision.transforms.v2.ScaleJitter")(target_size[, scale_range, ...]) | 根据["Simple + Copy-Paste is a Strong Data Augmentation Method for Instance Segmentation"](https://arxiv.org/abs/2012.07177)对输入执行大规模抖动。' - en: '| [`v2.RandomShortestSize`](generated/torchvision.transforms.v2.RandomShortestSize.html#torchvision.transforms.v2.RandomShortestSize "torchvision.transforms.v2.RandomShortestSize")(min_size[, max_size, ...]) | Randomly resize the input. |' + id: totrans-51 prefs: [] type: TYPE_TB + zh: '[`v2.RandomShortestSize`](generated/torchvision.transforms.v2.RandomShortestSize.html#torchvision.transforms.v2.RandomShortestSize + "torchvision.transforms.v2.RandomShortestSize")(min_size[, max_size, ...]) | 随机调整输入大小。' - en: '| [`v2.RandomResize`](generated/torchvision.transforms.v2.RandomResize.html#torchvision.transforms.v2.RandomResize "torchvision.transforms.v2.RandomResize")(min_size, max_size[, ...]) | Randomly resize the input. |' + id: totrans-52 prefs: [] type: TYPE_TB + zh: '[`v2.RandomResize`](generated/torchvision.transforms.v2.RandomResize.html#torchvision.transforms.v2.RandomResize + "torchvision.transforms.v2.RandomResize")(min_size, max_size[, ...]) | 随机调整输入大小。' - en: Functionals + id: totrans-53 prefs: [] type: TYPE_NORMAL + zh: 功能 - en: '| [`v2.functional.resize`](generated/torchvision.transforms.v2.functional.resize.html#torchvision.transforms.v2.functional.resize "torchvision.transforms.v2.functional.resize")(inpt, size[, ...]) | See [`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize "torchvision.transforms.v2.Resize") for details. |' + id: totrans-54 prefs: [] type: TYPE_TB + zh: '[`v2.functional.resize`](generated/torchvision.transforms.v2.functional.resize.html#torchvision.transforms.v2.functional.resize + "torchvision.transforms.v2.functional.resize")(inpt, size[, ...]) | 详细信息请参见[`Resize`](generated/torchvision.transforms.v2.Resize.html#torchvision.transforms.v2.Resize + "torchvision.transforms.v2.Resize")。' - en: Cropping[](#cropping "Permalink to this heading") + id: totrans-55 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 裁剪[](#cropping "跳转到此标题") - en: '| [`v2.RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop "torchvision.transforms.v2.RandomCrop")(size[, padding, ...]) | Crop the input at a random location. |' + id: totrans-56 prefs: [] type: TYPE_TB + zh: '[`v2.RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop + "torchvision.transforms.v2.RandomCrop")(size[, padding, ...]) | 在随机位置裁剪输入。' - en: '| [`v2.RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop "torchvision.transforms.v2.RandomResizedCrop")(size[, scale, ratio, ...]) | Crop a random portion of the input and resize it to a given size. |' + id: totrans-57 prefs: [] type: TYPE_TB + zh: '[`v2.RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop + "torchvision.transforms.v2.RandomResizedCrop")(size[, scale, ratio, ...]) | 对输入进行随机裁剪并调整大小到给定大小。' - en: '| [`v2.RandomIoUCrop`](generated/torchvision.transforms.v2.RandomIoUCrop.html#torchvision.transforms.v2.RandomIoUCrop "torchvision.transforms.v2.RandomIoUCrop")([min_scale, max_scale, ...]) | Random IoU crop transformation from ["SSD: Single Shot MultiBox Detector"](https://arxiv.org/abs/1512.02325). |' + id: totrans-58 prefs: [] type: TYPE_TB + zh: '[`v2.RandomIoUCrop`](generated/torchvision.transforms.v2.RandomIoUCrop.html#torchvision.transforms.v2.RandomIoUCrop + "torchvision.transforms.v2.RandomIoUCrop")([min_scale, max_scale, ...]) | 来自["SSD: + Single Shot MultiBox Detector"](https://arxiv.org/abs/1512.02325)的随机IoU裁剪转换。' - en: '| [`v2.CenterCrop`](generated/torchvision.transforms.v2.CenterCrop.html#torchvision.transforms.v2.CenterCrop "torchvision.transforms.v2.CenterCrop")(size) | Crop the input at the center. |' + id: totrans-59 prefs: [] type: TYPE_TB + zh: '[`v2.CenterCrop`](generated/torchvision.transforms.v2.CenterCrop.html#torchvision.transforms.v2.CenterCrop + "torchvision.transforms.v2.CenterCrop")(size) | 在中心裁剪输入。' - en: '| [`v2.FiveCrop`](generated/torchvision.transforms.v2.FiveCrop.html#torchvision.transforms.v2.FiveCrop "torchvision.transforms.v2.FiveCrop")(size) | Crop the image or video into four corners and the central crop. |' + id: totrans-60 prefs: [] type: TYPE_TB + zh: '[`v2.FiveCrop`](generated/torchvision.transforms.v2.FiveCrop.html#torchvision.transforms.v2.FiveCrop + "torchvision.transforms.v2.FiveCrop")(size) | 将图像或视频裁剪成四个角和中心裁剪。' - en: '| [`v2.TenCrop`](generated/torchvision.transforms.v2.TenCrop.html#torchvision.transforms.v2.TenCrop "torchvision.transforms.v2.TenCrop")(size[, vertical_flip]) | Crop the image or video into four corners and the central crop plus the flipped version of these (horizontal flipping is used by default). |' + id: totrans-61 prefs: [] type: TYPE_TB + zh: '[`v2.TenCrop`](generated/torchvision.transforms.v2.TenCrop.html#torchvision.transforms.v2.TenCrop + "torchvision.transforms.v2.TenCrop")(size[, vertical_flip]) | 将图像或视频裁剪成四个角和中心裁剪以及这些的翻转版本(默认使用水平翻转)。' - en: Functionals + id: totrans-62 prefs: [] type: TYPE_NORMAL + zh: 功能 - en: '| [`v2.functional.crop`](generated/torchvision.transforms.v2.functional.crop.html#torchvision.transforms.v2.functional.crop "torchvision.transforms.v2.functional.crop")(inpt, top, left, height, ...) | See [`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop "torchvision.transforms.v2.RandomCrop") for details. |' + id: totrans-63 prefs: [] type: TYPE_TB + zh: '[`v2.functional.crop`](generated/torchvision.transforms.v2.functional.crop.html#torchvision.transforms.v2.functional.crop + "torchvision.transforms.v2.functional.crop")(inpt, top, left, height, ...) | 详细信息请参见[`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop + "torchvision.transforms.v2.RandomCrop")。' - en: '| [`v2.functional.resized_crop`](generated/torchvision.transforms.v2.functional.resized_crop.html#torchvision.transforms.v2.functional.resized_crop "torchvision.transforms.v2.functional.resized_crop")(inpt, top, left, ...) | See [`RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop "torchvision.transforms.v2.RandomResizedCrop") for details. |' + id: totrans-64 prefs: [] type: TYPE_TB + zh: '[`v2.functional.resized_crop`](generated/torchvision.transforms.v2.functional.resized_crop.html#torchvision.transforms.v2.functional.resized_crop + "torchvision.transforms.v2.functional.resized_crop")(inpt, top, left, ...) | 详细信息请参见[`RandomResizedCrop`](generated/torchvision.transforms.v2.RandomResizedCrop.html#torchvision.transforms.v2.RandomResizedCrop + "torchvision.transforms.v2.RandomResizedCrop")。' - en: '| [`v2.functional.ten_crop`](generated/torchvision.transforms.v2.functional.ten_crop.html#torchvision.transforms.v2.functional.ten_crop "torchvision.transforms.v2.functional.ten_crop")(inpt, size[, ...]) | See [`TenCrop`](generated/torchvision.transforms.v2.TenCrop.html#torchvision.transforms.v2.TenCrop "torchvision.transforms.v2.TenCrop") for details. |' + id: totrans-65 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.ten_crop`](generated/torchvision.transforms.v2.functional.ten_crop.html#torchvision.transforms.v2.functional.ten_crop + "torchvision.transforms.v2.functional.ten_crop")(inpt, size[, ...]) | 查看详细信息,请参阅[`TenCrop`](generated/torchvision.transforms.v2.TenCrop.html#torchvision.transforms.v2.TenCrop + "torchvision.transforms.v2.TenCrop")。 |' - en: '| [`v2.functional.center_crop`](generated/torchvision.transforms.v2.functional.center_crop.html#torchvision.transforms.v2.functional.center_crop "torchvision.transforms.v2.functional.center_crop")(inpt, output_size) | See [`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop "torchvision.transforms.v2.RandomCrop") for details. |' + id: totrans-66 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.center_crop`](generated/torchvision.transforms.v2.functional.center_crop.html#torchvision.transforms.v2.functional.center_crop + "torchvision.transforms.v2.functional.center_crop")(inpt, output_size) | 查看详细信息,请参阅[`RandomCrop`](generated/torchvision.transforms.v2.RandomCrop.html#torchvision.transforms.v2.RandomCrop + "torchvision.transforms.v2.RandomCrop")。 |' - en: '| [`v2.functional.five_crop`](generated/torchvision.transforms.v2.functional.five_crop.html#torchvision.transforms.v2.functional.five_crop "torchvision.transforms.v2.functional.five_crop")(inpt, size) | See [`FiveCrop`](generated/torchvision.transforms.v2.FiveCrop.html#torchvision.transforms.v2.FiveCrop "torchvision.transforms.v2.FiveCrop") for details. |' + id: totrans-67 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.five_crop`](generated/torchvision.transforms.v2.functional.five_crop.html#torchvision.transforms.v2.functional.five_crop + "torchvision.transforms.v2.functional.five_crop")(inpt, size) | 查看详细信息,请参阅[`FiveCrop`](generated/torchvision.transforms.v2.FiveCrop.html#torchvision.transforms.v2.FiveCrop + "torchvision.transforms.v2.FiveCrop")。 |' - en: Others[](#others "Permalink to this heading") + id: totrans-68 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 其他[](#others "跳转到此标题") - en: '| [`v2.RandomHorizontalFlip`](generated/torchvision.transforms.v2.RandomHorizontalFlip.html#torchvision.transforms.v2.RandomHorizontalFlip "torchvision.transforms.v2.RandomHorizontalFlip")([p]) | Horizontally flip the input with a given probability. |' + id: totrans-69 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomHorizontalFlip`](generated/torchvision.transforms.v2.RandomHorizontalFlip.html#torchvision.transforms.v2.RandomHorizontalFlip + "torchvision.transforms.v2.RandomHorizontalFlip")([p]) | 按给定概率水平翻转输入。 |' - en: '| [`v2.RandomVerticalFlip`](generated/torchvision.transforms.v2.RandomVerticalFlip.html#torchvision.transforms.v2.RandomVerticalFlip "torchvision.transforms.v2.RandomVerticalFlip")([p]) | Vertically flip the input with a given probability. |' + id: totrans-70 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomVerticalFlip`](generated/torchvision.transforms.v2.RandomVerticalFlip.html#torchvision.transforms.v2.RandomVerticalFlip + "torchvision.transforms.v2.RandomVerticalFlip")([p]) | 按给定概率垂直翻转输入。 |' - en: '| [`v2.Pad`](generated/torchvision.transforms.v2.Pad.html#torchvision.transforms.v2.Pad "torchvision.transforms.v2.Pad")(padding[, fill, padding_mode]) | Pad the input on all sides with the given "pad" value. |' + id: totrans-71 prefs: [] type: TYPE_TB + zh: '| [`v2.Pad`](generated/torchvision.transforms.v2.Pad.html#torchvision.transforms.v2.Pad + "torchvision.transforms.v2.Pad")(padding[, fill, padding_mode]) | 使用给定的“pad”值在所有边上填充输入。 + |' - en: '| [`v2.RandomZoomOut`](generated/torchvision.transforms.v2.RandomZoomOut.html#torchvision.transforms.v2.RandomZoomOut "torchvision.transforms.v2.RandomZoomOut")([fill, side_range, p]) | "Zoom out" transformation from ["SSD: Single Shot MultiBox Detector"](https://arxiv.org/abs/1512.02325). |' + id: totrans-72 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomZoomOut`](generated/torchvision.transforms.v2.RandomZoomOut.html#torchvision.transforms.v2.RandomZoomOut + "torchvision.transforms.v2.RandomZoomOut")([fill, side_range, p]) | 来自["SSD: Single + Shot MultiBox Detector"](https://arxiv.org/abs/1512.02325)的"缩小"变换。 |' - en: '| [`v2.RandomRotation`](generated/torchvision.transforms.v2.RandomRotation.html#torchvision.transforms.v2.RandomRotation "torchvision.transforms.v2.RandomRotation")(degrees[, interpolation, ...]) | Rotate the input by angle. |' + id: totrans-73 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomRotation`](generated/torchvision.transforms.v2.RandomRotation.html#torchvision.transforms.v2.RandomRotation + "torchvision.transforms.v2.RandomRotation")(degrees[, interpolation, ...]) | 将输入旋转指定角度。 + |' - en: '| [`v2.RandomAffine`](generated/torchvision.transforms.v2.RandomAffine.html#torchvision.transforms.v2.RandomAffine "torchvision.transforms.v2.RandomAffine")(degrees[, translate, scale, ...]) | Random affine transformation the input keeping center invariant. |' + id: totrans-74 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomAffine`](generated/torchvision.transforms.v2.RandomAffine.html#torchvision.transforms.v2.RandomAffine + "torchvision.transforms.v2.RandomAffine")(degrees[, translate, scale, ...]) | + 随机仿射变换输入,保持中心不变。 |' - en: '| [`v2.RandomPerspective`](generated/torchvision.transforms.v2.RandomPerspective.html#torchvision.transforms.v2.RandomPerspective "torchvision.transforms.v2.RandomPerspective")([distortion_scale, p, ...]) | Perform a random perspective transformation of the input with a given probability. |' + id: totrans-75 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomPerspective`](generated/torchvision.transforms.v2.RandomPerspective.html#torchvision.transforms.v2.RandomPerspective + "torchvision.transforms.v2.RandomPerspective")([distortion_scale, p, ...]) | 按给定概率对输入执行随机透视变换。 + |' - en: '| [`v2.ElasticTransform`](generated/torchvision.transforms.v2.ElasticTransform.html#torchvision.transforms.v2.ElasticTransform "torchvision.transforms.v2.ElasticTransform")([alpha, sigma, ...]) | Transform the input with elastic transformations. |' + id: totrans-76 prefs: [] type: TYPE_TB + zh: '| [`v2.ElasticTransform`](generated/torchvision.transforms.v2.ElasticTransform.html#torchvision.transforms.v2.ElasticTransform + "torchvision.transforms.v2.ElasticTransform")([alpha, sigma, ...]) | 使用弹性变换对输入进行变换。 + |' - en: Functionals + id: totrans-77 prefs: [] type: TYPE_NORMAL + zh: 功能函数 - en: '| [`v2.functional.horizontal_flip`](generated/torchvision.transforms.v2.functional.horizontal_flip.html#torchvision.transforms.v2.functional.horizontal_flip "torchvision.transforms.v2.functional.horizontal_flip")(inpt) | See [`RandomHorizontalFlip`](generated/torchvision.transforms.v2.RandomHorizontalFlip.html#torchvision.transforms.v2.RandomHorizontalFlip "torchvision.transforms.v2.RandomHorizontalFlip") for details. |' + id: totrans-78 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.horizontal_flip`](generated/torchvision.transforms.v2.functional.horizontal_flip.html#torchvision.transforms.v2.functional.horizontal_flip + "torchvision.transforms.v2.functional.horizontal_flip")(inpt) | 查看详细信息,请参阅[`RandomHorizontalFlip`](generated/torchvision.transforms.v2.RandomHorizontalFlip.html#torchvision.transforms.v2.RandomHorizontalFlip + "torchvision.transforms.v2.RandomHorizontalFlip")。 |' - en: '| [`v2.functional.vertical_flip`](generated/torchvision.transforms.v2.functional.vertical_flip.html#torchvision.transforms.v2.functional.vertical_flip "torchvision.transforms.v2.functional.vertical_flip")(inpt) | See [`RandomVerticalFlip`](generated/torchvision.transforms.v2.RandomVerticalFlip.html#torchvision.transforms.v2.RandomVerticalFlip "torchvision.transforms.v2.RandomVerticalFlip") for details. |' + id: totrans-79 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.vertical_flip`](generated/torchvision.transforms.v2.functional.vertical_flip.html#torchvision.transforms.v2.functional.vertical_flip + "torchvision.transforms.v2.functional.vertical_flip")(inpt) | 查看[`RandomVerticalFlip`](generated/torchvision.transforms.v2.RandomVerticalFlip.html#torchvision.transforms.v2.RandomVerticalFlip + "torchvision.transforms.v2.RandomVerticalFlip")获取详细信息。 |' - en: '| [`v2.functional.pad`](generated/torchvision.transforms.v2.functional.pad.html#torchvision.transforms.v2.functional.pad "torchvision.transforms.v2.functional.pad")(inpt, padding[, fill, ...]) | See [`Pad`](generated/torchvision.transforms.v2.Pad.html#torchvision.transforms.v2.Pad "torchvision.transforms.v2.Pad") for details. |' + id: totrans-80 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.pad`](generated/torchvision.transforms.v2.functional.pad.html#torchvision.transforms.v2.functional.pad + "torchvision.transforms.v2.functional.pad")(inpt, padding[, fill, ...]) | 查看[`Pad`](generated/torchvision.transforms.v2.Pad.html#torchvision.transforms.v2.Pad + "torchvision.transforms.v2.Pad")获取详细信息。 |' - en: '| [`v2.functional.rotate`](generated/torchvision.transforms.v2.functional.rotate.html#torchvision.transforms.v2.functional.rotate "torchvision.transforms.v2.functional.rotate")(inpt, angle[, ...]) | See [`RandomRotation`](generated/torchvision.transforms.v2.RandomRotation.html#torchvision.transforms.v2.RandomRotation "torchvision.transforms.v2.RandomRotation") for details. |' + id: totrans-81 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.rotate`](generated/torchvision.transforms.v2.functional.rotate.html#torchvision.transforms.v2.functional.rotate + "torchvision.transforms.v2.functional.rotate")(inpt, angle[, ...]) | 查看[`RandomRotation`](generated/torchvision.transforms.v2.RandomRotation.html#torchvision.transforms.v2.RandomRotation + "torchvision.transforms.v2.RandomRotation")获取详细信息。 |' - en: '| [`v2.functional.affine`](generated/torchvision.transforms.v2.functional.affine.html#torchvision.transforms.v2.functional.affine "torchvision.transforms.v2.functional.affine")(inpt, angle, translate, ...) | See [`RandomAffine`](generated/torchvision.transforms.v2.RandomAffine.html#torchvision.transforms.v2.RandomAffine "torchvision.transforms.v2.RandomAffine") for details. |' + id: totrans-82 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.affine`](generated/torchvision.transforms.v2.functional.affine.html#torchvision.transforms.v2.functional.affine + "torchvision.transforms.v2.functional.affine")(inpt, angle, translate, ...) | + 查看[`RandomAffine`](generated/torchvision.transforms.v2.RandomAffine.html#torchvision.transforms.v2.RandomAffine + "torchvision.transforms.v2.RandomAffine")获取详细信息。 |' - en: '| [`v2.functional.perspective`](generated/torchvision.transforms.v2.functional.perspective.html#torchvision.transforms.v2.functional.perspective "torchvision.transforms.v2.functional.perspective")(inpt, startpoints, ...) | See [`RandomPerspective`](generated/torchvision.transforms.v2.RandomPerspective.html#torchvision.transforms.v2.RandomPerspective "torchvision.transforms.v2.RandomPerspective") for details. |' + id: totrans-83 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.perspective`](generated/torchvision.transforms.v2.functional.perspective.html#torchvision.transforms.v2.functional.perspective + "torchvision.transforms.v2.functional.perspective")(inpt, startpoints, ...) | + 查看[`RandomPerspective`](generated/torchvision.transforms.v2.RandomPerspective.html#torchvision.transforms.v2.RandomPerspective + "torchvision.transforms.v2.RandomPerspective")获取详细信息。 |' - en: '| [`v2.functional.elastic`](generated/torchvision.transforms.v2.functional.elastic.html#torchvision.transforms.v2.functional.elastic "torchvision.transforms.v2.functional.elastic")(inpt, displacement[, ...]) | See [`ElasticTransform`](generated/torchvision.transforms.v2.ElasticTransform.html#torchvision.transforms.v2.ElasticTransform "torchvision.transforms.v2.ElasticTransform") for details. |' + id: totrans-84 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.elastic`](generated/torchvision.transforms.v2.functional.elastic.html#torchvision.transforms.v2.functional.elastic + "torchvision.transforms.v2.functional.elastic")(inpt, displacement[, ...]) | 查看[`ElasticTransform`](generated/torchvision.transforms.v2.ElasticTransform.html#torchvision.transforms.v2.ElasticTransform + "torchvision.transforms.v2.ElasticTransform")获取详细信息。 |' - en: Color[](#color "Permalink to this heading") + id: totrans-85 prefs: - PREF_H3 type: TYPE_NORMAL + zh: Color[](#color "Permalink to this heading") - en: '| [`v2.ColorJitter`](generated/torchvision.transforms.v2.ColorJitter.html#torchvision.transforms.v2.ColorJitter "torchvision.transforms.v2.ColorJitter")([brightness, contrast, ...]) | Randomly change the brightness, contrast, saturation and hue of an image or video. |' + id: totrans-86 prefs: [] type: TYPE_TB + zh: '| [`v2.ColorJitter`](generated/torchvision.transforms.v2.ColorJitter.html#torchvision.transforms.v2.ColorJitter + "torchvision.transforms.v2.ColorJitter")([brightness, contrast, ...]) | 随机改变图像或视频的亮度、对比度、饱和度和色调。 + |' - en: '| [`v2.RandomChannelPermutation`](generated/torchvision.transforms.v2.RandomChannelPermutation.html#torchvision.transforms.v2.RandomChannelPermutation "torchvision.transforms.v2.RandomChannelPermutation")() | Randomly permute the channels of an image or video |' + id: totrans-87 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomChannelPermutation`](generated/torchvision.transforms.v2.RandomChannelPermutation.html#torchvision.transforms.v2.RandomChannelPermutation + "torchvision.transforms.v2.RandomChannelPermutation")() | 随机排列图像或视频的通道。 |' - en: '| [`v2.RandomPhotometricDistort`](generated/torchvision.transforms.v2.RandomPhotometricDistort.html#torchvision.transforms.v2.RandomPhotometricDistort "torchvision.transforms.v2.RandomPhotometricDistort")([brightness, ...]) | Randomly distorts the image or video as used in [SSD: Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325). |' + id: totrans-88 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomPhotometricDistort`](generated/torchvision.transforms.v2.RandomPhotometricDistort.html#torchvision.transforms.v2.RandomPhotometricDistort + "torchvision.transforms.v2.RandomPhotometricDistort")([brightness, ...]) | 随机扭曲图像或视频,如[SSD: + Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325)中所使用的。 |' - en: '| [`v2.Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale "torchvision.transforms.v2.Grayscale")([num_output_channels]) | Convert images or videos to grayscale. |' + id: totrans-89 prefs: [] type: TYPE_TB + zh: '| [`v2.Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale + "torchvision.transforms.v2.Grayscale")([num_output_channels]) | 将图像或视频转换为灰度图像。 + |' - en: '| [`v2.RandomGrayscale`](generated/torchvision.transforms.v2.RandomGrayscale.html#torchvision.transforms.v2.RandomGrayscale "torchvision.transforms.v2.RandomGrayscale")([p]) | Randomly convert image or videos to grayscale with a probability of p (default 0.1). |' + id: totrans-90 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomGrayscale`](generated/torchvision.transforms.v2.RandomGrayscale.html#torchvision.transforms.v2.RandomGrayscale + "torchvision.transforms.v2.RandomGrayscale")([p]) | 随机将图像或视频转换为灰度图像,概率为p(默认为0.1)。 + |' - en: '| [`v2.GaussianBlur`](generated/torchvision.transforms.v2.GaussianBlur.html#torchvision.transforms.v2.GaussianBlur "torchvision.transforms.v2.GaussianBlur")(kernel_size[, sigma]) | Blurs image with randomly chosen Gaussian blur. |' + id: totrans-91 prefs: [] type: TYPE_TB + zh: '| [`v2.GaussianBlur`](generated/torchvision.transforms.v2.GaussianBlur.html#torchvision.transforms.v2.GaussianBlur + "torchvision.transforms.v2.GaussianBlur")(kernel_size[, sigma]) | 使用随机选择的高斯模糊对图像进行模糊处理。 + |' - en: '| [`v2.RandomInvert`](generated/torchvision.transforms.v2.RandomInvert.html#torchvision.transforms.v2.RandomInvert "torchvision.transforms.v2.RandomInvert")([p]) | Inverts the colors of the given image or video with a given probability. |' + id: totrans-92 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomInvert`](generated/torchvision.transforms.v2.RandomInvert.html#torchvision.transforms.v2.RandomInvert + "torchvision.transforms.v2.RandomInvert")([p]) | 使用给定的概率反转给定图像或视频的颜色。 |' - en: '| [`v2.RandomPosterize`](generated/torchvision.transforms.v2.RandomPosterize.html#torchvision.transforms.v2.RandomPosterize "torchvision.transforms.v2.RandomPosterize")(bits[, p]) | Posterize the image or video with a given probability by reducing the number of bits for each color channel. |' + id: totrans-93 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomPosterize`](generated/torchvision.transforms.v2.RandomPosterize.html#torchvision.transforms.v2.RandomPosterize + "torchvision.transforms.v2.RandomPosterize")(bits[, p]) | 使用给定的概率通过减少每个颜色通道的位数来对图像或视频进行色调分离。 + |' - en: '| [`v2.RandomSolarize`](generated/torchvision.transforms.v2.RandomSolarize.html#torchvision.transforms.v2.RandomSolarize "torchvision.transforms.v2.RandomSolarize")(threshold[, p]) | Solarize the image or video with a given probability by inverting all pixel values above a threshold. |' + id: totrans-94 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomSolarize`](generated/torchvision.transforms.v2.RandomSolarize.html#torchvision.transforms.v2.RandomSolarize + "torchvision.transforms.v2.RandomSolarize")(threshold[, p]) | 使用给定的概率通过反转高于阈值的所有像素值来对图像或视频进行日光曝光处理。 + |' - en: '| [`v2.RandomAdjustSharpness`](generated/torchvision.transforms.v2.RandomAdjustSharpness.html#torchvision.transforms.v2.RandomAdjustSharpness "torchvision.transforms.v2.RandomAdjustSharpness")(sharpness_factor[, p]) | Adjust the sharpness of the image or video with a given probability. |' + id: totrans-95 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomAdjustSharpness`](generated/torchvision.transforms.v2.RandomAdjustSharpness.html#torchvision.transforms.v2.RandomAdjustSharpness + "torchvision.transforms.v2.RandomAdjustSharpness")(sharpness_factor[, p]) | 使用给定的概率调整图像或视频的锐度。 + |' - en: '| [`v2.RandomAutocontrast`](generated/torchvision.transforms.v2.RandomAutocontrast.html#torchvision.transforms.v2.RandomAutocontrast "torchvision.transforms.v2.RandomAutocontrast")([p]) | Autocontrast the pixels of the given image or video with a given probability. |' + id: totrans-96 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomAutocontrast`](generated/torchvision.transforms.v2.RandomAutocontrast.html#torchvision.transforms.v2.RandomAutocontrast + "torchvision.transforms.v2.RandomAutocontrast")([p]) | 使用给定的概率自动对给定图像或视频的像素进行自动对比度处理。 + |' - en: '| [`v2.RandomEqualize`](generated/torchvision.transforms.v2.RandomEqualize.html#torchvision.transforms.v2.RandomEqualize "torchvision.transforms.v2.RandomEqualize")([p]) | Equalize the histogram of the given image or video with a given probability. |' + id: totrans-97 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomEqualize`](generated/torchvision.transforms.v2.RandomEqualize.html#torchvision.transforms.v2.RandomEqualize + "torchvision.transforms.v2.RandomEqualize")([p]) | 使用给定的概率对给定图像或视频的直方图进行均衡化。 |' - en: Functionals + id: totrans-98 prefs: [] type: TYPE_NORMAL + zh: 功能函数 - en: '| [`v2.functional.permute_channels`](generated/torchvision.transforms.v2.functional.permute_channels.html#torchvision.transforms.v2.functional.permute_channels "torchvision.transforms.v2.functional.permute_channels")(inpt, permutation) | Permute the channels of the input according to the given permutation. |' + id: totrans-99 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.permute_channels`](generated/torchvision.transforms.v2.functional.permute_channels.html#torchvision.transforms.v2.functional.permute_channels + "torchvision.transforms.v2.functional.permute_channels")(inpt, permutation) | + 根据给定的排列方式重新排列输入的通道。 |' - en: '| [`v2.functional.rgb_to_grayscale`](generated/torchvision.transforms.v2.functional.rgb_to_grayscale.html#torchvision.transforms.v2.functional.rgb_to_grayscale "torchvision.transforms.v2.functional.rgb_to_grayscale")(inpt[, ...]) | See [`Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale "torchvision.transforms.v2.Grayscale") for details. |' + id: totrans-100 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.rgb_to_grayscale`](generated/torchvision.transforms.v2.functional.rgb_to_grayscale.html#torchvision.transforms.v2.functional.rgb_to_grayscale + "torchvision.transforms.v2.functional.rgb_to_grayscale")(inpt[, ...]) | 查看[`Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale + "torchvision.transforms.v2.Grayscale")获取详细信息。 |' - en: '| [`v2.functional.to_grayscale`](generated/torchvision.transforms.v2.functional.to_grayscale.html#torchvision.transforms.v2.functional.to_grayscale "torchvision.transforms.v2.functional.to_grayscale")(inpt[, ...]) | See [`Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale "torchvision.transforms.v2.Grayscale") for details. |' + id: totrans-101 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.to_grayscale`](generated/torchvision.transforms.v2.functional.to_grayscale.html#torchvision.transforms.v2.functional.to_grayscale + "torchvision.transforms.v2.functional.to_grayscale")(inpt[, ...]) | 查看[`Grayscale`](generated/torchvision.transforms.v2.Grayscale.html#torchvision.transforms.v2.Grayscale + "torchvision.transforms.v2.Grayscale")获取详细信息。 |' - en: '| [`v2.functional.gaussian_blur`](generated/torchvision.transforms.v2.functional.gaussian_blur.html#torchvision.transforms.v2.functional.gaussian_blur "torchvision.transforms.v2.functional.gaussian_blur")(inpt, kernel_size) | See [`GaussianBlur`](generated/torchvision.transforms.v2.GaussianBlur.html#torchvision.transforms.v2.GaussianBlur "torchvision.transforms.v2.GaussianBlur") for details. |' + id: totrans-102 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.gaussian_blur`](generated/torchvision.transforms.v2.functional.gaussian_blur.html#torchvision.transforms.v2.functional.gaussian_blur + "torchvision.transforms.v2.functional.gaussian_blur")(inpt, kernel_size) | 查看[`GaussianBlur`](generated/torchvision.transforms.v2.GaussianBlur.html#torchvision.transforms.v2.GaussianBlur + "torchvision.transforms.v2.GaussianBlur")获取详细信息。 |' - en: '| [`v2.functional.invert`](generated/torchvision.transforms.v2.functional.invert.html#torchvision.transforms.v2.functional.invert "torchvision.transforms.v2.functional.invert")(inpt) | See [`RandomInvert()`](generated/torchvision.transforms.v2.RandomInvert.html#torchvision.transforms.v2.RandomInvert "torchvision.transforms.v2.RandomInvert"). |' + id: totrans-103 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.invert`](generated/torchvision.transforms.v2.functional.invert.html#torchvision.transforms.v2.functional.invert + "torchvision.transforms.v2.functional.invert")(inpt) | 查看[`RandomInvert()`](generated/torchvision.transforms.v2.RandomInvert.html#torchvision.transforms.v2.RandomInvert + "torchvision.transforms.v2.RandomInvert"). |' - en: '| [`v2.functional.posterize`](generated/torchvision.transforms.v2.functional.posterize.html#torchvision.transforms.v2.functional.posterize "torchvision.transforms.v2.functional.posterize")(inpt, bits) | See [`RandomPosterize`](generated/torchvision.transforms.v2.RandomPosterize.html#torchvision.transforms.v2.RandomPosterize "torchvision.transforms.v2.RandomPosterize") for details. |' + id: totrans-104 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.posterize`](generated/torchvision.transforms.v2.functional.posterize.html#torchvision.transforms.v2.functional.posterize + "torchvision.transforms.v2.functional.posterize")(inpt, bits) | 查看[`RandomPosterize`](generated/torchvision.transforms.v2.RandomPosterize.html#torchvision.transforms.v2.RandomPosterize + "torchvision.transforms.v2.RandomPosterize")获取详细信息。 |' - en: '| [`v2.functional.solarize`](generated/torchvision.transforms.v2.functional.solarize.html#torchvision.transforms.v2.functional.solarize "torchvision.transforms.v2.functional.solarize")(inpt, threshold) | See [`RandomSolarize`](generated/torchvision.transforms.v2.RandomSolarize.html#torchvision.transforms.v2.RandomSolarize "torchvision.transforms.v2.RandomSolarize") for details. |' + id: totrans-105 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.solarize`](generated/torchvision.transforms.v2.functional.solarize.html#torchvision.transforms.v2.functional.solarize + "torchvision.transforms.v2.functional.solarize")(inpt, threshold) | 查看详细信息,请参阅[`RandomSolarize`](generated/torchvision.transforms.v2.RandomSolarize.html#torchvision.transforms.v2.RandomSolarize + "torchvision.transforms.v2.RandomSolarize") |' - en: '| [`v2.functional.adjust_sharpness`](generated/torchvision.transforms.v2.functional.adjust_sharpness.html#torchvision.transforms.v2.functional.adjust_sharpness "torchvision.transforms.v2.functional.adjust_sharpness")(inpt, ...) | See [`RandomAdjustSharpness`](generated/torchvision.transforms.RandomAdjustSharpness.html#torchvision.transforms.RandomAdjustSharpness "torchvision.transforms.RandomAdjustSharpness") |' + id: totrans-106 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_sharpness`](generated/torchvision.transforms.v2.functional.adjust_sharpness.html#torchvision.transforms.v2.functional.adjust_sharpness + "torchvision.transforms.v2.functional.adjust_sharpness")(inpt, ...) | 请参阅[`RandomAdjustSharpness`](generated/torchvision.transforms.RandomAdjustSharpness.html#torchvision.transforms.RandomAdjustSharpness + "torchvision.transforms.RandomAdjustSharpness") |' - en: '| [`v2.functional.autocontrast`](generated/torchvision.transforms.v2.functional.autocontrast.html#torchvision.transforms.v2.functional.autocontrast "torchvision.transforms.v2.functional.autocontrast")(inpt) | See [`RandomAutocontrast`](generated/torchvision.transforms.v2.RandomAutocontrast.html#torchvision.transforms.v2.RandomAutocontrast "torchvision.transforms.v2.RandomAutocontrast") for details. |' + id: totrans-107 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.autocontrast`](generated/torchvision.transforms.v2.functional.autocontrast.html#torchvision.transforms.v2.functional.autocontrast + "torchvision.transforms.v2.functional.autocontrast")(inpt) | 查看详细信息,请参阅[`RandomAutocontrast`](generated/torchvision.transforms.v2.RandomAutocontrast.html#torchvision.transforms.v2.RandomAutocontrast + "torchvision.transforms.v2.RandomAutocontrast") |' - en: '| [`v2.functional.adjust_contrast`](generated/torchvision.transforms.v2.functional.adjust_contrast.html#torchvision.transforms.v2.functional.adjust_contrast "torchvision.transforms.v2.functional.adjust_contrast")(inpt, ...) | See [`RandomAutocontrast`](generated/torchvision.transforms.RandomAutocontrast.html#torchvision.transforms.RandomAutocontrast "torchvision.transforms.RandomAutocontrast") |' + id: totrans-108 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_contrast`](generated/torchvision.transforms.v2.functional.adjust_contrast.html#torchvision.transforms.v2.functional.adjust_contrast + "torchvision.transforms.v2.functional.adjust_contrast")(inpt, ...) | 请参阅[`RandomAutocontrast`](generated/torchvision.transforms.RandomAutocontrast.html#torchvision.transforms.RandomAutocontrast + "torchvision.transforms.RandomAutocontrast") |' - en: '| [`v2.functional.equalize`](generated/torchvision.transforms.v2.functional.equalize.html#torchvision.transforms.v2.functional.equalize "torchvision.transforms.v2.functional.equalize")(inpt) | See [`RandomEqualize`](generated/torchvision.transforms.v2.RandomEqualize.html#torchvision.transforms.v2.RandomEqualize "torchvision.transforms.v2.RandomEqualize") for details. |' + id: totrans-109 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.equalize`](generated/torchvision.transforms.v2.functional.equalize.html#torchvision.transforms.v2.functional.equalize + "torchvision.transforms.v2.functional.equalize")(inpt) | 查看详细信息,请参阅[`RandomEqualize`](generated/torchvision.transforms.v2.RandomEqualize.html#torchvision.transforms.v2.RandomEqualize + "torchvision.transforms.v2.RandomEqualize") |' - en: '| [`v2.functional.adjust_brightness`](generated/torchvision.transforms.v2.functional.adjust_brightness.html#torchvision.transforms.v2.functional.adjust_brightness "torchvision.transforms.v2.functional.adjust_brightness")(inpt, ...) | Adjust brightness. |' + id: totrans-110 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_brightness`](generated/torchvision.transforms.v2.functional.adjust_brightness.html#torchvision.transforms.v2.functional.adjust_brightness + "torchvision.transforms.v2.functional.adjust_brightness")(inpt, ...) | 调整亮度。 |' - en: '| [`v2.functional.adjust_saturation`](generated/torchvision.transforms.v2.functional.adjust_saturation.html#torchvision.transforms.v2.functional.adjust_saturation "torchvision.transforms.v2.functional.adjust_saturation")(inpt, ...) | Adjust saturation. |' + id: totrans-111 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_saturation`](generated/torchvision.transforms.v2.functional.adjust_saturation.html#torchvision.transforms.v2.functional.adjust_saturation + "torchvision.transforms.v2.functional.adjust_saturation")(inpt, ...) | 调整饱和度。 + |' - en: '| [`v2.functional.adjust_hue`](generated/torchvision.transforms.v2.functional.adjust_hue.html#torchvision.transforms.v2.functional.adjust_hue "torchvision.transforms.v2.functional.adjust_hue")(inpt, hue_factor) | Adjust hue |' + id: totrans-112 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_hue`](generated/torchvision.transforms.v2.functional.adjust_hue.html#torchvision.transforms.v2.functional.adjust_hue + "torchvision.transforms.v2.functional.adjust_hue")(inpt, hue_factor) | 调整色调 |' - en: '| [`v2.functional.adjust_gamma`](generated/torchvision.transforms.v2.functional.adjust_gamma.html#torchvision.transforms.v2.functional.adjust_gamma "torchvision.transforms.v2.functional.adjust_gamma")(inpt, gamma[, gain]) | Adjust gamma. |' + id: totrans-113 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.adjust_gamma`](generated/torchvision.transforms.v2.functional.adjust_gamma.html#torchvision.transforms.v2.functional.adjust_gamma + "torchvision.transforms.v2.functional.adjust_gamma")(inpt, gamma[, gain]) | 调整伽马值。 + |' - en: Composition[](#composition "Permalink to this heading") + id: totrans-114 prefs: - PREF_H3 type: TYPE_NORMAL + zh: Composition[](#composition "Permalink to this heading") - en: '| [`v2.Compose`](generated/torchvision.transforms.v2.Compose.html#torchvision.transforms.v2.Compose "torchvision.transforms.v2.Compose")(transforms) | Composes several transforms together. |' + id: totrans-115 prefs: [] type: TYPE_TB + zh: '| [`v2.Compose`](generated/torchvision.transforms.v2.Compose.html#torchvision.transforms.v2.Compose + "torchvision.transforms.v2.Compose")(transforms) | 将多个转换组合在一起。 |' - en: '| [`v2.RandomApply`](generated/torchvision.transforms.v2.RandomApply.html#torchvision.transforms.v2.RandomApply "torchvision.transforms.v2.RandomApply")(transforms[, p]) | Apply randomly a list of transformations with a given probability. |' + id: totrans-116 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomApply`](generated/torchvision.transforms.v2.RandomApply.html#torchvision.transforms.v2.RandomApply + "torchvision.transforms.v2.RandomApply")(transforms[, p]) | 以给定概率随机应用一系列转换。 |' - en: '| [`v2.RandomChoice`](generated/torchvision.transforms.v2.RandomChoice.html#torchvision.transforms.v2.RandomChoice "torchvision.transforms.v2.RandomChoice")(transforms[, p]) | Apply single transformation randomly picked from a list. |' + id: totrans-117 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomChoice`](generated/torchvision.transforms.v2.RandomChoice.html#torchvision.transforms.v2.RandomChoice + "torchvision.transforms.v2.RandomChoice")(transforms[, p]) | 从列表中随机选择一个转换进行应用。 + |' - en: '| [`v2.RandomOrder`](generated/torchvision.transforms.v2.RandomOrder.html#torchvision.transforms.v2.RandomOrder "torchvision.transforms.v2.RandomOrder")(transforms) | Apply a list of transformations in a random order. |' + id: totrans-118 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomOrder`](generated/torchvision.transforms.v2.RandomOrder.html#torchvision.transforms.v2.RandomOrder + "torchvision.transforms.v2.RandomOrder")(transforms) | 以随机顺序应用一系列转换。 |' - en: Miscellaneous[](#miscellaneous "Permalink to this heading") + id: totrans-119 prefs: - PREF_H3 type: TYPE_NORMAL + zh: Miscellaneous[](#miscellaneous "Permalink to this heading") - en: '| [`v2.LinearTransformation`](generated/torchvision.transforms.v2.LinearTransformation.html#torchvision.transforms.v2.LinearTransformation "torchvision.transforms.v2.LinearTransformation")(...) | Transform a tensor image or video with a square transformation matrix and a mean_vector computed offline. |' + id: totrans-120 prefs: [] type: TYPE_TB + zh: '| [`v2.LinearTransformation`](generated/torchvision.transforms.v2.LinearTransformation.html#torchvision.transforms.v2.LinearTransformation + "torchvision.transforms.v2.LinearTransformation")(...) | 使用离线计算的方形变换矩阵和均值向量对张量图像或视频进行转换。 + |' - en: '| [`v2.Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize "torchvision.transforms.v2.Normalize")(mean, std[, inplace]) | Normalize a tensor image or video with mean and standard deviation. |' + id: totrans-121 prefs: [] type: TYPE_TB + zh: '| [`v2.Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize + "torchvision.transforms.v2.Normalize")(mean, std[, inplace]) | 使用均值和标准差对张量图像或视频进行归一化。 + |' - en: '| [`v2.RandomErasing`](generated/torchvision.transforms.v2.RandomErasing.html#torchvision.transforms.v2.RandomErasing "torchvision.transforms.v2.RandomErasing")([p, scale, ratio, value, ...]) | Randomly select a rectangle region in the input image or video and erase its pixels. |' + id: totrans-122 prefs: [] type: TYPE_TB + zh: '| [`v2.RandomErasing`](generated/torchvision.transforms.v2.RandomErasing.html#torchvision.transforms.v2.RandomErasing + "torchvision.transforms.v2.RandomErasing")([p, scale, ratio, value, ...]) | 随机选择输入图像或视频中的矩形区域并擦除其像素。 + |' - en: '| [`v2.Lambda`](generated/torchvision.transforms.v2.Lambda.html#torchvision.transforms.v2.Lambda "torchvision.transforms.v2.Lambda")(lambd, *types) | Apply a user-defined function as a transform. |' + id: totrans-123 prefs: [] type: TYPE_TB + zh: '| [`v2.Lambda`](generated/torchvision.transforms.v2.Lambda.html#torchvision.transforms.v2.Lambda + "torchvision.transforms.v2.Lambda")(lambd, *types) | 将用户定义的函数应用为转换。 |' - en: '| [`v2.SanitizeBoundingBoxes`](generated/torchvision.transforms.v2.SanitizeBoundingBoxes.html#torchvision.transforms.v2.SanitizeBoundingBoxes "torchvision.transforms.v2.SanitizeBoundingBoxes")([min_size, ...]) | Remove degenerate/invalid bounding boxes and their corresponding labels and masks. |' + id: totrans-124 prefs: [] type: TYPE_TB + zh: '| [`v2.SanitizeBoundingBoxes`](generated/torchvision.transforms.v2.SanitizeBoundingBoxes.html#torchvision.transforms.v2.SanitizeBoundingBoxes + "torchvision.transforms.v2.SanitizeBoundingBoxes")([min_size, ...]) | 删除退化/无效的边界框及其对应的标签和掩模。 + |' - en: '| [`v2.ClampBoundingBoxes`](generated/torchvision.transforms.v2.ClampBoundingBoxes.html#torchvision.transforms.v2.ClampBoundingBoxes "torchvision.transforms.v2.ClampBoundingBoxes")() | Clamp bounding boxes to their corresponding image dimensions. |' + id: totrans-125 prefs: [] type: TYPE_TB + zh: '| [`v2.ClampBoundingBoxes`](generated/torchvision.transforms.v2.ClampBoundingBoxes.html#torchvision.transforms.v2.ClampBoundingBoxes + "torchvision.transforms.v2.ClampBoundingBoxes")() | 将边界框限制在其对应的图像尺寸内。 |' - en: '| [`v2.UniformTemporalSubsample`](generated/torchvision.transforms.v2.UniformTemporalSubsample.html#torchvision.transforms.v2.UniformTemporalSubsample "torchvision.transforms.v2.UniformTemporalSubsample")(num_samples) | Uniformly subsample `num_samples` indices from the temporal dimension of the video. |' + id: totrans-126 prefs: [] type: TYPE_TB + zh: '| [`v2.UniformTemporalSubsample`](generated/torchvision.transforms.v2.UniformTemporalSubsample.html#torchvision.transforms.v2.UniformTemporalSubsample + "torchvision.transforms.v2.UniformTemporalSubsample")(num_samples) | 从视频的时间维度均匀地子采样 + `num_samples` 个索引。 |' - en: Functionals + id: totrans-127 prefs: [] type: TYPE_NORMAL + zh: 功能性 - en: '| [`v2.functional.normalize`](generated/torchvision.transforms.v2.functional.normalize.html#torchvision.transforms.v2.functional.normalize "torchvision.transforms.v2.functional.normalize")(inpt, mean, std[, ...]) | See [`Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize "torchvision.transforms.v2.Normalize") for details. |' + id: totrans-128 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.normalize`](generated/torchvision.transforms.v2.functional.normalize.html#torchvision.transforms.v2.functional.normalize + "torchvision.transforms.v2.functional.normalize")(inpt, mean, std[, ...]) | 详细信息请参见[`Normalize`](generated/torchvision.transforms.v2.Normalize.html#torchvision.transforms.v2.Normalize + "torchvision.transforms.v2.Normalize")。 |' - en: '| [`v2.functional.erase`](generated/torchvision.transforms.v2.functional.erase.html#torchvision.transforms.v2.functional.erase "torchvision.transforms.v2.functional.erase")(inpt, i, j, h, w, v[, ...]) | See `RandomErase` for details. |' + id: totrans-129 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.erase`](generated/torchvision.transforms.v2.functional.erase.html#torchvision.transforms.v2.functional.erase + "torchvision.transforms.v2.functional.erase")(inpt, i, j, h, w, v[, ...]) | 详细信息请参见 + `RandomErase`。 |' - en: '| [`v2.functional.clamp_bounding_boxes`](generated/torchvision.transforms.v2.functional.clamp_bounding_boxes.html#torchvision.transforms.v2.functional.clamp_bounding_boxes "torchvision.transforms.v2.functional.clamp_bounding_boxes")(inpt[, ...]) | See [`ClampBoundingBoxes()`](generated/torchvision.transforms.v2.ClampBoundingBoxes.html#torchvision.transforms.v2.ClampBoundingBoxes "torchvision.transforms.v2.ClampBoundingBoxes") for details. |' + id: totrans-130 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.clamp_bounding_boxes`](generated/torchvision.transforms.v2.functional.clamp_bounding_boxes.html#torchvision.transforms.v2.functional.clamp_bounding_boxes + "torchvision.transforms.v2.functional.clamp_bounding_boxes")(inpt[, ...]) | 详细信息请参见[`ClampBoundingBoxes()`](generated/torchvision.transforms.v2.ClampBoundingBoxes.html#torchvision.transforms.v2.ClampBoundingBoxes + "torchvision.transforms.v2.ClampBoundingBoxes")。 |' - en: '| [`v2.functional.uniform_temporal_subsample`](generated/torchvision.transforms.v2.functional.uniform_temporal_subsample.html#torchvision.transforms.v2.functional.uniform_temporal_subsample "torchvision.transforms.v2.functional.uniform_temporal_subsample")(...) | See [`UniformTemporalSubsample`](generated/torchvision.transforms.v2.UniformTemporalSubsample.html#torchvision.transforms.v2.UniformTemporalSubsample "torchvision.transforms.v2.UniformTemporalSubsample") for details. |' + id: totrans-131 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.uniform_temporal_subsample`](generated/torchvision.transforms.v2.functional.uniform_temporal_subsample.html#torchvision.transforms.v2.functional.uniform_temporal_subsample + "torchvision.transforms.v2.functional.uniform_temporal_subsample")(...) | 详细信息请参见[`UniformTemporalSubsample`](generated/torchvision.transforms.v2.UniformTemporalSubsample.html#torchvision.transforms.v2.UniformTemporalSubsample + "torchvision.transforms.v2.UniformTemporalSubsample")。 |' - en: '### Conversion[](#conversion "Permalink to this heading")' + id: totrans-132 prefs: [] type: TYPE_NORMAL + zh: '### 转换[](#conversion "跳转到此标题")' - en: Note + id: totrans-133 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: Beware, some of these conversion transforms below will scale the values while performing the conversion, while some may not do any scaling. By scaling, we mean e.g. that a `uint8` -> `float32` would map the [0, 255] range into [0, 1] (and vice-versa). See [Dtype and expected value range](#range-and-dtype). + id: totrans-134 prefs: [] type: TYPE_NORMAL + zh: 警惕,下面的一些转换操作可能会在执行转换时对值进行缩放,而有些可能不会进行任何缩放。通过缩放,我们指的是例如 `uint8` -> `float32` + 将把 [0, 255] 范围映射到 [0, 1](反之亦然)。请参阅[Dtype和期望值范围](#range-and-dtype)。 - en: '| [`v2.ToImage`](generated/torchvision.transforms.v2.ToImage.html#torchvision.transforms.v2.ToImage "torchvision.transforms.v2.ToImage")() | Convert a tensor, ndarray, or PIL Image to [`Image`](generated/torchvision.tv_tensors.Image.html#torchvision.tv_tensors.Image "torchvision.tv_tensors.Image") ; this does not scale values. |' + id: totrans-135 prefs: [] type: TYPE_TB + zh: '| [`v2.ToImage`](generated/torchvision.transforms.v2.ToImage.html#torchvision.transforms.v2.ToImage + "torchvision.transforms.v2.ToImage")() | 将张量、ndarray或PIL图像转换为[`Image`](generated/torchvision.tv_tensors.Image.html#torchvision.tv_tensors.Image + "torchvision.tv_tensors.Image");不会缩放值。 |' - en: '| [`v2.ToPureTensor`](generated/torchvision.transforms.v2.ToPureTensor.html#torchvision.transforms.v2.ToPureTensor "torchvision.transforms.v2.ToPureTensor")() | Convert all TVTensors to pure tensors, removing associated metadata (if any). |' + id: totrans-136 prefs: [] type: TYPE_TB + zh: '| [`v2.ToPureTensor`](generated/torchvision.transforms.v2.ToPureTensor.html#torchvision.transforms.v2.ToPureTensor + "torchvision.transforms.v2.ToPureTensor")() | 将所有TVTensors转换为纯张量,删除相关的元数据(如果有)。 + |' - en: '| [`v2.PILToTensor`](generated/torchvision.transforms.v2.PILToTensor.html#torchvision.transforms.v2.PILToTensor "torchvision.transforms.v2.PILToTensor")() | Convert a PIL Image to a tensor of the same type - this does not scale values. |' + id: totrans-137 prefs: [] type: TYPE_TB + zh: '| [`v2.PILToTensor`](generated/torchvision.transforms.v2.PILToTensor.html#torchvision.transforms.v2.PILToTensor + "torchvision.transforms.v2.PILToTensor")() | 将PIL图像转换为相同类型的张量-不会缩放值。 |' - en: '| [`v2.ToPILImage`](generated/torchvision.transforms.v2.ToPILImage.html#torchvision.transforms.v2.ToPILImage "torchvision.transforms.v2.ToPILImage")([mode]) | Convert a tensor or an ndarray to PIL Image |' + id: totrans-138 prefs: [] type: TYPE_TB + zh: '| [`v2.ToPILImage`](generated/torchvision.transforms.v2.ToPILImage.html#torchvision.transforms.v2.ToPILImage + "torchvision.transforms.v2.ToPILImage")([mode]) | 将张量或ndarray转换为PIL图像。 |' - en: '| [`v2.ToDtype`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype "torchvision.transforms.v2.ToDtype")(dtype[, scale]) | Converts the input to a specific dtype, optionally scaling the values for images or videos. |' + id: totrans-139 prefs: [] type: TYPE_TB + zh: '| [`v2.ToDtype`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype + "torchvision.transforms.v2.ToDtype")(dtype[, scale]) | 将输入转换为特定的dtype,可选择为图像或视频缩放值。 + |' - en: '| [`v2.ConvertBoundingBoxFormat`](generated/torchvision.transforms.v2.ConvertBoundingBoxFormat.html#torchvision.transforms.v2.ConvertBoundingBoxFormat "torchvision.transforms.v2.ConvertBoundingBoxFormat")(format) | Convert bounding box coordinates to the given `format`, eg from "CXCYWH" to "XYXY". |' + id: totrans-140 prefs: [] type: TYPE_TB + zh: '| [`v2.ConvertBoundingBoxFormat`](generated/torchvision.transforms.v2.ConvertBoundingBoxFormat.html#torchvision.transforms.v2.ConvertBoundingBoxFormat + "torchvision.transforms.v2.ConvertBoundingBoxFormat")(format) | 将边界框坐标转换为给定的`format`,例如从"CXCYWH"到"XYXY"。 + |' - en: functionals + id: totrans-141 prefs: [] type: TYPE_NORMAL + zh: functionals - en: '| [`v2.functional.to_image`](generated/torchvision.transforms.v2.functional.to_image.html#torchvision.transforms.v2.functional.to_image "torchvision.transforms.v2.functional.to_image")(inpt) | See [`ToImage`](generated/torchvision.transforms.v2.ToImage.html#torchvision.transforms.v2.ToImage "torchvision.transforms.v2.ToImage") for details. |' + id: totrans-142 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.to_image`](generated/torchvision.transforms.v2.functional.to_image.html#torchvision.transforms.v2.functional.to_image + "torchvision.transforms.v2.functional.to_image")(inpt) | 有关详细信息,请参阅[`ToImage`](generated/torchvision.transforms.v2.ToImage.html#torchvision.transforms.v2.ToImage + "torchvision.transforms.v2.ToImage")。 |' - en: '| [`v2.functional.pil_to_tensor`](generated/torchvision.transforms.v2.functional.pil_to_tensor.html#torchvision.transforms.v2.functional.pil_to_tensor "torchvision.transforms.v2.functional.pil_to_tensor")(pic) | Convert a `PIL Image` to a tensor of the same type. |' + id: totrans-143 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.pil_to_tensor`](generated/torchvision.transforms.v2.functional.pil_to_tensor.html#torchvision.transforms.v2.functional.pil_to_tensor + "torchvision.transforms.v2.functional.pil_to_tensor")(pic) | 将`PIL图像`转换为相同类型的张量。 + |' - en: '| [`v2.functional.to_pil_image`](generated/torchvision.transforms.v2.functional.to_pil_image.html#torchvision.transforms.v2.functional.to_pil_image "torchvision.transforms.v2.functional.to_pil_image")(pic[, mode]) | Convert a tensor or an ndarray to PIL Image. |' + id: totrans-144 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.to_pil_image`](generated/torchvision.transforms.v2.functional.to_pil_image.html#torchvision.transforms.v2.functional.to_pil_image + "torchvision.transforms.v2.functional.to_pil_image")(pic[, mode]) | 将张量或ndarray转换为PIL图像。 + |' - en: '| [`v2.functional.to_dtype`](generated/torchvision.transforms.v2.functional.to_dtype.html#torchvision.transforms.v2.functional.to_dtype "torchvision.transforms.v2.functional.to_dtype")(inpt[, dtype, scale]) | See [`ToDtype()`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype "torchvision.transforms.v2.ToDtype") for details. |' + id: totrans-145 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.to_dtype`](generated/torchvision.transforms.v2.functional.to_dtype.html#torchvision.transforms.v2.functional.to_dtype + "torchvision.transforms.v2.functional.to_dtype")(inpt[, dtype, scale]) | 有关详细信息,请参阅[`ToDtype()`](generated/torchvision.transforms.v2.ToDtype.html#torchvision.transforms.v2.ToDtype + "torchvision.transforms.v2.ToDtype")。 |' - en: '| [`v2.functional.convert_bounding_box_format`](generated/torchvision.transforms.v2.functional.convert_bounding_box_format.html#torchvision.transforms.v2.functional.convert_bounding_box_format "torchvision.transforms.v2.functional.convert_bounding_box_format")(inpt) | See [`ConvertBoundingBoxFormat()`](generated/torchvision.transforms.v2.ConvertBoundingBoxFormat.html#torchvision.transforms.v2.ConvertBoundingBoxFormat "torchvision.transforms.v2.ConvertBoundingBoxFormat") for details. |' + id: totrans-146 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.convert_bounding_box_format`](generated/torchvision.transforms.v2.functional.convert_bounding_box_format.html#torchvision.transforms.v2.functional.convert_bounding_box_format + "torchvision.transforms.v2.functional.convert_bounding_box_format")(inpt) | 有关详细信息,请参阅[`ConvertBoundingBoxFormat()`](generated/torchvision.transforms.v2.ConvertBoundingBoxFormat.html#torchvision.transforms.v2.ConvertBoundingBoxFormat + "torchvision.transforms.v2.ConvertBoundingBoxFormat")。 |' - en: Deprecated + id: totrans-147 prefs: [] type: TYPE_NORMAL + zh: Deprecated - en: '| [`v2.ToTensor`](generated/torchvision.transforms.v2.ToTensor.html#torchvision.transforms.v2.ToTensor "torchvision.transforms.v2.ToTensor")() | [DEPRECATED] Use `v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])` instead. |' + id: totrans-148 prefs: [] type: TYPE_TB + zh: '| [`v2.ToTensor`](generated/torchvision.transforms.v2.ToTensor.html#torchvision.transforms.v2.ToTensor + "torchvision.transforms.v2.ToTensor")() | [DEPRECATED] 使用`v2.Compose([v2.ToImage(), + v2.ToDtype(torch.float32, scale=True)])`代替。 |' - en: '| [`v2.functional.to_tensor`](generated/torchvision.transforms.v2.functional.to_tensor.html#torchvision.transforms.v2.functional.to_tensor "torchvision.transforms.v2.functional.to_tensor")(inpt) | [DEPREACTED] Use to_image() and to_dtype() instead. |' + id: totrans-149 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.to_tensor`](generated/torchvision.transforms.v2.functional.to_tensor.html#torchvision.transforms.v2.functional.to_tensor + "torchvision.transforms.v2.functional.to_tensor")(inpt) | [DEPREACTED] Use to_image() + and to_dtype() instead. |' - en: '| [`v2.ConvertImageDtype`](generated/torchvision.transforms.v2.ConvertImageDtype.html#torchvision.transforms.v2.ConvertImageDtype "torchvision.transforms.v2.ConvertImageDtype")([dtype]) | [DEPRECATED] Use `v2.ToDtype(dtype, scale=True)` instead. |' + id: totrans-150 prefs: [] type: TYPE_TB + zh: '| [`v2.ConvertImageDtype`](generated/torchvision.transforms.v2.ConvertImageDtype.html#torchvision.transforms.v2.ConvertImageDtype + "torchvision.transforms.v2.ConvertImageDtype")([dtype]) | [已弃用]请改用`v2.ToDtype(dtype, + scale=True)`。 |' - en: '| [`v2.functional.convert_image_dtype`](generated/torchvision.transforms.v2.functional.convert_image_dtype.html#torchvision.transforms.v2.functional.convert_image_dtype "torchvision.transforms.v2.functional.convert_image_dtype")(image[, dtype]) | [DEPRECATED] Use to_dtype() instead. |' + id: totrans-151 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.convert_image_dtype`](generated/torchvision.transforms.v2.functional.convert_image_dtype.html#torchvision.transforms.v2.functional.convert_image_dtype + "torchvision.transforms.v2.functional.convert_image_dtype")(image[, dtype]) | + [已弃用]请改用to_dtype()。 |' - en: Auto-Augmentation[](#auto-augmentation "Permalink to this heading") + id: totrans-152 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 自动增强[](#auto-augmentation "跳转到此标题的永久链接") - en: '[AutoAugment](https://arxiv.org/pdf/1805.09501.pdf) is a common Data Augmentation technique that can improve the accuracy of Image Classification models. Though the data augmentation policies are directly linked to their trained dataset, empirical @@ -775,280 +1262,462 @@ to other datasets. In TorchVision we implemented 3 policies learned on the following datasets: ImageNet, CIFAR10 and SVHN. The new transform can be used standalone or mixed-and-matched with existing transforms:' + id: totrans-153 prefs: [] type: TYPE_NORMAL + zh: '[AutoAugment](https://arxiv.org/pdf/1805.09501.pdf)是一种常见的数据增强技术,可以提高图像分类模型的准确性。尽管数据增强策略直接与其训练数据集相关联,但实证研究表明,将ImageNet策略应用于其他数据集时可以显著提高性能。在TorchVision中,我们实现了在以下数据集上学习的3种策略:ImageNet、CIFAR10和SVHN。新的转换可以独立使用,也可以与现有转换混合使用:' - en: '| [`v2.AutoAugment`](generated/torchvision.transforms.v2.AutoAugment.html#torchvision.transforms.v2.AutoAugment "torchvision.transforms.v2.AutoAugment")([policy, interpolation, fill]) | AutoAugment data augmentation method based on ["AutoAugment: Learning Augmentation Strategies from Data"](https://arxiv.org/pdf/1805.09501.pdf). |' + id: totrans-154 prefs: [] type: TYPE_TB + zh: '| [`v2.AutoAugment`](generated/torchvision.transforms.v2.AutoAugment.html#torchvision.transforms.v2.AutoAugment + "torchvision.transforms.v2.AutoAugment")([policy, interpolation, fill]) | 基于["AutoAugment: + Learning Augmentation Strategies from Data"](https://arxiv.org/pdf/1805.09501.pdf)的AutoAugment数据增强方法。 + |' - en: '| [`v2.RandAugment`](generated/torchvision.transforms.v2.RandAugment.html#torchvision.transforms.v2.RandAugment "torchvision.transforms.v2.RandAugment")([num_ops, magnitude, ...]) | RandAugment data augmentation method based on ["RandAugment: Practical automated data augmentation with a reduced search space"](https://arxiv.org/abs/1909.13719). |' + id: totrans-155 prefs: [] type: TYPE_TB + zh: '| [`v2.RandAugment`](generated/torchvision.transforms.v2.RandAugment.html#torchvision.transforms.v2.RandAugment + "torchvision.transforms.v2.RandAugment")([num_ops, magnitude, ...]) | 基于["RandAugment: + Practical automated data augmentation with a reduced search space"](https://arxiv.org/abs/1909.13719)的RandAugment数据增强方法。 + |' - en: '| [`v2.TrivialAugmentWide`](generated/torchvision.transforms.v2.TrivialAugmentWide.html#torchvision.transforms.v2.TrivialAugmentWide "torchvision.transforms.v2.TrivialAugmentWide")([num_magnitude_bins, ...]) | Dataset-independent data-augmentation with TrivialAugment Wide, as described in ["TrivialAugment: Tuning-free Yet State-of-the-Art Data Augmentation"](https://arxiv.org/abs/2103.10158). |' + id: totrans-156 prefs: [] type: TYPE_TB + zh: '| [`v2.TrivialAugmentWide`](generated/torchvision.transforms.v2.TrivialAugmentWide.html#torchvision.transforms.v2.TrivialAugmentWide + "torchvision.transforms.v2.TrivialAugmentWide")([num_magnitude_bins, ...]) | 使用TrivialAugment + Wide进行与数据集无关的数据增强,如["TrivialAugment: Tuning-free Yet State-of-the-Art Data Augmentation"](https://arxiv.org/abs/2103.10158)中所述。 + |' - en: '| [`v2.AugMix`](generated/torchvision.transforms.v2.AugMix.html#torchvision.transforms.v2.AugMix "torchvision.transforms.v2.AugMix")([severity, mixture_width, ...]) | AugMix data augmentation method based on ["AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty"](https://arxiv.org/abs/1912.02781). |' + id: totrans-157 prefs: [] type: TYPE_TB + zh: '| [`v2.AugMix`](generated/torchvision.transforms.v2.AugMix.html#torchvision.transforms.v2.AugMix + "torchvision.transforms.v2.AugMix")([severity, mixture_width, ...]) | 基于["AugMix: + A Simple Data Processing Method to Improve Robustness and Uncertainty"](https://arxiv.org/abs/1912.02781)的AugMix数据增强方法。 + |' - en: CutMix - MixUp[](#cutmix-mixup "Permalink to this heading") + id: totrans-158 prefs: - PREF_H3 type: TYPE_NORMAL + zh: CutMix - MixUp[](#cutmix-mixup "跳转到此标题的永久链接") - en: CutMix and MixUp are special transforms that are meant to be used on batches rather than on individual images, because they are combining pairs of images together. These can be used after the dataloader (once the samples are batched), or part of a collation function. See [How to use CutMix and MixUp](auto_examples/transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py) for detailed usage examples. + id: totrans-159 prefs: [] type: TYPE_NORMAL + zh: CutMix和MixUp是特殊的变换,用于批处理而不是单个图像,因为它们将图像对组合在一起。这些可以在数据加载器之后使用(一旦样本被分批),或作为整理函数的一部分。详细使用示例请参见[如何使用CutMix和MixUp](auto_examples/transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py)。 - en: '| [`v2.CutMix`](generated/torchvision.transforms.v2.CutMix.html#torchvision.transforms.v2.CutMix "torchvision.transforms.v2.CutMix")(*[, alpha, labels_getter]) | Apply CutMix to the provided batch of images and labels. |' + id: totrans-160 prefs: [] type: TYPE_TB + zh: '| [`v2.CutMix`](generated/torchvision.transforms.v2.CutMix.html#torchvision.transforms.v2.CutMix + "torchvision.transforms.v2.CutMix")(*[, alpha, labels_getter]) | 将CutMix应用于提供的图像和标签批次。 + |' - en: '| [`v2.MixUp`](generated/torchvision.transforms.v2.MixUp.html#torchvision.transforms.v2.MixUp "torchvision.transforms.v2.MixUp")(*[, alpha, labels_getter]) | Apply MixUp to the provided batch of images and labels. |' + id: totrans-161 prefs: [] type: TYPE_TB + zh: '| [`v2.MixUp`](generated/torchvision.transforms.v2.MixUp.html#torchvision.transforms.v2.MixUp + "torchvision.transforms.v2.MixUp")(*[, alpha, labels_getter]) | 将MixUp应用于提供的图像和标签批次。 + |' - en: Developer tools[](#developer-tools "Permalink to this heading") + id: totrans-162 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 开发者工具[](#developer-tools "跳转到此标题的永久链接") - en: '| [`v2.functional.register_kernel`](generated/torchvision.transforms.v2.functional.register_kernel.html#torchvision.transforms.v2.functional.register_kernel "torchvision.transforms.v2.functional.register_kernel")(functional, ...) | Decorate a kernel to register it for a functional and a (custom) tv_tensor type. |' + id: totrans-163 prefs: [] type: TYPE_TB + zh: '| [`v2.functional.register_kernel`](generated/torchvision.transforms.v2.functional.register_kernel.html#torchvision.transforms.v2.functional.register_kernel + "torchvision.transforms.v2.functional.register_kernel")(functional, ...) | 装饰一个内核以为一个功能和一个(自定义的)tv_tensor类型注册它。 + |' - en: V1 API Reference[](#v1-api-reference "Permalink to this heading") + id: totrans-164 prefs: - PREF_H2 type: TYPE_NORMAL + zh: V1 API参考[](#v1-api-reference "跳转到此标题的永久链接") - en: Geometry[](#id3 "Permalink to this heading") + id: totrans-165 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 几何[](#id3 "跳转到此标题的永久链接") - en: '| [`Resize`](generated/torchvision.transforms.Resize.html#torchvision.transforms.Resize "torchvision.transforms.Resize")(size[, interpolation, max_size, ...]) | Resize the input image to the given size. |' + id: totrans-166 prefs: [] type: TYPE_TB + zh: '| [`Resize`](generated/torchvision.transforms.Resize.html#torchvision.transforms.Resize + "torchvision.transforms.Resize")(size[, interpolation, max_size, ...]) | 将输入图像调整为给定大小。 + |' - en: '| [`RandomCrop`](generated/torchvision.transforms.RandomCrop.html#torchvision.transforms.RandomCrop "torchvision.transforms.RandomCrop")(size[, padding, pad_if_needed, ...]) | Crop the given image at a random location. |' + id: totrans-167 prefs: [] type: TYPE_TB + zh: '| [`RandomCrop`](generated/torchvision.transforms.RandomCrop.html#torchvision.transforms.RandomCrop + "torchvision.transforms.RandomCrop")(size[, padding, pad_if_needed, ...]) | 在随机位置裁剪给定图像。 + |' - en: '| [`RandomResizedCrop`](generated/torchvision.transforms.RandomResizedCrop.html#torchvision.transforms.RandomResizedCrop "torchvision.transforms.RandomResizedCrop")(size[, scale, ratio, ...]) | Crop a random portion of image and resize it to a given size. |' + id: totrans-168 prefs: [] type: TYPE_TB + zh: '| [`RandomResizedCrop`](generated/torchvision.transforms.RandomResizedCrop.html#torchvision.transforms.RandomResizedCrop + "torchvision.transforms.RandomResizedCrop")(size[, scale, ratio, ...]) | 裁剪图像的随机部分并将其调整为给定大小。 + |' - en: '| [`CenterCrop`](generated/torchvision.transforms.CenterCrop.html#torchvision.transforms.CenterCrop "torchvision.transforms.CenterCrop")(size) | Crops the given image at the center. |' + id: totrans-169 prefs: [] type: TYPE_TB + zh: '| [`CenterCrop`](generated/torchvision.transforms.CenterCrop.html#torchvision.transforms.CenterCrop + "torchvision.transforms.CenterCrop")(size) | 在中心裁剪给定图像。 |' - en: '| [`FiveCrop`](generated/torchvision.transforms.FiveCrop.html#torchvision.transforms.FiveCrop "torchvision.transforms.FiveCrop")(size) | Crop the given image into four corners and the central crop. |' + id: totrans-170 prefs: [] type: TYPE_TB + zh: '| [`FiveCrop`](generated/torchvision.transforms.FiveCrop.html#torchvision.transforms.FiveCrop + "torchvision.transforms.FiveCrop")(size) | 将给定图像裁剪为四个角和中心裁剪。 |' - en: '| [`TenCrop`](generated/torchvision.transforms.TenCrop.html#torchvision.transforms.TenCrop "torchvision.transforms.TenCrop")(size[, vertical_flip]) | Crop the given image into four corners and the central crop plus the flipped version of these (horizontal flipping is used by default). |' + id: totrans-171 prefs: [] type: TYPE_TB + zh: '| [`TenCrop`](generated/torchvision.transforms.TenCrop.html#torchvision.transforms.TenCrop + "torchvision.transforms.TenCrop")(size[, vertical_flip]) | 将给定图像裁剪为四个角和中心裁剪,以及这些裁剪的翻转版本(默认使用水平翻转)。 + |' - en: '| [`Pad`](generated/torchvision.transforms.Pad.html#torchvision.transforms.Pad "torchvision.transforms.Pad")(padding[, fill, padding_mode]) | Pad the given image on all sides with the given "pad" value. |' + id: totrans-172 prefs: [] type: TYPE_TB + zh: '| [`Pad`](generated/torchvision.transforms.Pad.html#torchvision.transforms.Pad + "torchvision.transforms.Pad")(padding[, fill, padding_mode]) | 使用给定的“pad”值在所有边上填充给定图像。 + |' - en: '| [`RandomRotation`](generated/torchvision.transforms.RandomRotation.html#torchvision.transforms.RandomRotation "torchvision.transforms.RandomRotation")(degrees[, interpolation, ...]) | Rotate the image by angle. |' + id: totrans-173 prefs: [] type: TYPE_TB + zh: '| [`RandomRotation`](generated/torchvision.transforms.RandomRotation.html#torchvision.transforms.RandomRotation + "torchvision.transforms.RandomRotation")(degrees[, interpolation, ...]) | 将图像旋转指定角度。 + |' - en: '| [`RandomAffine`](generated/torchvision.transforms.RandomAffine.html#torchvision.transforms.RandomAffine "torchvision.transforms.RandomAffine")(degrees[, translate, scale, ...]) | Random affine transformation of the image keeping center invariant. |' + id: totrans-174 prefs: [] type: TYPE_TB + zh: '| [`RandomAffine`](generated/torchvision.transforms.RandomAffine.html#torchvision.transforms.RandomAffine + "torchvision.transforms.RandomAffine")(degrees[, translate, scale, ...]) | 对图像进行随机仿射变换,保持中心不变。 + |' - en: '| [`RandomPerspective`](generated/torchvision.transforms.RandomPerspective.html#torchvision.transforms.RandomPerspective "torchvision.transforms.RandomPerspective")([distortion_scale, p, ...]) | Performs a random perspective transformation of the given image with a given probability. |' + id: totrans-175 prefs: [] type: TYPE_TB + zh: '| [`RandomPerspective`](generated/torchvision.transforms.RandomPerspective.html#torchvision.transforms.RandomPerspective + "torchvision.transforms.RandomPerspective")([distortion_scale, p, ...]) | 以给定概率对给定图像执行随机透视变换。 + |' - en: '| [`ElasticTransform`](generated/torchvision.transforms.ElasticTransform.html#torchvision.transforms.ElasticTransform "torchvision.transforms.ElasticTransform")([alpha, sigma, ...]) | Transform a tensor image with elastic transformations. |' + id: totrans-176 prefs: [] type: TYPE_TB + zh: '| [`ElasticTransform`](generated/torchvision.transforms.ElasticTransform.html#torchvision.transforms.ElasticTransform + "torchvision.transforms.ElasticTransform")([alpha, sigma, ...]) | 使用弹性变换对张量图像进行转换。 + |' - en: '| [`RandomHorizontalFlip`](generated/torchvision.transforms.RandomHorizontalFlip.html#torchvision.transforms.RandomHorizontalFlip "torchvision.transforms.RandomHorizontalFlip")([p]) | Horizontally flip the given image randomly with a given probability. |' + id: totrans-177 prefs: [] type: TYPE_TB + zh: '| [`RandomHorizontalFlip`](generated/torchvision.transforms.RandomHorizontalFlip.html#torchvision.transforms.RandomHorizontalFlip + "torchvision.transforms.RandomHorizontalFlip")([p]) | 以给定概率随机水平翻转给定图像。 |' - en: '| [`RandomVerticalFlip`](generated/torchvision.transforms.RandomVerticalFlip.html#torchvision.transforms.RandomVerticalFlip "torchvision.transforms.RandomVerticalFlip")([p]) | Vertically flip the given image randomly with a given probability. |' + id: totrans-178 prefs: [] type: TYPE_TB + zh: '| [`RandomVerticalFlip`](generated/torchvision.transforms.RandomVerticalFlip.html#torchvision.transforms.RandomVerticalFlip + "torchvision.transforms.RandomVerticalFlip")([p]) | 以给定概率随机垂直翻转给定图像。 |' - en: Color[](#id4 "Permalink to this heading") + id: totrans-179 prefs: - PREF_H3 type: TYPE_NORMAL + zh: Color[](#id4 "Permalink to this heading") - en: '| [`ColorJitter`](generated/torchvision.transforms.ColorJitter.html#torchvision.transforms.ColorJitter "torchvision.transforms.ColorJitter")([brightness, contrast, ...]) | Randomly change the brightness, contrast, saturation and hue of an image. |' + id: totrans-180 prefs: [] type: TYPE_TB + zh: '| [`ColorJitter`](generated/torchvision.transforms.ColorJitter.html#torchvision.transforms.ColorJitter + "torchvision.transforms.ColorJitter")([brightness, contrast, ...]) | 随机改变图像的亮度、对比度、饱和度和色调。 + |' - en: '| [`Grayscale`](generated/torchvision.transforms.Grayscale.html#torchvision.transforms.Grayscale "torchvision.transforms.Grayscale")([num_output_channels]) | Convert image to grayscale. |' + id: totrans-181 prefs: [] type: TYPE_TB + zh: '| [`Grayscale`](generated/torchvision.transforms.Grayscale.html#torchvision.transforms.Grayscale + "torchvision.transforms.Grayscale")([num_output_channels]) | 将图像转换为灰度图像。 |' - en: '| [`RandomGrayscale`](generated/torchvision.transforms.RandomGrayscale.html#torchvision.transforms.RandomGrayscale "torchvision.transforms.RandomGrayscale")([p]) | Randomly convert image to grayscale with a probability of p (default 0.1). |' + id: totrans-182 prefs: [] type: TYPE_TB + zh: '| [`RandomGrayscale`](generated/torchvision.transforms.RandomGrayscale.html#torchvision.transforms.RandomGrayscale + "torchvision.transforms.RandomGrayscale")([p]) | 以概率 p(默认为 0.1)随机将图像转换为灰度图像。 |' - en: '| [`GaussianBlur`](generated/torchvision.transforms.GaussianBlur.html#torchvision.transforms.GaussianBlur "torchvision.transforms.GaussianBlur")(kernel_size[, sigma]) | Blurs image with randomly chosen Gaussian blur. |' + id: totrans-183 prefs: [] type: TYPE_TB + zh: '| [`GaussianBlur`](generated/torchvision.transforms.GaussianBlur.html#torchvision.transforms.GaussianBlur + "torchvision.transforms.GaussianBlur")(kernel_size[, sigma]) | 使用随机选择的高斯模糊对图像进行模糊处理。 + |' - en: '| [`RandomInvert`](generated/torchvision.transforms.RandomInvert.html#torchvision.transforms.RandomInvert "torchvision.transforms.RandomInvert")([p]) | Inverts the colors of the given image randomly with a given probability. |' + id: totrans-184 prefs: [] type: TYPE_TB + zh: '| [`RandomInvert`](generated/torchvision.transforms.RandomInvert.html#torchvision.transforms.RandomInvert + "torchvision.transforms.RandomInvert")([p]) | 以给定概率随机反转给定图像的颜色。 |' - en: '| [`RandomPosterize`](generated/torchvision.transforms.RandomPosterize.html#torchvision.transforms.RandomPosterize "torchvision.transforms.RandomPosterize")(bits[, p]) | Posterize the image randomly with a given probability by reducing the number of bits for each color channel. |' + id: totrans-185 prefs: [] type: TYPE_TB + zh: '| [`RandomPosterize`](generated/torchvision.transforms.RandomPosterize.html#torchvision.transforms.RandomPosterize + "torchvision.transforms.RandomPosterize")(bits[, p]) | 以给定概率随机海报化图像,通过减少每个颜色通道的位数。 + |' - en: '| [`RandomSolarize`](generated/torchvision.transforms.RandomSolarize.html#torchvision.transforms.RandomSolarize "torchvision.transforms.RandomSolarize")(threshold[, p]) | Solarize the image randomly with a given probability by inverting all pixel values above a threshold. |' + id: totrans-186 prefs: [] type: TYPE_TB + zh: '| [`RandomSolarize`](generated/torchvision.transforms.RandomSolarize.html#torchvision.transforms.RandomSolarize + "torchvision.transforms.RandomSolarize")(threshold[, p]) | 以给定概率随机太阳化图像,通过反转所有高于阈值的像素值。 + |' - en: '| [`RandomAdjustSharpness`](generated/torchvision.transforms.RandomAdjustSharpness.html#torchvision.transforms.RandomAdjustSharpness "torchvision.transforms.RandomAdjustSharpness")(sharpness_factor[, p]) | Adjust the sharpness of the image randomly with a given probability. |' + id: totrans-187 prefs: [] type: TYPE_TB + zh: '| [`RandomAdjustSharpness`](generated/torchvision.transforms.RandomAdjustSharpness.html#torchvision.transforms.RandomAdjustSharpness + "torchvision.transforms.RandomAdjustSharpness")(sharpness_factor[, p]) | 以给定概率随机调整图像的清晰度。 + |' - en: '| [`RandomAutocontrast`](generated/torchvision.transforms.RandomAutocontrast.html#torchvision.transforms.RandomAutocontrast "torchvision.transforms.RandomAutocontrast")([p]) | Autocontrast the pixels of the given image randomly with a given probability. |' + id: totrans-188 prefs: [] type: TYPE_TB + zh: '| [`RandomAutocontrast`](generated/torchvision.transforms.RandomAutocontrast.html#torchvision.transforms.RandomAutocontrast + "torchvision.transforms.RandomAutocontrast")([p]) | 以给定概率随机自动对比度调整给定图像的像素。 |' - en: '| [`RandomEqualize`](generated/torchvision.transforms.RandomEqualize.html#torchvision.transforms.RandomEqualize "torchvision.transforms.RandomEqualize")([p]) | Equalize the histogram of the given image randomly with a given probability. |' + id: totrans-189 prefs: [] type: TYPE_TB + zh: '| [`RandomEqualize`](generated/torchvision.transforms.RandomEqualize.html#torchvision.transforms.RandomEqualize + "torchvision.transforms.RandomEqualize")([p]) | 以给定概率随机均衡给定图像的直方图。 |' - en: Composition[](#id5 "Permalink to this heading") + id: totrans-190 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 组合 - en: '| [`Compose`](generated/torchvision.transforms.Compose.html#torchvision.transforms.Compose "torchvision.transforms.Compose")(transforms) | Composes several transforms together. |' + id: totrans-191 prefs: [] type: TYPE_TB + zh: '| [`Compose`](generated/torchvision.transforms.Compose.html#torchvision.transforms.Compose + "torchvision.transforms.Compose")(transforms) | 将多个变换组合在一起。 |' - en: '| [`RandomApply`](generated/torchvision.transforms.RandomApply.html#torchvision.transforms.RandomApply "torchvision.transforms.RandomApply")(transforms[, p]) | Apply randomly a list of transformations with a given probability. |' + id: totrans-192 prefs: [] type: TYPE_TB + zh: '| [`RandomApply`](generated/torchvision.transforms.RandomApply.html#torchvision.transforms.RandomApply + "torchvision.transforms.RandomApply")(transforms[, p]) | 以给定概率随机应用一系列变换。 |' - en: '| [`RandomChoice`](generated/torchvision.transforms.RandomChoice.html#torchvision.transforms.RandomChoice "torchvision.transforms.RandomChoice")(transforms[, p]) | Apply single transformation randomly picked from a list. |' + id: totrans-193 prefs: [] type: TYPE_TB + zh: '| [`RandomChoice`](generated/torchvision.transforms.RandomChoice.html#torchvision.transforms.RandomChoice + "torchvision.transforms.RandomChoice")(transforms[, p]) | 从列表中随机选择一个单一变换。 |' - en: '| [`RandomOrder`](generated/torchvision.transforms.RandomOrder.html#torchvision.transforms.RandomOrder "torchvision.transforms.RandomOrder")(transforms) | Apply a list of transformations in a random order. |' + id: totrans-194 prefs: [] type: TYPE_TB + zh: '| [`RandomOrder`](generated/torchvision.transforms.RandomOrder.html#torchvision.transforms.RandomOrder + "torchvision.transforms.RandomOrder")(transforms) | 以随机顺序应用一系列变换。 |' - en: Miscellaneous[](#id6 "Permalink to this heading") + id: totrans-195 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 杂项 - en: '| [`LinearTransformation`](generated/torchvision.transforms.LinearTransformation.html#torchvision.transforms.LinearTransformation "torchvision.transforms.LinearTransformation")(transformation_matrix, ...) | Transform a tensor image with a square transformation matrix and a mean_vector computed offline. |' + id: totrans-196 prefs: [] type: TYPE_TB + zh: '| [`LinearTransformation`](generated/torchvision.transforms.LinearTransformation.html#torchvision.transforms.LinearTransformation + "torchvision.transforms.LinearTransformation")(transformation_matrix, ...) | 使用计算离线的方形变换矩阵和均值向量转换张量图像。 + |' - en: '| [`Normalize`](generated/torchvision.transforms.Normalize.html#torchvision.transforms.Normalize "torchvision.transforms.Normalize")(mean, std[, inplace]) | Normalize a tensor image with mean and standard deviation. |' + id: totrans-197 prefs: [] type: TYPE_TB + zh: '| [`Normalize`](generated/torchvision.transforms.Normalize.html#torchvision.transforms.Normalize + "torchvision.transforms.Normalize")(mean, std[, inplace]) | 使用均值和标准差对张量图像进行归一化。 + |' - en: '| [`RandomErasing`](generated/torchvision.transforms.RandomErasing.html#torchvision.transforms.RandomErasing "torchvision.transforms.RandomErasing")([p, scale, ratio, value, inplace]) | Randomly selects a rectangle region in a torch.Tensor image and erases its pixels. |' + id: totrans-198 prefs: [] type: TYPE_TB + zh: '| [`RandomErasing`](generated/torchvision.transforms.RandomErasing.html#torchvision.transforms.RandomErasing + "torchvision.transforms.RandomErasing")([p, scale, ratio, value, inplace]) | 随机选择 + torch.Tensor 图像中的矩形区域并擦除其像素。 |' - en: '| [`Lambda`](generated/torchvision.transforms.Lambda.html#torchvision.transforms.Lambda "torchvision.transforms.Lambda")(lambd) | Apply a user-defined lambda as a transform. |' + id: totrans-199 prefs: [] type: TYPE_TB + zh: '| [`Lambda`](generated/torchvision.transforms.Lambda.html#torchvision.transforms.Lambda + "torchvision.transforms.Lambda")(lambd) | 应用用户定义的lambda作为变换。 |' - en: Conversion[](#id7 "Permalink to this heading") + id: totrans-200 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 转换 - en: Note + id: totrans-201 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: Beware, some of these conversion transforms below will scale the values while performing the conversion, while some may not do any scaling. By scaling, we mean e.g. that a `uint8` -> `float32` would map the [0, 255] range into [0, 1] (and vice-versa). See [Dtype and expected value range](#range-and-dtype). + id: totrans-202 prefs: [] type: TYPE_NORMAL + zh: 请注意,下面的一些转换会在执行转换时缩放值,而有些可能不会进行任何缩放。通过缩放,我们指的是例如 `uint8` -> `float32` 将 [0, + 255] 范围映射到 [0, 1](反之亦然)。请参阅 [数据类型和期望值范围](#range-and-dtype)。 - en: '| [`ToPILImage`](generated/torchvision.transforms.ToPILImage.html#torchvision.transforms.ToPILImage "torchvision.transforms.ToPILImage")([mode]) | Convert a tensor or an ndarray to PIL Image |' + id: totrans-203 prefs: [] type: TYPE_TB + zh: '| [`ToPILImage`](generated/torchvision.transforms.ToPILImage.html#torchvision.transforms.ToPILImage + "torchvision.transforms.ToPILImage")([mode]) | 将张量或ndarray转换为PIL图像 |' - en: '| [`ToTensor`](generated/torchvision.transforms.ToTensor.html#torchvision.transforms.ToTensor "torchvision.transforms.ToTensor")() | Convert a PIL Image or ndarray to tensor and scale the values accordingly. |' + id: totrans-204 prefs: [] type: TYPE_TB + zh: '| [`ToTensor`](generated/torchvision.transforms.ToTensor.html#torchvision.transforms.ToTensor + "torchvision.transforms.ToTensor")() | 将PIL图像或ndarray转换为张量并相应地缩放值。 |' - en: '| [`PILToTensor`](generated/torchvision.transforms.PILToTensor.html#torchvision.transforms.PILToTensor "torchvision.transforms.PILToTensor")() | Convert a PIL Image to a tensor of the same type - this does not scale values. |' + id: totrans-205 prefs: [] type: TYPE_TB + zh: '| [`PILToTensor`](generated/torchvision.transforms.PILToTensor.html#torchvision.transforms.PILToTensor + "torchvision.transforms.PILToTensor")() | 将PIL图像转换为相同类型的张量 - 不会缩放值。 |' - en: '| [`ConvertImageDtype`](generated/torchvision.transforms.ConvertImageDtype.html#torchvision.transforms.ConvertImageDtype "torchvision.transforms.ConvertImageDtype")(dtype) | Convert a tensor image to the given `dtype` and scale the values accordingly. |' + id: totrans-206 prefs: [] type: TYPE_TB + zh: '| [`ConvertImageDtype`](generated/torchvision.transforms.ConvertImageDtype.html#torchvision.transforms.ConvertImageDtype + "torchvision.transforms.ConvertImageDtype")(dtype) | 将张量图像转换为给定的`dtype`并相应地缩放值。 + |' - en: Auto-Augmentation[](#id8 "Permalink to this heading") + id: totrans-207 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 自动增强[](#id8 "跳转到此标题") - en: '[AutoAugment](https://arxiv.org/pdf/1805.09501.pdf) is a common Data Augmentation technique that can improve the accuracy of Image Classification models. Though the data augmentation policies are directly linked to their trained dataset, empirical @@ -1056,218 +1725,380 @@ to other datasets. In TorchVision we implemented 3 policies learned on the following datasets: ImageNet, CIFAR10 and SVHN. The new transform can be used standalone or mixed-and-matched with existing transforms:' + id: totrans-208 prefs: [] type: TYPE_NORMAL + zh: '[AutoAugment](https://arxiv.org/pdf/1805.09501.pdf)是一种常见的数据增强技术,可以提高图像分类模型的准确性。尽管数据增强策略直接与它们训练的数据集相关联,但实证研究表明,当应用于其他数据集时,ImageNet策略会显著改善。在TorchVision中,我们实现了在以下数据集上学习的3种策略:ImageNet、CIFAR10和SVHN。新的转换可以独立使用,也可以与现有转换混合使用:' - en: '| [`AutoAugmentPolicy`](generated/torchvision.transforms.AutoAugmentPolicy.html#torchvision.transforms.AutoAugmentPolicy "torchvision.transforms.AutoAugmentPolicy")(value) | AutoAugment policies learned on different datasets. |' + id: totrans-209 prefs: [] type: TYPE_TB + zh: '| [`AutoAugmentPolicy`](generated/torchvision.transforms.AutoAugmentPolicy.html#torchvision.transforms.AutoAugmentPolicy + "torchvision.transforms.AutoAugmentPolicy")(value) | 在不同数据集上学习的AutoAugment策略。 + |' - en: '| [`AutoAugment`](generated/torchvision.transforms.AutoAugment.html#torchvision.transforms.AutoAugment "torchvision.transforms.AutoAugment")([policy, interpolation, fill]) | AutoAugment data augmentation method based on ["AutoAugment: Learning Augmentation Strategies from Data"](https://arxiv.org/pdf/1805.09501.pdf). |' + id: totrans-210 prefs: [] type: TYPE_TB + zh: '| [`AutoAugment`](generated/torchvision.transforms.AutoAugment.html#torchvision.transforms.AutoAugment + "torchvision.transforms.AutoAugment")([policy, interpolation, fill]) | 基于["AutoAugment: + Learning Augmentation Strategies from Data"](https://arxiv.org/pdf/1805.09501.pdf)的AutoAugment数据增强方法。 + |' - en: '| [`RandAugment`](generated/torchvision.transforms.RandAugment.html#torchvision.transforms.RandAugment "torchvision.transforms.RandAugment")([num_ops, magnitude, ...]) | RandAugment data augmentation method based on ["RandAugment: Practical automated data augmentation with a reduced search space"](https://arxiv.org/abs/1909.13719). |' + id: totrans-211 prefs: [] type: TYPE_TB + zh: '| [`RandAugment`](generated/torchvision.transforms.RandAugment.html#torchvision.transforms.RandAugment + "torchvision.transforms.RandAugment")([num_ops, magnitude, ...]) | 基于["RandAugment: + Practical automated data augmentation with a reduced search space"](https://arxiv.org/abs/1909.13719)的RandAugment数据增强方法。 + |' - en: '| [`TrivialAugmentWide`](generated/torchvision.transforms.TrivialAugmentWide.html#torchvision.transforms.TrivialAugmentWide "torchvision.transforms.TrivialAugmentWide")([num_magnitude_bins, ...]) | Dataset-independent data-augmentation with TrivialAugment Wide, as described in ["TrivialAugment: Tuning-free Yet State-of-the-Art Data Augmentation"](https://arxiv.org/abs/2103.10158). |' + id: totrans-212 prefs: [] type: TYPE_TB + zh: '| [`TrivialAugmentWide`](generated/torchvision.transforms.TrivialAugmentWide.html#torchvision.transforms.TrivialAugmentWide + "torchvision.transforms.TrivialAugmentWide")([num_magnitude_bins, ...]) | 使用TrivialAugment + Wide进行与数据集无关的数据增强,如["TrivialAugment: Tuning-free Yet State-of-the-Art Data Augmentation"](https://arxiv.org/abs/2103.10158)中所述。 + |' - en: '| [`AugMix`](generated/torchvision.transforms.AugMix.html#torchvision.transforms.AugMix "torchvision.transforms.AugMix")([severity, mixture_width, ...]) | AugMix data augmentation method based on ["AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty"](https://arxiv.org/abs/1912.02781). |' + id: totrans-213 prefs: [] type: TYPE_TB + zh: '| [`AugMix`](generated/torchvision.transforms.AugMix.html#torchvision.transforms.AugMix + "torchvision.transforms.AugMix")([severity, mixture_width, ...]) | 基于["AugMix: + A Simple Data Processing Method to Improve Robustness and Uncertainty"](https://arxiv.org/abs/1912.02781)的AugMix数据增强方法。 + |' - en: Functional Transforms[](#id14 "Permalink to this heading") + id: totrans-214 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 功能性转换[](#id14 "跳转到此标题") - en: '| [`adjust_brightness`](generated/torchvision.transforms.functional.adjust_brightness.html#torchvision.transforms.functional.adjust_brightness "torchvision.transforms.functional.adjust_brightness")(img, brightness_factor) | Adjust brightness of an image. |' + id: totrans-215 prefs: [] type: TYPE_TB + zh: '| [`adjust_brightness`](generated/torchvision.transforms.functional.adjust_brightness.html#torchvision.transforms.functional.adjust_brightness + "torchvision.transforms.functional.adjust_brightness")(img, brightness_factor) + | 调整图像的亮度。 |' - en: '| [`adjust_contrast`](generated/torchvision.transforms.functional.adjust_contrast.html#torchvision.transforms.functional.adjust_contrast "torchvision.transforms.functional.adjust_contrast")(img, contrast_factor) | Adjust contrast of an image. |' + id: totrans-216 prefs: [] type: TYPE_TB + zh: '| [`adjust_contrast`](generated/torchvision.transforms.functional.adjust_contrast.html#torchvision.transforms.functional.adjust_contrast + "torchvision.transforms.functional.adjust_contrast")(img, contrast_factor) | 调整图像的对比度。 + |' - en: '| [`adjust_gamma`](generated/torchvision.transforms.functional.adjust_gamma.html#torchvision.transforms.functional.adjust_gamma "torchvision.transforms.functional.adjust_gamma")(img, gamma[, gain]) | Perform gamma correction on an image. |' + id: totrans-217 prefs: [] type: TYPE_TB + zh: '| [`adjust_gamma`](generated/torchvision.transforms.functional.adjust_gamma.html#torchvision.transforms.functional.adjust_gamma + "torchvision.transforms.functional.adjust_gamma")(img, gamma[, gain]) | 对图像执行伽马校正。 + |' - en: '| [`adjust_hue`](generated/torchvision.transforms.functional.adjust_hue.html#torchvision.transforms.functional.adjust_hue "torchvision.transforms.functional.adjust_hue")(img, hue_factor) | Adjust hue of an image. |' + id: totrans-218 prefs: [] type: TYPE_TB + zh: '| [`adjust_hue`](generated/torchvision.transforms.functional.adjust_hue.html#torchvision.transforms.functional.adjust_hue + "torchvision.transforms.functional.adjust_hue")(img, hue_factor) | 调整图像的色调。 |' - en: '| [`adjust_saturation`](generated/torchvision.transforms.functional.adjust_saturation.html#torchvision.transforms.functional.adjust_saturation "torchvision.transforms.functional.adjust_saturation")(img, saturation_factor) | Adjust color saturation of an image. |' + id: totrans-219 prefs: [] type: TYPE_TB + zh: '| [`adjust_saturation`](generated/torchvision.transforms.functional.adjust_saturation.html#torchvision.transforms.functional.adjust_saturation + "torchvision.transforms.functional.adjust_saturation")(img, saturation_factor) + | 调整图像的颜色饱和度。 |' - en: '| [`adjust_sharpness`](generated/torchvision.transforms.functional.adjust_sharpness.html#torchvision.transforms.functional.adjust_sharpness "torchvision.transforms.functional.adjust_sharpness")(img, sharpness_factor) | Adjust the sharpness of an image. |' + id: totrans-220 prefs: [] type: TYPE_TB + zh: '| [`adjust_sharpness`](generated/torchvision.transforms.functional.adjust_sharpness.html#torchvision.transforms.functional.adjust_sharpness + "torchvision.transforms.functional.adjust_sharpness")(img, sharpness_factor) | + 调整图像的锐度。 |' - en: '| [`affine`](generated/torchvision.transforms.functional.affine.html#torchvision.transforms.functional.affine "torchvision.transforms.functional.affine")(img, angle, translate, scale, shear) | Apply affine transformation on the image keeping image center invariant. |' + id: totrans-221 prefs: [] type: TYPE_TB + zh: '| [`affine`](generated/torchvision.transforms.functional.affine.html#torchvision.transforms.functional.affine + "torchvision.transforms.functional.affine")(img, angle, translate, scale, shear) + | 在保持图像中心不变的情况下对图像应用仿射变换。 |' - en: '| [`autocontrast`](generated/torchvision.transforms.functional.autocontrast.html#torchvision.transforms.functional.autocontrast "torchvision.transforms.functional.autocontrast")(img) | Maximize contrast of an image by remapping its pixels per channel so that the lowest becomes black and the lightest becomes white. |' + id: totrans-222 prefs: [] type: TYPE_TB + zh: '| [`autocontrast`](generated/torchvision.transforms.functional.autocontrast.html#torchvision.transforms.functional.autocontrast + "torchvision.transforms.functional.autocontrast")(img) | 通过重新映射每个通道的像素,使最低值变为黑色,最亮值变为白色,从而最大化图像的对比度。 + |' - en: '| [`center_crop`](generated/torchvision.transforms.functional.center_crop.html#torchvision.transforms.functional.center_crop "torchvision.transforms.functional.center_crop")(img, output_size) | Crops the given image at the center. |' + id: totrans-223 prefs: [] type: TYPE_TB + zh: '| [`center_crop`](generated/torchvision.transforms.functional.center_crop.html#torchvision.transforms.functional.center_crop + "torchvision.transforms.functional.center_crop")(img, output_size) | 在中心裁剪给定图像。 + |' - en: '| [`convert_image_dtype`](generated/torchvision.transforms.functional.convert_image_dtype.html#torchvision.transforms.functional.convert_image_dtype "torchvision.transforms.functional.convert_image_dtype")(image[, dtype]) | Convert a tensor image to the given `dtype` and scale the values accordingly This function does not support PIL Image. |' + id: totrans-224 prefs: [] type: TYPE_TB + zh: '| [`convert_image_dtype`](generated/torchvision.transforms.functional.convert_image_dtype.html#torchvision.transforms.functional.convert_image_dtype + "torchvision.transforms.functional.convert_image_dtype")(image[, dtype]) | 将张量图像转换为给定的`dtype`并相应地缩放值。此函数不支持PIL图像。 + |' - en: '| [`crop`](generated/torchvision.transforms.functional.crop.html#torchvision.transforms.functional.crop "torchvision.transforms.functional.crop")(img, top, left, height, width) | Crop the given image at specified location and output size. |' + id: totrans-225 prefs: [] type: TYPE_TB + zh: '| [`crop`](generated/torchvision.transforms.functional.crop.html#torchvision.transforms.functional.crop + "torchvision.transforms.functional.crop")(img, top, left, height, width) | 在指定位置裁剪给定图像并输出大小。 + |' - en: '| [`equalize`](generated/torchvision.transforms.functional.equalize.html#torchvision.transforms.functional.equalize "torchvision.transforms.functional.equalize")(img) | Equalize the histogram of an image by applying a non-linear mapping to the input in order to create a uniform distribution of grayscale values in the output. |' + id: totrans-226 prefs: [] type: TYPE_TB + zh: '| [`equalize`](generated/torchvision.transforms.functional.equalize.html#torchvision.transforms.functional.equalize + "torchvision.transforms.functional.equalize")(img) | 通过对输入应用非线性映射来均衡图像的直方图,以创建输出中灰度值的均匀分布。 + |' - en: '| [`erase`](generated/torchvision.transforms.functional.erase.html#torchvision.transforms.functional.erase "torchvision.transforms.functional.erase")(img, i, j, h, w, v[, inplace]) | Erase the input Tensor Image with given value. |' + id: totrans-227 prefs: [] type: TYPE_TB + zh: '| [`erase`](generated/torchvision.transforms.functional.erase.html#torchvision.transforms.functional.erase + "torchvision.transforms.functional.erase")(img, i, j, h, w, v[, inplace]) | 用给定值擦除输入张量图像。 + |' - en: '| [`five_crop`](generated/torchvision.transforms.functional.five_crop.html#torchvision.transforms.functional.five_crop "torchvision.transforms.functional.five_crop")(img, size) | Crop the given image into four corners and the central crop. |' + id: totrans-228 prefs: [] type: TYPE_TB + zh: '| [`five_crop`](generated/torchvision.transforms.functional.five_crop.html#torchvision.transforms.functional.five_crop + "torchvision.transforms.functional.five_crop")(img, size) | 将给定图像裁剪成四个角和中心裁剪。 + |' - en: '| [`gaussian_blur`](generated/torchvision.transforms.functional.gaussian_blur.html#torchvision.transforms.functional.gaussian_blur "torchvision.transforms.functional.gaussian_blur")(img, kernel_size[, sigma]) | Performs Gaussian blurring on the image by given kernel. |' + id: totrans-229 prefs: [] type: TYPE_TB + zh: '| [`gaussian_blur`](generated/torchvision.transforms.functional.gaussian_blur.html#torchvision.transforms.functional.gaussian_blur + "torchvision.transforms.functional.gaussian_blur")(img, kernel_size[, sigma]) + | 通过给定的核对图像执行高斯模糊。 |' - en: '| [`get_dimensions`](generated/torchvision.transforms.functional.get_dimensions.html#torchvision.transforms.functional.get_dimensions "torchvision.transforms.functional.get_dimensions")(img) | Returns the dimensions of an image as [channels, height, width]. |' + id: totrans-230 prefs: [] type: TYPE_TB + zh: '| [`get_dimensions`](generated/torchvision.transforms.functional.get_dimensions.html#torchvision.transforms.functional.get_dimensions + "torchvision.transforms.functional.get_dimensions")(img) | 返回图像的尺寸为[通道,高度,宽度]。 + |' - en: '| [`get_image_num_channels`](generated/torchvision.transforms.functional.get_image_num_channels.html#torchvision.transforms.functional.get_image_num_channels "torchvision.transforms.functional.get_image_num_channels")(img) | Returns the number of channels of an image. |' + id: totrans-231 prefs: [] type: TYPE_TB + zh: '| [`get_image_num_channels`](generated/torchvision.transforms.functional.get_image_num_channels.html#torchvision.transforms.functional.get_image_num_channels + "torchvision.transforms.functional.get_image_num_channels")(img) | 返回图像的通道数。 |' - en: '| [`get_image_size`](generated/torchvision.transforms.functional.get_image_size.html#torchvision.transforms.functional.get_image_size "torchvision.transforms.functional.get_image_size")(img) | Returns the size of an image as [width, height]. |' + id: totrans-232 prefs: [] type: TYPE_TB + zh: '| [`get_image_size`](generated/torchvision.transforms.functional.get_image_size.html#torchvision.transforms.functional.get_image_size + "torchvision.transforms.functional.get_image_size")(img) | 返回图像的尺寸为[宽度,高度]。 |' - en: '| [`hflip`](generated/torchvision.transforms.functional.hflip.html#torchvision.transforms.functional.hflip "torchvision.transforms.functional.hflip")(img) | Horizontally flip the given image. |' + id: totrans-233 prefs: [] type: TYPE_TB + zh: '| [`hflip`](generated/torchvision.transforms.functional.hflip.html#torchvision.transforms.functional.hflip + "torchvision.transforms.functional.hflip")(img) | 水平翻转给定图像。 |' - en: '| [`invert`](generated/torchvision.transforms.functional.invert.html#torchvision.transforms.functional.invert "torchvision.transforms.functional.invert")(img) | Invert the colors of an RGB/grayscale image. |' + id: totrans-234 prefs: [] type: TYPE_TB + zh: '| [`invert`](generated/torchvision.transforms.functional.invert.html#torchvision.transforms.functional.invert + "torchvision.transforms.functional.invert")(img) | 反转RGB/灰度图像的颜色。 |' - en: '| [`normalize`](generated/torchvision.transforms.functional.normalize.html#torchvision.transforms.functional.normalize "torchvision.transforms.functional.normalize")(tensor, mean, std[, inplace]) | Normalize a float tensor image with mean and standard deviation. |' + id: totrans-235 prefs: [] type: TYPE_TB + zh: '| [`normalize`](generated/torchvision.transforms.functional.normalize.html#torchvision.transforms.functional.normalize + "torchvision.transforms.functional.normalize")(tensor, mean, std[, inplace]) | + 使用均值和标准差对浮点张量图像进行归一化。 |' - en: '| [`pad`](generated/torchvision.transforms.functional.pad.html#torchvision.transforms.functional.pad "torchvision.transforms.functional.pad")(img, padding[, fill, padding_mode]) | Pad the given image on all sides with the given "pad" value. |' + id: totrans-236 prefs: [] type: TYPE_TB + zh: '| [`pad`](generated/torchvision.transforms.functional.pad.html#torchvision.transforms.functional.pad + "torchvision.transforms.functional.pad")(img, padding[, fill, padding_mode]) | + 使用给定的“填充”值在所有边上填充给定的图像。 |' - en: '| [`perspective`](generated/torchvision.transforms.functional.perspective.html#torchvision.transforms.functional.perspective "torchvision.transforms.functional.perspective")(img, startpoints, endpoints[, ...]) | Perform perspective transform of the given image. |' + id: totrans-237 prefs: [] type: TYPE_TB + zh: '| [`perspective`](generated/torchvision.transforms.functional.perspective.html#torchvision.transforms.functional.perspective + "torchvision.transforms.functional.perspective")(img, startpoints, endpoints[, + ...]) | 对给定图像执行透视变换。 |' - en: '| [`pil_to_tensor`](generated/torchvision.transforms.functional.pil_to_tensor.html#torchvision.transforms.functional.pil_to_tensor "torchvision.transforms.functional.pil_to_tensor")(pic) | Convert a `PIL Image` to a tensor of the same type. |' + id: totrans-238 prefs: [] type: TYPE_TB + zh: '| [`pil_to_tensor`](generated/torchvision.transforms.functional.pil_to_tensor.html#torchvision.transforms.functional.pil_to_tensor + "torchvision.transforms.functional.pil_to_tensor")(pic) | 将`PIL Image`转换为相同类型的张量。 + |' - en: '| [`posterize`](generated/torchvision.transforms.functional.posterize.html#torchvision.transforms.functional.posterize "torchvision.transforms.functional.posterize")(img, bits) | Posterize an image by reducing the number of bits for each color channel. |' + id: totrans-239 prefs: [] type: TYPE_TB + zh: '| [`posterize`](generated/torchvision.transforms.functional.posterize.html#torchvision.transforms.functional.posterize + "torchvision.transforms.functional.posterize")(img, bits) | 通过减少每个颜色通道的位数来制作海报效果。 + |' - en: '| [`resize`](generated/torchvision.transforms.functional.resize.html#torchvision.transforms.functional.resize "torchvision.transforms.functional.resize")(img, size[, interpolation, max_size, ...]) | Resize the input image to the given size. |' + id: totrans-240 prefs: [] type: TYPE_TB + zh: '| [`resize`](generated/torchvision.transforms.functional.resize.html#torchvision.transforms.functional.resize + "torchvision.transforms.functional.resize")(img, size[, interpolation, max_size, + ...]) | 将输入图像调整大小为给定大小。 |' - en: '| [`resized_crop`](generated/torchvision.transforms.functional.resized_crop.html#torchvision.transforms.functional.resized_crop "torchvision.transforms.functional.resized_crop")(img, top, left, height, width, size) | Crop the given image and resize it to desired size. |' + id: totrans-241 prefs: [] type: TYPE_TB + zh: '| [`resized_crop`](generated/torchvision.transforms.functional.resized_crop.html#torchvision.transforms.functional.resized_crop + "torchvision.transforms.functional.resized_crop")(img, top, left, height, width, + size) | 裁剪给定的图像并将其调整大小到所需大小。 |' - en: '| [`rgb_to_grayscale`](generated/torchvision.transforms.functional.rgb_to_grayscale.html#torchvision.transforms.functional.rgb_to_grayscale "torchvision.transforms.functional.rgb_to_grayscale")(img[, num_output_channels]) | Convert RGB image to grayscale version of image. |' + id: totrans-242 prefs: [] type: TYPE_TB + zh: '| [`rgb_to_grayscale`](generated/torchvision.transforms.functional.rgb_to_grayscale.html#torchvision.transforms.functional.rgb_to_grayscale + "torchvision.transforms.functional.rgb_to_grayscale")(img[, num_output_channels]) + | 将RGB图像转换为灰度图像。 |' - en: '| [`rotate`](generated/torchvision.transforms.functional.rotate.html#torchvision.transforms.functional.rotate "torchvision.transforms.functional.rotate")(img, angle[, interpolation, expand, ...]) | Rotate the image by angle. |' + id: totrans-243 prefs: [] type: TYPE_TB + zh: '| [`rotate`](generated/torchvision.transforms.functional.rotate.html#torchvision.transforms.functional.rotate + "torchvision.transforms.functional.rotate")(img, angle[, interpolation, expand, + ...]) | 以角度旋转图像。 |' - en: '| [`solarize`](generated/torchvision.transforms.functional.solarize.html#torchvision.transforms.functional.solarize "torchvision.transforms.functional.solarize")(img, threshold) | Solarize an RGB/grayscale image by inverting all pixel values above a threshold. |' + id: totrans-244 prefs: [] type: TYPE_TB + zh: '| [`solarize`](generated/torchvision.transforms.functional.solarize.html#torchvision.transforms.functional.solarize + "torchvision.transforms.functional.solarize")(img, threshold) | 通过反转所有高于阈值的像素值来使RGB/灰度图像太阳化。 + |' - en: '| [`ten_crop`](generated/torchvision.transforms.functional.ten_crop.html#torchvision.transforms.functional.ten_crop "torchvision.transforms.functional.ten_crop")(img, size[, vertical_flip]) | Generate ten cropped images from the given image. |' + id: totrans-245 prefs: [] type: TYPE_TB + zh: '| [`ten_crop`](generated/torchvision.transforms.functional.ten_crop.html#torchvision.transforms.functional.ten_crop + "torchvision.transforms.functional.ten_crop")(img, size[, vertical_flip]) | 从给定图像生成十个裁剪图像。 + |' - en: '| [`to_grayscale`](generated/torchvision.transforms.functional.to_grayscale.html#torchvision.transforms.functional.to_grayscale "torchvision.transforms.functional.to_grayscale")(img[, num_output_channels]) | Convert PIL image of any mode (RGB, HSV, LAB, etc) to grayscale version of image. |' + id: totrans-246 prefs: [] type: TYPE_TB + zh: '| [`to_grayscale`](generated/torchvision.transforms.functional.to_grayscale.html#torchvision.transforms.functional.to_grayscale + "torchvision.transforms.functional.to_grayscale")(img[, num_output_channels]) + | 将任何模式的PIL图像(RGB、HSV、LAB等)转换为灰度图像。 |' - en: '| [`to_pil_image`](generated/torchvision.transforms.functional.to_pil_image.html#torchvision.transforms.functional.to_pil_image "torchvision.transforms.functional.to_pil_image")(pic[, mode]) | Convert a tensor or an ndarray to PIL Image. |' + id: totrans-247 prefs: [] type: TYPE_TB + zh: '| [`to_pil_image`](generated/torchvision.transforms.functional.to_pil_image.html#torchvision.transforms.functional.to_pil_image + "torchvision.transforms.functional.to_pil_image")(pic[, mode]) | 将张量或ndarray转换为PIL图像。 + |' - en: '| [`to_tensor`](generated/torchvision.transforms.functional.to_tensor.html#torchvision.transforms.functional.to_tensor "torchvision.transforms.functional.to_tensor")(pic) | Convert a `PIL Image` or `numpy.ndarray` to tensor. |' + id: totrans-248 prefs: [] type: TYPE_TB + zh: '| [`to_tensor`](generated/torchvision.transforms.functional.to_tensor.html#torchvision.transforms.functional.to_tensor + "torchvision.transforms.functional.to_tensor")(pic) | 将`PIL Image`或`numpy.ndarray`转换为张量。 + |' - en: '| [`vflip`](generated/torchvision.transforms.functional.vflip.html#torchvision.transforms.functional.vflip "torchvision.transforms.functional.vflip")(img) | Vertically flip the given image. |' + id: totrans-249 prefs: [] type: TYPE_TB + zh: '| [`vflip`](generated/torchvision.transforms.functional.vflip.html#torchvision.transforms.functional.vflip + "torchvision.transforms.functional.vflip")(img) | 垂直翻转给定的图像。 |' diff --git a/totrans/vis017_03.yaml b/totrans/vis017_03.yaml index 19468642c1c685b84465d620d602f99c7d3512c9..937adcf92bf18106d623798acb614a409ee00021 100644 --- a/totrans/vis017_03.yaml +++ b/totrans/vis017_03.yaml @@ -1,60 +1,101 @@ - en: TVTensors + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: TVTensors - en: 原文:[https://pytorch.org/vision/stable/tv_tensors.html](https://pytorch.org/vision/stable/tv_tensors.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/tv_tensors.html](https://pytorch.org/vision/stable/tv_tensors.html) - en: TVTensors are [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") subclasses which the v2 [transforms](transforms.html#transforms) use under the hood to dispatch their inputs to the appropriate lower-level kernels. Most users do not need to manipulate TVTensors directly. + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: TVTensors是[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)")的子类,v2 [transforms](transforms.html#transforms)在内部使用它们来将输入分派到适当的底层内核。大多数用户不需要直接操作TVTensors。 - en: Refer to [Getting started with transforms v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py) for an introduction to TVTensors, or [TVTensors FAQ](auto_examples/transforms/plot_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-tv-tensors-py) for more advanced info. + id: totrans-3 prefs: [] type: TYPE_NORMAL + zh: 有关TVTensors的介绍,请参阅[开始使用transforms v2](auto_examples/transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py),或者查看[TVTensors + FAQ](auto_examples/transforms/plot_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-tv-tensors-py)以获取更多高级信息。 - en: '| [`Image`](generated/torchvision.tv_tensors.Image.html#torchvision.tv_tensors.Image "torchvision.tv_tensors.Image")(data, *[, dtype, device, requires_grad]) | [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") subclass for images. |' + id: totrans-4 prefs: [] type: TYPE_TB + zh: '| [`Image`](generated/torchvision.tv_tensors.Image.html#torchvision.tv_tensors.Image + "torchvision.tv_tensors.Image")(data, *[, dtype, device, requires_grad]) | 用于图像的[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)")子类。 |' - en: '| [`Video`](generated/torchvision.tv_tensors.Video.html#torchvision.tv_tensors.Video "torchvision.tv_tensors.Video")(data, *[, dtype, device, requires_grad]) | [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") subclass for videos. |' + id: totrans-5 prefs: [] type: TYPE_TB + zh: '| [`Video`](generated/torchvision.tv_tensors.Video.html#torchvision.tv_tensors.Video + "torchvision.tv_tensors.Video")(data, *[, dtype, device, requires_grad]) | 用于视频的[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)")子类。 |' - en: '| [`BoundingBoxFormat`](generated/torchvision.tv_tensors.BoundingBoxFormat.html#torchvision.tv_tensors.BoundingBoxFormat "torchvision.tv_tensors.BoundingBoxFormat")(value) | Coordinate format of a bounding box. |' + id: totrans-6 prefs: [] type: TYPE_TB + zh: '| [`BoundingBoxFormat`](generated/torchvision.tv_tensors.BoundingBoxFormat.html#torchvision.tv_tensors.BoundingBoxFormat + "torchvision.tv_tensors.BoundingBoxFormat")(value) | 边界框的坐标格式。 |' - en: '| [`BoundingBoxes`](generated/torchvision.tv_tensors.BoundingBoxes.html#torchvision.tv_tensors.BoundingBoxes "torchvision.tv_tensors.BoundingBoxes")(data, *, format, canvas_size) | [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") subclass for bounding boxes. |' + id: totrans-7 prefs: [] type: TYPE_TB + zh: '| [`BoundingBoxes`](generated/torchvision.tv_tensors.BoundingBoxes.html#torchvision.tv_tensors.BoundingBoxes + "torchvision.tv_tensors.BoundingBoxes")(data, *, format, canvas_size) | 用于边界框的[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)")子类。 |' - en: '| [`Mask`](generated/torchvision.tv_tensors.Mask.html#torchvision.tv_tensors.Mask "torchvision.tv_tensors.Mask")(data, *[, dtype, device, requires_grad]) | [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") subclass for segmentation and detection masks. |' + id: totrans-8 prefs: [] type: TYPE_TB + zh: '| [`Mask`](generated/torchvision.tv_tensors.Mask.html#torchvision.tv_tensors.Mask + "torchvision.tv_tensors.Mask")(data, *[, dtype, device, requires_grad]) | 用于分割和检测掩码的[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)")子类。 |' - en: '| [`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor "torchvision.tv_tensors.TVTensor") | Base class for all TVTensors. |' + id: totrans-9 prefs: [] type: TYPE_TB + zh: '| [`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor + "torchvision.tv_tensors.TVTensor") | 所有TVTensors的基类。 |' - en: '| [`set_return_type`](generated/torchvision.tv_tensors.set_return_type.html#torchvision.tv_tensors.set_return_type "torchvision.tv_tensors.set_return_type")(return_type) | Set the return type of torch operations on [`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor "torchvision.tv_tensors.TVTensor"). |' + id: totrans-10 prefs: [] type: TYPE_TB + zh: '| [`set_return_type`](generated/torchvision.tv_tensors.set_return_type.html#torchvision.tv_tensors.set_return_type + "torchvision.tv_tensors.set_return_type")(return_type) | 设置[`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor + "torchvision.tv_tensors.TVTensor")上torch操作的返回类型。 |' - en: '| [`wrap`](generated/torchvision.tv_tensors.wrap.html#torchvision.tv_tensors.wrap "torchvision.tv_tensors.wrap")(wrappee, *, like, **kwargs) | Convert a [`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor "(in PyTorch v2.2)") (`wrappee`) into the same [`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor "torchvision.tv_tensors.TVTensor") subclass as `like`. |' + id: totrans-11 prefs: [] type: TYPE_TB + zh: '| [`wrap`](generated/torchvision.tv_tensors.wrap.html#torchvision.tv_tensors.wrap + "torchvision.tv_tensors.wrap")(wrappee, *, like, **kwargs) | 将[`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor + "(在PyTorch v2.2中)") (`wrappee`)转换为与`like`相同的[`TVTensor`](generated/torchvision.tv_tensors.TVTensor.html#torchvision.tv_tensors.TVTensor + "torchvision.tv_tensors.TVTensor")子类。 |' diff --git a/totrans/vis017_04.yaml b/totrans/vis017_04.yaml index 2b8caadc6dbf0c73e38255da2f121de7fed2fc93..e53186387100c650f16406e6fcbb33e54fbfd251 100644 --- a/totrans/vis017_04.yaml +++ b/totrans/vis017_04.yaml @@ -1,1440 +1,2440 @@ - en: Models and pre-trained weights + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 模型和预训练权重 - en: 原文:[https://pytorch.org/vision/stable/models.html](https://pytorch.org/vision/stable/models.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/models.html](https://pytorch.org/vision/stable/models.html) - en: 'The `torchvision.models` subpackage contains definitions of models for addressing different tasks, including: image classification, pixelwise semantic segmentation, object detection, instance segmentation, person keypoint detection, video classification, and optical flow.' + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.models`子包含有用于解决不同任务的模型的定义,包括:图像分类、像素级语义分割、目标检测、实例分割、人体关键点检测、视频分类和光流。' - en: General information on pre-trained weights[](#general-information-on-pre-trained-weights "Permalink to this heading") + id: totrans-3 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 有关预训练权重的一般信息[](#general-information-on-pre-trained-weights "此标题的永久链接") - en: TorchVision offers pre-trained weights for every provided architecture, using the PyTorch [`torch.hub`](https://pytorch.org/docs/stable/hub.html#module-torch.hub "(in PyTorch v2.2)"). Instancing a pre-trained model will download its weights to a cache directory. This directory can be set using the TORCH_HOME environment variable. See [`torch.hub.load_state_dict_from_url()`](https://pytorch.org/docs/stable/hub.html#torch.hub.load_state_dict_from_url "(in PyTorch v2.2)") for details. + id: totrans-4 prefs: [] type: TYPE_NORMAL + zh: TorchVision为每个提供的架构提供了预训练权重,使用PyTorch [`torch.hub`](https://pytorch.org/docs/stable/hub.html#module-torch.hub + "(在PyTorch v2.2中)")。实例化预训练模型将下载其权重到缓存目录。可以使用TORCH_HOME环境变量设置此目录。有关详细信息,请参阅[`torch.hub.load_state_dict_from_url()`](https://pytorch.org/docs/stable/hub.html#torch.hub.load_state_dict_from_url + "(在PyTorch v2.2中)")。 - en: Note + id: totrans-5 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: The pre-trained models provided in this library may have their own licenses or terms and conditions derived from the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case. + id: totrans-6 prefs: [] type: TYPE_NORMAL + zh: 此库中提供的预训练模型可能具有根据用于训练的数据集派生的自己的许可证或条款。您有责任确定是否有权限将这些模型用于您的用例。 - en: Note + id: totrans-7 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: Backward compatibility is guaranteed for loading a serialized `state_dict` to the model created using old PyTorch version. On the contrary, loading entire saved models or serialized `ScriptModules` (serialized using older versions of PyTorch) may not preserve the historic behaviour. Refer to the following [documentation](https://pytorch.org/docs/stable/notes/serialization.html#id6) + id: totrans-8 prefs: [] type: TYPE_NORMAL + zh: 对于将序列化的`state_dict`加载到使用旧版本PyTorch创建的模型,向后兼容性是有保证的。相反,加载整个保存的模型或序列化的`ScriptModules`(使用旧版本PyTorch序列化)可能不会保留历史行为。请参考以下[文档](https://pytorch.org/docs/stable/notes/serialization.html#id6) - en: Initializing pre-trained models[](#initializing-pre-trained-models "Permalink to this heading") + id: totrans-9 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 初始化预训练模型[](#initializing-pre-trained-models "此标题的永久链接") - en: 'As of v0.13, TorchVision offers a new [Multi-weight support API](https://pytorch.org/blog/introducing-torchvision-new-multi-weight-support-api/) for loading different weights to the existing model builder methods:' + id: totrans-10 prefs: [] type: TYPE_NORMAL + zh: 从v0.13开始,TorchVision提供了一个新的[多权重支持API](https://pytorch.org/blog/introducing-torchvision-new-multi-weight-support-api/),用于将不同权重加载到现有的模型构建器方法中: - en: '[PRE0]' + id: totrans-11 prefs: [] type: TYPE_PRE + zh: '[PRE0]' - en: 'Migrating to the new API is very straightforward. The following method calls between the 2 APIs are all equivalent:' + id: totrans-12 prefs: [] type: TYPE_NORMAL + zh: 迁移到新API非常简单。在这两个API之间的以下方法调用是等效的: - en: '[PRE1]' + id: totrans-13 prefs: [] type: TYPE_PRE + zh: '[PRE1]' - en: Note that the `pretrained` parameter is now deprecated, using it will emit warnings and will be removed on v0.15. + id: totrans-14 prefs: [] type: TYPE_NORMAL -- en: Using the pre-trained models[](#using-the-pre-trained-models "Permalink to - this heading") + zh: 请注意,`pretrained`参数现在已弃用,使用它将发出警告,并将在v0.15中删除。 +- en: Using the pre-trained models[](#using-the-pre-trained-models "Permalink to this + heading") + id: totrans-15 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 使用预训练模型[](#using-the-pre-trained-models "此标题的永久链接") - en: Before using the pre-trained models, one must preprocess the image (resize with right resolution/interpolation, apply inference transforms, rescale the values etc). There is no standard way to do this as it depends on how a given model was trained. It can vary across model families, variants or even weight versions. Using the correct preprocessing method is critical and failing to do so may lead to decreased accuracy or incorrect outputs. + id: totrans-16 prefs: [] type: TYPE_NORMAL + zh: 在使用预训练模型之前,必须对图像进行预处理(调整大小以获得正确的分辨率/插值,应用推理变换,重新缩放值等)。没有标准的方法可以做到这一点,因为它取决于给定模型的训练方式。它可能会因模型系列、变体甚至权重版本而有所不同。使用正确的预处理方法至关重要,否则可能导致准确性降低或输出不正确。 - en: 'All the necessary information for the inference transforms of each pre-trained model is provided on its weights documentation. To simplify inference, TorchVision bundles the necessary preprocessing transforms into each model weight. These are accessible via the `weight.transforms` attribute:' + id: totrans-17 prefs: [] type: TYPE_NORMAL + zh: 每个预训练模型的推理变换的所有必要信息都在其权重文档中提供。为了简化推理,TorchVision将必要的预处理变换捆绑到每个模型权重中。这些可以通过`weight.transforms`属性访问: - en: '[PRE2]' + id: totrans-18 prefs: [] type: TYPE_PRE + zh: '[PRE2]' - en: Some models use modules which have different training and evaluation behavior, such as batch normalization. To switch between these modes, use `model.train()` or `model.eval()` as appropriate. See [`train()`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.train "(in PyTorch v2.2)") or [`eval()`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.eval "(in PyTorch v2.2)") for details. + id: totrans-19 prefs: [] type: TYPE_NORMAL + zh: 有些模型使用具有不同训练和评估行为的模块,例如批量归一化。要在这些模式之间切换,请适当使用`model.train()`或`model.eval()`。有关详细信息,请参阅[`train()`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.train + "(在PyTorch v2.2中)")或[`eval()`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.eval + "(在PyTorch v2.2中)")。 - en: '[PRE3]' + id: totrans-20 prefs: [] type: TYPE_PRE + zh: '[PRE3]' - en: Listing and retrieving available models[](#listing-and-retrieving-available-models "Permalink to this heading") + id: totrans-21 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 列出和检索可用模型[](#listing-and-retrieving-available-models "此标题的永久链接") - en: 'As of v0.14, TorchVision offers a new mechanism which allows listing and retrieving models and weights by their names. Here are a few examples on how to use them:' + id: totrans-22 prefs: [] type: TYPE_NORMAL + zh: 从v0.14开始,TorchVision提供了一种新机制,允许按名称列出和检索模型和权重。以下是如何使用它们的几个示例: - en: '[PRE4]' + id: totrans-23 prefs: [] type: TYPE_PRE + zh: '[PRE4]' - en: 'Here are the available public functions to retrieve models and their corresponding weights:' + id: totrans-24 prefs: [] type: TYPE_NORMAL + zh: 以下是可用的公共函数,用于检索模型及其对应的权重: - en: '| [`get_model`](generated/torchvision.models.get_model.html#torchvision.models.get_model "torchvision.models.get_model")(name, **config) | Gets the model name and configuration and returns an instantiated model. |' + id: totrans-25 prefs: [] type: TYPE_TB + zh: '| [`get_model`](generated/torchvision.models.get_model.html#torchvision.models.get_model + "torchvision.models.get_model")(name, **config) | 获取模型名称和配置,并返回一个实例化的模型。 |' - en: '| [`get_model_weights`](generated/torchvision.models.get_model_weights.html#torchvision.models.get_model_weights "torchvision.models.get_model_weights")(name) | Returns the weights enum class associated to the given model. |' + id: totrans-26 prefs: [] type: TYPE_TB + zh: '| [`get_model_weights`](generated/torchvision.models.get_model_weights.html#torchvision.models.get_model_weights + "torchvision.models.get_model_weights")(name) | 返回与给定模型关联的权重枚举类。 |' - en: '| [`get_weight`](generated/torchvision.models.get_weight.html#torchvision.models.get_weight "torchvision.models.get_weight")(name) | Gets the weights enum value by its full name. |' + id: totrans-27 prefs: [] type: TYPE_TB + zh: '| [`get_weight`](generated/torchvision.models.get_weight.html#torchvision.models.get_weight + "torchvision.models.get_weight")(name) | 通过完整名称获取权重枚举值。 |' - en: '| [`list_models`](generated/torchvision.models.list_models.html#torchvision.models.list_models "torchvision.models.list_models")([module, include, exclude]) | Returns a list with the names of registered models. |' + id: totrans-28 prefs: [] type: TYPE_TB + zh: '| [`list_models`](generated/torchvision.models.list_models.html#torchvision.models.list_models + "torchvision.models.list_models")([module, include, exclude]) | 返回已注册模型名称的列表。 + |' - en: Using models from Hub[](#using-models-from-hub "Permalink to this heading") + id: totrans-29 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 使用 Hub 中的模型[](#using-models-from-hub "跳转到此标题") - en: 'Most pre-trained models can be accessed directly via PyTorch Hub without having TorchVision installed:' + id: totrans-30 prefs: [] type: TYPE_NORMAL + zh: 大多数预训练模型可以直接通过 PyTorch Hub 访问,无需安装 TorchVision: - en: '[PRE5]' + id: totrans-31 prefs: [] type: TYPE_PRE + zh: '[PRE5]' - en: 'You can also retrieve all the available weights of a specific model via PyTorch Hub by doing:' + id: totrans-32 prefs: [] type: TYPE_NORMAL + zh: 您还可以通过 PyTorch Hub 检索特定模型的所有可用权重: - en: '[PRE6]' + id: totrans-33 prefs: [] type: TYPE_PRE + zh: '[PRE6]' - en: The only exception to the above are the detection models included on `torchvision.models.detection`. These models require TorchVision to be installed because they depend on custom C++ operators. + id: totrans-34 prefs: [] type: TYPE_NORMAL + zh: 上述唯一的例外是包含在 `torchvision.models.detection` 中的检测模型。这些模型需要安装 TorchVision,因为它们依赖于自定义的 + C++ 运算符。 - en: Classification[](#classification "Permalink to this heading") + id: totrans-35 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 分类[](#classification "跳转到此标题") - en: 'The following classification models are available, with or without pre-trained weights:' + id: totrans-36 prefs: [] type: TYPE_NORMAL + zh: 以下分类模型可用,带有或不带有预训练权重: - en: '[AlexNet](models/alexnet.html)' + id: totrans-37 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[AlexNet](models/alexnet.html)' - en: '[ConvNeXt](models/convnext.html)' + id: totrans-38 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[ConvNeXt](models/convnext.html)' - en: '[DenseNet](models/densenet.html)' + id: totrans-39 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[DenseNet](models/densenet.html)' - en: '[EfficientNet](models/efficientnet.html)' + id: totrans-40 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[EfficientNet](models/efficientnet.html)' - en: '[EfficientNetV2](models/efficientnetv2.html)' + id: totrans-41 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[EfficientNetV2](models/efficientnetv2.html)' - en: '[GoogLeNet](models/googlenet.html)' + id: totrans-42 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[GoogLeNet](models/googlenet.html)' - en: '[Inception V3](models/inception.html)' + id: totrans-43 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Inception V3](models/inception.html)' - en: '[MaxVit](models/maxvit.html)' + id: totrans-44 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[MaxVit](models/maxvit.html)' - en: '[MNASNet](models/mnasnet.html)' + id: totrans-45 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[MNASNet](models/mnasnet.html)' - en: '[MobileNet V2](models/mobilenetv2.html)' + id: totrans-46 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[MobileNet V2](models/mobilenetv2.html)' - en: '[MobileNet V3](models/mobilenetv3.html)' + id: totrans-47 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[MobileNet V3](models/mobilenetv3.html)' - en: '[RegNet](models/regnet.html)' + id: totrans-48 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[RegNet](models/regnet.html)' - en: '[ResNet](models/resnet.html)' + id: totrans-49 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[ResNet](models/resnet.html)' - en: '[ResNeXt](models/resnext.html)' + id: totrans-50 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[ResNeXt](models/resnext.html)' - en: '[ShuffleNet V2](models/shufflenetv2.html)' + id: totrans-51 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[ShuffleNet V2](models/shufflenetv2.html)' - en: '[SqueezeNet](models/squeezenet.html)' + id: totrans-52 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[SqueezeNet](models/squeezenet.html)' - en: '[SwinTransformer](models/swin_transformer.html)' + id: totrans-53 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[SwinTransformer](models/swin_transformer.html)' - en: '[VGG](models/vgg.html)' + id: totrans-54 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[VGG](models/vgg.html)' - en: '[VisionTransformer](models/vision_transformer.html)' + id: totrans-55 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[VisionTransformer](models/vision_transformer.html)' - en: '[Wide ResNet](models/wide_resnet.html)' + id: totrans-56 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Wide ResNet](models/wide_resnet.html)' - en: 'Here is an example of how to use the pre-trained image classification models:' + id: totrans-57 prefs: [] type: TYPE_NORMAL + zh: 以下是如何使用预训练图像分类模型的示例: - en: '[PRE7]' + id: totrans-58 prefs: [] type: TYPE_PRE + zh: '[PRE7]' - en: The classes of the pre-trained model outputs can be found at `weights.meta["categories"]`. + id: totrans-59 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在 `weights.meta["categories"]` 中找到。 - en: Table of all available classification weights[](#table-of-all-available-classification-weights "Permalink to this heading") + id: totrans-60 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 所有可用分类权重的表格[](#table-of-all-available-classification-weights "跳转到此标题") - en: 'Accuracies are reported on ImageNet-1K using single crops:' + id: totrans-61 prefs: [] type: TYPE_NORMAL + zh: 在 ImageNet-1K 上使用单个裁剪报告准确性: - en: '| **Weight** | **Acc@1** | **Acc@5** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-62 prefs: [] type: TYPE_TB + zh: '| **权重** | **Acc@1** | **Acc@5** | **参数** | **GFLOPS** | **Recipe** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-63 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`AlexNet_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.alexnet.html#torchvision.models.AlexNet_Weights "torchvision.models.AlexNet_Weights") | 56.522 | 79.066 | 61.1M | 0.71 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-64 prefs: [] type: TYPE_TB + zh: '| [`AlexNet_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.alexnet.html#torchvision.models.AlexNet_Weights + "torchvision.models.AlexNet_Weights") | 56.522 | 79.066 | 61.1M | 0.71 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`ConvNeXt_Base_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_base.html#torchvision.models.ConvNeXt_Base_Weights "torchvision.models.ConvNeXt_Base_Weights") | 84.062 | 96.87 | 88.6M | 15.36 | [link](https://github.com/pytorch/vision/tree/main/references/classification#convnext) |' + id: totrans-65 prefs: [] type: TYPE_TB + zh: '| [`ConvNeXt_Base_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_base.html#torchvision.models.ConvNeXt_Base_Weights + "torchvision.models.ConvNeXt_Base_Weights") | 84.062 | 96.87 | 88.6M | 15.36 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#convnext) + |' - en: '| [`ConvNeXt_Large_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_large.html#torchvision.models.ConvNeXt_Large_Weights "torchvision.models.ConvNeXt_Large_Weights") | 84.414 | 96.976 | 197.8M | 34.36 | [link](https://github.com/pytorch/vision/tree/main/references/classification#convnext) |' + id: totrans-66 prefs: [] type: TYPE_TB + zh: '| [`ConvNeXt_Large_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_large.html#torchvision.models.ConvNeXt_Large_Weights + "torchvision.models.ConvNeXt_Large_Weights") | 84.414 | 96.976 | 197.8M | 34.36 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#convnext) + |' - en: '| [`ConvNeXt_Small_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_small.html#torchvision.models.ConvNeXt_Small_Weights "torchvision.models.ConvNeXt_Small_Weights") | 83.616 | 96.65 | 50.2M | 8.68 | [link](https://github.com/pytorch/vision/tree/main/references/classification#convnext) |' + id: totrans-67 prefs: [] type: TYPE_TB + zh: '| [`ConvNeXt_Small_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_small.html#torchvision.models.ConvNeXt_Small_Weights + "torchvision.models.ConvNeXt_Small_Weights") | 83.616 | 96.65 | 50.2M | 8.68 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#convnext) + |' - en: '| [`ConvNeXt_Tiny_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_tiny.html#torchvision.models.ConvNeXt_Tiny_Weights "torchvision.models.ConvNeXt_Tiny_Weights") | 82.52 | 96.146 | 28.6M | 4.46 | [link](https://github.com/pytorch/vision/tree/main/references/classification#convnext) |' + id: totrans-68 prefs: [] type: TYPE_TB + zh: '| [`ConvNeXt_Tiny_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.convnext_tiny.html#torchvision.models.ConvNeXt_Tiny_Weights + "torchvision.models.ConvNeXt_Tiny_Weights") | 82.52 | 96.146 | 28.6M | 4.46 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#convnext) + |' - en: '| [`DenseNet121_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet121.html#torchvision.models.DenseNet121_Weights "torchvision.models.DenseNet121_Weights") | 74.434 | 91.972 | 8.0M | 2.83 | [link](https://github.com/pytorch/vision/pull/116) |' + id: totrans-69 prefs: [] type: TYPE_TB + zh: '| [`DenseNet121_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet121.html#torchvision.models.DenseNet121_Weights + "torchvision.models.DenseNet121_Weights") | 74.434 | 91.972 | 8.0M | 2.83 | [链接](https://github.com/pytorch/vision/pull/116) + |' - en: '| [`DenseNet161_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet161.html#torchvision.models.DenseNet161_Weights "torchvision.models.DenseNet161_Weights") | 77.138 | 93.56 | 28.7M | 7.73 | [link](https://github.com/pytorch/vision/pull/116) |' + id: totrans-70 prefs: [] type: TYPE_TB + zh: '| [`DenseNet161_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet161.html#torchvision.models.DenseNet161_Weights + "torchvision.models.DenseNet161_Weights") | 77.138 | 93.56 | 28.7M | 7.73 | [链接](https://github.com/pytorch/vision/pull/116) + |' - en: '| [`DenseNet169_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet169.html#torchvision.models.DenseNet169_Weights "torchvision.models.DenseNet169_Weights") | 75.6 | 92.806 | 14.1M | 3.36 | [link](https://github.com/pytorch/vision/pull/116) |' + id: totrans-71 prefs: [] type: TYPE_TB + zh: '| [`DenseNet169_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet169.html#torchvision.models.DenseNet169_Weights + "torchvision.models.DenseNet169_Weights") | 75.6 | 92.806 | 14.1M | 3.36 | [链接](https://github.com/pytorch/vision/pull/116) + |' - en: '| [`DenseNet201_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet201.html#torchvision.models.DenseNet201_Weights "torchvision.models.DenseNet201_Weights") | 76.896 | 93.37 | 20.0M | 4.29 | [link](https://github.com/pytorch/vision/pull/116) |' + id: totrans-72 prefs: [] type: TYPE_TB + zh: '| [`DenseNet201_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.densenet201.html#torchvision.models.DenseNet201_Weights + "torchvision.models.DenseNet201_Weights") | 76.896 | 93.37 | 20.0M | 4.29 | [链接](https://github.com/pytorch/vision/pull/116) + |' - en: '| [`EfficientNet_B0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b0.html#torchvision.models.EfficientNet_B0_Weights "torchvision.models.EfficientNet_B0_Weights") | 77.692 | 93.532 | 5.3M | 0.39 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-73 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b0.html#torchvision.models.EfficientNet_B0_Weights + "torchvision.models.EfficientNet_B0_Weights") | 77.692 | 93.532 | 5.3M | 0.39 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B1_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b1.html#torchvision.models.EfficientNet_B1_Weights "torchvision.models.EfficientNet_B1_Weights") | 78.642 | 94.186 | 7.8M | 0.69 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-74 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B1_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b1.html#torchvision.models.EfficientNet_B1_Weights + "torchvision.models.EfficientNet_B1_Weights") | 78.642 | 94.186 | 7.8M | 0.69 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B1_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.efficientnet_b1.html#torchvision.models.EfficientNet_B1_Weights "torchvision.models.EfficientNet_B1_Weights") | 79.838 | 94.934 | 7.8M | 0.69 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-lr-wd-crop-tuning) |' + id: totrans-75 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B1_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.efficientnet_b1.html#torchvision.models.EfficientNet_B1_Weights + "torchvision.models.EfficientNet_B1_Weights") | 79.838 | 94.934 | 7.8M | 0.69 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe-with-lr-wd-crop-tuning) + |' - en: '| [`EfficientNet_B2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b2.html#torchvision.models.EfficientNet_B2_Weights "torchvision.models.EfficientNet_B2_Weights") | 80.608 | 95.31 | 9.1M | 1.09 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-76 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b2.html#torchvision.models.EfficientNet_B2_Weights + "torchvision.models.EfficientNet_B2_Weights") | 80.608 | 95.31 | 9.1M | 1.09 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b3.html#torchvision.models.EfficientNet_B3_Weights "torchvision.models.EfficientNet_B3_Weights") | 82.008 | 96.054 | 12.2M | 1.83 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-77 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b3.html#torchvision.models.EfficientNet_B3_Weights + "torchvision.models.EfficientNet_B3_Weights") | 82.008 | 96.054 | 12.2M | 1.83 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B4_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b4.html#torchvision.models.EfficientNet_B4_Weights "torchvision.models.EfficientNet_B4_Weights") | 83.384 | 96.594 | 19.3M | 4.39 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-78 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B4_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b4.html#torchvision.models.EfficientNet_B4_Weights + "torchvision.models.EfficientNet_B4_Weights") | 83.384 | 96.594 | 19.3M | 4.39 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b5.html#torchvision.models.EfficientNet_B5_Weights "torchvision.models.EfficientNet_B5_Weights") | 83.444 | 96.628 | 30.4M | 10.27 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-79 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b5.html#torchvision.models.EfficientNet_B5_Weights + "torchvision.models.EfficientNet_B5_Weights") | 83.444 | 96.628 | 30.4M | 10.27 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B6_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b6.html#torchvision.models.EfficientNet_B6_Weights "torchvision.models.EfficientNet_B6_Weights") | 84.008 | 96.916 | 43.0M | 19.07 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-80 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B6_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b6.html#torchvision.models.EfficientNet_B6_Weights + "torchvision.models.EfficientNet_B6_Weights") | 84.008 | 96.916 | 43.0M | 19.07 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_B7_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b7.html#torchvision.models.EfficientNet_B7_Weights "torchvision.models.EfficientNet_B7_Weights") | 84.122 | 96.908 | 66.3M | 37.75 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) |' + id: totrans-81 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_B7_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_b7.html#torchvision.models.EfficientNet_B7_Weights + "torchvision.models.EfficientNet_B7_Weights") | 84.122 | 96.908 | 66.3M | 37.75 + | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1) + |' - en: '| [`EfficientNet_V2_L_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_l.html#torchvision.models.EfficientNet_V2_L_Weights "torchvision.models.EfficientNet_V2_L_Weights") | 85.808 | 97.788 | 118.5M | 56.08 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) |' + id: totrans-82 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_V2_L_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_l.html#torchvision.models.EfficientNet_V2_L_Weights + "torchvision.models.EfficientNet_V2_L_Weights") | 85.808 | 97.788 | 118.5M | 56.08 + | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) + |' - en: '| [`EfficientNet_V2_M_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_m.html#torchvision.models.EfficientNet_V2_M_Weights "torchvision.models.EfficientNet_V2_M_Weights") | 85.112 | 97.156 | 54.1M | 24.58 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) |' + id: totrans-83 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_V2_M_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_m.html#torchvision.models.EfficientNet_V2_M_Weights + "torchvision.models.EfficientNet_V2_M_Weights") | 85.112 | 97.156 | 54.1M | 24.58 + | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) + |' - en: '| [`EfficientNet_V2_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_s.html#torchvision.models.EfficientNet_V2_S_Weights "torchvision.models.EfficientNet_V2_S_Weights") | 84.228 | 96.878 | 21.5M | 8.37 | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) |' + id: totrans-84 prefs: [] type: TYPE_TB + zh: '| [`EfficientNet_V2_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.efficientnet_v2_s.html#torchvision.models.EfficientNet_V2_S_Weights + "torchvision.models.EfficientNet_V2_S_Weights") | 84.228 | 96.878 | 21.5M | 8.37 + | [link](https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2) + |' - en: '| [`GoogLeNet_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.googlenet.html#torchvision.models.GoogLeNet_Weights "torchvision.models.GoogLeNet_Weights") | 69.778 | 89.53 | 6.6M | 1.5 | [link](https://github.com/pytorch/vision/tree/main/references/classification#googlenet) |' + id: totrans-85 prefs: [] type: TYPE_TB + zh: '| [`GoogLeNet_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.googlenet.html#torchvision.models.GoogLeNet_Weights + "torchvision.models.GoogLeNet_Weights") | 69.778 | 89.53 | 6.6M | 1.5 | [link](https://github.com/pytorch/vision/tree/main/references/classification#googlenet) + |' - en: '| [`Inception_V3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.inception_v3.html#torchvision.models.Inception_V3_Weights "torchvision.models.Inception_V3_Weights") | 77.294 | 93.45 | 27.2M | 5.71 | [link](https://github.com/pytorch/vision/tree/main/references/classification#inception-v3) |' + id: totrans-86 prefs: [] type: TYPE_TB + zh: '| [`Inception_V3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.inception_v3.html#torchvision.models.Inception_V3_Weights + "torchvision.models.Inception_V3_Weights") | 77.294 | 93.45 | 27.2M | 5.71 | [link](https://github.com/pytorch/vision/tree/main/references/classification#inception-v3) + |' - en: '| [`MNASNet0_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet0_5.html#torchvision.models.MNASNet0_5_Weights "torchvision.models.MNASNet0_5_Weights") | 67.734 | 87.49 | 2.2M | 0.1 | [link](https://github.com/1e100/mnasnet_trainer) |' + id: totrans-87 prefs: [] type: TYPE_TB + zh: '| [`MNASNet0_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet0_5.html#torchvision.models.MNASNet0_5_Weights + "torchvision.models.MNASNet0_5_Weights") | 67.734 | 87.49 | 2.2M | 0.1 | [link](https://github.com/1e100/mnasnet_trainer) + |' - en: '| [`MNASNet0_75_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet0_75.html#torchvision.models.MNASNet0_75_Weights "torchvision.models.MNASNet0_75_Weights") | 71.18 | 90.496 | 3.2M | 0.21 | [link](https://github.com/pytorch/vision/pull/6019) |' + id: totrans-88 prefs: [] type: TYPE_TB + zh: '| [`MNASNet0_75_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet0_75.html#torchvision.models.MNASNet0_75_Weights + "torchvision.models.MNASNet0_75_Weights") | 71.18 | 90.496 | 3.2M | 0.21 | [link](https://github.com/pytorch/vision/pull/6019) + |' - en: '| [`MNASNet1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet1_0.html#torchvision.models.MNASNet1_0_Weights "torchvision.models.MNASNet1_0_Weights") | 73.456 | 91.51 | 4.4M | 0.31 | [link](https://github.com/1e100/mnasnet_trainer) |' + id: totrans-89 prefs: [] type: TYPE_TB + zh: '| [`MNASNet1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet1_0.html#torchvision.models.MNASNet1_0_Weights + "torchvision.models.MNASNet1_0_Weights") | 73.456 | 91.51 | 4.4M | 0.31 | [link](https://github.com/1e100/mnasnet_trainer) + |' - en: '| [`MNASNet1_3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet1_3.html#torchvision.models.MNASNet1_3_Weights "torchvision.models.MNASNet1_3_Weights") | 76.506 | 93.522 | 6.3M | 0.53 | [link](https://github.com/pytorch/vision/pull/6019) |' + id: totrans-90 prefs: [] type: TYPE_TB + zh: '| [`MNASNet1_3_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mnasnet1_3.html#torchvision.models.MNASNet1_3_Weights + "torchvision.models.MNASNet1_3_Weights") | 76.506 | 93.522 | 6.3M | 0.53 | [link](https://github.com/pytorch/vision/pull/6019) + |' - en: '| [`MaxVit_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.maxvit_t.html#torchvision.models.MaxVit_T_Weights "torchvision.models.MaxVit_T_Weights") | 83.7 | 96.722 | 30.9M | 5.56 | [link](https://github.com/pytorch/vision/tree/main/references/classification#maxvit) |' + id: totrans-91 prefs: [] type: TYPE_TB + zh: '| [`MaxVit_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.maxvit_t.html#torchvision.models.MaxVit_T_Weights + "torchvision.models.MaxVit_T_Weights") | 83.7 | 96.722 | 30.9M | 5.56 | [link](https://github.com/pytorch/vision/tree/main/references/classification#maxvit) + |' - en: '| [`MobileNet_V2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v2.html#torchvision.models.MobileNet_V2_Weights "torchvision.models.MobileNet_V2_Weights") | 71.878 | 90.286 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv2) |' + id: totrans-92 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v2.html#torchvision.models.MobileNet_V2_Weights + "torchvision.models.MobileNet_V2_Weights") | 71.878 | 90.286 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv2) + |' - en: '| [`MobileNet_V2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.mobilenet_v2.html#torchvision.models.MobileNet_V2_Weights "torchvision.models.MobileNet_V2_Weights") | 72.154 | 90.822 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-reg-tuning) |' + id: totrans-93 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.mobilenet_v2.html#torchvision.models.MobileNet_V2_Weights + "torchvision.models.MobileNet_V2_Weights") | 72.154 | 90.822 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-reg-tuning) + |' - en: '| [`MobileNet_V3_Large_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v3_large.html#torchvision.models.MobileNet_V3_Large_Weights "torchvision.models.MobileNet_V3_Large_Weights") | 74.042 | 91.34 | 5.5M | 0.22 | [link](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small) |' + id: totrans-94 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V3_Large_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v3_large.html#torchvision.models.MobileNet_V3_Large_Weights + "torchvision.models.MobileNet_V3_Large_Weights") | 74.042 | 91.34 | 5.5M | 0.22 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small) + |' - en: '| [`MobileNet_V3_Large_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.mobilenet_v3_large.html#torchvision.models.MobileNet_V3_Large_Weights "torchvision.models.MobileNet_V3_Large_Weights") | 75.274 | 92.566 | 5.5M | 0.22 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-reg-tuning) |' + id: totrans-95 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V3_Large_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.mobilenet_v3_large.html#torchvision.models.MobileNet_V3_Large_Weights + "torchvision.models.MobileNet_V3_Large_Weights") | 75.274 | 92.566 | 5.5M | 0.22 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe-with-reg-tuning) + |' - en: '| [`MobileNet_V3_Small_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v3_small.html#torchvision.models.MobileNet_V3_Small_Weights "torchvision.models.MobileNet_V3_Small_Weights") | 67.668 | 87.402 | 2.5M | 0.06 | [link](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small) |' + id: totrans-96 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V3_Small_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.mobilenet_v3_small.html#torchvision.models.MobileNet_V3_Small_Weights + "torchvision.models.MobileNet_V3_Small_Weights") | 67.668 | 87.402 | 2.5M | 0.06 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small) + |' - en: '| [`RegNet_X_16GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_16gf.html#torchvision.models.RegNet_X_16GF_Weights "torchvision.models.RegNet_X_16GF_Weights") | 80.058 | 94.944 | 54.3M | 15.94 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) |' + id: totrans-97 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_16GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_16gf.html#torchvision.models.RegNet_X_16GF_Weights + "torchvision.models.RegNet_X_16GF_Weights") | 80.058 | 94.944 | 54.3M | 15.94 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) + |' - en: '| [`RegNet_X_16GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_16gf.html#torchvision.models.RegNet_X_16GF_Weights "torchvision.models.RegNet_X_16GF_Weights") | 82.716 | 96.196 | 54.3M | 15.94 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-98 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_16GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_16gf.html#torchvision.models.RegNet_X_16GF_Weights + "torchvision.models.RegNet_X_16GF_Weights") | 82.716 | 96.196 | 54.3M | 15.94 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_X_1_6GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_1_6gf.html#torchvision.models.RegNet_X_1_6GF_Weights "torchvision.models.RegNet_X_1_6GF_Weights") | 77.04 | 93.44 | 9.2M | 1.6 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-99 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_1_6GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_1_6gf.html#torchvision.models.RegNet_X_1_6GF_Weights + "torchvision.models.RegNet_X_1_6GF_Weights") | 77.04 | 93.44 | 9.2M | 1.6 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_X_1_6GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_1_6gf.html#torchvision.models.RegNet_X_1_6GF_Weights "torchvision.models.RegNet_X_1_6GF_Weights") | 79.668 | 94.922 | 9.2M | 1.6 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' + id: totrans-100 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_1_6GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_1_6gf.html#torchvision.models.RegNet_X_1_6GF_Weights + "torchvision.models.RegNet_X_1_6GF_Weights") | 79.668 | 94.922 | 9.2M | 1.6 | + [链接](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' - en: '| [`RegNet_X_32GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_32gf.html#torchvision.models.RegNet_X_32GF_Weights "torchvision.models.RegNet_X_32GF_Weights") | 80.622 | 95.248 | 107.8M | 31.74 | [link](https://github.com/pytorch/vision/tree/main/references/classification#large-models) |' + id: totrans-101 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_32GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_32gf.html#torchvision.models.RegNet_X_32GF_Weights + "torchvision.models.RegNet_X_32GF_Weights") | 80.622 | 95.248 | 107.8M | 31.74 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#large-models) + |' - en: '| [`RegNet_X_32GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_32gf.html#torchvision.models.RegNet_X_32GF_Weights "torchvision.models.RegNet_X_32GF_Weights") | 83.014 | 96.288 | 107.8M | 31.74 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-102 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_32GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_32gf.html#torchvision.models.RegNet_X_32GF_Weights + "torchvision.models.RegNet_X_32GF_Weights") | 83.014 | 96.288 | 107.8M | 31.74 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_X_3_2GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_3_2gf.html#torchvision.models.RegNet_X_3_2GF_Weights "torchvision.models.RegNet_X_3_2GF_Weights") | 78.364 | 93.992 | 15.3M | 3.18 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) |' + id: totrans-103 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_3_2GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_3_2gf.html#torchvision.models.RegNet_X_3_2GF_Weights + "torchvision.models.RegNet_X_3_2GF_Weights") | 78.364 | 93.992 | 15.3M | 3.18 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) + |' - en: '| [`RegNet_X_3_2GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_3_2gf.html#torchvision.models.RegNet_X_3_2GF_Weights "torchvision.models.RegNet_X_3_2GF_Weights") | 81.196 | 95.43 | 15.3M | 3.18 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-104 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_3_2GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_3_2gf.html#torchvision.models.RegNet_X_3_2GF_Weights + "torchvision.models.RegNet_X_3_2GF_Weights") | 81.196 | 95.43 | 15.3M | 3.18 | + [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_X_400MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_400mf.html#torchvision.models.RegNet_X_400MF_Weights "torchvision.models.RegNet_X_400MF_Weights") | 72.834 | 90.95 | 5.5M | 0.41 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-105 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_400MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_400mf.html#torchvision.models.RegNet_X_400MF_Weights + "torchvision.models.RegNet_X_400MF_Weights") | 72.834 | 90.95 | 5.5M | 0.41 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_X_400MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_400mf.html#torchvision.models.RegNet_X_400MF_Weights "torchvision.models.RegNet_X_400MF_Weights") | 74.864 | 92.322 | 5.5M | 0.41 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' + id: totrans-106 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_400MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_400mf.html#torchvision.models.RegNet_X_400MF_Weights + "torchvision.models.RegNet_X_400MF_Weights") | 74.864 | 92.322 | 5.5M | 0.41 | + [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' - en: '| [`RegNet_X_800MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_800mf.html#torchvision.models.RegNet_X_800MF_Weights "torchvision.models.RegNet_X_800MF_Weights") | 75.212 | 92.348 | 7.3M | 0.8 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-107 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_800MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_800mf.html#torchvision.models.RegNet_X_800MF_Weights + "torchvision.models.RegNet_X_800MF_Weights") | 75.212 | 92.348 | 7.3M | 0.8 | + [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_X_800MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_800mf.html#torchvision.models.RegNet_X_800MF_Weights "torchvision.models.RegNet_X_800MF_Weights") | 77.522 | 93.826 | 7.3M | 0.8 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' + id: totrans-108 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_800MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_800mf.html#torchvision.models.RegNet_X_800MF_Weights + "torchvision.models.RegNet_X_800MF_Weights") | 77.522 | 93.826 | 7.3M | 0.8 | + [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' - en: '| [`RegNet_X_8GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_8gf.html#torchvision.models.RegNet_X_8GF_Weights "torchvision.models.RegNet_X_8GF_Weights") | 79.344 | 94.686 | 39.6M | 8 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) |' + id: totrans-109 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_8GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_x_8gf.html#torchvision.models.RegNet_X_8GF_Weights + "torchvision.models.RegNet_X_8GF_Weights") | 79.344 | 94.686 | 39.6M | 8 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) + |' - en: '| [`RegNet_X_8GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_8gf.html#torchvision.models.RegNet_X_8GF_Weights "torchvision.models.RegNet_X_8GF_Weights") | 81.682 | 95.678 | 39.6M | 8 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-110 prefs: [] type: TYPE_TB + zh: '| [`RegNet_X_8GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_x_8gf.html#torchvision.models.RegNet_X_8GF_Weights + "torchvision.models.RegNet_X_8GF_Weights") | 81.682 | 95.678 | 39.6M | 8 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) + |' - en: '| [`RegNet_Y_128GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_128gf.html#torchvision.models.RegNet_Y_128GF_Weights "torchvision.models.RegNet_Y_128GF_Weights") | 88.228 | 98.682 | 644.8M | 374.57 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-111 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_128GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_128gf.html#torchvision.models.RegNet_Y_128GF_Weights + "torchvision.models.RegNet_Y_128GF_Weights") | 88.228 | 98.682 | 644.8M | 374.57 + | [link](https://github.com/facebookresearch/SWAG) |' - en: '| [`RegNet_Y_128GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_128gf.html#torchvision.models.RegNet_Y_128GF_Weights "torchvision.models.RegNet_Y_128GF_Weights") | 86.068 | 97.844 | 644.8M | 127.52 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-112 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_128GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_128gf.html#torchvision.models.RegNet_Y_128GF_Weights + "torchvision.models.RegNet_Y_128GF_Weights") | 86.068 | 97.844 | 644.8M | 127.52 + | [link](https://github.com/pytorch/vision/pull/5793) |' - en: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights "torchvision.models.RegNet_Y_16GF_Weights") | 80.424 | 95.24 | 83.6M | 15.91 | [link](https://github.com/pytorch/vision/tree/main/references/classification#large-models) |' + id: totrans-113 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights + "torchvision.models.RegNet_Y_16GF_Weights") | 80.424 | 95.24 | 83.6M | 15.91 | + [link](https://github.com/pytorch/vision/tree/main/references/classification#large-models) + |' - en: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights "torchvision.models.RegNet_Y_16GF_Weights") | 82.886 | 96.328 | 83.6M | 15.91 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-114 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights + "torchvision.models.RegNet_Y_16GF_Weights") | 82.886 | 96.328 | 83.6M | 15.91 + | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights "torchvision.models.RegNet_Y_16GF_Weights") | 86.012 | 98.054 | 83.6M | 46.73 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-115 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights + "torchvision.models.RegNet_Y_16GF_Weights") | 86.012 | 98.054 | 83.6M | 46.73 + | [link](https://github.com/facebookresearch/SWAG) |' - en: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights "torchvision.models.RegNet_Y_16GF_Weights") | 83.976 | 97.244 | 83.6M | 15.91 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-116 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_16GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_16gf.html#torchvision.models.RegNet_Y_16GF_Weights + "torchvision.models.RegNet_Y_16GF_Weights") | 83.976 | 97.244 | 83.6M | 15.91 + | [link](https://github.com/pytorch/vision/pull/5793) |' - en: '| [`RegNet_Y_1_6GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_1_6gf.html#torchvision.models.RegNet_Y_1_6GF_Weights "torchvision.models.RegNet_Y_1_6GF_Weights") | 77.95 | 93.966 | 11.2M | 1.61 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-117 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_1_6GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_1_6gf.html#torchvision.models.RegNet_Y_1_6GF_Weights + "torchvision.models.RegNet_Y_1_6GF_Weights") | 77.95 | 93.966 | 11.2M | 1.61 | + [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_Y_1_6GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_1_6gf.html#torchvision.models.RegNet_Y_1_6GF_Weights "torchvision.models.RegNet_Y_1_6GF_Weights") | 80.876 | 95.444 | 11.2M | 1.61 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-118 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_1_6GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_1_6gf.html#torchvision.models.RegNet_Y_1_6GF_Weights + "torchvision.models.RegNet_Y_1_6GF_Weights") | 80.876 | 95.444 | 11.2M | 1.61 + | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights "torchvision.models.RegNet_Y_32GF_Weights") | 80.878 | 95.34 | 145.0M | 32.28 | [link](https://github.com/pytorch/vision/tree/main/references/classification#large-models) |' + id: totrans-119 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights + "torchvision.models.RegNet_Y_32GF_Weights") | 80.878 | 95.34 | 145.0M | 32.28 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#large-models) + |' - en: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights "torchvision.models.RegNet_Y_32GF_Weights") | 83.368 | 96.498 | 145.0M | 32.28 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-120 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights + "torchvision.models.RegNet_Y_32GF_Weights") | 83.368 | 96.498 | 145.0M | 32.28 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights "torchvision.models.RegNet_Y_32GF_Weights") | 86.838 | 98.362 | 145.0M | 94.83 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-121 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights + "torchvision.models.RegNet_Y_32GF_Weights") | 86.838 | 98.362 | 145.0M | 94.83 + | [链接](https://github.com/facebookresearch/SWAG) |' - en: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights "torchvision.models.RegNet_Y_32GF_Weights") | 84.622 | 97.48 | 145.0M | 32.28 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-122 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_32GF_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.regnet_y_32gf.html#torchvision.models.RegNet_Y_32GF_Weights + "torchvision.models.RegNet_Y_32GF_Weights") | 84.622 | 97.48 | 145.0M | 32.28 + | [链接](https://github.com/pytorch/vision/pull/5793) |' - en: '| [`RegNet_Y_3_2GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_3_2gf.html#torchvision.models.RegNet_Y_3_2GF_Weights "torchvision.models.RegNet_Y_3_2GF_Weights") | 78.948 | 94.576 | 19.4M | 3.18 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) |' + id: totrans-123 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_3_2GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_3_2gf.html#torchvision.models.RegNet_Y_3_2GF_Weights + "torchvision.models.RegNet_Y_3_2GF_Weights") | 78.948 | 94.576 | 19.4M | 3.18 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) + |' - en: '| [`RegNet_Y_3_2GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_3_2gf.html#torchvision.models.RegNet_Y_3_2GF_Weights "torchvision.models.RegNet_Y_3_2GF_Weights") | 81.982 | 95.972 | 19.4M | 3.18 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-124 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_3_2GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_3_2gf.html#torchvision.models.RegNet_Y_3_2GF_Weights + "torchvision.models.RegNet_Y_3_2GF_Weights") | 81.982 | 95.972 | 19.4M | 3.18 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_400MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_400mf.html#torchvision.models.RegNet_Y_400MF_Weights "torchvision.models.RegNet_Y_400MF_Weights") | 74.046 | 91.716 | 4.3M | 0.4 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-125 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_400MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_400mf.html#torchvision.models.RegNet_Y_400MF_Weights + "torchvision.models.RegNet_Y_400MF_Weights") | 74.046 | 91.716 | 4.3M | 0.4 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_Y_400MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_400mf.html#torchvision.models.RegNet_Y_400MF_Weights "torchvision.models.RegNet_Y_400MF_Weights") | 75.804 | 92.742 | 4.3M | 0.4 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-126 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_400MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_400mf.html#torchvision.models.RegNet_Y_400MF_Weights + "torchvision.models.RegNet_Y_400MF_Weights") | 75.804 | 92.742 | 4.3M | 0.4 | + [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_800MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_800mf.html#torchvision.models.RegNet_Y_800MF_Weights "torchvision.models.RegNet_Y_800MF_Weights") | 76.42 | 93.136 | 6.4M | 0.83 | [link](https://github.com/pytorch/vision/tree/main/references/classification#small-models) |' + id: totrans-127 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_800MF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_800mf.html#torchvision.models.RegNet_Y_800MF_Weights + "torchvision.models.RegNet_Y_800MF_Weights") | 76.42 | 93.136 | 6.4M | 0.83 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#small-models) + |' - en: '| [`RegNet_Y_800MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_800mf.html#torchvision.models.RegNet_Y_800MF_Weights "torchvision.models.RegNet_Y_800MF_Weights") | 78.828 | 94.502 | 6.4M | 0.83 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-128 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_800MF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_800mf.html#torchvision.models.RegNet_Y_800MF_Weights + "torchvision.models.RegNet_Y_800MF_Weights") | 78.828 | 94.502 | 6.4M | 0.83 | + [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`RegNet_Y_8GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_8gf.html#torchvision.models.RegNet_Y_8GF_Weights "torchvision.models.RegNet_Y_8GF_Weights") | 80.032 | 95.048 | 39.4M | 8.47 | [link](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) |' + id: totrans-129 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_8GF_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.regnet_y_8gf.html#torchvision.models.RegNet_Y_8GF_Weights + "torchvision.models.RegNet_Y_8GF_Weights") | 80.032 | 95.048 | 39.4M | 8.47 | + [链接](https://github.com/pytorch/vision/tree/main/references/classification#medium-models) + |' - en: '| [`RegNet_Y_8GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_8gf.html#torchvision.models.RegNet_Y_8GF_Weights "torchvision.models.RegNet_Y_8GF_Weights") | 82.828 | 96.33 | 39.4M | 8.47 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-130 prefs: [] type: TYPE_TB + zh: '| [`RegNet_Y_8GF_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.regnet_y_8gf.html#torchvision.models.RegNet_Y_8GF_Weights + "torchvision.models.RegNet_Y_8GF_Weights") | 82.828 | 96.33 | 39.4M | 8.47 | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) + |' - en: '| [`ResNeXt101_32X8D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext101_32x8d.html#torchvision.models.ResNeXt101_32X8D_Weights "torchvision.models.ResNeXt101_32X8D_Weights") | 79.312 | 94.526 | 88.8M | 16.41 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnext) |' + id: totrans-131 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_32X8D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext101_32x8d.html#torchvision.models.ResNeXt101_32X8D_Weights + "torchvision.models.ResNeXt101_32X8D_Weights") | 79.312 | 94.526 | 88.8M | 16.41 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnext) + |' - en: '| [`ResNeXt101_32X8D_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnext101_32x8d.html#torchvision.models.ResNeXt101_32X8D_Weights "torchvision.models.ResNeXt101_32X8D_Weights") | 82.834 | 96.228 | 88.8M | 16.41 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' + id: totrans-132 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_32X8D_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnext101_32x8d.html#torchvision.models.ResNeXt101_32X8D_Weights + "torchvision.models.ResNeXt101_32X8D_Weights") | 82.834 | 96.228 | 88.8M | 16.41 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' - en: '| [`ResNeXt101_64X4D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext101_64x4d.html#torchvision.models.ResNeXt101_64X4D_Weights "torchvision.models.ResNeXt101_64X4D_Weights") | 83.246 | 96.454 | 83.5M | 15.46 | [link](https://github.com/pytorch/vision/pull/5935) |' + id: totrans-133 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_64X4D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext101_64x4d.html#torchvision.models.ResNeXt101_64X4D_Weights + "torchvision.models.ResNeXt101_64X4D_Weights") | 83.246 | 96.454 | 83.5M | 15.46 + | [链接](https://github.com/pytorch/vision/pull/5935) |' - en: '| [`ResNeXt50_32X4D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext50_32x4d.html#torchvision.models.ResNeXt50_32X4D_Weights "torchvision.models.ResNeXt50_32X4D_Weights") | 77.618 | 93.698 | 25.0M | 4.23 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnext) |' + id: totrans-134 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt50_32X4D_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnext50_32x4d.html#torchvision.models.ResNeXt50_32X4D_Weights + "torchvision.models.ResNeXt50_32X4D_Weights") | 77.618 | 93.698 | 25.0M | 4.23 + | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnext) + |' - en: '| [`ResNeXt50_32X4D_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnext50_32x4d.html#torchvision.models.ResNeXt50_32X4D_Weights "torchvision.models.ResNeXt50_32X4D_Weights") | 81.198 | 95.34 | 25.0M | 4.23 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-135 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt50_32X4D_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnext50_32x4d.html#torchvision.models.ResNeXt50_32X4D_Weights + "torchvision.models.ResNeXt50_32X4D_Weights") | 81.198 | 95.34 | 25.0M | 4.23 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`ResNet101_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet101.html#torchvision.models.ResNet101_Weights "torchvision.models.ResNet101_Weights") | 77.374 | 93.546 | 44.5M | 7.8 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnet) |' + id: totrans-136 prefs: [] type: TYPE_TB + zh: '| [`ResNet101_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet101.html#torchvision.models.ResNet101_Weights + "torchvision.models.ResNet101_Weights") | 77.374 | 93.546 | 44.5M | 7.8 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnet) + |' - en: '| [`ResNet101_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet101.html#torchvision.models.ResNet101_Weights "torchvision.models.ResNet101_Weights") | 81.886 | 95.78 | 44.5M | 7.8 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-137 prefs: [] type: TYPE_TB + zh: '| [`ResNet101_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet101.html#torchvision.models.ResNet101_Weights + "torchvision.models.ResNet101_Weights") | 81.886 | 95.78 | 44.5M | 7.8 | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) + |' - en: '| [`ResNet152_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet152.html#torchvision.models.ResNet152_Weights "torchvision.models.ResNet152_Weights") | 78.312 | 94.046 | 60.2M | 11.51 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnet) |' + id: totrans-138 prefs: [] type: TYPE_TB + zh: '| [`ResNet152_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet152.html#torchvision.models.ResNet152_Weights + "torchvision.models.ResNet152_Weights") | 78.312 | 94.046 | 60.2M | 11.51 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnet) + |' - en: '| [`ResNet152_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet152.html#torchvision.models.ResNet152_Weights "torchvision.models.ResNet152_Weights") | 82.284 | 96.002 | 60.2M | 11.51 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-139 prefs: [] type: TYPE_TB + zh: '| [`ResNet152_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet152.html#torchvision.models.ResNet152_Weights + "torchvision.models.ResNet152_Weights") | 82.284 | 96.002 | 60.2M | 11.51 | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) + |' - en: '| [`ResNet18_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet18.html#torchvision.models.ResNet18_Weights "torchvision.models.ResNet18_Weights") | 69.758 | 89.078 | 11.7M | 1.81 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnet) |' + id: totrans-140 prefs: [] type: TYPE_TB + zh: '| [`ResNet18_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet18.html#torchvision.models.ResNet18_Weights + "torchvision.models.ResNet18_Weights") | 69.758 | 89.078 | 11.7M | 1.81 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnet) + |' - en: '| [`ResNet34_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet34.html#torchvision.models.ResNet34_Weights "torchvision.models.ResNet34_Weights") | 73.314 | 91.42 | 21.8M | 3.66 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnet) |' + id: totrans-141 prefs: [] type: TYPE_TB + zh: '| [`ResNet34_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet34.html#torchvision.models.ResNet34_Weights + "torchvision.models.ResNet34_Weights") | 73.314 | 91.42 | 21.8M | 3.66 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnet) + |' - en: '| [`ResNet50_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet50.html#torchvision.models.ResNet50_Weights "torchvision.models.ResNet50_Weights") | 76.13 | 92.862 | 25.6M | 4.09 | [link](https://github.com/pytorch/vision/tree/main/references/classification#resnet) |' + id: totrans-142 prefs: [] type: TYPE_TB + zh: '| [`ResNet50_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.resnet50.html#torchvision.models.ResNet50_Weights + "torchvision.models.ResNet50_Weights") | 76.13 | 92.862 | 25.6M | 4.09 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#resnet) + |' - en: '| [`ResNet50_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet50.html#torchvision.models.ResNet50_Weights "torchvision.models.ResNet50_Weights") | 80.858 | 95.434 | 25.6M | 4.09 | [link](https://github.com/pytorch/vision/issues/3995#issuecomment-1013906621) |' + id: totrans-143 prefs: [] type: TYPE_TB + zh: '| [`ResNet50_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.resnet50.html#torchvision.models.ResNet50_Weights + "torchvision.models.ResNet50_Weights") | 80.858 | 95.434 | 25.6M | 4.09 | [链接](https://github.com/pytorch/vision/issues/3995#issuecomment-1013906621) + |' - en: '| [`ShuffleNet_V2_X0_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x0_5.html#torchvision.models.ShuffleNet_V2_X0_5_Weights "torchvision.models.ShuffleNet_V2_X0_5_Weights") | 60.552 | 81.746 | 1.4M | 0.04 | [link](https://github.com/ericsun99/Shufflenet-v2-Pytorch) |' + id: totrans-144 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X0_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x0_5.html#torchvision.models.ShuffleNet_V2_X0_5_Weights + "torchvision.models.ShuffleNet_V2_X0_5_Weights") | 60.552 | 81.746 | 1.4M | 0.04 + | [链接](https://github.com/ericsun99/Shufflenet-v2-Pytorch) |' - en: '| [`ShuffleNet_V2_X1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x1_0.html#torchvision.models.ShuffleNet_V2_X1_0_Weights "torchvision.models.ShuffleNet_V2_X1_0_Weights") | 69.362 | 88.316 | 2.3M | 0.14 | [link](https://github.com/ericsun99/Shufflenet-v2-Pytorch) |' + id: totrans-145 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x1_0.html#torchvision.models.ShuffleNet_V2_X1_0_Weights + "torchvision.models.ShuffleNet_V2_X1_0_Weights") | 69.362 | 88.316 | 2.3M | 0.14 + | [链接](https://github.com/ericsun99/Shufflenet-v2-Pytorch) |' - en: '| [`ShuffleNet_V2_X1_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x1_5.html#torchvision.models.ShuffleNet_V2_X1_5_Weights "torchvision.models.ShuffleNet_V2_X1_5_Weights") | 72.996 | 91.086 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/pull/5906) |' + id: totrans-146 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X1_5_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x1_5.html#torchvision.models.ShuffleNet_V2_X1_5_Weights + "torchvision.models.ShuffleNet_V2_X1_5_Weights") | 72.996 | 91.086 | 3.5M | 0.3 + | [链接](https://github.com/pytorch/vision/pull/5906) |' - en: '| [`ShuffleNet_V2_X2_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x2_0.html#torchvision.models.ShuffleNet_V2_X2_0_Weights "torchvision.models.ShuffleNet_V2_X2_0_Weights") | 76.23 | 93.006 | 7.4M | 0.58 | [link](https://github.com/pytorch/vision/pull/5906) |' + id: totrans-147 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X2_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.shufflenet_v2_x2_0.html#torchvision.models.ShuffleNet_V2_X2_0_Weights + "torchvision.models.ShuffleNet_V2_X2_0_Weights") | 76.23 | 93.006 | 7.4M | 0.58 + | [链接](https://github.com/pytorch/vision/pull/5906) |' - en: '| [`SqueezeNet1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.squeezenet1_0.html#torchvision.models.SqueezeNet1_0_Weights "torchvision.models.SqueezeNet1_0_Weights") | 58.092 | 80.42 | 1.2M | 0.82 | [link](https://github.com/pytorch/vision/pull/49#issuecomment-277560717) |' + id: totrans-148 prefs: [] type: TYPE_TB + zh: '| [`SqueezeNet1_0_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.squeezenet1_0.html#torchvision.models.SqueezeNet1_0_Weights + "torchvision.models.SqueezeNet1_0_Weights") | 58.092 | 80.42 | 1.2M | 0.82 | [链接](https://github.com/pytorch/vision/pull/49#issuecomment-277560717) + |' - en: '| [`SqueezeNet1_1_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.squeezenet1_1.html#torchvision.models.SqueezeNet1_1_Weights "torchvision.models.SqueezeNet1_1_Weights") | 58.178 | 80.624 | 1.2M | 0.35 | [link](https://github.com/pytorch/vision/pull/49#issuecomment-277560717) |' + id: totrans-149 prefs: [] type: TYPE_TB + zh: '| [`SqueezeNet1_1_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.squeezenet1_1.html#torchvision.models.SqueezeNet1_1_Weights + "torchvision.models.SqueezeNet1_1_Weights") | 58.178 | 80.624 | 1.2M | 0.35 | + [链接](https://github.com/pytorch/vision/pull/49#issuecomment-277560717) |' - en: '| [`Swin_B_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_b.html#torchvision.models.Swin_B_Weights "torchvision.models.Swin_B_Weights") | 83.582 | 96.64 | 87.8M | 15.43 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) |' + id: totrans-150 prefs: [] type: TYPE_TB + zh: '| [`Swin_B_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_b.html#torchvision.models.Swin_B_Weights + "torchvision.models.Swin_B_Weights") | 83.582 | 96.64 | 87.8M | 15.43 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) + |' - en: '| [`Swin_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_s.html#torchvision.models.Swin_S_Weights "torchvision.models.Swin_S_Weights") | 83.196 | 96.36 | 49.6M | 8.74 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) |' + id: totrans-151 prefs: [] type: TYPE_TB + zh: '| [`Swin_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_s.html#torchvision.models.Swin_S_Weights + "torchvision.models.Swin_S_Weights") | 83.196 | 96.36 | 49.6M | 8.74 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) + |' - en: '| [`Swin_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_t.html#torchvision.models.Swin_T_Weights "torchvision.models.Swin_T_Weights") | 81.474 | 95.776 | 28.3M | 4.49 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) |' + id: totrans-152 prefs: [] type: TYPE_TB + zh: '| [`Swin_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_t.html#torchvision.models.Swin_T_Weights + "torchvision.models.Swin_T_Weights") | 81.474 | 95.776 | 28.3M | 4.49 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer) + |' - en: '| [`Swin_V2_B_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_b.html#torchvision.models.Swin_V2_B_Weights "torchvision.models.Swin_V2_B_Weights") | 84.112 | 96.864 | 87.9M | 20.32 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) |' + id: totrans-153 prefs: [] type: TYPE_TB + zh: '| [`Swin_V2_B_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_b.html#torchvision.models.Swin_V2_B_Weights + "torchvision.models.Swin_V2_B_Weights") | 84.112 | 96.864 | 87.9M | 20.32 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) + |' - en: '| [`Swin_V2_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_s.html#torchvision.models.Swin_V2_S_Weights "torchvision.models.Swin_V2_S_Weights") | 83.712 | 96.816 | 49.7M | 11.55 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) |' + id: totrans-154 prefs: [] type: TYPE_TB + zh: '| [`Swin_V2_S_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_s.html#torchvision.models.Swin_V2_S_Weights + "torchvision.models.Swin_V2_S_Weights") | 83.712 | 96.816 | 49.7M | 11.55 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) + |' - en: '| [`Swin_V2_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_t.html#torchvision.models.Swin_V2_T_Weights "torchvision.models.Swin_V2_T_Weights") | 82.072 | 96.132 | 28.4M | 5.94 | [link](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) |' + id: totrans-155 prefs: [] type: TYPE_TB + zh: '| [`Swin_V2_T_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.swin_v2_t.html#torchvision.models.Swin_V2_T_Weights + "torchvision.models.Swin_V2_T_Weights") | 82.072 | 96.132 | 28.4M | 5.94 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#swintransformer-v2) + |' - en: '| [`VGG11_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg11_bn.html#torchvision.models.VGG11_BN_Weights "torchvision.models.VGG11_BN_Weights") | 70.37 | 89.81 | 132.9M | 7.61 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-156 prefs: [] type: TYPE_TB + zh: '| [`VGG11_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg11_bn.html#torchvision.models.VGG11_BN_Weights + "torchvision.models.VGG11_BN_Weights") | 70.37 | 89.81 | 132.9M | 7.61 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG11_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg11.html#torchvision.models.VGG11_Weights "torchvision.models.VGG11_Weights") | 69.02 | 88.628 | 132.9M | 7.61 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-157 prefs: [] type: TYPE_TB + zh: '| [`VGG11_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg11.html#torchvision.models.VGG11_Weights + "torchvision.models.VGG11_Weights") | 69.02 | 88.628 | 132.9M | 7.61 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG13_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg13_bn.html#torchvision.models.VGG13_BN_Weights "torchvision.models.VGG13_BN_Weights") | 71.586 | 90.374 | 133.1M | 11.31 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-158 prefs: [] type: TYPE_TB + zh: '| [`VGG13_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg13_bn.html#torchvision.models.VGG13_BN_Weights + "torchvision.models.VGG13_BN_Weights") | 71.586 | 90.374 | 133.1M | 11.31 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG13_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg13.html#torchvision.models.VGG13_Weights "torchvision.models.VGG13_Weights") | 69.928 | 89.246 | 133.0M | 11.31 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-159 prefs: [] type: TYPE_TB + zh: '| [`VGG13_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg13.html#torchvision.models.VGG13_Weights + "torchvision.models.VGG13_Weights") | 69.928 | 89.246 | 133.0M | 11.31 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG16_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg16_bn.html#torchvision.models.VGG16_BN_Weights "torchvision.models.VGG16_BN_Weights") | 73.36 | 91.516 | 138.4M | 15.47 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-160 prefs: [] type: TYPE_TB + zh: '| [`VGG16_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg16_bn.html#torchvision.models.VGG16_BN_Weights + "torchvision.models.VGG16_BN_Weights") | 73.36 | 91.516 | 138.4M | 15.47 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg16.html#torchvision.models.VGG16_Weights "torchvision.models.VGG16_Weights") | 71.592 | 90.382 | 138.4M | 15.47 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-161 prefs: [] type: TYPE_TB + zh: '| [`VGG16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg16.html#torchvision.models.VGG16_Weights + "torchvision.models.VGG16_Weights") | 71.592 | 90.382 | 138.4M | 15.47 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG16_Weights.IMAGENET1K_FEATURES`](models/generated/torchvision.models.vgg16.html#torchvision.models.VGG16_Weights "torchvision.models.VGG16_Weights") | nan | nan | 138.4M | 15.47 | [link](https://github.com/amdegroot/ssd.pytorch#training-ssd) |' + id: totrans-162 prefs: [] type: TYPE_TB + zh: '| [`VGG16_Weights.IMAGENET1K_FEATURES`](models/generated/torchvision.models.vgg16.html#torchvision.models.VGG16_Weights + "torchvision.models.VGG16_Weights") | nan | nan | 138.4M | 15.47 | [链接](https://github.com/amdegroot/ssd.pytorch#training-ssd) + |' - en: '| [`VGG19_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg19_bn.html#torchvision.models.VGG19_BN_Weights "torchvision.models.VGG19_BN_Weights") | 74.218 | 91.842 | 143.7M | 19.63 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-163 prefs: [] type: TYPE_TB + zh: '| [`VGG19_BN_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg19_bn.html#torchvision.models.VGG19_BN_Weights + "torchvision.models.VGG19_BN_Weights") | 74.218 | 91.842 | 143.7M | 19.63 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`VGG19_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg19.html#torchvision.models.VGG19_Weights "torchvision.models.VGG19_Weights") | 72.376 | 90.876 | 143.7M | 19.63 | [link](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) |' + id: totrans-164 prefs: [] type: TYPE_TB + zh: '| [`VGG19_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vgg19.html#torchvision.models.VGG19_Weights + "torchvision.models.VGG19_Weights") | 72.376 | 90.876 | 143.7M | 19.63 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg) + |' - en: '| [`ViT_B_16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights "torchvision.models.ViT_B_16_Weights") | 81.072 | 95.318 | 86.6M | 17.56 | [link](https://github.com/pytorch/vision/tree/main/references/classification#vit_b_16) |' + id: totrans-165 prefs: [] type: TYPE_TB + zh: '| [`ViT_B_16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights + "torchvision.models.ViT_B_16_Weights") | 81.072 | 95.318 | 86.6M | 17.56 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#vit_b_16) + |' - en: '| [`ViT_B_16_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights "torchvision.models.ViT_B_16_Weights") | 85.304 | 97.65 | 86.9M | 55.48 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-166 prefs: [] type: TYPE_TB + zh: '| [`ViT_B_16_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights + "torchvision.models.ViT_B_16_Weights") | 85.304 | 97.65 | 86.9M | 55.48 | [链接](https://github.com/facebookresearch/SWAG) + |' - en: '| [`ViT_B_16_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights "torchvision.models.ViT_B_16_Weights") | 81.886 | 96.18 | 86.6M | 17.56 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-167 prefs: [] type: TYPE_TB + zh: '| [`ViT_B_16_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_b_16.html#torchvision.models.ViT_B_16_Weights + "torchvision.models.ViT_B_16_Weights") | 81.886 | 96.18 | 86.6M | 17.56 | [链接](https://github.com/pytorch/vision/pull/5793) + |' - en: '| [`ViT_B_32_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_b_32.html#torchvision.models.ViT_B_32_Weights "torchvision.models.ViT_B_32_Weights") | 75.912 | 92.466 | 88.2M | 4.41 | [link](https://github.com/pytorch/vision/tree/main/references/classification#vit_b_32) |' + id: totrans-168 prefs: [] type: TYPE_TB + zh: '| [`ViT_B_32_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_b_32.html#torchvision.models.ViT_B_32_Weights + "torchvision.models.ViT_B_32_Weights") | 75.912 | 92.466 | 88.2M | 4.41 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#vit_b_32) + |' - en: '| [`ViT_H_14_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_h_14.html#torchvision.models.ViT_H_14_Weights "torchvision.models.ViT_H_14_Weights") | 88.552 | 98.694 | 633.5M | 1016.72 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-169 prefs: [] type: TYPE_TB + zh: '| [`ViT_H_14_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_h_14.html#torchvision.models.ViT_H_14_Weights + "torchvision.models.ViT_H_14_Weights") | 88.552 | 98.694 | 633.5M | 1016.72 | + [链接](https://github.com/facebookresearch/SWAG) |' - en: '| [`ViT_H_14_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_h_14.html#torchvision.models.ViT_H_14_Weights "torchvision.models.ViT_H_14_Weights") | 85.708 | 97.73 | 632.0M | 167.29 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-170 prefs: [] type: TYPE_TB + zh: '| [`ViT_H_14_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_h_14.html#torchvision.models.ViT_H_14_Weights + "torchvision.models.ViT_H_14_Weights") | 85.708 | 97.73 | 632.0M | 167.29 | [链接](https://github.com/pytorch/vision/pull/5793) + |' - en: '| [`ViT_L_16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights "torchvision.models.ViT_L_16_Weights") | 79.662 | 94.638 | 304.3M | 61.55 | [link](https://github.com/pytorch/vision/tree/main/references/classification#vit_l_16) |' + id: totrans-171 prefs: [] type: TYPE_TB + zh: '| [`ViT_L_16_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights + "torchvision.models.ViT_L_16_Weights") | 79.662 | 94.638 | 304.3M | 61.55 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#vit_l_16) + |' - en: '| [`ViT_L_16_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights "torchvision.models.ViT_L_16_Weights") | 88.064 | 98.512 | 305.2M | 361.99 | [link](https://github.com/facebookresearch/SWAG) |' + id: totrans-172 prefs: [] type: TYPE_TB + zh: '| [`ViT_L_16_Weights.IMAGENET1K_SWAG_E2E_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights + "torchvision.models.ViT_L_16_Weights") | 88.064 | 98.512 | 305.2M | 361.99 | [链接](https://github.com/facebookresearch/SWAG) + |' - en: '| [`ViT_L_16_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights "torchvision.models.ViT_L_16_Weights") | 85.146 | 97.422 | 304.3M | 61.55 | [link](https://github.com/pytorch/vision/pull/5793) |' + id: totrans-173 prefs: [] type: TYPE_TB + zh: '| [`ViT_L_16_Weights.IMAGENET1K_SWAG_LINEAR_V1`](models/generated/torchvision.models.vit_l_16.html#torchvision.models.ViT_L_16_Weights + "torchvision.models.ViT_L_16_Weights") | 85.146 | 97.422 | 304.3M | 61.55 | [链接](https://github.com/pytorch/vision/pull/5793) + |' - en: '| [`ViT_L_32_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_l_32.html#torchvision.models.ViT_L_32_Weights "torchvision.models.ViT_L_32_Weights") | 76.972 | 93.07 | 306.5M | 15.38 | [link](https://github.com/pytorch/vision/tree/main/references/classification#vit_l_32) |' + id: totrans-174 prefs: [] type: TYPE_TB + zh: '| [`ViT_L_32_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.vit_l_32.html#torchvision.models.ViT_L_32_Weights + "torchvision.models.ViT_L_32_Weights") | 76.972 | 93.07 | 306.5M | 15.38 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#vit_l_32) + |' - en: '| [`Wide_ResNet101_2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.wide_resnet101_2.html#torchvision.models.Wide_ResNet101_2_Weights "torchvision.models.Wide_ResNet101_2_Weights") | 78.848 | 94.284 | 126.9M | 22.75 | [link](https://github.com/pytorch/vision/pull/912#issue-445437439) |' + id: totrans-175 prefs: [] type: TYPE_TB + zh: '| [`Wide_ResNet101_2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.wide_resnet101_2.html#torchvision.models.Wide_ResNet101_2_Weights + "torchvision.models.Wide_ResNet101_2_Weights") | 78.848 | 94.284 | 126.9M | 22.75 + | [链接](https://github.com/pytorch/vision/pull/912#issue-445437439) |' - en: '| [`Wide_ResNet101_2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.wide_resnet101_2.html#torchvision.models.Wide_ResNet101_2_Weights "torchvision.models.Wide_ResNet101_2_Weights") | 82.51 | 96.02 | 126.9M | 22.75 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe) |' + id: totrans-176 prefs: [] type: TYPE_TB + zh: '| [`Wide_ResNet101_2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.wide_resnet101_2.html#torchvision.models.Wide_ResNet101_2_Weights + "torchvision.models.Wide_ResNet101_2_Weights") | 82.51 | 96.02 | 126.9M | 22.75 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe) |' - en: '| [`Wide_ResNet50_2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.wide_resnet50_2.html#torchvision.models.Wide_ResNet50_2_Weights "torchvision.models.Wide_ResNet50_2_Weights") | 78.468 | 94.086 | 68.9M | 11.4 | [link](https://github.com/pytorch/vision/pull/912#issue-445437439) |' + id: totrans-177 prefs: [] type: TYPE_TB + zh: '| [`Wide_ResNet50_2_Weights.IMAGENET1K_V1`](models/generated/torchvision.models.wide_resnet50_2.html#torchvision.models.Wide_ResNet50_2_Weights + "torchvision.models.Wide_ResNet50_2_Weights") | 78.468 | 94.086 | 68.9M | 11.4 + | [链接](https://github.com/pytorch/vision/pull/912#issue-445437439) |' - en: '| [`Wide_ResNet50_2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.wide_resnet50_2.html#torchvision.models.Wide_ResNet50_2_Weights "torchvision.models.Wide_ResNet50_2_Weights") | 81.602 | 95.758 | 68.9M | 11.4 | [link](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' + id: totrans-178 prefs: [] type: TYPE_TB + zh: '| [`Wide_ResNet50_2_Weights.IMAGENET1K_V2`](models/generated/torchvision.models.wide_resnet50_2.html#torchvision.models.Wide_ResNet50_2_Weights + "torchvision.models.Wide_ResNet50_2_Weights") | 81.602 | 95.758 | 68.9M | 11.4 + | [链接](https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres) |' - en: Quantized models[](#quantized-models "Permalink to this heading") + id: totrans-179 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 量化模型[](#quantized-models "跳转到此标题") - en: 'The following architectures provide support for INT8 quantized models, with or without pre-trained weights:' + id: totrans-180 prefs: [] type: TYPE_NORMAL + zh: 以下架构支持带有或不带预训练权重的INT8量化模型: - en: '[Quantized GoogLeNet](models/googlenet_quant.html)' + id: totrans-181 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的GoogLeNet](models/googlenet_quant.html)' - en: '[Quantized InceptionV3](models/inception_quant.html)' + id: totrans-182 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的InceptionV3](models/inception_quant.html)' - en: '[Quantized MobileNet V2](models/mobilenetv2_quant.html)' + id: totrans-183 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的MobileNet V2](models/mobilenetv2_quant.html)' - en: '[Quantized MobileNet V3](models/mobilenetv3_quant.html)' + id: totrans-184 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的MobileNet V3](models/mobilenetv3_quant.html)' - en: '[Quantized ResNet](models/resnet_quant.html)' + id: totrans-185 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的ResNet](models/resnet_quant.html)' - en: '[Quantized ResNeXt](models/resnext_quant.html)' + id: totrans-186 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的ResNeXt](models/resnext_quant.html)' - en: '[Quantized ShuffleNet V2](models/shufflenetv2_quant.html)' + id: totrans-187 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[量化的ShuffleNet V2](models/shufflenetv2_quant.html)' - en: 'Here is an example of how to use the pre-trained quantized image classification models:' + id: totrans-188 prefs: [] type: TYPE_NORMAL + zh: 以下是如何使用预训练的量化图像分类模型的示例: - en: '[PRE8]' + id: totrans-189 prefs: [] type: TYPE_PRE + zh: '[PRE8]' - en: The classes of the pre-trained model outputs can be found at `weights.meta["categories"]`. + id: totrans-190 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在`weights.meta["categories"]`中找到。 - en: Table of all available quantized classification weights[](#table-of-all-available-quantized-classification-weights "Permalink to this heading") + id: totrans-191 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 所有可用的量化分类权重表[](#table-of-all-available-quantized-classification-weights "跳转到此标题") - en: 'Accuracies are reported on ImageNet-1K using single crops:' + id: totrans-192 prefs: [] type: TYPE_NORMAL + zh: 准确率是在ImageNet-1K上使用单个裁剪报告的: - en: '| **Weight** | **Acc@1** | **Acc@5** | **Params** | **GIPS** | **Recipe** |' + id: totrans-193 prefs: [] type: TYPE_TB + zh: '| **权重** | **准确率@1** | **准确率@5** | **参数** | **GIPS** | **配方** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-194 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`GoogLeNet_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.googlenet.html#torchvision.models.quantization.GoogLeNet_QuantizedWeights "torchvision.models.quantization.GoogLeNet_QuantizedWeights") | 69.826 | 89.404 | 6.6M | 1.5 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-195 prefs: [] type: TYPE_TB + zh: '| [`GoogLeNet_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.googlenet.html#torchvision.models.quantization.GoogLeNet_QuantizedWeights + "torchvision.models.quantization.GoogLeNet_QuantizedWeights") | 69.826 | 89.404 + | 6.6M | 1.5 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`Inception_V3_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.inception_v3.html#torchvision.models.quantization.Inception_V3_QuantizedWeights "torchvision.models.quantization.Inception_V3_QuantizedWeights") | 77.176 | 93.354 | 27.2M | 5.71 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-196 prefs: [] type: TYPE_TB + zh: '| [`Inception_V3_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.inception_v3.html#torchvision.models.quantization.Inception_V3_QuantizedWeights + "torchvision.models.quantization.Inception_V3_QuantizedWeights") | 77.176 | 93.354 + | 27.2M | 5.71 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`MobileNet_V2_QuantizedWeights.IMAGENET1K_QNNPACK_V1`](models/generated/torchvision.models.quantization.mobilenet_v2.html#torchvision.models.quantization.MobileNet_V2_QuantizedWeights "torchvision.models.quantization.MobileNet_V2_QuantizedWeights") | 71.658 | 90.15 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/tree/main/references/classification#qat-mobilenetv2) |' + id: totrans-197 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V2_QuantizedWeights.IMAGENET1K_QNNPACK_V1`](models/generated/torchvision.models.quantization.mobilenet_v2.html#torchvision.models.quantization.MobileNet_V2_QuantizedWeights + "torchvision.models.quantization.MobileNet_V2_QuantizedWeights") | 71.658 | 90.15 + | 3.5M | 0.3 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#qat-mobilenetv2) + |' - en: '| [`MobileNet_V3_Large_QuantizedWeights.IMAGENET1K_QNNPACK_V1`](models/generated/torchvision.models.quantization.mobilenet_v3_large.html#torchvision.models.quantization.MobileNet_V3_Large_QuantizedWeights "torchvision.models.quantization.MobileNet_V3_Large_QuantizedWeights") | 73.004 | 90.858 | 5.5M | 0.22 | [link](https://github.com/pytorch/vision/tree/main/references/classification#qat-mobilenetv3) |' + id: totrans-198 prefs: [] type: TYPE_TB + zh: '| [`MobileNet_V3_Large_QuantizedWeights.IMAGENET1K_QNNPACK_V1`](models/generated/torchvision.models.quantization.mobilenet_v3_large.html#torchvision.models.quantization.MobileNet_V3_Large_QuantizedWeights + "torchvision.models.quantization.MobileNet_V3_Large_QuantizedWeights") | 73.004 + | 90.858 | 5.5M | 0.22 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#qat-mobilenetv3) + |' - en: '| [`ResNeXt101_32X8D_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnext101_32x8d.html#torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights "torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights") | 78.986 | 94.48 | 88.8M | 16.41 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-199 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_32X8D_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnext101_32x8d.html#torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights + "torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights") | 78.986 + | 94.48 | 88.8M | 16.41 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ResNeXt101_32X8D_QuantizedWeights.IMAGENET1K_FBGEMM_V2`](models/generated/torchvision.models.quantization.resnext101_32x8d.html#torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights "torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights") | 82.574 | 96.132 | 88.8M | 16.41 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-200 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_32X8D_QuantizedWeights.IMAGENET1K_FBGEMM_V2`](models/generated/torchvision.models.quantization.resnext101_32x8d.html#torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights + "torchvision.models.quantization.ResNeXt101_32X8D_QuantizedWeights") | 82.574 + | 96.132 | 88.8M | 16.41 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ResNeXt101_64X4D_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnext101_64x4d.html#torchvision.models.quantization.ResNeXt101_64X4D_QuantizedWeights "torchvision.models.quantization.ResNeXt101_64X4D_QuantizedWeights") | 82.898 | 96.326 | 83.5M | 15.46 | [link](https://github.com/pytorch/vision/pull/5935) |' + id: totrans-201 prefs: [] type: TYPE_TB + zh: '| [`ResNeXt101_64X4D_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnext101_64x4d.html#torchvision.models.quantization.ResNeXt101_64X4D_QuantizedWeights + "torchvision.models.quantization.ResNeXt101_64X4D_QuantizedWeights") | 82.898 + | 96.326 | 83.5M | 15.46 | [链接](https://github.com/pytorch/vision/pull/5935) |' - en: '| [`ResNet18_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnet18.html#torchvision.models.quantization.ResNet18_QuantizedWeights "torchvision.models.quantization.ResNet18_QuantizedWeights") | 69.494 | 88.882 | 11.7M | 1.81 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-202 prefs: [] type: TYPE_TB + zh: '| [`ResNet18_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnet18.html#torchvision.models.quantization.ResNet18_QuantizedWeights + "torchvision.models.quantization.ResNet18_QuantizedWeights") | 69.494 | 88.882 + | 11.7M | 1.81 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ResNet50_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnet50.html#torchvision.models.quantization.ResNet50_QuantizedWeights "torchvision.models.quantization.ResNet50_QuantizedWeights") | 75.92 | 92.814 | 25.6M | 4.09 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-203 prefs: [] type: TYPE_TB + zh: '| [`ResNet50_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.resnet50.html#torchvision.models.quantization.ResNet50_QuantizedWeights + "torchvision.models.quantization.ResNet50_QuantizedWeights") | 75.92 | 92.814 + | 25.6M | 4.09 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ResNet50_QuantizedWeights.IMAGENET1K_FBGEMM_V2`](models/generated/torchvision.models.quantization.resnet50.html#torchvision.models.quantization.ResNet50_QuantizedWeights "torchvision.models.quantization.ResNet50_QuantizedWeights") | 80.282 | 94.976 | 25.6M | 4.09 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-204 prefs: [] type: TYPE_TB + zh: '| [`ResNet50_QuantizedWeights.IMAGENET1K_FBGEMM_V2`](models/generated/torchvision.models.quantization.resnet50.html#torchvision.models.quantization.ResNet50_QuantizedWeights + "torchvision.models.quantization.ResNet50_QuantizedWeights") | 80.282 | 94.976 + | 25.6M | 4.09 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ShuffleNet_V2_X0_5_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x0_5.html#torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights "torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights") | 57.972 | 79.78 | 1.4M | 0.04 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-205 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X0_5_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x0_5.html#torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights + "torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights") | 57.972 + | 79.78 | 1.4M | 0.04 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ShuffleNet_V2_X1_0_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x1_0.html#torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights "torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights") | 68.36 | 87.582 | 2.3M | 0.14 | [link](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) |' + id: totrans-206 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X1_0_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x1_0.html#torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights + "torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights") | 68.36 + | 87.582 | 2.3M | 0.14 | [链接](https://github.com/pytorch/vision/tree/main/references/classification#post-training-quantized-models) + |' - en: '| [`ShuffleNet_V2_X1_5_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x1_5.html#torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights "torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights") | 72.052 | 90.7 | 3.5M | 0.3 | [link](https://github.com/pytorch/vision/pull/5906) |' + id: totrans-207 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X1_5_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x1_5.html#torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights + "torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights") | 72.052 + | 90.7 | 3.5M | 0.3 | [链接](https://github.com/pytorch/vision/pull/5906) |' - en: '| [`ShuffleNet_V2_X2_0_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x2_0.html#torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights "torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights") | 75.354 | 92.488 | 7.4M | 0.58 | [link](https://github.com/pytorch/vision/pull/5906) |' + id: totrans-208 prefs: [] type: TYPE_TB + zh: '| [`ShuffleNet_V2_X2_0_QuantizedWeights.IMAGENET1K_FBGEMM_V1`](models/generated/torchvision.models.quantization.shufflenet_v2_x2_0.html#torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights + "torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights") | 75.354 + | 92.488 | 7.4M | 0.58 | [链接](https://github.com/pytorch/vision/pull/5906) |' - en: Semantic Segmentation[](#semantic-segmentation "Permalink to this heading") + id: totrans-209 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 语义分割[](#semantic-segmentation "跳转到此标题") - en: Warning + id: totrans-210 prefs: [] type: TYPE_NORMAL + zh: 警告 - en: The segmentation module is in Beta stage, and backward compatibility is not guaranteed. + id: totrans-211 prefs: [] type: TYPE_NORMAL + zh: 分割模块处于Beta阶段,不保证向后兼容性。 - en: 'The following semantic segmentation models are available, with or without pre-trained weights:' + id: totrans-212 prefs: [] type: TYPE_NORMAL + zh: 以下语义分割模型可用,带或不带预训练权重: - en: '[DeepLabV3](models/deeplabv3.html)' + id: totrans-213 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[DeepLabV3](models/deeplabv3.html)' - en: '[FCN](models/fcn.html)' + id: totrans-214 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[FCN](models/fcn.html)' - en: '[LRASPP](models/lraspp.html)' + id: totrans-215 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[LRASPP](models/lraspp.html)' - en: 'Here is an example of how to use the pre-trained semantic segmentation models:' + id: totrans-216 prefs: [] type: TYPE_NORMAL + zh: 以下是如何使用预训练语义分割模型的示例: - en: '[PRE9]' + id: totrans-217 prefs: [] type: TYPE_PRE + zh: '[PRE9]' - en: The classes of the pre-trained model outputs can be found at `weights.meta["categories"]`. The output format of the models is illustrated in [Semantic segmentation models](auto_examples/others/plot_visualization_utils.html#semantic-seg-output). + id: totrans-218 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在 `weights.meta["categories"]` 中找到。模型的输出格式在[语义分割模型](auto_examples/others/plot_visualization_utils.html#semantic-seg-output)中有说明。 - en: Table of all available semantic segmentation weights[](#table-of-all-available-semantic-segmentation-weights "Permalink to this heading") + id: totrans-219 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 所有可用语义分割权重的表格[](#table-of-all-available-semantic-segmentation-weights "跳转到此标题") - en: 'All models are evaluated a subset of COCO val2017, on the 20 categories that are present in the Pascal VOC dataset:' + id: totrans-220 prefs: [] type: TYPE_NORMAL + zh: 所有模型都是在COCO val2017的子集上评估的,涵盖了Pascal VOC数据集中存在的20个类别: - en: '| **Weight** | **Mean IoU** | **pixelwise Acc** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-221 prefs: [] type: TYPE_TB + zh: '| **权重** | **平均IoU** | **像素准确率** | **参数** | **GFLOPS** | **配置** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-222 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`DeepLabV3_MobileNet_V3_Large_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_mobilenet_v3_large.html#torchvision.models.segmentation.DeepLabV3_MobileNet_V3_Large_Weights "torchvision.models.segmentation.DeepLabV3_MobileNet_V3_Large_Weights") | 60.3 | 91.2 | 11.0M | 10.45 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_mobilenet_v3_large) |' + id: totrans-223 prefs: [] type: TYPE_TB + zh: '| [`DeepLabV3_MobileNet_V3_Large_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_mobilenet_v3_large.html#torchvision.models.segmentation.DeepLabV3_MobileNet_V3_Large_Weights + "torchvision.models.segmentation.DeepLabV3_MobileNet_V3_Large_Weights") | 60.3 + | 91.2 | 11.0M | 10.45 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_mobilenet_v3_large) + |' - en: '| [`DeepLabV3_ResNet101_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_resnet101.html#torchvision.models.segmentation.DeepLabV3_ResNet101_Weights "torchvision.models.segmentation.DeepLabV3_ResNet101_Weights") | 67.4 | 92.4 | 61.0M | 258.74 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#fcn_resnet101) |' + id: totrans-224 prefs: [] type: TYPE_TB + zh: '| [`DeepLabV3_ResNet101_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_resnet101.html#torchvision.models.segmentation.DeepLabV3_ResNet101_Weights + "torchvision.models.segmentation.DeepLabV3_ResNet101_Weights") | 67.4 | 92.4 | + 61.0M | 258.74 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#fcn_resnet101) + |' - en: '| [`DeepLabV3_ResNet50_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_resnet50.html#torchvision.models.segmentation.DeepLabV3_ResNet50_Weights "torchvision.models.segmentation.DeepLabV3_ResNet50_Weights") | 66.4 | 92.4 | 42.0M | 178.72 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_resnet50) |' + id: totrans-225 prefs: [] type: TYPE_TB + zh: '| [`DeepLabV3_ResNet50_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.deeplabv3_resnet50.html#torchvision.models.segmentation.DeepLabV3_ResNet50_Weights + "torchvision.models.segmentation.DeepLabV3_ResNet50_Weights") | 66.4 | 92.4 | + 42.0M | 178.72 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_resnet50) + |' - en: '| [`FCN_ResNet101_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.fcn_resnet101.html#torchvision.models.segmentation.FCN_ResNet101_Weights "torchvision.models.segmentation.FCN_ResNet101_Weights") | 63.7 | 91.9 | 54.3M | 232.74 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_resnet101) |' + id: totrans-226 prefs: [] type: TYPE_TB + zh: '| [`FCN_ResNet101_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.fcn_resnet101.html#torchvision.models.segmentation.FCN_ResNet101_Weights + "torchvision.models.segmentation.FCN_ResNet101_Weights") | 63.7 | 91.9 | 54.3M + | 232.74 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_resnet101) + |' - en: '| [`FCN_ResNet50_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.fcn_resnet50.html#torchvision.models.segmentation.FCN_ResNet50_Weights "torchvision.models.segmentation.FCN_ResNet50_Weights") | 60.5 | 91.4 | 35.3M | 152.72 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#fcn_resnet50) |' + id: totrans-227 prefs: [] type: TYPE_TB + zh: '| [`FCN_ResNet50_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.fcn_resnet50.html#torchvision.models.segmentation.FCN_ResNet50_Weights + "torchvision.models.segmentation.FCN_ResNet50_Weights") | 60.5 | 91.4 | 35.3M + | 152.72 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#fcn_resnet50) + |' - en: '| [`LRASPP_MobileNet_V3_Large_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.lraspp_mobilenet_v3_large.html#torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights "torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights") | 57.9 | 91.2 | 3.2M | 2.09 | [link](https://github.com/pytorch/vision/tree/main/references/segmentation#lraspp_mobilenet_v3_large) |' + id: totrans-228 prefs: [] type: TYPE_TB + zh: '| [`LRASPP_MobileNet_V3_Large_Weights.COCO_WITH_VOC_LABELS_V1`](models/generated/torchvision.models.segmentation.lraspp_mobilenet_v3_large.html#torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights + "torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights") | 57.9 | + 91.2 | 3.2M | 2.09 | [链接](https://github.com/pytorch/vision/tree/main/references/segmentation#lraspp_mobilenet_v3_large) + |' - en: '## Object Detection, Instance Segmentation and Person Keypoint Detection[](#object-detection-instance-segmentation-and-person-keypoint-detection "Permalink to this heading")' + id: totrans-229 prefs: [] type: TYPE_NORMAL + zh: '## 目标检测、实例分割和人体关键点检测[](#object-detection-instance-segmentation-and-person-keypoint-detection + "跳转到此标题")' - en: The pre-trained models for detection, instance segmentation and keypoint detection are initialized with the classification models in torchvision. The models expect a list of `Tensor[C, H, W]`. Check the constructor of the models for more information. + id: totrans-230 prefs: [] type: TYPE_NORMAL + zh: 检测、实例分割和关键点检测的预训练模型是使用torchvision中的分类模型初始化的。这些模型期望一个`Tensor[C, H, W]`列表。查看模型的构造函数以获取更多信息。 - en: Warning + id: totrans-231 prefs: [] type: TYPE_NORMAL + zh: 警告 - en: The detection module is in Beta stage, and backward compatibility is not guaranteed. + id: totrans-232 prefs: [] type: TYPE_NORMAL + zh: 检测模块处于Beta阶段,不保证向后兼容性。 - en: Object Detection[](#object-detection "Permalink to this heading") + id: totrans-233 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 目标检测[](#object-detection "跳转到此标题") - en: 'The following object detection models are available, with or without pre-trained weights:' + id: totrans-234 prefs: [] type: TYPE_NORMAL + zh: 以下目标检测模型可用,有或没有预训练权重: - en: '[Faster R-CNN](models/faster_rcnn.html)' + id: totrans-235 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Faster R-CNN](models/faster_rcnn.html)' - en: '[FCOS](models/fcos.html)' + id: totrans-236 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[FCOS](models/fcos.html)' - en: '[RetinaNet](models/retinanet.html)' + id: totrans-237 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[RetinaNet](models/retinanet.html)' - en: '[SSD](models/ssd.html)' + id: totrans-238 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[SSD](models/ssd.html)' - en: '[SSDlite](models/ssdlite.html)' + id: totrans-239 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[SSDlite](models/ssdlite.html)' - en: 'Here is an example of how to use the pre-trained object detection models:' + id: totrans-240 prefs: [] type: TYPE_NORMAL + zh: 以下是如何使用预训练目标检测模型的示例: - en: '[PRE10]' + id: totrans-241 prefs: [] type: TYPE_PRE + zh: '[PRE10]' - en: The classes of the pre-trained model outputs can be found at `weights.meta["categories"]`. For details on how to plot the bounding boxes of the models, you may refer to [Instance segmentation models](auto_examples/others/plot_visualization_utils.html#instance-seg-output). + id: totrans-242 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在`weights.meta["categories"]`中找到。有关如何绘制模型边界框的详细信息,您可以参考[实例分割模型](auto_examples/others/plot_visualization_utils.html#instance-seg-output)。 - en: Table of all available Object detection weights[](#table-of-all-available-object-detection-weights "Permalink to this heading") + id: totrans-243 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 所有可用的目标检测权重表[](#table-of-all-available-object-detection-weights "跳转到此标题") - en: 'Box MAPs are reported on COCO val2017:' + id: totrans-244 prefs: [] type: TYPE_NORMAL + zh: 在COCO val2017上报告了Box MAPs: - en: '| **Weight** | **Box MAP** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-245 prefs: [] type: TYPE_TB + zh: '| **权重** | **Box MAP** | **参数** | **GFLOPS** | **Recipe** |' - en: '| --- | --- | --- | --- | --- |' + id: totrans-246 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- |' - en: '| [`FCOS_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fcos_resnet50_fpn.html#torchvision.models.detection.FCOS_ResNet50_FPN_Weights "torchvision.models.detection.FCOS_ResNet50_FPN_Weights") | 39.2 | 32.3M | 128.21 | [link](https://github.com/pytorch/vision/tree/main/references/detection#fcos-resnet-50-fpn) |' + id: totrans-247 prefs: [] type: TYPE_TB + zh: '| [`FCOS_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fcos_resnet50_fpn.html#torchvision.models.detection.FCOS_ResNet50_FPN_Weights + "torchvision.models.detection.FCOS_ResNet50_FPN_Weights") | 39.2 | 32.3M | 128.21 + | [链接](https://github.com/pytorch/vision/tree/main/references/detection#fcos-resnet-50-fpn) + |' - en: '| [`FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn.html#torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights "torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights") | 22.8 | 19.4M | 0.72 | [link](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-mobilenetv3-large-320-fpn) |' + id: totrans-248 prefs: [] type: TYPE_TB + zh: '| [`FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn.html#torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights + "torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights") + | 22.8 | 19.4M | 0.72 | [链接](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-mobilenetv3-large-320-fpn) + |' - en: '| [`FasterRCNN_MobileNet_V3_Large_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn.html#torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights "torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights") | 32.8 | 19.4M | 4.49 | [link](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-mobilenetv3-large-fpn) |' + id: totrans-249 prefs: [] type: TYPE_TB + zh: '| [`FasterRCNN_MobileNet_V3_Large_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn.html#torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights + "torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights") | 32.8 + | 19.4M | 4.49 | [链接](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-mobilenetv3-large-fpn) + |' - en: '| [`FasterRCNN_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn_v2.html#torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights "torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights") | 46.7 | 43.7M | 280.37 | [link](https://github.com/pytorch/vision/pull/5763) |' + id: totrans-250 prefs: [] type: TYPE_TB + zh: '| [`FasterRCNN_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn_v2.html#torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights + "torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights") | 46.7 | 43.7M + | 280.37 | [链接](https://github.com/pytorch/vision/pull/5763) |' - en: '| [`FasterRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html#torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights "torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights") | 37 | 41.8M | 134.38 | [link](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-resnet-50-fpn) |' + id: totrans-251 prefs: [] type: TYPE_TB + zh: '| [`FasterRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html#torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights + "torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights") | 37 | 41.8M | + 134.38 | [链接](https://github.com/pytorch/vision/tree/main/references/detection#faster-r-cnn-resnet-50-fpn) + |' - en: '| [`RetinaNet_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.retinanet_resnet50_fpn_v2.html#torchvision.models.detection.RetinaNet_ResNet50_FPN_V2_Weights "torchvision.models.detection.RetinaNet_ResNet50_FPN_V2_Weights") | 41.5 | 38.2M | 152.24 | [link](https://github.com/pytorch/vision/pull/5756) |' + id: totrans-252 prefs: [] type: TYPE_TB + zh: '| [`RetinaNet_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.retinanet_resnet50_fpn_v2.html#torchvision.models.detection.RetinaNet_ResNet50_FPN_V2_Weights + "torchvision.models.detection.RetinaNet_ResNet50_FPN_V2_Weights") | 41.5 | 38.2M + | 152.24 | [link](https://github.com/pytorch/vision/pull/5756) |' - en: '| [`RetinaNet_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.retinanet_resnet50_fpn.html#torchvision.models.detection.RetinaNet_ResNet50_FPN_Weights "torchvision.models.detection.RetinaNet_ResNet50_FPN_Weights") | 36.4 | 34.0M | 151.54 | [link](https://github.com/pytorch/vision/tree/main/references/detection#retinanet) |' + id: totrans-253 prefs: [] type: TYPE_TB + zh: '| [`RetinaNet_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.retinanet_resnet50_fpn.html#torchvision.models.detection.RetinaNet_ResNet50_FPN_Weights + "torchvision.models.detection.RetinaNet_ResNet50_FPN_Weights") | 36.4 | 34.0M + | 151.54 | [link](https://github.com/pytorch/vision/tree/main/references/detection#retinanet) + |' - en: '| [`SSD300_VGG16_Weights.COCO_V1`](models/generated/torchvision.models.detection.ssd300_vgg16.html#torchvision.models.detection.SSD300_VGG16_Weights "torchvision.models.detection.SSD300_VGG16_Weights") | 25.1 | 35.6M | 34.86 | [link](https://github.com/pytorch/vision/tree/main/references/detection#ssd300-vgg16) |' + id: totrans-254 prefs: [] type: TYPE_TB + zh: '| [`SSD300_VGG16_Weights.COCO_V1`](models/generated/torchvision.models.detection.ssd300_vgg16.html#torchvision.models.detection.SSD300_VGG16_Weights + "torchvision.models.detection.SSD300_VGG16_Weights") | 25.1 | 35.6M | 34.86 | + [link](https://github.com/pytorch/vision/tree/main/references/detection#ssd300-vgg16) + |' - en: '| [`SSDLite320_MobileNet_V3_Large_Weights.COCO_V1`](models/generated/torchvision.models.detection.ssdlite320_mobilenet_v3_large.html#torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights "torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights") | 21.3 | 3.4M | 0.58 | [link](https://github.com/pytorch/vision/tree/main/references/detection#ssdlite320-mobilenetv3-large) |' + id: totrans-255 prefs: [] type: TYPE_TB + zh: '| [`SSDLite320_MobileNet_V3_Large_Weights.COCO_V1`](models/generated/torchvision.models.detection.ssdlite320_mobilenet_v3_large.html#torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights + "torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights") | 21.3 | + 3.4M | 0.58 | [link](https://github.com/pytorch/vision/tree/main/references/detection#ssdlite320-mobilenetv3-large) + |' - en: Instance Segmentation[](#instance-segmentation "Permalink to this heading") + id: totrans-256 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 实例分割[](#instance-segmentation "跳转到此标题") - en: 'The following instance segmentation models are available, with or without pre-trained weights:' + id: totrans-257 prefs: [] type: TYPE_NORMAL + zh: 以下是可用的实例分割模型,带或不带预训练权重: - en: '[Mask R-CNN](models/mask_rcnn.html)' + id: totrans-258 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Mask R-CNN](models/mask_rcnn.html)' - en: For details on how to plot the masks of the models, you may refer to [Instance segmentation models](auto_examples/others/plot_visualization_utils.html#instance-seg-output). + id: totrans-259 prefs: [] type: TYPE_NORMAL + zh: 有关如何绘制模型的蒙版的详细信息,您可以参考[实例分割模型](auto_examples/others/plot_visualization_utils.html#instance-seg-output)。 - en: Table of all available Instance segmentation weights[](#table-of-all-available-instance-segmentation-weights "Permalink to this heading") + id: totrans-260 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 所有可用实例分割权重的表格[](#table-of-all-available-instance-segmentation-weights "跳转到此标题") - en: 'Box and Mask MAPs are reported on COCO val2017:' + id: totrans-261 prefs: [] type: TYPE_NORMAL + zh: 在COCO val2017上报告了框和蒙版MAPs: - en: '| **Weight** | **Box MAP** | **Mask MAP** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-262 prefs: [] type: TYPE_TB + zh: '| **权重** | **框MAP** | **蒙版MAP** | **参数** | **GFLOPS** | **链接** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-263 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`MaskRCNN_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.maskrcnn_resnet50_fpn_v2.html#torchvision.models.detection.MaskRCNN_ResNet50_FPN_V2_Weights "torchvision.models.detection.MaskRCNN_ResNet50_FPN_V2_Weights") | 47.4 | 41.8 | 46.4M | 333.58 | [link](https://github.com/pytorch/vision/pull/5773) |' + id: totrans-264 prefs: [] type: TYPE_TB + zh: '| [`MaskRCNN_ResNet50_FPN_V2_Weights.COCO_V1`](models/generated/torchvision.models.detection.maskrcnn_resnet50_fpn_v2.html#torchvision.models.detection.MaskRCNN_ResNet50_FPN_V2_Weights + "torchvision.models.detection.MaskRCNN_ResNet50_FPN_V2_Weights") | 47.4 | 41.8 + | 46.4M | 333.58 | [link](https://github.com/pytorch/vision/pull/5773) |' - en: '| [`MaskRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.maskrcnn_resnet50_fpn.html#torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights "torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights") | 37.9 | 34.6 | 44.4M | 134.38 | [link](https://github.com/pytorch/vision/tree/main/references/detection#mask-r-cnn) |' + id: totrans-265 prefs: [] type: TYPE_TB + zh: '| [`MaskRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.maskrcnn_resnet50_fpn.html#torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights + "torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights") | 37.9 | 34.6 | + 44.4M | 134.38 | [link](https://github.com/pytorch/vision/tree/main/references/detection#mask-r-cnn) + |' - en: Keypoint Detection[](#keypoint-detection "Permalink to this heading") + id: totrans-266 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 关键点检测[](#keypoint-detection "跳转到此标题") - en: 'The following person keypoint detection models are available, with or without pre-trained weights:' + id: totrans-267 prefs: [] type: TYPE_NORMAL + zh: 以下是可用的人体关键点检测模型,带或不带预训练权重: - en: '[Keypoint R-CNN](models/keypoint_rcnn.html)' + id: totrans-268 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Keypoint R-CNN](models/keypoint_rcnn.html)' - en: The classes of the pre-trained model outputs can be found at `weights.meta["keypoint_names"]`. For details on how to plot the bounding boxes of the models, you may refer to [Visualizing keypoints](auto_examples/others/plot_visualization_utils.html#keypoint-output). + id: totrans-269 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在`weights.meta["keypoint_names"]`中找到。有关如何绘制模型的边界框的详细信息,您可以参考[可视化关键点](auto_examples/others/plot_visualization_utils.html#keypoint-output)。 - en: Table of all available Keypoint detection weights[](#table-of-all-available-keypoint-detection-weights "Permalink to this heading") + id: totrans-270 prefs: - PREF_H4 type: TYPE_NORMAL + zh: 所有可用关键点检测权重的表格[](#table-of-all-available-keypoint-detection-weights "跳转到此标题") - en: 'Box and Keypoint MAPs are reported on COCO val2017:' + id: totrans-271 prefs: [] type: TYPE_NORMAL + zh: 在COCO val2017上报告了框和关键点MAPs: - en: '| **Weight** | **Box MAP** | **Keypoint MAP** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-272 prefs: [] type: TYPE_TB + zh: '| **权重** | **框MAP** | **关键点MAP** | **参数** | **GFLOPS** | **链接** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-273 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`KeypointRCNN_ResNet50_FPN_Weights.COCO_LEGACY`](models/generated/torchvision.models.detection.keypointrcnn_resnet50_fpn.html#torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights "torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights") | 50.6 | 61.1 | 59.1M | 133.92 | [link](https://github.com/pytorch/vision/issues/1606) |' + id: totrans-274 prefs: [] type: TYPE_TB + zh: '| [`KeypointRCNN_ResNet50_FPN_Weights.COCO_LEGACY`](models/generated/torchvision.models.detection.keypointrcnn_resnet50_fpn.html#torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights + "torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights") | 50.6 | 61.1 + | 59.1M | 133.92 | [link](https://github.com/pytorch/vision/issues/1606) |' - en: '| [`KeypointRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.keypointrcnn_resnet50_fpn.html#torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights "torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights") | 54.6 | 65 | 59.1M | 137.42 | [link](https://github.com/pytorch/vision/tree/main/references/detection#keypoint-r-cnn) |' + id: totrans-275 prefs: [] type: TYPE_TB + zh: '| [`KeypointRCNN_ResNet50_FPN_Weights.COCO_V1`](models/generated/torchvision.models.detection.keypointrcnn_resnet50_fpn.html#torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights + "torchvision.models.detection.KeypointRCNN_ResNet50_FPN_Weights") | 54.6 | 65 + | 59.1M | 137.42 | [链接](https://github.com/pytorch/vision/tree/main/references/detection#keypoint-r-cnn) + |' - en: Video Classification[](#video-classification "Permalink to this heading") + id: totrans-276 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 视频分类[](#video-classification "跳转到此标题的永久链接") - en: Warning + id: totrans-277 prefs: [] type: TYPE_NORMAL + zh: 警告 - en: The video module is in Beta stage, and backward compatibility is not guaranteed. + id: totrans-278 prefs: [] type: TYPE_NORMAL + zh: 视频模块处于Beta阶段,不保证向后兼容性。 - en: 'The following video classification models are available, with or without pre-trained weights:' + id: totrans-279 prefs: [] type: TYPE_NORMAL + zh: 以下视频分类模型可用,带有或不带有预训练权重: - en: '[Video MViT](models/video_mvit.html)' + id: totrans-280 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[视频MViT](models/video_mvit.html)' - en: '[Video ResNet](models/video_resnet.html)' + id: totrans-281 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[视频ResNet](models/video_resnet.html)' - en: '[Video S3D](models/video_s3d.html)' + id: totrans-282 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[视频S3D](models/video_s3d.html)' - en: '[Video SwinTransformer](models/video_swin_transformer.html)' + id: totrans-283 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[视频SwinTransformer](models/video_swin_transformer.html)' - en: 'Here is an example of how to use the pre-trained video classification models:' + id: totrans-284 prefs: [] type: TYPE_NORMAL + zh: 以下是如何使用预训练视频分类模型的示例: - en: '[PRE11]' + id: totrans-285 prefs: [] type: TYPE_PRE + zh: '[PRE11]' - en: The classes of the pre-trained model outputs can be found at `weights.meta["categories"]`. + id: totrans-286 prefs: [] type: TYPE_NORMAL + zh: 预训练模型输出的类别可以在`weights.meta["categories"]`中找到。 - en: Table of all available video classification weights[](#table-of-all-available-video-classification-weights "Permalink to this heading") + id: totrans-287 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 所有可用视频分类权重的表格[](#table-of-all-available-video-classification-weights "跳转到此标题的永久链接") - en: 'Accuracies are reported on Kinetics-400 using single crops for clip length 16:' + id: totrans-288 prefs: [] type: TYPE_NORMAL + zh: 准确率是使用单个裁剪在剪辑长度为16的Kinetics-400上报告的: - en: '| **Weight** | **Acc@1** | **Acc@5** | **Params** | **GFLOPS** | **Recipe** |' + id: totrans-289 prefs: [] type: TYPE_TB + zh: '| **权重** | **准确率@1** | **准确率@5** | **参数** | **GFLOPS** | **配置** |' - en: '| --- | --- | --- | --- | --- | --- |' + id: totrans-290 prefs: [] type: TYPE_TB + zh: '| --- | --- | --- | --- | --- | --- |' - en: '| [`MC3_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mc3_18.html#torchvision.models.video.MC3_18_Weights "torchvision.models.video.MC3_18_Weights") | 63.96 | 84.13 | 11.7M | 43.34 | [link](https://github.com/pytorch/vision/tree/main/references/video_classification) |' + id: totrans-291 prefs: [] type: TYPE_TB + zh: '| [`MC3_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mc3_18.html#torchvision.models.video.MC3_18_Weights + "torchvision.models.video.MC3_18_Weights") | 63.96 | 84.13 | 11.7M | 43.34 | [链接](https://github.com/pytorch/vision/tree/main/references/video_classification) + |' - en: '| [`MViT_V1_B_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mvit_v1_b.html#torchvision.models.video.MViT_V1_B_Weights "torchvision.models.video.MViT_V1_B_Weights") | 78.477 | 93.582 | 36.6M | 70.6 | [link](https://github.com/facebookresearch/pytorchvideo/blob/main/docs/source/model_zoo.md) |' + id: totrans-292 prefs: [] type: TYPE_TB + zh: '| [`MViT_V1_B_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mvit_v1_b.html#torchvision.models.video.MViT_V1_B_Weights + "torchvision.models.video.MViT_V1_B_Weights") | 78.477 | 93.582 | 36.6M | 70.6 + | [链接](https://github.com/facebookresearch/pytorchvideo/blob/main/docs/source/model_zoo.md) + |' - en: '| [`MViT_V2_S_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mvit_v2_s.html#torchvision.models.video.MViT_V2_S_Weights "torchvision.models.video.MViT_V2_S_Weights") | 80.757 | 94.665 | 34.5M | 64.22 | [link](https://github.com/facebookresearch/SlowFast/blob/main/MODEL_ZOO.md) |' + id: totrans-293 prefs: [] type: TYPE_TB + zh: '| [`MViT_V2_S_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.mvit_v2_s.html#torchvision.models.video.MViT_V2_S_Weights + "torchvision.models.video.MViT_V2_S_Weights") | 80.757 | 94.665 | 34.5M | 64.22 + | [链接](https://github.com/facebookresearch/SlowFast/blob/main/MODEL_ZOO.md) |' - en: '| [`R2Plus1D_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.r2plus1d_18.html#torchvision.models.video.R2Plus1D_18_Weights "torchvision.models.video.R2Plus1D_18_Weights") | 67.463 | 86.175 | 31.5M | 40.52 | [link](https://github.com/pytorch/vision/tree/main/references/video_classification) |' + id: totrans-294 prefs: [] type: TYPE_TB + zh: '| [`R2Plus1D_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.r2plus1d_18.html#torchvision.models.video.R2Plus1D_18_Weights + "torchvision.models.video.R2Plus1D_18_Weights") | 67.463 | 86.175 | 31.5M | 40.52 + | [链接](https://github.com/pytorch/vision/tree/main/references/video_classification) + |' - en: '| [`R3D_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.r3d_18.html#torchvision.models.video.R3D_18_Weights "torchvision.models.video.R3D_18_Weights") | 63.2 | 83.479 | 33.4M | 40.7 | [link](https://github.com/pytorch/vision/tree/main/references/video_classification) |' + id: totrans-295 prefs: [] type: TYPE_TB + zh: '| [`R3D_18_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.r3d_18.html#torchvision.models.video.R3D_18_Weights + "torchvision.models.video.R3D_18_Weights") | 63.2 | 83.479 | 33.4M | 40.7 | [链接](https://github.com/pytorch/vision/tree/main/references/video_classification) + |' - en: '| [`S3D_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.s3d.html#torchvision.models.video.S3D_Weights "torchvision.models.video.S3D_Weights") | 68.368 | 88.05 | 8.3M | 17.98 | [link](https://github.com/pytorch/vision/tree/main/references/video_classification#s3d) |' + id: totrans-296 prefs: [] type: TYPE_TB + zh: '| [`S3D_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.s3d.html#torchvision.models.video.S3D_Weights + "torchvision.models.video.S3D_Weights") | 68.368 | 88.05 | 8.3M | 17.98 | [链接](https://github.com/pytorch/vision/tree/main/references/video_classification#s3d) + |' - en: '| [`Swin3D_B_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_b.html#torchvision.models.video.Swin3D_B_Weights "torchvision.models.video.Swin3D_B_Weights") | 79.427 | 94.386 | 88.0M | 140.67 | [link](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) |' + id: totrans-297 prefs: [] type: TYPE_TB + zh: '| [`Swin3D_B_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_b.html#torchvision.models.video.Swin3D_B_Weights + "torchvision.models.video.Swin3D_B_Weights") | 79.427 | 94.386 | 88.0M | 140.67 + | [链接](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) + |' - en: '| [`Swin3D_B_Weights.KINETICS400_IMAGENET22K_V1`](models/generated/torchvision.models.video.swin3d_b.html#torchvision.models.video.Swin3D_B_Weights "torchvision.models.video.Swin3D_B_Weights") | 81.643 | 95.574 | 88.0M | 140.67 | [link](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) |' + id: totrans-298 prefs: [] type: TYPE_TB + zh: '| [`Swin3D_B_Weights.KINETICS400_IMAGENET22K_V1`](models/generated/torchvision.models.video.swin3d_b.html#torchvision.models.video.Swin3D_B_Weights + "torchvision.models.video.Swin3D_B_Weights") | 81.643 | 95.574 | 88.0M | 140.67 + | [链接](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) + |' - en: '| [`Swin3D_S_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_s.html#torchvision.models.video.Swin3D_S_Weights "torchvision.models.video.Swin3D_S_Weights") | 79.521 | 94.158 | 49.8M | 82.84 | [link](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) |' + id: totrans-299 prefs: [] type: TYPE_TB + zh: '| [`Swin3D_S_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_s.html#torchvision.models.video.Swin3D_S_Weights + "torchvision.models.video.Swin3D_S_Weights") | 79.521 | 94.158 | 49.8M | 82.84 + | [链接](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) + |' - en: '| [`Swin3D_T_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_t.html#torchvision.models.video.Swin3D_T_Weights "torchvision.models.video.Swin3D_T_Weights") | 77.715 | 93.519 | 28.2M | 43.88 | [link](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) |' + id: totrans-300 prefs: [] type: TYPE_TB + zh: '| [`Swin3D_T_Weights.KINETICS400_V1`](models/generated/torchvision.models.video.swin3d_t.html#torchvision.models.video.Swin3D_T_Weights + "torchvision.models.video.Swin3D_T_Weights") | 77.715 | 93.519 | 28.2M | 43.88 + | [链接](https://github.com/SwinTransformer/Video-Swin-Transformer#kinetics-400) + |' - en: Optical Flow[](#optical-flow "Permalink to this heading") + id: totrans-301 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 光流 - en: The following Optical Flow models are available, with or without pre-trained + id: totrans-302 prefs: [] type: TYPE_NORMAL + zh: 以下光流模型可用,带有或不带有预训练 - en: '[RAFT](models/raft.html)' + id: totrans-303 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[RAFT](models/raft.html)' diff --git a/totrans/vis017_05.yaml b/totrans/vis017_05.yaml index af40a6e6fe98da7dc085761804a980f1c58ed8f7..6f5e719e5ed6fe7d9cfb669ed5d70f2654f77edd 100644 --- a/totrans/vis017_05.yaml +++ b/totrans/vis017_05.yaml @@ -1,449 +1,782 @@ - en: Datasets + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 数据集 - en: 原文:[https://pytorch.org/vision/stable/datasets.html](https://pytorch.org/vision/stable/datasets.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/datasets.html](https://pytorch.org/vision/stable/datasets.html) - en: Torchvision provides many built-in datasets in the `torchvision.datasets` module, as well as utility classes for building your own datasets. + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: 'Torchvision 在 `torchvision.datasets` 模块中提供了许多内置数据集,以及用于构建自己数据集的实用类。 ' - en: Built-in datasets[](#built-in-datasets "Permalink to this heading") + id: totrans-3 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 内置数据集[](#built-in-datasets "跳转到此标题") - en: 'All datasets are subclasses of [`torch.utils.data.Dataset`](https://pytorch.org/docs/stable/data.html#torch.utils.data.Dataset "(in PyTorch v2.2)") i.e, they have `__getitem__` and `__len__` methods implemented. Hence, they can all be passed to a [`torch.utils.data.DataLoader`](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader "(in PyTorch v2.2)") which can load multiple samples in parallel using `torch.multiprocessing` workers. For example:' + id: totrans-4 prefs: [] type: TYPE_NORMAL + zh: 所有数据集都是 [`torch.utils.data.Dataset`](https://pytorch.org/docs/stable/data.html#torch.utils.data.Dataset + "(在 PyTorch v2.2 中)") 的子类,即它们实现了 `__getitem__` 和 `__len__` 方法。因此,它们都可以传递给 [`torch.utils.data.DataLoader`](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader + "(在 PyTorch v2.2 中)"),后者可以使用 `torch.multiprocessing` 工作程序并行加载多个样本。例如: - en: '[PRE0]' + id: totrans-5 prefs: [] type: TYPE_PRE + zh: '[PRE0]' - en: 'All the datasets have almost similar API. They all have two common arguments: `transform` and `target_transform` to transform the input and target respectively. You can also create your own datasets using the provided [base classes](#base-classes-datasets).' + id: totrans-6 prefs: [] type: TYPE_NORMAL + zh: 所有数据集几乎具有相似的 API。它们都有两个共同的参数:`transform` 和 `target_transform`,用于分别转换输入和目标。您还可以使用提供的 + [基类](#base-classes-datasets) 创建自己的数据集。 - en: Image classification[](#image-classification "Permalink to this heading") + id: totrans-7 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 图像分类[](#image-classification "跳转到此标题") - en: '| [`Caltech101`](generated/torchvision.datasets.Caltech101.html#torchvision.datasets.Caltech101 "torchvision.datasets.Caltech101")(root[, target_type, transform, ...]) | [Caltech 101](https://data.caltech.edu/records/20086) Dataset. |' + id: totrans-8 prefs: [] type: TYPE_TB + zh: '| [`Caltech101`](generated/torchvision.datasets.Caltech101.html#torchvision.datasets.Caltech101 + "torchvision.datasets.Caltech101")(root[, target_type, transform, ...]) | [Caltech + 101](https://data.caltech.edu/records/20086) 数据集。 |' - en: '| [`Caltech256`](generated/torchvision.datasets.Caltech256.html#torchvision.datasets.Caltech256 "torchvision.datasets.Caltech256")(root[, transform, ...]) | [Caltech 256](https://data.caltech.edu/records/20087) Dataset. |' + id: totrans-9 prefs: [] type: TYPE_TB + zh: '| [`Caltech256`](generated/torchvision.datasets.Caltech256.html#torchvision.datasets.Caltech256 + "torchvision.datasets.Caltech256")(root[, transform, ...]) | [Caltech 256](https://data.caltech.edu/records/20087) + 数据集。 |' - en: '| [`CelebA`](generated/torchvision.datasets.CelebA.html#torchvision.datasets.CelebA "torchvision.datasets.CelebA")(root[, split, target_type, ...]) | [Large-scale CelebFaces Attributes (CelebA) Dataset](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) Dataset. |' + id: totrans-10 prefs: [] type: TYPE_TB + zh: '| [`CelebA`](generated/torchvision.datasets.CelebA.html#torchvision.datasets.CelebA + "torchvision.datasets.CelebA")(root[, split, target_type, ...]) | [大规模 CelebFaces + 属性 (CelebA) 数据集](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)。 |' - en: '| [`CIFAR10`](generated/torchvision.datasets.CIFAR10.html#torchvision.datasets.CIFAR10 "torchvision.datasets.CIFAR10")(root[, train, transform, ...]) | [CIFAR10](https://www.cs.toronto.edu/~kriz/cifar.html) Dataset. |' + id: totrans-11 prefs: [] type: TYPE_TB + zh: '| [`CIFAR10`](generated/torchvision.datasets.CIFAR10.html#torchvision.datasets.CIFAR10 + "torchvision.datasets.CIFAR10")(root[, train, transform, ...]) | [CIFAR10](https://www.cs.toronto.edu/~kriz/cifar.html) + 数据集。 |' - en: '| [`CIFAR100`](generated/torchvision.datasets.CIFAR100.html#torchvision.datasets.CIFAR100 "torchvision.datasets.CIFAR100")(root[, train, transform, ...]) | [CIFAR100](https://www.cs.toronto.edu/~kriz/cifar.html) Dataset. |' + id: totrans-12 prefs: [] type: TYPE_TB + zh: '| [`CIFAR100`](generated/torchvision.datasets.CIFAR100.html#torchvision.datasets.CIFAR100 + "torchvision.datasets.CIFAR100")(root[, train, transform, ...]) | [CIFAR100](https://www.cs.toronto.edu/~kriz/cifar.html) + 数据集。 |' - en: '| [`Country211`](generated/torchvision.datasets.Country211.html#torchvision.datasets.Country211 "torchvision.datasets.Country211")(root[, split, transform, ...]) | [The Country211 Data Set](https://github.com/openai/CLIP/blob/main/data/country211.md) from OpenAI. |' + id: totrans-13 prefs: [] type: TYPE_TB + zh: '| [`Country211`](generated/torchvision.datasets.Country211.html#torchvision.datasets.Country211 + "torchvision.datasets.Country211")(root[, split, transform, ...]) | 来自 OpenAI + 的 [Country211 数据集](https://github.com/openai/CLIP/blob/main/data/country211.md)。 + |' - en: '| [`DTD`](generated/torchvision.datasets.DTD.html#torchvision.datasets.DTD "torchvision.datasets.DTD")(root[, split, partition, transform, ...]) | [Describable Textures Dataset (DTD)](https://www.robots.ox.ac.uk/~vgg/data/dtd/). |' + id: totrans-14 prefs: [] type: TYPE_TB + zh: '| [`DTD`](generated/torchvision.datasets.DTD.html#torchvision.datasets.DTD + "torchvision.datasets.DTD")(root[, split, partition, transform, ...]) | [可描述纹理数据集 + (DTD)](https://www.robots.ox.ac.uk/~vgg/data/dtd/)。 |' - en: '| [`EMNIST`](generated/torchvision.datasets.EMNIST.html#torchvision.datasets.EMNIST "torchvision.datasets.EMNIST")(root, split, **kwargs) | [EMNIST](https://www.westernsydney.edu.au/bens/home/reproducible_research/emnist) Dataset. |' + id: totrans-15 prefs: [] type: TYPE_TB + zh: '| [`EMNIST`](generated/torchvision.datasets.EMNIST.html#torchvision.datasets.EMNIST + "torchvision.datasets.EMNIST")(root, split, **kwargs) | [EMNIST](https://www.westernsydney.edu.au/bens/home/reproducible_research/emnist) + 数据集。 |' - en: '| [`EuroSAT`](generated/torchvision.datasets.EuroSAT.html#torchvision.datasets.EuroSAT "torchvision.datasets.EuroSAT")(root[, transform, target_transform, ...]) | RGB version of the [EuroSAT](https://github.com/phelber/eurosat) Dataset. |' + id: totrans-16 prefs: [] type: TYPE_TB + zh: '| [`EuroSAT`](generated/torchvision.datasets.EuroSAT.html#torchvision.datasets.EuroSAT + "torchvision.datasets.EuroSAT")(root[, transform, target_transform, ...]) | [EuroSAT](https://github.com/phelber/eurosat) + 数据集的 RGB 版本。 |' - en: '| [`FakeData`](generated/torchvision.datasets.FakeData.html#torchvision.datasets.FakeData "torchvision.datasets.FakeData")([size, image_size, num_classes, ...]) | A fake dataset that returns randomly generated images and returns them as PIL images |' + id: totrans-17 prefs: [] type: TYPE_TB + zh: '| [`FakeData`](generated/torchvision.datasets.FakeData.html#torchvision.datasets.FakeData + "torchvision.datasets.FakeData")([size, image_size, num_classes, ...]) | 返回随机生成的图像并将其作为 + PIL 图像返回的虚假数据集 |' - en: '| [`FashionMNIST`](generated/torchvision.datasets.FashionMNIST.html#torchvision.datasets.FashionMNIST "torchvision.datasets.FashionMNIST")(root[, train, transform, ...]) | [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) Dataset. |' + id: totrans-18 prefs: [] type: TYPE_TB + zh: '| [`FashionMNIST`](generated/torchvision.datasets.FashionMNIST.html#torchvision.datasets.FashionMNIST + "torchvision.datasets.FashionMNIST")(root[, train, transform, ...]) | [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) + 数据集。 |' - en: '| [`FER2013`](generated/torchvision.datasets.FER2013.html#torchvision.datasets.FER2013 "torchvision.datasets.FER2013")(root[, split, transform, ...]) | [FER2013](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge) Dataset. |' + id: totrans-19 prefs: [] type: TYPE_TB + zh: '| [`FER2013`](generated/torchvision.datasets.FER2013.html#torchvision.datasets.FER2013 + "torchvision.datasets.FER2013")(root[, split, transform, ...]) | [FER2013](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge) + 数据集。 |' - en: '| [`FGVCAircraft`](generated/torchvision.datasets.FGVCAircraft.html#torchvision.datasets.FGVCAircraft "torchvision.datasets.FGVCAircraft")(root[, split, ...]) | [FGVC Aircraft](https://www.robots.ox.ac.uk/~vgg/data/fgvc-aircraft/) Dataset. |' + id: totrans-20 prefs: [] type: TYPE_TB + zh: '| [`FGVCAircraft`](generated/torchvision.datasets.FGVCAircraft.html#torchvision.datasets.FGVCAircraft + "torchvision.datasets.FGVCAircraft")(root[, split, ...]) | [FGVC Aircraft](https://www.robots.ox.ac.uk/~vgg/data/fgvc-aircraft/) + 数据集。 |' - en: '| [`Flickr8k`](generated/torchvision.datasets.Flickr8k.html#torchvision.datasets.Flickr8k "torchvision.datasets.Flickr8k")(root, ann_file[, transform, ...]) | [Flickr8k Entities](http://hockenmaier.cs.illinois.edu/8k-pictures.html) Dataset. |' + id: totrans-21 prefs: [] type: TYPE_TB + zh: '| [`Flickr8k`](generated/torchvision.datasets.Flickr8k.html#torchvision.datasets.Flickr8k + "torchvision.datasets.Flickr8k")(root, ann_file[, transform, ...]) | [Flickr8k + Entities](http://hockenmaier.cs.illinois.edu/8k-pictures.html) 数据集。 |' - en: '| [`Flickr30k`](generated/torchvision.datasets.Flickr30k.html#torchvision.datasets.Flickr30k "torchvision.datasets.Flickr30k")(root, ann_file[, transform, ...]) | [Flickr30k Entities](https://bryanplummer.com/Flickr30kEntities/) Dataset. |' + id: totrans-22 prefs: [] type: TYPE_TB + zh: '| [`Flickr30k`](generated/torchvision.datasets.Flickr30k.html#torchvision.datasets.Flickr30k + "torchvision.datasets.Flickr30k")(root, ann_file[, transform, ...]) | [Flickr30k + Entities](https://bryanplummer.com/Flickr30kEntities/) 数据集。 |' - en: '| [`Flowers102`](generated/torchvision.datasets.Flowers102.html#torchvision.datasets.Flowers102 "torchvision.datasets.Flowers102")(root[, split, transform, ...]) | [Oxford 102 Flower](https://www.robots.ox.ac.uk/~vgg/data/flowers/102/) Dataset. |' + id: totrans-23 prefs: [] type: TYPE_TB + zh: '| [`Flowers102`](generated/torchvision.datasets.Flowers102.html#torchvision.datasets.Flowers102 + "torchvision.datasets.Flowers102")(root[, split, transform, ...]) | [Oxford 102 + Flower](https://www.robots.ox.ac.uk/~vgg/data/flowers/102/) 数据集。 |' - en: '| [`Food101`](generated/torchvision.datasets.Food101.html#torchvision.datasets.Food101 "torchvision.datasets.Food101")(root[, split, transform, ...]) | [The Food-101 Data Set](https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/). |' + id: totrans-24 prefs: [] type: TYPE_TB + zh: '| [`Food101`](generated/torchvision.datasets.Food101.html#torchvision.datasets.Food101 + "torchvision.datasets.Food101")(root[, split, transform, ...]) | [The Food-101 + Data Set](https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/)。 |' - en: '| [`GTSRB`](generated/torchvision.datasets.GTSRB.html#torchvision.datasets.GTSRB "torchvision.datasets.GTSRB")(root[, split, transform, ...]) | [German Traffic Sign Recognition Benchmark (GTSRB)](https://benchmark.ini.rub.de/) Dataset. |' + id: totrans-25 prefs: [] type: TYPE_TB + zh: '| [`GTSRB`](generated/torchvision.datasets.GTSRB.html#torchvision.datasets.GTSRB + "torchvision.datasets.GTSRB")(root[, split, transform, ...]) | [German Traffic + Sign Recognition Benchmark (GTSRB)](https://benchmark.ini.rub.de/) 数据集。 |' - en: '| [`INaturalist`](generated/torchvision.datasets.INaturalist.html#torchvision.datasets.INaturalist "torchvision.datasets.INaturalist")(root[, version, target_type, ...]) | [iNaturalist](https://github.com/visipedia/inat_comp) Dataset. |' + id: totrans-26 prefs: [] type: TYPE_TB + zh: '| [`INaturalist`](generated/torchvision.datasets.INaturalist.html#torchvision.datasets.INaturalist + "torchvision.datasets.INaturalist")(root[, version, target_type, ...]) | [iNaturalist](https://github.com/visipedia/inat_comp) + 数据集。 |' - en: '| [`ImageNet`](generated/torchvision.datasets.ImageNet.html#torchvision.datasets.ImageNet "torchvision.datasets.ImageNet")(root[, split]) | [ImageNet](http://image-net.org/) 2012 Classification Dataset. |' + id: totrans-27 prefs: [] type: TYPE_TB + zh: '| [`ImageNet`](generated/torchvision.datasets.ImageNet.html#torchvision.datasets.ImageNet + "torchvision.datasets.ImageNet")(root[, split]) | [ImageNet](http://image-net.org/) + 2012分类数据集。 |' - en: '| [`Imagenette`](generated/torchvision.datasets.Imagenette.html#torchvision.datasets.Imagenette "torchvision.datasets.Imagenette")(root[, split, size, download, ...]) | [Imagenette](https://github.com/fastai/imagenette#imagenette-1) image classification dataset. |' + id: totrans-28 prefs: [] type: TYPE_TB + zh: '| [`Imagenette`](generated/torchvision.datasets.Imagenette.html#torchvision.datasets.Imagenette + "torchvision.datasets.Imagenette")(root[, split, size, download, ...]) | [Imagenette](https://github.com/fastai/imagenette#imagenette-1) + 图像分类数据集。 |' - en: '| [`KMNIST`](generated/torchvision.datasets.KMNIST.html#torchvision.datasets.KMNIST "torchvision.datasets.KMNIST")(root[, train, transform, ...]) | [Kuzushiji-MNIST](https://github.com/rois-codh/kmnist) Dataset. |' + id: totrans-29 prefs: [] type: TYPE_TB + zh: '| [`KMNIST`](generated/torchvision.datasets.KMNIST.html#torchvision.datasets.KMNIST + "torchvision.datasets.KMNIST")(root[, train, transform, ...]) | [Kuzushiji-MNIST](https://github.com/rois-codh/kmnist) + 数据集。 |' - en: '| [`LFWPeople`](generated/torchvision.datasets.LFWPeople.html#torchvision.datasets.LFWPeople "torchvision.datasets.LFWPeople")(root[, split, image_set, ...]) | [LFW](http://vis-www.cs.umass.edu/lfw/) Dataset. |' + id: totrans-30 prefs: [] type: TYPE_TB + zh: '| [`LFWPeople`](generated/torchvision.datasets.LFWPeople.html#torchvision.datasets.LFWPeople + "torchvision.datasets.LFWPeople")(root[, split, image_set, ...]) | [LFW](http://vis-www.cs.umass.edu/lfw/) + 数据集。 |' - en: '| [`LSUN`](generated/torchvision.datasets.LSUN.html#torchvision.datasets.LSUN "torchvision.datasets.LSUN")(root[, classes, transform, ...]) | [LSUN](https://www.yf.io/p/lsun) dataset. |' + id: totrans-31 prefs: [] type: TYPE_TB + zh: '| [`LSUN`](generated/torchvision.datasets.LSUN.html#torchvision.datasets.LSUN + "torchvision.datasets.LSUN")(root[, classes, transform, ...]) | [LSUN](https://www.yf.io/p/lsun) + 数据集。 |' - en: '| [`MNIST`](generated/torchvision.datasets.MNIST.html#torchvision.datasets.MNIST "torchvision.datasets.MNIST")(root[, train, transform, ...]) | [MNIST](http://yann.lecun.com/exdb/mnist/) Dataset. |' + id: totrans-32 prefs: [] type: TYPE_TB + zh: '| [`MNIST`](generated/torchvision.datasets.MNIST.html#torchvision.datasets.MNIST + "torchvision.datasets.MNIST")(root[, train, transform, ...]) | [MNIST](http://yann.lecun.com/exdb/mnist/) + 数据集。 |' - en: '| [`Omniglot`](generated/torchvision.datasets.Omniglot.html#torchvision.datasets.Omniglot "torchvision.datasets.Omniglot")(root[, background, transform, ...]) | [Omniglot](https://github.com/brendenlake/omniglot) Dataset. |' + id: totrans-33 prefs: [] type: TYPE_TB + zh: '| [`Omniglot`](generated/torchvision.datasets.Omniglot.html#torchvision.datasets.Omniglot + "torchvision.datasets.Omniglot")(root[, background, transform, ...]) | [Omniglot](https://github.com/brendenlake/omniglot) + 数据集。 |' - en: '| [`OxfordIIITPet`](generated/torchvision.datasets.OxfordIIITPet.html#torchvision.datasets.OxfordIIITPet "torchvision.datasets.OxfordIIITPet")(root[, split, target_types, ...]) | [Oxford-IIIT Pet Dataset](https://www.robots.ox.ac.uk/~vgg/data/pets/). |' + id: totrans-34 prefs: [] type: TYPE_TB + zh: '| [`OxfordIIITPet`](generated/torchvision.datasets.OxfordIIITPet.html#torchvision.datasets.OxfordIIITPet + "torchvision.datasets.OxfordIIITPet")(root[, split, target_types, ...]) | [Oxford-IIIT + Pet Dataset](https://www.robots.ox.ac.uk/~vgg/data/pets/)。 |' - en: '| [`Places365`](generated/torchvision.datasets.Places365.html#torchvision.datasets.Places365 "torchvision.datasets.Places365")(root, split, small, download, ...) | [Places365](http://places2.csail.mit.edu/index.html) classification dataset. |' + id: totrans-35 prefs: [] type: TYPE_TB + zh: '| [`Places365`](generated/torchvision.datasets.Places365.html#torchvision.datasets.Places365 + "torchvision.datasets.Places365")(root, split, small, download, ...) | [Places365](http://places2.csail.mit.edu/index.html) + 分类数据集。 |' - en: '| [`PCAM`](generated/torchvision.datasets.PCAM.html#torchvision.datasets.PCAM "torchvision.datasets.PCAM")(root[, split, transform, ...]) | [PCAM Dataset](https://github.com/basveeling/pcam). |' + id: totrans-36 prefs: [] type: TYPE_TB + zh: '| [`PCAM`](generated/torchvision.datasets.PCAM.html#torchvision.datasets.PCAM + "torchvision.datasets.PCAM")(root[, split, transform, ...]) | [PCAM 数据集](https://github.com/basveeling/pcam). + |' - en: '| [`QMNIST`](generated/torchvision.datasets.QMNIST.html#torchvision.datasets.QMNIST "torchvision.datasets.QMNIST")(root[, what, compat, train]) | [QMNIST](https://github.com/facebookresearch/qmnist) Dataset. |' + id: totrans-37 prefs: [] type: TYPE_TB + zh: '| [`QMNIST`](generated/torchvision.datasets.QMNIST.html#torchvision.datasets.QMNIST + "torchvision.datasets.QMNIST")(root[, what, compat, train]) | [QMNIST](https://github.com/facebookresearch/qmnist) + 数据集。 |' - en: '| [`RenderedSST2`](generated/torchvision.datasets.RenderedSST2.html#torchvision.datasets.RenderedSST2 "torchvision.datasets.RenderedSST2")(root[, split, transform, ...]) | [The Rendered SST2 Dataset](https://github.com/openai/CLIP/blob/main/data/rendered-sst2.md). |' + id: totrans-38 prefs: [] type: TYPE_TB + zh: '| [`RenderedSST2`](generated/torchvision.datasets.RenderedSST2.html#torchvision.datasets.RenderedSST2 + "torchvision.datasets.RenderedSST2")(root[, split, transform, ...]) | [The Rendered + SST2 数据集](https://github.com/openai/CLIP/blob/main/data/rendered-sst2.md). |' - en: '| [`SEMEION`](generated/torchvision.datasets.SEMEION.html#torchvision.datasets.SEMEION "torchvision.datasets.SEMEION")(root[, transform, target_transform, ...]) | [SEMEION](http://archive.ics.uci.edu/ml/datasets/semeion+handwritten+digit) Dataset. |' + id: totrans-39 prefs: [] type: TYPE_TB + zh: '| [`SEMEION`](generated/torchvision.datasets.SEMEION.html#torchvision.datasets.SEMEION + "torchvision.datasets.SEMEION")(root[, transform, target_transform, ...]) | [SEMEION](http://archive.ics.uci.edu/ml/datasets/semeion+handwritten+digit) + 数据集。 |' - en: '| [`SBU`](generated/torchvision.datasets.SBU.html#torchvision.datasets.SBU "torchvision.datasets.SBU")(root[, transform, target_transform, ...]) | [SBU Captioned Photo](http://www.cs.virginia.edu/~vicente/sbucaptions/) Dataset. |' + id: totrans-40 prefs: [] type: TYPE_TB + zh: '| [`SBU`](generated/torchvision.datasets.SBU.html#torchvision.datasets.SBU + "torchvision.datasets.SBU")(root[, transform, target_transform, ...]) | [SBU Captioned + Photo](http://www.cs.virginia.edu/~vicente/sbucaptions/) 数据集。 |' - en: '| [`StanfordCars`](generated/torchvision.datasets.StanfordCars.html#torchvision.datasets.StanfordCars "torchvision.datasets.StanfordCars")(root[, split, transform, ...]) | [Stanford Cars](https://ai.stanford.edu/~jkrause/cars/car_dataset.html) Dataset |' + id: totrans-41 prefs: [] type: TYPE_TB + zh: '| [`StanfordCars`](generated/torchvision.datasets.StanfordCars.html#torchvision.datasets.StanfordCars + "torchvision.datasets.StanfordCars")(root[, split, transform, ...]) | [Stanford + Cars](https://ai.stanford.edu/~jkrause/cars/car_dataset.html) 数据集 |' - en: '| [`STL10`](generated/torchvision.datasets.STL10.html#torchvision.datasets.STL10 "torchvision.datasets.STL10")(root[, split, folds, transform, ...]) | [STL10](https://cs.stanford.edu/~acoates/stl10/) Dataset. |' + id: totrans-42 prefs: [] type: TYPE_TB + zh: '| [`STL10`](generated/torchvision.datasets.STL10.html#torchvision.datasets.STL10 + "torchvision.datasets.STL10")(root[, split, folds, transform, ...]) | [STL10](https://cs.stanford.edu/~acoates/stl10/) + 数据集。 |' - en: '| [`SUN397`](generated/torchvision.datasets.SUN397.html#torchvision.datasets.SUN397 "torchvision.datasets.SUN397")(root[, transform, target_transform, ...]) | [The SUN397 Data Set](https://vision.princeton.edu/projects/2010/SUN/). |' + id: totrans-43 prefs: [] type: TYPE_TB + zh: '| [`SUN397`](generated/torchvision.datasets.SUN397.html#torchvision.datasets.SUN397 + "torchvision.datasets.SUN397")(root[, transform, target_transform, ...]) | [The + SUN397 Data Set](https://vision.princeton.edu/projects/2010/SUN/). |' - en: '| [`SVHN`](generated/torchvision.datasets.SVHN.html#torchvision.datasets.SVHN "torchvision.datasets.SVHN")(root[, split, transform, ...]) | [SVHN](http://ufldl.stanford.edu/housenumbers/) Dataset. |' + id: totrans-44 prefs: [] type: TYPE_TB + zh: '| [`SVHN`](generated/torchvision.datasets.SVHN.html#torchvision.datasets.SVHN + "torchvision.datasets.SVHN")(root[, split, transform, ...]) | [SVHN](http://ufldl.stanford.edu/housenumbers/) + 数据集。 |' - en: '| [`USPS`](generated/torchvision.datasets.USPS.html#torchvision.datasets.USPS "torchvision.datasets.USPS")(root[, train, transform, ...]) | [USPS](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#usps) Dataset. |' + id: totrans-45 prefs: [] type: TYPE_TB + zh: '| [`USPS`](generated/torchvision.datasets.USPS.html#torchvision.datasets.USPS + "torchvision.datasets.USPS")(root[, train, transform, ...]) | [USPS](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#usps) + 数据集。 |' - en: Image detection or segmentation[](#image-detection-or-segmentation "Permalink to this heading") + id: totrans-46 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 图像检测或分割[](#image-detection-or-segmentation "Permalink to this heading") - en: '| [`CocoDetection`](generated/torchvision.datasets.CocoDetection.html#torchvision.datasets.CocoDetection "torchvision.datasets.CocoDetection")(root, annFile[, transform, ...]) | [MS Coco Detection](https://cocodataset.org/#detection-2016) Dataset. |' + id: totrans-47 prefs: [] type: TYPE_TB + zh: '| [`CocoDetection`](generated/torchvision.datasets.CocoDetection.html#torchvision.datasets.CocoDetection + "torchvision.datasets.CocoDetection")(root, annFile[, transform, ...]) | [MS Coco + Detection](https://cocodataset.org/#detection-2016) 数据集。 |' - en: '| [`CelebA`](generated/torchvision.datasets.CelebA.html#torchvision.datasets.CelebA "torchvision.datasets.CelebA")(root[, split, target_type, ...]) | [Large-scale CelebFaces Attributes (CelebA) Dataset](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) Dataset. |' + id: totrans-48 prefs: [] type: TYPE_TB + zh: '| [`CelebA`](generated/torchvision.datasets.CelebA.html#torchvision.datasets.CelebA + "torchvision.datasets.CelebA")(root[, split, target_type, ...]) | [Large-scale + CelebFaces Attributes (CelebA) 数据集](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) + 数据集。 |' - en: '| [`Cityscapes`](generated/torchvision.datasets.Cityscapes.html#torchvision.datasets.Cityscapes "torchvision.datasets.Cityscapes")(root[, split, mode, target_type, ...]) | [Cityscapes](http://www.cityscapes-dataset.com/) Dataset. |' + id: totrans-49 prefs: [] type: TYPE_TB + zh: '| [`Cityscapes`](generated/torchvision.datasets.Cityscapes.html#torchvision.datasets.Cityscapes + "torchvision.datasets.Cityscapes")(root[, split, mode, target_type, ...]) | [Cityscapes](http://www.cityscapes-dataset.com/) + 数据集。 |' - en: '| [`Kitti`](generated/torchvision.datasets.Kitti.html#torchvision.datasets.Kitti "torchvision.datasets.Kitti")(root[, train, transform, ...]) | [KITTI](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark) Dataset. |' + id: totrans-50 prefs: [] type: TYPE_TB + zh: '| [`Kitti`](generated/torchvision.datasets.Kitti.html#torchvision.datasets.Kitti + "torchvision.datasets.Kitti")(root[, train, transform, ...]) | [KITTI](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark) + 数据集。 |' - en: '| [`OxfordIIITPet`](generated/torchvision.datasets.OxfordIIITPet.html#torchvision.datasets.OxfordIIITPet "torchvision.datasets.OxfordIIITPet")(root[, split, target_types, ...]) | [Oxford-IIIT Pet Dataset](https://www.robots.ox.ac.uk/~vgg/data/pets/). |' + id: totrans-51 prefs: [] type: TYPE_TB + zh: '| [`OxfordIIITPet`](generated/torchvision.datasets.OxfordIIITPet.html#torchvision.datasets.OxfordIIITPet + "torchvision.datasets.OxfordIIITPet")(root[, split, target_types, ...]) | [Oxford-IIIT + Pet 数据集](https://www.robots.ox.ac.uk/~vgg/data/pets/). |' - en: '| [`SBDataset`](generated/torchvision.datasets.SBDataset.html#torchvision.datasets.SBDataset "torchvision.datasets.SBDataset")(root[, image_set, mode, download, ...]) | [Semantic Boundaries Dataset](http://home.bharathh.info/pubs/codes/SBD/download.html) |' + id: totrans-52 prefs: [] type: TYPE_TB + zh: '| [`SBDataset`](generated/torchvision.datasets.SBDataset.html#torchvision.datasets.SBDataset + "torchvision.datasets.SBDataset")(root[, image_set, mode, download, ...]) | [Semantic + Boundaries Dataset](http://home.bharathh.info/pubs/codes/SBD/download.html) |' - en: '| [`VOCSegmentation`](generated/torchvision.datasets.VOCSegmentation.html#torchvision.datasets.VOCSegmentation "torchvision.datasets.VOCSegmentation")(root[, year, image_set, ...]) | [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/) Segmentation Dataset. |' + id: totrans-53 prefs: [] type: TYPE_TB + zh: '| [`VOCSegmentation`](generated/torchvision.datasets.VOCSegmentation.html#torchvision.datasets.VOCSegmentation + "torchvision.datasets.VOCSegmentation")(root[, year, image_set, ...]) | [Pascal + VOC](http://host.robots.ox.ac.uk/pascal/VOC/)分割数据集。 |' - en: '| [`VOCDetection`](generated/torchvision.datasets.VOCDetection.html#torchvision.datasets.VOCDetection "torchvision.datasets.VOCDetection")(root[, year, image_set, ...]) | [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/) Detection Dataset. |' + id: totrans-54 prefs: [] type: TYPE_TB + zh: '| [`VOCDetection`](generated/torchvision.datasets.VOCDetection.html#torchvision.datasets.VOCDetection + "torchvision.datasets.VOCDetection")(root[, year, image_set, ...]) | [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/)检测数据集。 + |' - en: '| [`WIDERFace`](generated/torchvision.datasets.WIDERFace.html#torchvision.datasets.WIDERFace "torchvision.datasets.WIDERFace")(root[, split, transform, ...]) | [WIDERFace](http://shuoyang1213.me/WIDERFACE/) Dataset. |' + id: totrans-55 prefs: [] type: TYPE_TB + zh: '| [`WIDERFace`](generated/torchvision.datasets.WIDERFace.html#torchvision.datasets.WIDERFace + "torchvision.datasets.WIDERFace")(root[, split, transform, ...]) | [WIDERFace](http://shuoyang1213.me/WIDERFACE/)数据集。 + |' - en: Optical Flow[](#optical-flow "Permalink to this heading") + id: totrans-56 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 光流[](#optical-flow "跳转到此标题") - en: '| [`FlyingChairs`](generated/torchvision.datasets.FlyingChairs.html#torchvision.datasets.FlyingChairs "torchvision.datasets.FlyingChairs")(root[, split, transforms]) | [FlyingChairs](https://lmb.informatik.uni-freiburg.de/resources/datasets/FlyingChairs.en.html#flyingchairs) Dataset for optical flow. |' + id: totrans-57 prefs: [] type: TYPE_TB + zh: '| [`FlyingChairs`](generated/torchvision.datasets.FlyingChairs.html#torchvision.datasets.FlyingChairs + "torchvision.datasets.FlyingChairs")(root[, split, transforms]) | 用于光流的[FlyingChairs](https://lmb.informatik.uni-freiburg.de/resources/datasets/FlyingChairs.en.html#flyingchairs)数据集。 + |' - en: '| [`FlyingThings3D`](generated/torchvision.datasets.FlyingThings3D.html#torchvision.datasets.FlyingThings3D "torchvision.datasets.FlyingThings3D")(root[, split, pass_name, ...]) | [FlyingThings3D](https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html) dataset for optical flow. |' + id: totrans-58 prefs: [] type: TYPE_TB + zh: '| [`FlyingThings3D`](generated/torchvision.datasets.FlyingThings3D.html#torchvision.datasets.FlyingThings3D + "torchvision.datasets.FlyingThings3D")(root[, split, pass_name, ...]) | 用于光流的[FlyingThings3D](https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html)数据集。 + |' - en: '| [`HD1K`](generated/torchvision.datasets.HD1K.html#torchvision.datasets.HD1K "torchvision.datasets.HD1K")(root[, split, transforms]) | [HD1K](http://hci-benchmark.iwr.uni-heidelberg.de/) dataset for optical flow. |' + id: totrans-59 prefs: [] type: TYPE_TB + zh: '| [`HD1K`](generated/torchvision.datasets.HD1K.html#torchvision.datasets.HD1K + "torchvision.datasets.HD1K")(root[, split, transforms]) | 用于光流的[HD1K](http://hci-benchmark.iwr.uni-heidelberg.de/)数据集。 + |' - en: '| [`KittiFlow`](generated/torchvision.datasets.KittiFlow.html#torchvision.datasets.KittiFlow "torchvision.datasets.KittiFlow")(root[, split, transforms]) | [KITTI](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow) dataset for optical flow (2015). |' + id: totrans-60 prefs: [] type: TYPE_TB + zh: '| [`KittiFlow`](generated/torchvision.datasets.KittiFlow.html#torchvision.datasets.KittiFlow + "torchvision.datasets.KittiFlow")(root[, split, transforms]) | 用于光流的[KITTI](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow)数据集(2015年)。 + |' - en: '| [`Sintel`](generated/torchvision.datasets.Sintel.html#torchvision.datasets.Sintel "torchvision.datasets.Sintel")(root[, split, pass_name, transforms]) | [Sintel](http://sintel.is.tue.mpg.de/) Dataset for optical flow. |' + id: totrans-61 prefs: [] type: TYPE_TB + zh: '| [`Sintel`](generated/torchvision.datasets.Sintel.html#torchvision.datasets.Sintel + "torchvision.datasets.Sintel")(root[, split, pass_name, transforms]) | 用于光流的[Sintel](http://sintel.is.tue.mpg.de/)数据集。 + |' - en: Stereo Matching[](#stereo-matching "Permalink to this heading") + id: totrans-62 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 立体匹配[](#stereo-matching "跳转到此标题") - en: '| [`CarlaStereo`](generated/torchvision.datasets.CarlaStereo.html#torchvision.datasets.CarlaStereo "torchvision.datasets.CarlaStereo")(root[, transforms]) | Carla simulator data linked in the [CREStereo github repo](https://github.com/megvii-research/CREStereo). |' + id: totrans-63 prefs: [] type: TYPE_TB + zh: '| [`CarlaStereo`](generated/torchvision.datasets.CarlaStereo.html#torchvision.datasets.CarlaStereo + "torchvision.datasets.CarlaStereo")(root[, transforms]) | [CREStereo github repo](https://github.com/megvii-research/CREStereo)中链接的Carla模拟器数据。 + |' - en: '| [`Kitti2012Stereo`](generated/torchvision.datasets.Kitti2012Stereo.html#torchvision.datasets.Kitti2012Stereo "torchvision.datasets.Kitti2012Stereo")(root[, split, transforms]) | KITTI dataset from the [2012 stereo evaluation benchmark](http://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php). |' + id: totrans-64 prefs: [] type: TYPE_TB + zh: '| [`Kitti2012Stereo`](generated/torchvision.datasets.Kitti2012Stereo.html#torchvision.datasets.Kitti2012Stereo + "torchvision.datasets.Kitti2012Stereo")(root[, split, transforms]) | 来自[2012年立体评估基准](http://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php)的KITTI数据集。 + |' - en: '| [`Kitti2015Stereo`](generated/torchvision.datasets.Kitti2015Stereo.html#torchvision.datasets.Kitti2015Stereo "torchvision.datasets.Kitti2015Stereo")(root[, split, transforms]) | KITTI dataset from the [2015 stereo evaluation benchmark](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php). |' + id: totrans-65 prefs: [] type: TYPE_TB + zh: '| [`Kitti2015Stereo`](generated/torchvision.datasets.Kitti2015Stereo.html#torchvision.datasets.Kitti2015Stereo + "torchvision.datasets.Kitti2015Stereo")(root[, split, transforms]) | 来自[2015年立体评估基准](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php)的KITTI数据集。 + |' - en: '| [`CREStereo`](generated/torchvision.datasets.CREStereo.html#torchvision.datasets.CREStereo "torchvision.datasets.CREStereo")(root[, transforms]) | Synthetic dataset used in training the [CREStereo](https://arxiv.org/pdf/2203.11483.pdf) architecture. |' + id: totrans-66 prefs: [] type: TYPE_TB + zh: '| [`CREStereo`](generated/torchvision.datasets.CREStereo.html#torchvision.datasets.CREStereo + "torchvision.datasets.CREStereo")(root[, transforms]) | 用于训练[CREStereo](https://arxiv.org/pdf/2203.11483.pdf)架构的合成数据集。 + |' - en: '| [`FallingThingsStereo`](generated/torchvision.datasets.FallingThingsStereo.html#torchvision.datasets.FallingThingsStereo "torchvision.datasets.FallingThingsStereo")(root[, variant, transforms]) | [FallingThings](https://research.nvidia.com/publication/2018-06_falling-things-synthetic-dataset-3d-object-detection-and-pose-estimation) dataset. |' + id: totrans-67 prefs: [] type: TYPE_TB + zh: '| [`FallingThingsStereo`](generated/torchvision.datasets.FallingThingsStereo.html#torchvision.datasets.FallingThingsStereo + "torchvision.datasets.FallingThingsStereo")(root[, variant, transforms]) | [FallingThings](https://research.nvidia.com/publication/2018-06_falling-things-synthetic-dataset-3d-object-detection-and-pose-estimation)数据集。 + |' - en: '| [`SceneFlowStereo`](generated/torchvision.datasets.SceneFlowStereo.html#torchvision.datasets.SceneFlowStereo "torchvision.datasets.SceneFlowStereo")(root[, variant, pass_name, ...]) | Dataset interface for [Scene Flow](https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html) datasets. |' + id: totrans-68 prefs: [] type: TYPE_TB + zh: '| [`SceneFlowStereo`](generated/torchvision.datasets.SceneFlowStereo.html#torchvision.datasets.SceneFlowStereo + "torchvision.datasets.SceneFlowStereo")(root[, variant, pass_name, ...]) | 用于[Scene + Flow](https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html)数据集的数据集接口。 + |' - en: '| [`SintelStereo`](generated/torchvision.datasets.SintelStereo.html#torchvision.datasets.SintelStereo "torchvision.datasets.SintelStereo")(root[, pass_name, transforms]) | Sintel [Stereo Dataset](http://sintel.is.tue.mpg.de/stereo). |' + id: totrans-69 prefs: [] type: TYPE_TB + zh: '| [`SintelStereo`](generated/torchvision.datasets.SintelStereo.html#torchvision.datasets.SintelStereo + "torchvision.datasets.SintelStereo")(root[, pass_name, transforms]) | Sintel立体数据集 + 。 |' - en: '| [`InStereo2k`](generated/torchvision.datasets.InStereo2k.html#torchvision.datasets.InStereo2k "torchvision.datasets.InStereo2k")(root[, split, transforms]) | [InStereo2k](https://github.com/YuhuaXu/StereoDataset) dataset. |' + id: totrans-70 prefs: [] type: TYPE_TB + zh: '| [`InStereo2k`](generated/torchvision.datasets.InStereo2k.html#torchvision.datasets.InStereo2k + "torchvision.datasets.InStereo2k")(root[, split, transforms]) | InStereo2k数据集 + 。 |' - en: '| [`ETH3DStereo`](generated/torchvision.datasets.ETH3DStereo.html#torchvision.datasets.ETH3DStereo "torchvision.datasets.ETH3DStereo")(root[, split, transforms]) | ETH3D [Low-Res Two-View](https://www.eth3d.net/datasets) dataset. |' + id: totrans-71 prefs: [] type: TYPE_TB + zh: '| [`ETH3DStereo`](generated/torchvision.datasets.ETH3DStereo.html#torchvision.datasets.ETH3DStereo + "torchvision.datasets.ETH3DStereo")(root[, split, transforms]) | ETH3D低分辨率双视图数据集 + 。 |' - en: '| [`Middlebury2014Stereo`](generated/torchvision.datasets.Middlebury2014Stereo.html#torchvision.datasets.Middlebury2014Stereo "torchvision.datasets.Middlebury2014Stereo")(root[, split, ...]) | Publicly available scenes from the Middlebury dataset 2014 version . |' + id: totrans-72 prefs: [] type: TYPE_TB + zh: '| [`Middlebury2014Stereo`](generated/torchvision.datasets.Middlebury2014Stereo.html#torchvision.datasets.Middlebury2014Stereo + "torchvision.datasets.Middlebury2014Stereo")(root[, split, ...]) | Middlebury数据集2014版本的公开场景 + 。 |' - en: Image pairs[](#image-pairs "Permalink to this heading") + id: totrans-73 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 图像对[](#image-pairs "Permalink to this heading") - en: '| [`LFWPairs`](generated/torchvision.datasets.LFWPairs.html#torchvision.datasets.LFWPairs "torchvision.datasets.LFWPairs")(root[, split, image_set, ...]) | [LFW](http://vis-www.cs.umass.edu/lfw/) Dataset. |' + id: totrans-74 prefs: [] type: TYPE_TB + zh: '| [`LFWPairs`](generated/torchvision.datasets.LFWPairs.html#torchvision.datasets.LFWPairs + "torchvision.datasets.LFWPairs")(root[, split, image_set, ...]) | LFW数据集 。 + |' - en: '| [`PhotoTour`](generated/torchvision.datasets.PhotoTour.html#torchvision.datasets.PhotoTour "torchvision.datasets.PhotoTour")(root, name[, train, transform, ...]) | [Multi-view Stereo Correspondence](http://matthewalunbrown.com/patchdata/patchdata.html) Dataset. |' + id: totrans-75 prefs: [] type: TYPE_TB + zh: '| [`PhotoTour`](generated/torchvision.datasets.PhotoTour.html#torchvision.datasets.PhotoTour + "torchvision.datasets.PhotoTour")(root, name[, train, transform, ...]) | 多视图立体对应数据集 + 。 |' - en: Image captioning[](#image-captioning "Permalink to this heading") + id: totrans-76 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 图像字幕[](#image-captioning "Permalink to this heading") - en: '| [`CocoCaptions`](generated/torchvision.datasets.CocoCaptions.html#torchvision.datasets.CocoCaptions "torchvision.datasets.CocoCaptions")(root, annFile[, transform, ...]) | [MS Coco Captions](https://cocodataset.org/#captions-2015) Dataset. |' + id: totrans-77 prefs: [] type: TYPE_TB + zh: '| [`CocoCaptions`](generated/torchvision.datasets.CocoCaptions.html#torchvision.datasets.CocoCaptions + "torchvision.datasets.CocoCaptions")(root, annFile[, transform, ...]) | MS Coco + Captions数据集 。 |' - en: Video classification[](#video-classification "Permalink to this heading") + id: totrans-78 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 视频分类[](#video-classification "Permalink to this heading") - en: '| [`HMDB51`](generated/torchvision.datasets.HMDB51.html#torchvision.datasets.HMDB51 "torchvision.datasets.HMDB51")(root, annotation_path, frames_per_clip) | [HMDB51](https://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/) dataset. |' + id: totrans-79 prefs: [] type: TYPE_TB + zh: '| [`HMDB51`](generated/torchvision.datasets.HMDB51.html#torchvision.datasets.HMDB51 + "torchvision.datasets.HMDB51")(root, annotation_path, frames_per_clip) | HMDB51数据集 + 。 + |' - en: '| [`Kinetics`](generated/torchvision.datasets.Kinetics.html#torchvision.datasets.Kinetics "torchvision.datasets.Kinetics")(root, frames_per_clip[, ...]) | [Generic Kinetics](https://www.deepmind.com/open-source/kinetics) dataset. |' + id: totrans-80 prefs: [] type: TYPE_TB + zh: '| [`Kinetics`](generated/torchvision.datasets.Kinetics.html#torchvision.datasets.Kinetics + "torchvision.datasets.Kinetics")(root, frames_per_clip[, ...]) | 通用Kinetics数据集 + 。 |' - en: '| [`UCF101`](generated/torchvision.datasets.UCF101.html#torchvision.datasets.UCF101 "torchvision.datasets.UCF101")(root, annotation_path, frames_per_clip) | [UCF101](https://www.crcv.ucf.edu/data/UCF101.php) dataset. |' + id: totrans-81 prefs: [] type: TYPE_TB + zh: '| [`UCF101`](generated/torchvision.datasets.UCF101.html#torchvision.datasets.UCF101 + "torchvision.datasets.UCF101")(root, annotation_path, frames_per_clip) | UCF101数据集 + 。 |' - en: Video prediction[](#video-prediction "Permalink to this heading") + id: totrans-82 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 视频预测[](#video-prediction "Permalink to this heading") - en: '| [`MovingMNIST`](generated/torchvision.datasets.MovingMNIST.html#torchvision.datasets.MovingMNIST "torchvision.datasets.MovingMNIST")(root[, split, split_ratio, ...]) | [MovingMNIST](http://www.cs.toronto.edu/~nitish/unsupervised_video/) Dataset. |' + id: totrans-83 prefs: [] type: TYPE_TB + zh: '| [`MovingMNIST`](generated/torchvision.datasets.MovingMNIST.html#torchvision.datasets.MovingMNIST + "torchvision.datasets.MovingMNIST")(root[, split, split_ratio, ...]) | MovingMNIST数据集 + 。 |' - en: '## Base classes for custom datasets[](#base-classes-for-custom-datasets "Permalink to this heading")' + id: totrans-84 prefs: [] type: TYPE_NORMAL + zh: '## 自定义数据集的基类[](#base-classes-for-custom-datasets "Permalink to this heading")' - en: '| [`DatasetFolder`](generated/torchvision.datasets.DatasetFolder.html#torchvision.datasets.DatasetFolder "torchvision.datasets.DatasetFolder")(root, loader[, extensions, ...]) | A generic data loader. |' + id: totrans-85 prefs: [] type: TYPE_TB + zh: '| [`DatasetFolder`](generated/torchvision.datasets.DatasetFolder.html#torchvision.datasets.DatasetFolder + "torchvision.datasets.DatasetFolder")(root, loader[, extensions, ...]) | 通用数据加载器。 + |' - en: '| [`ImageFolder`](generated/torchvision.datasets.ImageFolder.html#torchvision.datasets.ImageFolder "torchvision.datasets.ImageFolder")(root, transform, ...) | A generic data loader where the images are arranged in this way by default: . |' + id: totrans-86 prefs: [] type: TYPE_TB + zh: '| [`ImageFolder`](generated/torchvision.datasets.ImageFolder.html#torchvision.datasets.ImageFolder + "torchvision.datasets.ImageFolder")(root, transform, ...) | 通用数据加载器,默认情况下图像排列方式如下:。 + |' - en: '| [`VisionDataset`](generated/torchvision.datasets.VisionDataset.html#torchvision.datasets.VisionDataset "torchvision.datasets.VisionDataset")([root, transforms, transform, ...]) | Base Class For making datasets which are compatible with torchvision. |' + id: totrans-87 prefs: [] type: TYPE_TB + zh: '| [`VisionDataset`](generated/torchvision.datasets.VisionDataset.html#torchvision.datasets.VisionDataset + "torchvision.datasets.VisionDataset")([root, transforms, transform, ...]) | 用于与torchvision兼容的数据集的基类。 + |' - en: Transforms v2[](#transforms-v2 "Permalink to this heading") + id: totrans-88 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 转换v2[](#transforms-v2 "Permalink to this heading") - en: '| [`wrap_dataset_for_transforms_v2`](generated/torchvision.datasets.wrap_dataset_for_transforms_v2.html#torchvision.datasets.wrap_dataset_for_transforms_v2 "torchvision.datasets.wrap_dataset_for_transforms_v2")(dataset[, ...]) | Wrap a `torchvision.dataset` for usage with `torchvision.transforms.v2`. |' + id: totrans-89 prefs: [] type: TYPE_TB + zh: '| [`wrap_dataset_for_transforms_v2`](generated/torchvision.datasets.wrap_dataset_for_transforms_v2.html#torchvision.datasets.wrap_dataset_for_transforms_v2 + "torchvision.datasets.wrap_dataset_for_transforms_v2")(dataset[, ...]) | 使用`torchvision.transforms.v2`包装`torchvision.dataset`以供使用。 + |' diff --git a/totrans/vis017_06.yaml b/totrans/vis017_06.yaml index d4a4ab3055a26b25a2dc6cdfbadb73cc8f7413bf..9648c895388ffd1573207e62fdcfd521a6e8a1ab 100644 --- a/totrans/vis017_06.yaml +++ b/totrans/vis017_06.yaml @@ -1,40 +1,67 @@ - en: Utils + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: Utils - en: 原文:[https://pytorch.org/vision/stable/utils.html](https://pytorch.org/vision/stable/utils.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/utils.html](https://pytorch.org/vision/stable/utils.html) - en: The `torchvision.utils` module contains various utilities, mostly [for visualization](auto_examples/others/plot_visualization_utils.html#sphx-glr-auto-examples-others-plot-visualization-utils-py). + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.utils` 模块包含各种实用工具,主要用于[可视化](auto_examples/others/plot_visualization_utils.html#sphx-glr-auto-examples-others-plot-visualization-utils-py)。' - en: '| [`draw_bounding_boxes`](generated/torchvision.utils.draw_bounding_boxes.html#torchvision.utils.draw_bounding_boxes "torchvision.utils.draw_bounding_boxes")(image, boxes[, labels, ...]) | Draws bounding boxes on given image. |' + id: totrans-3 prefs: [] type: TYPE_TB + zh: '| [`draw_bounding_boxes`](generated/torchvision.utils.draw_bounding_boxes.html#torchvision.utils.draw_bounding_boxes + "torchvision.utils.draw_bounding_boxes")(image, boxes[, labels, ...]) | 在给定的图像上绘制边界框。 + |' - en: '| [`draw_segmentation_masks`](generated/torchvision.utils.draw_segmentation_masks.html#torchvision.utils.draw_segmentation_masks "torchvision.utils.draw_segmentation_masks")(image, masks[, ...]) | Draws segmentation masks on given RGB image. |' + id: totrans-4 prefs: [] type: TYPE_TB + zh: '| [`draw_segmentation_masks`](generated/torchvision.utils.draw_segmentation_masks.html#torchvision.utils.draw_segmentation_masks + "torchvision.utils.draw_segmentation_masks")(image, masks[, ...]) | 在给定的 RGB 图像上绘制分割蒙版。 + |' - en: '| [`draw_keypoints`](generated/torchvision.utils.draw_keypoints.html#torchvision.utils.draw_keypoints "torchvision.utils.draw_keypoints")(image, keypoints[, ...]) | Draws Keypoints on given RGB image. |' + id: totrans-5 prefs: [] type: TYPE_TB + zh: '| [`draw_keypoints`](generated/torchvision.utils.draw_keypoints.html#torchvision.utils.draw_keypoints + "torchvision.utils.draw_keypoints")(image, keypoints[, ...]) | 在给定的 RGB 图像上绘制关键点。 + |' - en: '| [`flow_to_image`](generated/torchvision.utils.flow_to_image.html#torchvision.utils.flow_to_image "torchvision.utils.flow_to_image")(flow) | Converts a flow to an RGB image. |' + id: totrans-6 prefs: [] type: TYPE_TB + zh: '| [`flow_to_image`](generated/torchvision.utils.flow_to_image.html#torchvision.utils.flow_to_image + "torchvision.utils.flow_to_image")(flow) | 将光流转换为 RGB 图像。 |' - en: '| [`make_grid`](generated/torchvision.utils.make_grid.html#torchvision.utils.make_grid "torchvision.utils.make_grid")(tensor[, nrow, padding, ...]) | Make a grid of images. |' + id: totrans-7 prefs: [] type: TYPE_TB + zh: '| [`make_grid`](generated/torchvision.utils.make_grid.html#torchvision.utils.make_grid + "torchvision.utils.make_grid")(tensor[, nrow, padding, ...]) | 制作图像网格。 |' - en: '| [`save_image`](generated/torchvision.utils.save_image.html#torchvision.utils.save_image "torchvision.utils.save_image")(tensor, fp[, format]) | Save a given Tensor into an image file. |' + id: totrans-8 prefs: [] type: TYPE_TB + zh: '| [`save_image`](generated/torchvision.utils.save_image.html#torchvision.utils.save_image + "torchvision.utils.save_image")(tensor, fp[, format]) | 将给定的张量保存为图像文件。 |' diff --git a/totrans/vis017_07.yaml b/totrans/vis017_07.yaml index d0bfa249687d382ec02bb3f843c22bcc2d112688..58d99cf3e89d59cdc6379b527efe681b34b5be57 100644 --- a/totrans/vis017_07.yaml +++ b/totrans/vis017_07.yaml @@ -1,254 +1,430 @@ - en: Operators + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 运算符 - en: 原文:[https://pytorch.org/vision/stable/ops.html](https://pytorch.org/vision/stable/ops.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/ops.html](https://pytorch.org/vision/stable/ops.html) - en: '`torchvision.ops` implements operators, losses and layers that are specific for Computer Vision.' + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.ops` 实现了特定于计算机视觉的运算符、损失和层。' - en: Note + id: totrans-3 prefs: [] type: TYPE_NORMAL + zh: 注意 - en: All operators have native support for TorchScript. + id: totrans-4 prefs: [] type: TYPE_NORMAL + zh: 所有运算符都原生支持TorchScript。 - en: Detection and Segmentation Operators[](#detection-and-segmentation-operators "Permalink to this heading") + id: totrans-5 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 检测和分割运算符[](#detection-and-segmentation-operators "跳转到此标题") - en: The below operators perform pre-processing as well as post-processing required in object detection and segmentation models. + id: totrans-6 prefs: [] type: TYPE_NORMAL + zh: 以下运算符执行对象检测和分割模型中所需的预处理和后处理。 - en: '| [`batched_nms`](generated/torchvision.ops.batched_nms.html#torchvision.ops.batched_nms "torchvision.ops.batched_nms")(boxes, scores, idxs, iou_threshold) | Performs non-maximum suppression in a batched fashion. |' + id: totrans-7 prefs: [] type: TYPE_TB + zh: '| [`batched_nms`](generated/torchvision.ops.batched_nms.html#torchvision.ops.batched_nms + "torchvision.ops.batched_nms")(boxes, scores, idxs, iou_threshold) | 以批处理方式执行非极大值抑制。 + |' - en: '| [`masks_to_boxes`](generated/torchvision.ops.masks_to_boxes.html#torchvision.ops.masks_to_boxes "torchvision.ops.masks_to_boxes")(masks) | Compute the bounding boxes around the provided masks. |' + id: totrans-8 prefs: [] type: TYPE_TB + zh: '| [`masks_to_boxes`](generated/torchvision.ops.masks_to_boxes.html#torchvision.ops.masks_to_boxes + "torchvision.ops.masks_to_boxes")(masks) | 计算提供的掩码周围的边界框。 |' - en: '| [`nms`](generated/torchvision.ops.nms.html#torchvision.ops.nms "torchvision.ops.nms")(boxes, scores, iou_threshold) | Performs non-maximum suppression (NMS) on the boxes according to their intersection-over-union (IoU). |' + id: totrans-9 prefs: [] type: TYPE_TB + zh: '| [`nms`](generated/torchvision.ops.nms.html#torchvision.ops.nms "torchvision.ops.nms")(boxes, scores, iou_threshold) + | 根据它们的交并比(IoU)对框执行非极大值抑制(NMS)。 |' - en: '| [`roi_align`](generated/torchvision.ops.roi_align.html#torchvision.ops.roi_align "torchvision.ops.roi_align")(input, boxes, output_size[, ...]) | Performs Region of Interest (RoI) Align operator with average pooling, as described in Mask R-CNN. |' + id: totrans-10 prefs: [] type: TYPE_TB + zh: '| [`roi_align`](generated/torchvision.ops.roi_align.html#torchvision.ops.roi_align + "torchvision.ops.roi_align")(input, boxes, output_size[, ...]) | 执行具有平均池化的感兴趣区域(RoI)对齐运算符,如Mask + R-CNN中所述。 |' - en: '| [`roi_pool`](generated/torchvision.ops.roi_pool.html#torchvision.ops.roi_pool "torchvision.ops.roi_pool")(input, boxes, output_size[, ...]) | Performs Region of Interest (RoI) Pool operator described in Fast R-CNN |' + id: totrans-11 prefs: [] type: TYPE_TB + zh: '| [`roi_pool`](generated/torchvision.ops.roi_pool.html#torchvision.ops.roi_pool + "torchvision.ops.roi_pool")(input, boxes, output_size[, ...]) | 执行Fast R-CNN中描述的感兴趣区域(RoI)池运算符。 + |' - en: '| [`ps_roi_align`](generated/torchvision.ops.ps_roi_align.html#torchvision.ops.ps_roi_align "torchvision.ops.ps_roi_align")(input, boxes, output_size[, ...]) | Performs Position-Sensitive Region of Interest (RoI) Align operator mentioned in Light-Head R-CNN. |' + id: totrans-12 prefs: [] type: TYPE_TB + zh: '| [`ps_roi_align`](generated/torchvision.ops.ps_roi_align.html#torchvision.ops.ps_roi_align + "torchvision.ops.ps_roi_align")(input, boxes, output_size[, ...]) | 执行Light-Head + R-CNN中提到的位置敏感的感兴趣区域(RoI)对齐运算符。 |' - en: '| [`ps_roi_pool`](generated/torchvision.ops.ps_roi_pool.html#torchvision.ops.ps_roi_pool "torchvision.ops.ps_roi_pool")(input, boxes, output_size[, ...]) | Performs Position-Sensitive Region of Interest (RoI) Pool operator described in R-FCN |' + id: totrans-13 prefs: [] type: TYPE_TB + zh: '| [`ps_roi_pool`](generated/torchvision.ops.ps_roi_pool.html#torchvision.ops.ps_roi_pool + "torchvision.ops.ps_roi_pool")(input, boxes, output_size[, ...]) | 执行R-FCN中描述的位置敏感的感兴趣区域(RoI)池运算符。 + |' - en: '| [`FeaturePyramidNetwork`](generated/torchvision.ops.FeaturePyramidNetwork.html#torchvision.ops.FeaturePyramidNetwork "torchvision.ops.FeaturePyramidNetwork")(in_channels_list, ...) | Module that adds a FPN from on top of a set of feature maps. |' + id: totrans-14 prefs: [] type: TYPE_TB + zh: '| [`FeaturePyramidNetwork`](generated/torchvision.ops.FeaturePyramidNetwork.html#torchvision.ops.FeaturePyramidNetwork + "torchvision.ops.FeaturePyramidNetwork")(in_channels_list, ...) | 从一组特征图顶部添加FPN的模块。 + |' - en: '| [`MultiScaleRoIAlign`](generated/torchvision.ops.MultiScaleRoIAlign.html#torchvision.ops.MultiScaleRoIAlign "torchvision.ops.MultiScaleRoIAlign")(featmap_names, ...[, ...]) | Multi-scale RoIAlign pooling, which is useful for detection with or without FPN. |' + id: totrans-15 prefs: [] type: TYPE_TB + zh: '| [`MultiScaleRoIAlign`](generated/torchvision.ops.MultiScaleRoIAlign.html#torchvision.ops.MultiScaleRoIAlign + "torchvision.ops.MultiScaleRoIAlign")(featmap_names, ...[, ...]) | 多尺度RoIAlign池化,适用于具有或不具有FPN的检测。 + |' - en: '| [`RoIAlign`](generated/torchvision.ops.RoIAlign.html#torchvision.ops.RoIAlign "torchvision.ops.RoIAlign")(output_size, spatial_scale, ...[, ...]) | See [`roi_align()`](generated/torchvision.ops.roi_align.html#torchvision.ops.roi_align "torchvision.ops.roi_align"). |' + id: totrans-16 prefs: [] type: TYPE_TB + zh: '| [`RoIAlign`](generated/torchvision.ops.RoIAlign.html#torchvision.ops.RoIAlign + "torchvision.ops.RoIAlign")(output_size, spatial_scale, ...[, ...]) | 参见[`roi_align()`](generated/torchvision.ops.roi_align.html#torchvision.ops.roi_align + "torchvision.ops.roi_align")。 |' - en: '| [`RoIPool`](generated/torchvision.ops.RoIPool.html#torchvision.ops.RoIPool "torchvision.ops.RoIPool")(output_size, spatial_scale) | See [`roi_pool()`](generated/torchvision.ops.roi_pool.html#torchvision.ops.roi_pool "torchvision.ops.roi_pool"). |' + id: totrans-17 prefs: [] type: TYPE_TB + zh: '| [`RoIPool`](generated/torchvision.ops.RoIPool.html#torchvision.ops.RoIPool + "torchvision.ops.RoIPool")(output_size, spatial_scale) | 参见[`roi_pool()`](generated/torchvision.ops.roi_pool.html#torchvision.ops.roi_pool + "torchvision.ops.roi_pool")。 |' - en: '| [`PSRoIAlign`](generated/torchvision.ops.PSRoIAlign.html#torchvision.ops.PSRoIAlign "torchvision.ops.PSRoIAlign")(output_size, spatial_scale, ...) | See [`ps_roi_align()`](generated/torchvision.ops.ps_roi_align.html#torchvision.ops.ps_roi_align "torchvision.ops.ps_roi_align"). |' + id: totrans-18 prefs: [] type: TYPE_TB + zh: '| [`PSRoIAlign`](generated/torchvision.ops.PSRoIAlign.html#torchvision.ops.PSRoIAlign + "torchvision.ops.PSRoIAlign")(output_size, spatial_scale, ...) | 参见[`ps_roi_align()`](generated/torchvision.ops.ps_roi_align.html#torchvision.ops.ps_roi_align + "torchvision.ops.ps_roi_align")。 |' - en: '| [`PSRoIPool`](generated/torchvision.ops.PSRoIPool.html#torchvision.ops.PSRoIPool "torchvision.ops.PSRoIPool")(output_size, spatial_scale) | See [`ps_roi_pool()`](generated/torchvision.ops.ps_roi_pool.html#torchvision.ops.ps_roi_pool "torchvision.ops.ps_roi_pool"). |' + id: totrans-19 prefs: [] type: TYPE_TB + zh: '| [`PSRoIPool`](generated/torchvision.ops.PSRoIPool.html#torchvision.ops.PSRoIPool + "torchvision.ops.PSRoIPool")(output_size, spatial_scale) | 参见[`ps_roi_pool()`](generated/torchvision.ops.ps_roi_pool.html#torchvision.ops.ps_roi_pool + "torchvision.ops.ps_roi_pool")。 |' - en: Box Operators[](#box-operators "Permalink to this heading") + id: totrans-20 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 框运算符[](#box-operators "跳转到此标题") - en: These utility functions perform various operations on bounding boxes. + id: totrans-21 prefs: [] type: TYPE_NORMAL + zh: 这些实用函数在边界框上执行各种操作。 - en: '| [`box_area`](generated/torchvision.ops.box_area.html#torchvision.ops.box_area "torchvision.ops.box_area")(boxes) | Computes the area of a set of bounding boxes, which are specified by their (x1, y1, x2, y2) coordinates. |' + id: totrans-22 prefs: [] type: TYPE_TB + zh: '| [`box_area`](generated/torchvision.ops.box_area.html#torchvision.ops.box_area + "torchvision.ops.box_area")(boxes) | 计算一组边界框的面积,这些边界框由它们的(x1,y1,x2,y2)坐标指定。 |' - en: '| [`box_convert`](generated/torchvision.ops.box_convert.html#torchvision.ops.box_convert "torchvision.ops.box_convert")(boxes, in_fmt, out_fmt) | Converts boxes from given in_fmt to out_fmt. |' + id: totrans-23 prefs: [] type: TYPE_TB + zh: '| [`box_convert`](generated/torchvision.ops.box_convert.html#torchvision.ops.box_convert + "torchvision.ops.box_convert")(boxes, in_fmt, out_fmt) | 将框从给定的in_fmt转换为out_fmt。 + |' - en: '| [`box_iou`](generated/torchvision.ops.box_iou.html#torchvision.ops.box_iou "torchvision.ops.box_iou")(boxes1, boxes2) | Return intersection-over-union (Jaccard index) between two sets of boxes. |' + id: totrans-24 prefs: [] type: TYPE_TB + zh: '| [`box_iou`](generated/torchvision.ops.box_iou.html#torchvision.ops.box_iou + "torchvision.ops.box_iou")(boxes1, boxes2) | 返回两组框之间的交并比(Jaccard指数)。 |' - en: '| [`clip_boxes_to_image`](generated/torchvision.ops.clip_boxes_to_image.html#torchvision.ops.clip_boxes_to_image "torchvision.ops.clip_boxes_to_image")(boxes, size) | Clip boxes so that they lie inside an image of size size. |' + id: totrans-25 prefs: [] type: TYPE_TB + zh: '| [`clip_boxes_to_image`](generated/torchvision.ops.clip_boxes_to_image.html#torchvision.ops.clip_boxes_to_image + "torchvision.ops.clip_boxes_to_image")(boxes, size) | 将框裁剪到大小为size的图像内。 |' - en: '| [`complete_box_iou`](generated/torchvision.ops.complete_box_iou.html#torchvision.ops.complete_box_iou "torchvision.ops.complete_box_iou")(boxes1, boxes2[, eps]) | Return complete intersection-over-union (Jaccard index) between two sets of boxes. |' + id: totrans-26 prefs: [] type: TYPE_TB + zh: '| [`complete_box_iou`](generated/torchvision.ops.complete_box_iou.html#torchvision.ops.complete_box_iou + "torchvision.ops.complete_box_iou")(boxes1, boxes2[, eps]) | 返回两组框之间的完整交并比(Jaccard指数)。 + |' - en: '| [`distance_box_iou`](generated/torchvision.ops.distance_box_iou.html#torchvision.ops.distance_box_iou "torchvision.ops.distance_box_iou")(boxes1, boxes2[, eps]) | Return distance intersection-over-union (Jaccard index) between two sets of boxes. |' + id: totrans-27 prefs: [] type: TYPE_TB + zh: '| [`distance_box_iou`](generated/torchvision.ops.distance_box_iou.html#torchvision.ops.distance_box_iou + "torchvision.ops.distance_box_iou")(boxes1, boxes2[, eps]) | 返回两组框之间的距离交并比(Jaccard指数)。 + |' - en: '| [`generalized_box_iou`](generated/torchvision.ops.generalized_box_iou.html#torchvision.ops.generalized_box_iou "torchvision.ops.generalized_box_iou")(boxes1, boxes2) | Return generalized intersection-over-union (Jaccard index) between two sets of boxes. |' + id: totrans-28 prefs: [] type: TYPE_TB + zh: '| [`generalized_box_iou`](generated/torchvision.ops.generalized_box_iou.html#torchvision.ops.generalized_box_iou + "torchvision.ops.generalized_box_iou")(boxes1, boxes2) | 返回两组框之间的广义交并比(Jaccard指数)。 + |' - en: '| [`remove_small_boxes`](generated/torchvision.ops.remove_small_boxes.html#torchvision.ops.remove_small_boxes "torchvision.ops.remove_small_boxes")(boxes, min_size) | Remove boxes which contains at least one side smaller than min_size. |' + id: totrans-29 prefs: [] type: TYPE_TB + zh: '| [`remove_small_boxes`](generated/torchvision.ops.remove_small_boxes.html#torchvision.ops.remove_small_boxes + "torchvision.ops.remove_small_boxes")(boxes, min_size) | 删除至少有一边小于min_size的框。 + |' - en: Losses[](#losses "Permalink to this heading") + id: totrans-30 prefs: - PREF_H2 type: TYPE_NORMAL + zh: Losses[](#losses "Permalink to this heading") - en: 'The following vision-specific loss functions are implemented:' + id: totrans-31 prefs: [] type: TYPE_NORMAL + zh: 实现了以下特定于视觉的损失函数: - en: '| [`complete_box_iou_loss`](generated/torchvision.ops.complete_box_iou_loss.html#torchvision.ops.complete_box_iou_loss "torchvision.ops.complete_box_iou_loss")(boxes1, boxes2[, ...]) | Gradient-friendly IoU loss with an additional penalty that is non-zero when the boxes do not overlap. |' + id: totrans-32 prefs: [] type: TYPE_TB + zh: '| [`complete_box_iou_loss`](generated/torchvision.ops.complete_box_iou_loss.html#torchvision.ops.complete_box_iou_loss + "torchvision.ops.complete_box_iou_loss")(boxes1, boxes2[, ...]) | 具有额外惩罚的梯度友好的IoU损失,当框不重叠时,惩罚值不为零。 + |' - en: '| [`distance_box_iou_loss`](generated/torchvision.ops.distance_box_iou_loss.html#torchvision.ops.distance_box_iou_loss "torchvision.ops.distance_box_iou_loss")(boxes1, boxes2[, ...]) | Gradient-friendly IoU loss with an additional penalty that is non-zero when the distance between boxes'' centers isn''t zero. |' + id: totrans-33 prefs: [] type: TYPE_TB + zh: '| [`distance_box_iou_loss`](generated/torchvision.ops.distance_box_iou_loss.html#torchvision.ops.distance_box_iou_loss + "torchvision.ops.distance_box_iou_loss")(boxes1, boxes2[, ...]) | 具有额外惩罚的梯度友好的IoU损失,当框之间的中心距离不为零时,惩罚值不为零。 + |' - en: '| [`generalized_box_iou_loss`](generated/torchvision.ops.generalized_box_iou_loss.html#torchvision.ops.generalized_box_iou_loss "torchvision.ops.generalized_box_iou_loss")(boxes1, boxes2[, ...]) | Gradient-friendly IoU loss with an additional penalty that is non-zero when the boxes do not overlap and scales with the size of their smallest enclosing box. |' + id: totrans-34 prefs: [] type: TYPE_TB + zh: '| [`generalized_box_iou_loss`](generated/torchvision.ops.generalized_box_iou_loss.html#torchvision.ops.generalized_box_iou_loss + "torchvision.ops.generalized_box_iou_loss")(boxes1, boxes2[, ...]) | 具有额外惩罚的梯度友好的IoU损失,当框不重叠且与其最小外接框的大小成比例时,惩罚值不为零。 + |' - en: '| [`sigmoid_focal_loss`](generated/torchvision.ops.sigmoid_focal_loss.html#torchvision.ops.sigmoid_focal_loss "torchvision.ops.sigmoid_focal_loss")(inputs, targets[, alpha, ...]) | Loss used in RetinaNet for dense detection: [https://arxiv.org/abs/1708.02002](https://arxiv.org/abs/1708.02002). |' + id: totrans-35 prefs: [] type: TYPE_TB + zh: '| [`sigmoid_focal_loss`](generated/torchvision.ops.sigmoid_focal_loss.html#torchvision.ops.sigmoid_focal_loss + "torchvision.ops.sigmoid_focal_loss")(inputs, targets[, alpha, ...]) | 用于密集检测的RetinaNet中使用的损失函数:[https://arxiv.org/abs/1708.02002](https://arxiv.org/abs/1708.02002)。 + |' - en: Layers[](#layers "Permalink to this heading") + id: totrans-36 prefs: - PREF_H2 type: TYPE_NORMAL + zh: Layers[](#layers "Permalink to this heading") - en: 'TorchVision provides commonly used building blocks as layers:' + id: totrans-37 prefs: [] type: TYPE_NORMAL + zh: TorchVision提供常用的构建块作为层: - en: '| [`Conv2dNormActivation`](generated/torchvision.ops.Conv2dNormActivation.html#torchvision.ops.Conv2dNormActivation "torchvision.ops.Conv2dNormActivation")(in_channels, ...) | Configurable block used for Convolution2d-Normalization-Activation blocks. |' + id: totrans-38 prefs: [] type: TYPE_TB + zh: '| [`Conv2dNormActivation`](generated/torchvision.ops.Conv2dNormActivation.html#torchvision.ops.Conv2dNormActivation + "torchvision.ops.Conv2dNormActivation")(in_channels, ...) | 用于卷积2D-规范化-激活块的可配置块。 + |' - en: '| [`Conv3dNormActivation`](generated/torchvision.ops.Conv3dNormActivation.html#torchvision.ops.Conv3dNormActivation "torchvision.ops.Conv3dNormActivation")(in_channels, ...) | Configurable block used for Convolution3d-Normalization-Activation blocks. |' + id: totrans-39 prefs: [] type: TYPE_TB + zh: '| [`Conv3dNormActivation`](generated/torchvision.ops.Conv3dNormActivation.html#torchvision.ops.Conv3dNormActivation + "torchvision.ops.Conv3dNormActivation")(in_channels, ...) | 用于卷积3D-规范化-激活块的可配置块。 + |' - en: '| [`DeformConv2d`](generated/torchvision.ops.DeformConv2d.html#torchvision.ops.DeformConv2d "torchvision.ops.DeformConv2d")(in_channels, out_channels, ...) | See [`deform_conv2d()`](generated/torchvision.ops.deform_conv2d.html#torchvision.ops.deform_conv2d "torchvision.ops.deform_conv2d"). |' + id: totrans-40 prefs: [] type: TYPE_TB + zh: '| [`DeformConv2d`](generated/torchvision.ops.DeformConv2d.html#torchvision.ops.DeformConv2d + "torchvision.ops.DeformConv2d")(in_channels, out_channels, ...) | 参见[`deform_conv2d()`](generated/torchvision.ops.deform_conv2d.html#torchvision.ops.deform_conv2d + "torchvision.ops.deform_conv2d")。 |' - en: '| [`DropBlock2d`](generated/torchvision.ops.DropBlock2d.html#torchvision.ops.DropBlock2d "torchvision.ops.DropBlock2d")(p, block_size[, inplace, eps]) | See [`drop_block2d()`](generated/torchvision.ops.drop_block2d.html#torchvision.ops.drop_block2d "torchvision.ops.drop_block2d"). |' + id: totrans-41 prefs: [] type: TYPE_TB + zh: '| [`DropBlock2d`](generated/torchvision.ops.DropBlock2d.html#torchvision.ops.DropBlock2d + "torchvision.ops.DropBlock2d")(p, block_size[, inplace, eps]) | 参见[`drop_block2d()`](generated/torchvision.ops.drop_block2d.html#torchvision.ops.drop_block2d + "torchvision.ops.drop_block2d")。 |' - en: '| [`DropBlock3d`](generated/torchvision.ops.DropBlock3d.html#torchvision.ops.DropBlock3d "torchvision.ops.DropBlock3d")(p, block_size[, inplace, eps]) | See [`drop_block3d()`](generated/torchvision.ops.drop_block3d.html#torchvision.ops.drop_block3d "torchvision.ops.drop_block3d"). |' + id: totrans-42 prefs: [] type: TYPE_TB + zh: '| [`DropBlock3d`](generated/torchvision.ops.DropBlock3d.html#torchvision.ops.DropBlock3d + "torchvision.ops.DropBlock3d")(p, block_size[, inplace, eps]) | 参见[`drop_block3d()`](generated/torchvision.ops.drop_block3d.html#torchvision.ops.drop_block3d + "torchvision.ops.drop_block3d")。 |' - en: '| [`FrozenBatchNorm2d`](generated/torchvision.ops.FrozenBatchNorm2d.html#torchvision.ops.FrozenBatchNorm2d "torchvision.ops.FrozenBatchNorm2d")(num_features[, eps]) | BatchNorm2d where the batch statistics and the affine parameters are fixed |' + id: totrans-43 prefs: [] type: TYPE_TB + zh: '| [`FrozenBatchNorm2d`](generated/torchvision.ops.FrozenBatchNorm2d.html#torchvision.ops.FrozenBatchNorm2d + "torchvision.ops.FrozenBatchNorm2d")(num_features[, eps]) | 批量归一化2d,其中批量统计数据和仿射参数是固定的。 + |' - en: '| [`MLP`](generated/torchvision.ops.MLP.html#torchvision.ops.MLP "torchvision.ops.MLP")(in_channels, hidden_channels, ...) | This block implements the multi-layer perceptron (MLP) module. |' + id: totrans-44 prefs: [] type: TYPE_TB + zh: '| [`MLP`](generated/torchvision.ops.MLP.html#torchvision.ops.MLP "torchvision.ops.MLP")(in_channels, hidden_channels, ...) + | 此块实现多层感知器(MLP)模块。 |' - en: '| [`Permute`](generated/torchvision.ops.Permute.html#torchvision.ops.Permute "torchvision.ops.Permute")(dims) | This module returns a view of the tensor input with its dimensions permuted. |' + id: totrans-45 prefs: [] type: TYPE_TB + zh: '| [`Permute`](generated/torchvision.ops.Permute.html#torchvision.ops.Permute + "torchvision.ops.Permute")(dims) | 此模块返回一个对输入张量进行维度重新排列的视图。 |' - en: '| [`SqueezeExcitation`](generated/torchvision.ops.SqueezeExcitation.html#torchvision.ops.SqueezeExcitation "torchvision.ops.SqueezeExcitation")(input_channels, ...) | This block implements the Squeeze-and-Excitation block from [https://arxiv.org/abs/1709.01507](https://arxiv.org/abs/1709.01507) (see Fig. |' + id: totrans-46 prefs: [] type: TYPE_TB + zh: '| [`SqueezeExcitation`](generated/torchvision.ops.SqueezeExcitation.html#torchvision.ops.SqueezeExcitation + "torchvision.ops.SqueezeExcitation")(input_channels, ...) | 此块实现来自[https://arxiv.org/abs/1709.01507](https://arxiv.org/abs/1709.01507)的Squeeze-and-Excitation块(参见图)。 + |' - en: '| [`StochasticDepth`](generated/torchvision.ops.StochasticDepth.html#torchvision.ops.StochasticDepth "torchvision.ops.StochasticDepth")(p, mode) | See [`stochastic_depth()`](generated/torchvision.ops.stochastic_depth.html#torchvision.ops.stochastic_depth "torchvision.ops.stochastic_depth"). |' + id: totrans-47 prefs: [] type: TYPE_TB + zh: '| [`StochasticDepth`](generated/torchvision.ops.StochasticDepth.html#torchvision.ops.StochasticDepth + "torchvision.ops.StochasticDepth")(p, mode) | 参见[`stochastic_depth()`](generated/torchvision.ops.stochastic_depth.html#torchvision.ops.stochastic_depth + "torchvision.ops.stochastic_depth")。 |' - en: '| [`deform_conv2d`](generated/torchvision.ops.deform_conv2d.html#torchvision.ops.deform_conv2d "torchvision.ops.deform_conv2d")(input, offset, weight[, bias, ...]) | Performs Deformable Convolution v2, described in [Deformable ConvNets v2: More Deformable, Better Results](https://arxiv.org/abs/1811.11168) if `mask` is not `None` and Performs Deformable Convolution, described in [Deformable Convolutional Networks](https://arxiv.org/abs/1703.06211) if `mask` is `None`. |' + id: totrans-48 prefs: [] type: TYPE_TB + zh: '| [`deform_conv2d`](generated/torchvision.ops.deform_conv2d.html#torchvision.ops.deform_conv2d + "torchvision.ops.deform_conv2d")(input, offset, weight[, bias, ...]) | 执行可变形卷积 + v2,如果`mask`不是`None`,则描述在[可变形卷积网络v2:更可变形,更好的结果](https://arxiv.org/abs/1811.11168),如果`mask`是`None`,则执行可变形卷积,描述在[可变形卷积网络](https://arxiv.org/abs/1703.06211)。 + |' - en: '| [`drop_block2d`](generated/torchvision.ops.drop_block2d.html#torchvision.ops.drop_block2d "torchvision.ops.drop_block2d")(input, p, block_size[, ...]) | Implements DropBlock2d from "DropBlock: A regularization method for convolutional networks" . |' + id: totrans-49 prefs: [] type: TYPE_TB + zh: '| [`drop_block2d`](generated/torchvision.ops.drop_block2d.html#torchvision.ops.drop_block2d + "torchvision.ops.drop_block2d")(input, p, block_size[, ...]) | 从"DropBlock:卷积网络的正则化方法"中实现DropBlock2d + 。 |' - en: '| [`drop_block3d`](generated/torchvision.ops.drop_block3d.html#torchvision.ops.drop_block3d "torchvision.ops.drop_block3d")(input, p, block_size[, ...]) | Implements DropBlock3d from "DropBlock: A regularization method for convolutional networks" . |' + id: totrans-50 prefs: [] type: TYPE_TB + zh: '| [`drop_block3d`](generated/torchvision.ops.drop_block3d.html#torchvision.ops.drop_block3d + "torchvision.ops.drop_block3d")(input, p, block_size[, ...]) | 从"DropBlock:卷积网络的正则化方法"中实现DropBlock3d + 。 |' - en: '| [`stochastic_depth`](generated/torchvision.ops.stochastic_depth.html#torchvision.ops.stochastic_depth "torchvision.ops.stochastic_depth")(input, p, mode[, training]) | Implements the Stochastic Depth from ["Deep Networks with Stochastic Depth"](https://arxiv.org/abs/1603.09382) used for randomly dropping residual branches of residual architectures. |' + id: totrans-51 prefs: [] type: TYPE_TB + zh: '| [`stochastic_depth`](generated/torchvision.ops.stochastic_depth.html#torchvision.ops.stochastic_depth + "torchvision.ops.stochastic_depth")(input, p, mode[, training]) | 实现来自["具有随机深度的深度网络"](https://arxiv.org/abs/1603.09382)的随机深度,用于随机丢弃残差架构的残差分支。 + |' diff --git a/totrans/vis017_08.yaml b/totrans/vis017_08.yaml index 09d95990021d03fb496cf0c6cbb8ba495e42f06f..b2a147a81fb0fa28d7165f3b4fa7a71df16d4c0d 100644 --- a/totrans/vis017_08.yaml +++ b/totrans/vis017_08.yaml @@ -1,121 +1,195 @@ - en: Decoding / Encoding images and videos + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 解码/编码图像和视频 - en: 原文:[https://pytorch.org/vision/stable/io.html](https://pytorch.org/vision/stable/io.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/io.html](https://pytorch.org/vision/stable/io.html) - en: The `torchvision.io` package provides functions for performing IO operations. They are currently specific to reading and writing images and videos. + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.io`包提供了执行IO操作的函数。目前这些函数专门用于读取和写入图像和视频。' - en: Images[](#images "Permalink to this heading") + id: totrans-3 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 图像[](#images "跳转到此标题") - en: '| [`read_image`](generated/torchvision.io.read_image.html#torchvision.io.read_image "torchvision.io.read_image")(path[, mode]) | Reads a JPEG or PNG image into a 3 dimensional RGB or grayscale Tensor. |' + id: totrans-4 prefs: [] type: TYPE_TB + zh: '| [`read_image`](generated/torchvision.io.read_image.html#torchvision.io.read_image + "torchvision.io.read_image")(path[, mode]) | 将JPEG或PNG图像读入三维RGB或灰度张量。 |' - en: '| [`decode_image`](generated/torchvision.io.decode_image.html#torchvision.io.decode_image "torchvision.io.decode_image")(input[, mode]) | Detects whether an image is a JPEG or PNG and performs the appropriate operation to decode the image into a 3 dimensional RGB or grayscale Tensor. |' + id: totrans-5 prefs: [] type: TYPE_TB + zh: '| [`decode_image`](generated/torchvision.io.decode_image.html#torchvision.io.decode_image + "torchvision.io.decode_image")(input[, mode]) | 检测图像是JPEG还是PNG,并执行适当的操作将图像解码为三维RGB或灰度张量。 + |' - en: '| [`encode_jpeg`](generated/torchvision.io.encode_jpeg.html#torchvision.io.encode_jpeg "torchvision.io.encode_jpeg")(input[, quality]) | Takes an input tensor in CHW layout and returns a buffer with the contents of its corresponding JPEG file. |' + id: totrans-6 prefs: [] type: TYPE_TB + zh: '| [`encode_jpeg`](generated/torchvision.io.encode_jpeg.html#torchvision.io.encode_jpeg + "torchvision.io.encode_jpeg")(input[, quality]) | 将输入张量按CHW布局编码为其对应JPEG文件内容的缓冲区。 + |' - en: '| [`decode_jpeg`](generated/torchvision.io.decode_jpeg.html#torchvision.io.decode_jpeg "torchvision.io.decode_jpeg")(input[, mode, device]) | Decodes a JPEG image into a 3 dimensional RGB or grayscale Tensor. |' + id: totrans-7 prefs: [] type: TYPE_TB + zh: '| [`decode_jpeg`](generated/torchvision.io.decode_jpeg.html#torchvision.io.decode_jpeg + "torchvision.io.decode_jpeg")(input[, mode, device]) | 将JPEG图像解码为三维RGB或灰度张量。 |' - en: '| [`write_jpeg`](generated/torchvision.io.write_jpeg.html#torchvision.io.write_jpeg "torchvision.io.write_jpeg")(input, filename[, quality]) | Takes an input tensor in CHW layout and saves it in a JPEG file. |' + id: totrans-8 prefs: [] type: TYPE_TB + zh: '| [`write_jpeg`](generated/torchvision.io.write_jpeg.html#torchvision.io.write_jpeg + "torchvision.io.write_jpeg")(input, filename[, quality]) | 将输入张量按CHW布局保存为JPEG文件。 + |' - en: '| [`encode_png`](generated/torchvision.io.encode_png.html#torchvision.io.encode_png "torchvision.io.encode_png")(input[, compression_level]) | Takes an input tensor in CHW layout and returns a buffer with the contents of its corresponding PNG file. |' + id: totrans-9 prefs: [] type: TYPE_TB + zh: '| [`encode_png`](generated/torchvision.io.encode_png.html#torchvision.io.encode_png + "torchvision.io.encode_png")(input[, compression_level]) | 将输入张量按CHW布局编码为其对应PNG文件内容的缓冲区。 + |' - en: '| [`decode_png`](generated/torchvision.io.decode_png.html#torchvision.io.decode_png "torchvision.io.decode_png")(input[, mode]) | Decodes a PNG image into a 3 dimensional RGB or grayscale Tensor. |' + id: totrans-10 prefs: [] type: TYPE_TB + zh: '| [`decode_png`](generated/torchvision.io.decode_png.html#torchvision.io.decode_png + "torchvision.io.decode_png")(input[, mode]) | 将PNG图像解码为三维RGB或灰度张量。 |' - en: '| [`write_png`](generated/torchvision.io.write_png.html#torchvision.io.write_png "torchvision.io.write_png")(input, filename[, compression_level]) | Takes an input tensor in CHW layout (or HW in the case of grayscale images) and saves it in a PNG file. |' + id: totrans-11 prefs: [] type: TYPE_TB + zh: '| [`write_png`](generated/torchvision.io.write_png.html#torchvision.io.write_png + "torchvision.io.write_png")(input, filename[, compression_level]) | 将输入张量按CHW布局(或灰度图像的情况下按HW布局)保存为PNG文件。 + |' - en: '| [`read_file`](generated/torchvision.io.read_file.html#torchvision.io.read_file "torchvision.io.read_file")(path) | Reads and outputs the bytes contents of a file as a uint8 Tensor with one dimension. |' + id: totrans-12 prefs: [] type: TYPE_TB + zh: '| [`read_file`](generated/torchvision.io.read_file.html#torchvision.io.read_file + "torchvision.io.read_file")(path) | 读取文件的字节内容,并输出为具有一维uint8张量。 |' - en: '| [`write_file`](generated/torchvision.io.write_file.html#torchvision.io.write_file "torchvision.io.write_file")(filename, data) | Writes the contents of an uint8 tensor with one dimension to a file. |' + id: totrans-13 prefs: [] type: TYPE_TB + zh: '| [`write_file`](generated/torchvision.io.write_file.html#torchvision.io.write_file + "torchvision.io.write_file")(filename, data) | 将具有一维的uint8张量内容写入文件。 |' - en: '| [`ImageReadMode`](generated/torchvision.io.ImageReadMode.html#torchvision.io.ImageReadMode "torchvision.io.ImageReadMode")(value) | Support for various modes while reading images. |' + id: totrans-14 prefs: [] type: TYPE_TB + zh: '| [`ImageReadMode`](generated/torchvision.io.ImageReadMode.html#torchvision.io.ImageReadMode + "torchvision.io.ImageReadMode")(value) | 在读取图像时支持各种模式。 |' - en: Video[](#video "Permalink to this heading") + id: totrans-15 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 视频[](#video "跳转到此标题") - en: '| [`read_video`](generated/torchvision.io.read_video.html#torchvision.io.read_video "torchvision.io.read_video")(filename[, start_pts, end_pts, ...]) | Reads a video from a file, returning both the video frames and the audio frames |' + id: totrans-16 prefs: [] type: TYPE_TB + zh: '| [`read_video`](generated/torchvision.io.read_video.html#torchvision.io.read_video + "torchvision.io.read_video")(filename[, start_pts, end_pts, ...]) | 从文件中读取视频,返回视频帧和音频帧 + |' - en: '| [`read_video_timestamps`](generated/torchvision.io.read_video_timestamps.html#torchvision.io.read_video_timestamps "torchvision.io.read_video_timestamps")(filename[, pts_unit]) | List the video frames timestamps. |' + id: totrans-17 prefs: [] type: TYPE_TB + zh: '| [`read_video_timestamps`](generated/torchvision.io.read_video_timestamps.html#torchvision.io.read_video_timestamps + "torchvision.io.read_video_timestamps")(filename[, pts_unit]) | 列出视频帧的时间戳。 |' - en: '| [`write_video`](generated/torchvision.io.write_video.html#torchvision.io.write_video "torchvision.io.write_video")(filename, video_array, fps[, ...]) | Writes a 4d tensor in [T, H, W, C] format in a video file |' + id: totrans-18 prefs: [] type: TYPE_TB + zh: '| [`write_video`](generated/torchvision.io.write_video.html#torchvision.io.write_video + "torchvision.io.write_video")(filename, video_array, fps[, ...]) | 将[T, H, W, + C]格式的4维张量写入视频文件 |' - en: Fine-grained video API[](#fine-grained-video-api "Permalink to this heading") + id: totrans-19 prefs: - PREF_H3 type: TYPE_NORMAL + zh: 细粒度视频API[](#fine-grained-video-api "跳转到此标题") - en: In addition to the `read_video` function, we provide a high-performance lower-level API for more fine-grained control compared to the `read_video` function. It does all this whilst fully supporting torchscript. + id: totrans-20 prefs: [] type: TYPE_NORMAL + zh: 除了`read_video`函数外,我们还提供了一个高性能的低级API,用于比`read_video`函数更精细的控制。它在完全支持torchscript的同时完成所有这些操作。 - en: Warning + id: totrans-21 prefs: [] type: TYPE_NORMAL + zh: 警告 - en: The fine-grained video API is in Beta stage, and backward compatibility is not guaranteed. + id: totrans-22 prefs: [] type: TYPE_NORMAL + zh: 细粒度视频API处于Beta阶段,不保证向后兼容性。 - en: '| [`VideoReader`](generated/torchvision.io.VideoReader.html#torchvision.io.VideoReader "torchvision.io.VideoReader")(src[, stream, num_threads]) | Fine-grained video-reading API. |' + id: totrans-23 prefs: [] type: TYPE_TB + zh: '| [`VideoReader`](generated/torchvision.io.VideoReader.html#torchvision.io.VideoReader + "torchvision.io.VideoReader")(src[, stream, num_threads]) | 细粒度视频读取API。 |' - en: 'Example of inspecting a video:' + id: totrans-24 prefs: [] type: TYPE_NORMAL + zh: 检查视频的示例: - en: '[PRE0]' + id: totrans-25 prefs: [] type: TYPE_PRE + zh: '[PRE0]' diff --git a/totrans/vis017_09.yaml b/totrans/vis017_09.yaml index 24ad95a01c5062fab7b3ae07ec6727d790dc8298..010ac872f5066790c8734c0c6eece0ff16f71368 100644 --- a/totrans/vis017_09.yaml +++ b/totrans/vis017_09.yaml @@ -1,63 +1,90 @@ - en: Feature extraction for model inspection + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 模型检查的特征提取 - en: 原文:[https://pytorch.org/vision/stable/feature_extraction.html](https://pytorch.org/vision/stable/feature_extraction.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/feature_extraction.html](https://pytorch.org/vision/stable/feature_extraction.html) - en: 'The `torchvision.models.feature_extraction` package contains feature extraction utilities that let us tap into our models to access intermediate transformations of our inputs. This could be useful for a variety of applications in computer vision. Just a few examples are:' + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '`torchvision.models.feature_extraction`包含特征提取工具,让我们可以访问模型对输入的中间转换。这对计算机视觉中的各种应用可能很有用。只是一些例子包括:' - en: Visualizing feature maps. + id: totrans-3 prefs: - PREF_UL type: TYPE_NORMAL + zh: 可视化特征图。 - en: Extracting features to compute image descriptors for tasks like facial recognition, copy-detection, or image retrieval. + id: totrans-4 prefs: - PREF_UL type: TYPE_NORMAL + zh: 提取特征以计算图像描述符,用于面部识别、复制检测或图像检索等任务。 - en: Passing selected features to downstream sub-networks for end-to-end training with a specific task in mind. For example, passing a hierarchy of features to a Feature Pyramid Network with object detection heads. + id: totrans-5 prefs: - PREF_UL type: TYPE_NORMAL + zh: 将选定的特征传递给下游子网络,以便根据特定任务进行端到端训练。例如,将特征的层次结构传递给具有目标检测头的特征金字塔网络。 - en: 'Torchvision provides [`create_feature_extractor()`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor "torchvision.models.feature_extraction.create_feature_extractor") for this purpose. It works by following roughly these steps:' + id: totrans-6 prefs: [] type: TYPE_NORMAL + zh: Torchvision提供了[`create_feature_extractor()`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor + "torchvision.models.feature_extraction.create_feature_extractor")用于此目的。它大致按照以下步骤进行: - en: Symbolically tracing the model to get a graphical representation of how it transforms the input, step by step. + id: totrans-7 prefs: - PREF_OL type: TYPE_NORMAL + zh: 符号跟踪模型,以逐步获取其如何转换输入的图形表示。 - en: Setting the user-selected graph nodes as outputs. + id: totrans-8 prefs: - PREF_OL type: TYPE_NORMAL + zh: 将用户选择的图节点设置为输出。 - en: Removing all redundant nodes (anything downstream of the output nodes). + id: totrans-9 prefs: - PREF_OL type: TYPE_NORMAL + zh: 删除所有冗余节点(输出节点之后的所有节点)。 - en: Generating python code from the resulting graph and bundling that into a PyTorch module together with the graph itself. + id: totrans-10 prefs: - PREF_OL type: TYPE_NORMAL + zh: 从生成的图形中生成Python代码,并将其与图形一起捆绑到PyTorch模块中。 - en: The [torch.fx documentation](https://pytorch.org/docs/stable/fx.html) provides a more general and detailed explanation of the above procedure and the inner workings of the symbolic tracing. + id: totrans-11 prefs: [] type: TYPE_NORMAL + zh: '[torch.fx文档](https://pytorch.org/docs/stable/fx.html)提供了对上述过程和符号跟踪内部工作的更一般和详细的解释。' - en: '**About Node Names**' + id: totrans-12 prefs: [] type: TYPE_NORMAL + zh: '**关于节点名称**' - en: 'In order to specify which nodes should be output nodes for extracted features, one should be familiar with the node naming convention used here (which differs slightly from that used in `torch.fx`). A node name is specified as a `.` separated @@ -65,8 +92,10 @@ or leaf module. For instance `"layer4.2.relu"` in ResNet-50 represents the output of the ReLU of the 2nd block of the 4th layer of the `ResNet` module. Here are some finer points to keep in mind:' + id: totrans-13 prefs: [] type: TYPE_NORMAL + zh: 为了指定应该作为提取特征的输出节点的节点,应该熟悉此处使用的节点命名约定(与`torch.fx`中使用的略有不同)。节点名称被指定为一个以`.`分隔的路径,从顶层模块向下遍历模块层次结构,直到叶操作或叶模块。例如,在ResNet-50中,`"layer4.2.relu"`代表`ResNet`模块第4层第2个块的ReLU的输出。以下是一些需要注意的细节: - en: When specifying node names for [`create_feature_extractor()`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor "torchvision.models.feature_extraction.create_feature_extractor"), you may provide a truncated version of a node name as a shortcut. To see how this works, try creating @@ -74,9 +103,13 @@ print(train_nodes)` and observe that the last node pertaining to `layer4` is `"layer4.2.relu_2"`. One may specify `"layer4.2.relu_2"` as the return node, or just `"layer4"` as this, by convention, refers to the last node (in order of execution) of `layer4`. + id: totrans-14 prefs: - PREF_UL type: TYPE_NORMAL + zh: 在为[`create_feature_extractor()`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor + "torchvision.models.feature_extraction.create_feature_extractor")指定节点名称时,您可以提供节点名称的缩写版本作为快捷方式。要查看其工作原理,请尝试创建一个ResNet-50模型,并使用`train_nodes, + _ = get_graph_node_names(model) print(train_nodes)`打印节点名称,观察与`layer4`相关的最后一个节点是`"layer4.2.relu_2"`。可以将`"layer4.2.relu_2"`指定为返回节点,或者只指定`"layer4"`,因为按照惯例,这指的是`layer4`的最后一个节点(按执行顺序)。 - en: If a certain module or operation is repeated more than once, node names get an additional `_{int}` postfix to disambiguate. For instance, maybe the addition (`+`) operation is used three times in the same `forward` method. Then there would @@ -84,31 +117,49 @@ The counter is maintained within the scope of the direct parent. So in ResNet-50 there is a `"layer4.1.add"` and a `"layer4.2.add"`. Because the addition operations reside in different blocks, there is no need for a postfix to disambiguate. + id: totrans-15 prefs: - PREF_UL type: TYPE_NORMAL + zh: 如果某个模块或操作重复多次,则节点名称会附加`_{int}`后缀以消除歧义。例如,也许加法(`+`)操作在同一个`forward`方法中使用了三次。那么会有`"path.to.module.add"`,`"path.to.module.add_1"`,`"path.to.module.add_2"`。计数器在直接父级的范围内维护。因此,在ResNet-50中有一个`"layer4.1.add"`和一个`"layer4.2.add"`。因为加法操作位于不同的块中,所以不需要后缀来消除歧义。 - en: '**An Example**' + id: totrans-16 prefs: [] type: TYPE_NORMAL + zh: '**一个示例**' - en: 'Here is an example of how we might extract features for MaskRCNN:' + id: totrans-17 prefs: [] type: TYPE_NORMAL + zh: 这里有一个我们可能为MaskRCNN提取特征的示例: - en: '[PRE0]' + id: totrans-18 prefs: [] type: TYPE_PRE + zh: '[PRE0]' - en: API Reference[](#api-reference "Permalink to this heading") + id: totrans-19 prefs: - PREF_H2 type: TYPE_NORMAL + zh: API参考[](#api-reference "Permalink to this heading") - en: '| [`create_feature_extractor`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor "torchvision.models.feature_extraction.create_feature_extractor")(model[, ...]) | Creates a new graph module that returns intermediate nodes from a given model as dictionary with user specified keys as strings, and the requested outputs as values. |' + id: totrans-20 prefs: [] type: TYPE_TB + zh: '| [`create_feature_extractor`](generated/torchvision.models.feature_extraction.create_feature_extractor.html#torchvision.models.feature_extraction.create_feature_extractor + "torchvision.models.feature_extraction.create_feature_extractor")(model[, ...]) + | 创建一个新的图模块,将给定模型的中间节点作为字典返回,用户可以指定键作为字符串,请求的输出作为值。 |' - en: '| [`get_graph_node_names`](generated/torchvision.models.feature_extraction.get_graph_node_names.html#torchvision.models.feature_extraction.get_graph_node_names "torchvision.models.feature_extraction.get_graph_node_names")(model[, tracer_kwargs, ...]) | Dev utility to return node names in order of execution. |' + id: totrans-21 prefs: [] type: TYPE_TB + zh: '| [`get_graph_node_names`](generated/torchvision.models.feature_extraction.get_graph_node_names.html#torchvision.models.feature_extraction.get_graph_node_names + "torchvision.models.feature_extraction.get_graph_node_names")(model[, tracer_kwargs, ...]) + | 开发工具,按执行顺序返回节点名称。 |' diff --git a/totrans/vis017_10.yaml b/totrans/vis017_10.yaml index 6cb6122ec190f1f675915b76be74e74c911bec4c..16a4de63d690c13b1bdcb98262f8889e096d053c 100644 --- a/totrans/vis017_10.yaml +++ b/totrans/vis017_10.yaml @@ -1,4 +1,6 @@ - en: Examples and training references + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 示例和培训参考资料 diff --git a/totrans/vis017_11.yaml b/totrans/vis017_11.yaml index 96f3a9fc485c5f3853d70b86c2dde5b8a6469fd6..eba67850738f23cb79f925a97cf3caedcefe2af3 100644 --- a/totrans/vis017_11.yaml +++ b/totrans/vis017_11.yaml @@ -1,102 +1,168 @@ - en: Examples and tutorials + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 示例和教程 - en: 原文:[https://pytorch.org/vision/stable/auto_examples/index.html](https://pytorch.org/vision/stable/auto_examples/index.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/auto_examples/index.html](https://pytorch.org/vision/stable/auto_examples/index.html) - en: '## Transforms[](#transforms "Permalink to this heading")' + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: '## 变换[](#transforms "跳转到此标题")' - en: '![](../Images/ae533e69e8f27cd058b9a1aecea600fc.png)' + id: totrans-3 prefs: [] type: TYPE_IMG + zh: '![](../Images/ae533e69e8f27cd058b9a1aecea600fc.png)' - en: '[Getting started with transforms v2](transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py)' + id: totrans-4 prefs: [] type: TYPE_NORMAL + zh: '[开始使用变换v2](transforms/plot_transforms_getting_started.html#sphx-glr-auto-examples-transforms-plot-transforms-getting-started-py)' - en: Getting started with transforms v2![](../Images/0dd38779bf0dc0cce8475d6ed37e8c3a.png) + id: totrans-5 prefs: [] type: TYPE_NORMAL + zh: 开始使用变换v2![](../Images/0dd38779bf0dc0cce8475d6ed37e8c3a.png) - en: '[Illustration of transforms](transforms/plot_transforms_illustrations.html#sphx-glr-auto-examples-transforms-plot-transforms-illustrations-py)' + id: totrans-6 prefs: [] type: TYPE_NORMAL + zh: '[变换的示例](transforms/plot_transforms_illustrations.html#sphx-glr-auto-examples-transforms-plot-transforms-illustrations-py)' - en: Illustration of transforms![](../Images/e5daa82e85051ac0e31dc0c545fd5cfc.png) + id: totrans-7 prefs: [] type: TYPE_NORMAL + zh: 变换的示例![](../Images/e5daa82e85051ac0e31dc0c545fd5cfc.png) - en: '[Transforms v2: End-to-end object detection/segmentation example](transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py)' + id: totrans-8 prefs: [] type: TYPE_NORMAL + zh: '[变换v2:端到端目标检测/分割示例](transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py)' - en: 'Transforms v2: End-to-end object detection/segmentation example![](../Images/28774614295b13bdd690b35a48a8ee63.png)' + id: totrans-9 prefs: [] type: TYPE_NORMAL + zh: 变换v2:端到端目标检测/分割示例![](../Images/28774614295b13bdd690b35a48a8ee63.png) - en: '[How to use CutMix and MixUp](transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py)' + id: totrans-10 prefs: [] type: TYPE_NORMAL + zh: '[如何使用CutMix和MixUp](transforms/plot_cutmix_mixup.html#sphx-glr-auto-examples-transforms-plot-cutmix-mixup-py)' - en: How to use CutMix and MixUp![](../Images/6ea7323dd91268050bc3b112bfbe2137.png) + id: totrans-11 prefs: [] type: TYPE_NORMAL + zh: 如何使用CutMix和MixUp![](../Images/6ea7323dd91268050bc3b112bfbe2137.png) - en: '[How to write your own v2 transforms](transforms/plot_custom_transforms.html#sphx-glr-auto-examples-transforms-plot-custom-transforms-py)' + id: totrans-12 prefs: [] type: TYPE_NORMAL + zh: '[如何编写自己的v2变换](transforms/plot_custom_transforms.html#sphx-glr-auto-examples-transforms-plot-custom-transforms-py)' - en: How to write your own v2 transforms![](../Images/9936dd3731e6a31830b04978e4a36372.png) + id: totrans-13 prefs: [] type: TYPE_NORMAL + zh: 如何编写自己的v2变换![](../Images/9936dd3731e6a31830b04978e4a36372.png) - en: '[TVTensors FAQ](transforms/plot_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-tv-tensors-py)' + id: totrans-14 prefs: [] type: TYPE_NORMAL + zh: '[TVTensors常见问题](transforms/plot_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-tv-tensors-py)' - en: TVTensors FAQ![](../Images/b09b279e2189e74008bf1dd4792bb78d.png) + id: totrans-15 prefs: [] type: TYPE_NORMAL + zh: TVTensors常见问题![](../Images/b09b279e2189e74008bf1dd4792bb78d.png) - en: '[How to write your own TVTensor class](transforms/plot_custom_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-custom-tv-tensors-py)' + id: totrans-16 prefs: [] type: TYPE_NORMAL + zh: '[如何编写自己的TVTensor类](transforms/plot_custom_tv_tensors.html#sphx-glr-auto-examples-transforms-plot-custom-tv-tensors-py)' - en: How to write your own TVTensor class + id: totrans-17 prefs: [] type: TYPE_NORMAL + zh: 如何编写自己的TVTensor类 - en: Others[](#others "Permalink to this heading") + id: totrans-18 prefs: - PREF_H2 type: TYPE_NORMAL + zh: 其他[](#others "跳转到此标题") - en: '![](../Images/1b48db70ec2a2bb8db51c1b168cd480e.png)' + id: totrans-19 prefs: [] type: TYPE_IMG + zh: '![](../Images/1b48db70ec2a2bb8db51c1b168cd480e.png)' - en: '[Optical Flow: Predicting movement with the RAFT model](others/plot_optical_flow.html#sphx-glr-auto-examples-others-plot-optical-flow-py)' + id: totrans-20 prefs: [] type: TYPE_NORMAL + zh: '[光流:使用RAFT模型预测运动](others/plot_optical_flow.html#sphx-glr-auto-examples-others-plot-optical-flow-py)' - en: 'Optical Flow: Predicting movement with the RAFT model![](../Images/ec115e54f428029e9c1723af4b728dd6.png)' + id: totrans-21 prefs: [] type: TYPE_NORMAL + zh: 光流:使用RAFT模型预测运动![](../Images/ec115e54f428029e9c1723af4b728dd6.png) - en: '[Repurposing masks into bounding boxes](others/plot_repurposing_annotations.html#sphx-glr-auto-examples-others-plot-repurposing-annotations-py)' + id: totrans-22 prefs: [] type: TYPE_NORMAL + zh: '[将掩模重新用于边界框](others/plot_repurposing_annotations.html#sphx-glr-auto-examples-others-plot-repurposing-annotations-py)' - en: Repurposing masks into bounding boxes![](../Images/0d750c2d96bfcb18567ee1fa6e199cb1.png) + id: totrans-23 prefs: [] type: TYPE_NORMAL + zh: 将掩模重新用于边界框![](../Images/0d750c2d96bfcb18567ee1fa6e199cb1.png) - en: '[Torchscript support](others/plot_scripted_tensor_transforms.html#sphx-glr-auto-examples-others-plot-scripted-tensor-transforms-py)' + id: totrans-24 prefs: [] type: TYPE_NORMAL + zh: '[Torchscript支持](others/plot_scripted_tensor_transforms.html#sphx-glr-auto-examples-others-plot-scripted-tensor-transforms-py)' - en: Torchscript support![](../Images/bd0d411b154c618ccf9261eaa1d9c426.png) + id: totrans-25 prefs: [] type: TYPE_NORMAL + zh: Torchscript支持![](../Images/bd0d411b154c618ccf9261eaa1d9c426.png) - en: '[Video API](others/plot_video_api.html#sphx-glr-auto-examples-others-plot-video-api-py)' + id: totrans-26 prefs: [] type: TYPE_NORMAL + zh: '[视频API](others/plot_video_api.html#sphx-glr-auto-examples-others-plot-video-api-py)' - en: Video API![](../Images/ce0e5a69fa7dc1e5ba1cf00c70fda84a.png) + id: totrans-27 prefs: [] type: TYPE_NORMAL + zh: 视频API![](../Images/ce0e5a69fa7dc1e5ba1cf00c70fda84a.png) - en: '[Visualization utilities](others/plot_visualization_utils.html#sphx-glr-auto-examples-others-plot-visualization-utils-py)' + id: totrans-28 prefs: [] type: TYPE_NORMAL + zh: '[可视化工具](others/plot_visualization_utils.html#sphx-glr-auto-examples-others-plot-visualization-utils-py)' - en: Visualization utilities + id: totrans-29 prefs: [] type: TYPE_NORMAL + zh: 可视化工具 - en: '[`Download all examples in Python source code: auto_examples_python.zip`](../_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip)' + id: totrans-30 prefs: [] type: TYPE_NORMAL + zh: '[`下载所有Python源代码示例:auto_examples_python.zip`](../_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip)' - en: '[`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip`](../_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip)' + id: totrans-31 prefs: [] type: TYPE_NORMAL + zh: '[`下载所有Jupyter笔记本示例:auto_examples_jupyter.zip`](../_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip)' - en: '[Gallery generated by Sphinx-Gallery](https://sphinx-gallery.github.io)' + id: totrans-32 prefs: [] type: TYPE_NORMAL + zh: '[Sphinx-Gallery生成的画廊](https://sphinx-gallery.github.io)' diff --git a/totrans/vis017_12.yaml b/totrans/vis017_12.yaml index 141f5753d1ff52a777b67bf7ff98a40192a2a7f5..370bc28680f67067dabdc024462d0666d301eaac 100644 --- a/totrans/vis017_12.yaml +++ b/totrans/vis017_12.yaml @@ -1,16 +1,22 @@ - en: Training references + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: 训练参考 - en: 原文:[https://pytorch.org/vision/stable/training_references.html](https://pytorch.org/vision/stable/training_references.html) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/vision/stable/training_references.html](https://pytorch.org/vision/stable/training_references.html) - en: On top of the many models, datasets, and image transforms, Torchvision also provides training reference scripts. These are the scripts that we use to train the [models](models.html#models) which are then available with pre-trained weights. + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: 除了许多模型、数据集和图像转换之外,Torchvision还提供训练参考脚本。这些脚本是我们用来训练[模型](models.html#models)的,然后这些模型就可以使用预训练的权重。 - en: These scripts are not part of the core package and are instead available [on GitHub](https://github.com/pytorch/vision/tree/main/references). We currently provide references for [classification](https://github.com/pytorch/vision/tree/main/references/classification), @@ -18,22 +24,32 @@ [segmentation](https://github.com/pytorch/vision/tree/main/references/segmentation), [similarity learning](https://github.com/pytorch/vision/tree/main/references/similarity), and [video classification](https://github.com/pytorch/vision/tree/main/references/video_classification). + id: totrans-3 prefs: [] type: TYPE_NORMAL + zh: 这些脚本不是核心包的一部分,而是在[GitHub](https://github.com/pytorch/vision/tree/main/references)上提供。我们目前为[分类](https://github.com/pytorch/vision/tree/main/references/classification)、[检测](https://github.com/pytorch/vision/tree/main/references/detection)、[分割](https://github.com/pytorch/vision/tree/main/references/segmentation)、[相似性学习](https://github.com/pytorch/vision/tree/main/references/similarity)和[视频分类](https://github.com/pytorch/vision/tree/main/references/video_classification)提供参考。 - en: While these scripts are largely stable, they do not offer backward compatibility guarantees. + id: totrans-4 prefs: [] type: TYPE_NORMAL + zh: 尽管这些脚本在很大程度上是稳定的,但它们不提供向后兼容性保证。 - en: 'In general, these scripts rely on the latest (not yet released) pytorch version or the latest torchvision version. This means that to use them, **you might need to install the latest pytorch and torchvision versions**, with e.g.:' + id: totrans-5 prefs: [] type: TYPE_NORMAL + zh: 一般来说,这些脚本依赖于最新(尚未发布)的pytorch版本或最新的torchvision版本。这意味着要使用它们,**您可能需要安装最新的pytorch和torchvision版本**,例如: - en: '[PRE0]' + id: totrans-6 prefs: [] type: TYPE_PRE + zh: '[PRE0]' - en: If you need to rely on an older stable version of pytorch or torchvision, e.g. torchvision 0.10, then it’s safer to use the scripts from that corresponding release on GitHub, namely [https://github.com/pytorch/vision/tree/v0.10.0/references](https://github.com/pytorch/vision/tree/v0.10.0/references). + id: totrans-7 prefs: [] type: TYPE_NORMAL + zh: 如果您需要依赖于较旧的稳定版本的pytorch或torchvision,例如torchvision 0.10,那么最好使用GitHub上对应发布的脚本,即[https://github.com/pytorch/vision/tree/v0.10.0/references](https://github.com/pytorch/vision/tree/v0.10.0/references)。 diff --git a/totrans/vis017_13.yaml b/totrans/vis017_13.yaml index 5fcc1c33682477d25adbc55165db4b5dc2d1a41c..7095894be9834c9bd3154e9084a960ac7ca953dc 100644 --- a/totrans/vis017_13.yaml +++ b/totrans/vis017_13.yaml @@ -1,4 +1,6 @@ - en: PyTorch Libraries + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: PyTorch库 diff --git a/totrans/vis017_14.yaml b/totrans/vis017_14.yaml index 31e81dd3826d52f36d7cee5789ddbac45739964d..e6f88458a5372472a01299aaa92a6199c59dec0f 100644 --- a/totrans/vis017_14.yaml +++ b/totrans/vis017_14.yaml @@ -1,203 +1,318 @@ - en: TorchServe + id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL + zh: TorchServe - en: 原文:[https://pytorch.org/serve](https://pytorch.org/serve) + id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL + zh: 原文:[https://pytorch.org/serve](https://pytorch.org/serve) - en: TorchServe is a performant, flexible and easy to use tool for serving PyTorch models in production. + id: totrans-2 prefs: [] type: TYPE_NORMAL + zh: TorchServe是一个性能优越、灵活且易于使用的工具,用于在生产环境中提供PyTorch模型。 - en: What’s going on in TorchServe? + id: totrans-3 prefs: [] type: TYPE_NORMAL + zh: TorchServe中发生了什么? - en: '[High performance Llama 2 deployments with AWS Inferentia2 using TorchServe](https://pytorch.org/blog/high-performance-llama/)' + id: totrans-4 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用AWS Inferentia2和TorchServe进行高性能Llama 2部署](https://pytorch.org/blog/high-performance-llama/)' - en: '[Naver Case Study: Transition From High-Cost GPUs to Intel CPUs and oneAPI powered Software with performance](https://pytorch.org/blog/ml-model-server-resource-saving/)' + id: totrans-5 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Naver案例研究:从高成本GPU过渡到Intel CPU和使用性能的oneAPI软件](https://pytorch.org/blog/ml-model-server-resource-saving/)' - en: '[Run multiple generative AI models on GPU using Amazon SageMaker multi-model endpoints with TorchServe and save up to 75% in inference costs](https://aws.amazon.com/blogs/machine-learning/run-multiple-generative-ai-models-on-gpu-using-amazon-sagemaker-multi-model-endpoints-with-torchserve-and-save-up-to-75-in-inference-costs/)' + id: totrans-6 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用Amazon SageMaker多模型端点在GPU上运行多个生成AI模型,并节省高达75%的推理成本](https://aws.amazon.com/blogs/machine-learning/run-multiple-generative-ai-models-on-gpu-using-amazon-sagemaker-multi-model-endpoints-with-torchserve-and-save-up-to-75-in-inference-costs/)' - en: '[Deploying your Generative AI model in only four steps with Vertex AI and PyTorch](https://cloud.google.com/blog/products/ai-machine-learning/get-your-genai-model-going-in-four-easy-steps)' + id: totrans-7 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用Vertex AI和PyTorch在四个步骤中部署您的生成AI模型](https://cloud.google.com/blog/products/ai-machine-learning/get-your-genai-model-going-in-four-easy-steps)' - en: '[PyTorch Model Serving on Google Cloud TPUv5](https://cloud.google.com/tpu/docs/v5e-inference#pytorch-model-inference-and-serving)' + id: totrans-8 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[在Google Cloud TPUv5上提供PyTorch模型](https://cloud.google.com/tpu/docs/v5e-inference#pytorch-model-inference-and-serving)' - en: '[Monitoring using Datadog](https://www.datadoghq.com/blog/ai-integrations/#model-serving-and-deployment-vertex-ai-amazon-sagemaker-torchserve)' + id: totrans-9 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用Datadog进行监控](https://www.datadoghq.com/blog/ai-integrations/#model-serving-and-deployment-vertex-ai-amazon-sagemaker-torchserve)' - en: '[Torchserve Performance Tuning, Animated Drawings Case-Study](https://pytorch.org/blog/torchserve-performance-tuning/)' + id: totrans-10 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Torchserve性能调优,动画绘图案例研究](https://pytorch.org/blog/torchserve-performance-tuning/)' - en: '[Walmart Search: Serving Models at a Scale on TorchServe](https://medium.com/walmartglobaltech/search-model-serving-using-pytorch-and-torchserve-6caf9d1c5f4d)' + id: totrans-11 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[Walmart搜索:在TorchServe上规模化提供模型](https://medium.com/walmartglobaltech/search-model-serving-using-pytorch-and-torchserve-6caf9d1c5f4d)' - en: '[Scaling inference on CPU with TorchServe](https://www.youtube.com/watch?v=066_Jd6cwZg)' + id: totrans-12 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用TorchServe在CPU上扩展推理](https://www.youtube.com/watch?v=066_Jd6cwZg)' - en: '[TorchServe C++ backend](https://www.youtube.com/watch?v=OSmGGDpaesc)' + id: totrans-13 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[TorchServe C++后端](https://www.youtube.com/watch?v=OSmGGDpaesc)' - en: '[Grokking Intel CPU PyTorch performance from first principles: a TorchServe case study](https://pytorch.org/tutorials/intermediate/torchserve_with_ipex.html)' + id: totrans-14 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[从第一原理理解英特尔CPU PyTorch性能:TorchServe案例研究](https://pytorch.org/tutorials/intermediate/torchserve_with_ipex.html)' - en: '[Grokking Intel CPU PyTorch performance from first principles( Part 2): a TorchServe case study](https://pytorch.org/tutorials/intermediate/torchserve_with_ipex_2.html)' + id: totrans-15 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[从第一原理理解英特尔CPU PyTorch性能(第2部分):TorchServe案例研究](https://pytorch.org/tutorials/intermediate/torchserve_with_ipex_2.html)' - en: '[Case Study: Amazon Ads Uses PyTorch and AWS Inferentia to Scale Models for Ads Processing](https://pytorch.org/blog/amazon-ads-case-study/)' + id: totrans-16 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[案例研究:亚马逊广告使用PyTorch和AWS Inferentia扩展广告处理模型](https://pytorch.org/blog/amazon-ads-case-study/)' - en: '[Optimize your inference jobs using dynamic batch inference with TorchServe on Amazon SageMaker](https://aws.amazon.com/blogs/machine-learning/optimize-your-inference-jobs-using-dynamic-batch-inference-with-torchserve-on-amazon-sagemaker/)' + id: totrans-17 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用TorchServe在Amazon SageMaker上进行动态批量推理来优化推理作业](https://aws.amazon.com/blogs/machine-learning/optimize-your-inference-jobs-using-dynamic-batch-inference-with-torchserve-on-amazon-sagemaker/)' - en: '[Using AI to bring children’s drawings to life](https://ai.facebook.com/blog/using-ai-to-bring-childrens-drawings-to-life/)' + id: totrans-18 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[使用AI让儿童的绘画栩栩如生](https://ai.facebook.com/blog/using-ai-to-bring-childrens-drawings-to-life/)' - en: '[Model Serving in PyTorch](https://www.youtube.com/watch?v=2A17ZtycsPw)' + id: totrans-19 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[在PyTorch中提供模型](https://www.youtube.com/watch?v=2A17ZtycsPw)' - en: '[Evolution of Cresta’s machine learning architecture: Migration to AWS and PyTorch](https://aws.amazon.com/blogs/machine-learning/evolution-of-crestas-machine-learning-architecture-migration-to-aws-and-pytorch/)' + id: totrans-20 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[克雷斯塔机器学习架构的演变:迁移到AWS和PyTorch](https://aws.amazon.com/blogs/machine-learning/evolution-of-crestas-machine-learning-architecture-migration-to-aws-and-pytorch/)' - en: '[Explain Like I’m 5: TorchServe](https://www.youtube.com/watch?v=NEdZbkfHQCk)' + id: totrans-21 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[像我5岁一样解释:TorchServe](https://www.youtube.com/watch?v=NEdZbkfHQCk)' - en: '[How to Serve PyTorch Models with TorchServe](https://www.youtube.com/watch?v=XlO7iQMV3Ik)' + id: totrans-22 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[如何使用TorchServe提供PyTorch模型](https://www.youtube.com/watch?v=XlO7iQMV3Ik)' - en: '[How to deploy PyTorch models on Vertex AI](https://cloud.google.com/blog/topics/developers-practitioners/pytorch-google-cloud-how-deploy-pytorch-models-vertex-ai)' + id: totrans-23 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[如何在Vertex AI上部署PyTorch模型](https://cloud.google.com/blog/topics/developers-practitioners/pytorch-google-cloud-how-deploy-pytorch-models-vertex-ai)' - en: '[Quantitative Comparison of Serving Platforms](https://biano-ai.github.io/research/2021/08/16/quantitative-comparison-of-serving-platforms-for-neural-networks.html)' + id: totrans-24 prefs: - PREF_UL type: TYPE_NORMAL + zh: '[服务平台的定量比较](https://biano-ai.github.io/research/2021/08/16/quantitative-comparison-of-serving-platforms-for-neural-networks.html)' - en: All + id: totrans-25 prefs: [] type: TYPE_NORMAL + zh: 全部 - en: '* * *' + id: totrans-26 prefs: [] type: TYPE_NORMAL + zh: '* * *' - en: '[#### TorchServe Quick Start' + id: totrans-27 prefs: [] type: TYPE_NORMAL + zh: '[#### TorchServe快速入门' - en: 'Topics: Quick Start' + id: totrans-28 prefs: [] type: TYPE_NORMAL + zh: 主题:快速入门 - en: Learn how to install TorchServe and serve models. + id: totrans-29 prefs: [] type: TYPE_NORMAL + zh: 学习如何安装TorchServe并提供模型。 - en: '![](../Images/2e44a4dab4c1bd5cde13eaa681343e78.png)](getting_started.html) [#### Running TorchServe' + id: totrans-30 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/2e44a4dab4c1bd5cde13eaa681343e78.png)](getting_started.html) + [#### 运行TorchServe' - en: 'Topics: Running TorchServe' + id: totrans-31 prefs: [] type: TYPE_NORMAL + zh: 主题:运行TorchServe - en: Indepth explanation of how to run TorchServe + id: totrans-32 prefs: [] type: TYPE_NORMAL + zh: 深入解释如何运行TorchServe - en: '![](../Images/661e92286b91a04a664aa0dd434223f4.png)](server.html) [#### Why TorchServe' + id: totrans-33 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/661e92286b91a04a664aa0dd434223f4.png)](server.html) [#### 为什么选择TorchServe' - en: 'Topics: Examples' + id: totrans-34 prefs: [] type: TYPE_NORMAL + zh: 主题:示例 - en: Various TorchServe use cases + id: totrans-35 prefs: [] type: TYPE_NORMAL + zh: 各种TorchServe用例 - en: '![](../Images/0507eb3112fdbfd24e3e2ba13aa3e3fa.png)](use_cases.html) [#### Performance' + id: totrans-36 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/0507eb3112fdbfd24e3e2ba13aa3e3fa.png)](use_cases.html) [#### + 性能' - en: 'Topics: Performance,Troubleshooting' + id: totrans-37 prefs: [] type: TYPE_NORMAL + zh: 主题:性能,故障排除 - en: Guides and best practices on how to improve perfromance when working with TorchServe + id: totrans-38 prefs: [] type: TYPE_NORMAL + zh: 指南和最佳实践,以提高在使用TorchServe时的性能 - en: '![](../Images/a115bf3860d7637d64025cdabc4de95b.png)](performance_guide.html) [#### Metrics' + id: totrans-39 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/a115bf3860d7637d64025cdabc4de95b.png)](performance_guide.html) + [#### 指标' - en: 'Topics: Metrics,Performance,Troubleshooting' + id: totrans-40 prefs: [] type: TYPE_NORMAL + zh: 主题:指标,性能,故障排除 - en: Collecting and viewing Torcherve metrics + id: totrans-41 prefs: [] type: TYPE_NORMAL + zh: 收集和查看Torcherve指标 - en: '![](../Images/eab661f8c4941205ffdc566aced9bccf.png)](metrics.html) [#### Large Model Inference' + id: totrans-42 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/eab661f8c4941205ffdc566aced9bccf.png)](metrics.html) [#### 大型模型推理' - en: 'Topics: Large-Models,Performance' + id: totrans-43 prefs: [] type: TYPE_NORMAL + zh: 主题:大型模型,性能 - en: Serving Large Models with TorchServe + id: totrans-44 prefs: [] type: TYPE_NORMAL + zh: 使用TorchServe为大型模型提供服务 - en: '![](../Images/f6afe69d86ffcf863cd832ed3698732f.png)](large_model_inference.html) [#### Troubleshooting' + id: totrans-45 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/f6afe69d86ffcf863cd832ed3698732f.png)](large_model_inference.html) + [#### 故障排除' - en: 'Topics: Troubleshooting,Performance' + id: totrans-46 prefs: [] type: TYPE_NORMAL + zh: 主题:故障排除,性能 - en: Various updates on Torcherve and use cases. + id: totrans-47 prefs: [] type: TYPE_NORMAL + zh: 有关Torcherve和用例的各种更新。 - en: '![](../Images/d23903f23b5705cc9f1d9bdca6ce6bbb.png)](Troubleshooting.html) [#### TorchServe Security Policy' + id: totrans-48 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/d23903f23b5705cc9f1d9bdca6ce6bbb.png)](Troubleshooting.html) + [#### TorchServe安全策略' - en: 'Topics: Security' + id: totrans-49 prefs: [] type: TYPE_NORMAL + zh: 主题:安全 - en: Security Policy + id: totrans-50 prefs: [] type: TYPE_NORMAL + zh: 安全策略 - en: '![](../Images/2e44a4dab4c1bd5cde13eaa681343e78.png)](security.html) [#### FAQs' + id: totrans-51 prefs: [] type: TYPE_NORMAL + zh: '![](../Images/2e44a4dab4c1bd5cde13eaa681343e78.png)](security.html) [#### 常见问题解答' - en: 'Topics: FAQS' + id: totrans-52 prefs: [] type: TYPE_NORMAL + zh: 主题:常见问题解答 - en: Various frequently asked questions. + id: totrans-53 prefs: [] type: TYPE_NORMAL + zh: 各种常见问题。 - en: '![](../Images/7ccfac0b40fe2fac42582244489f0da4.png)](FAQs.html)' + id: totrans-54 prefs: [] type: TYPE_IMG + zh: '![](../Images/7ccfac0b40fe2fac42582244489f0da4.png)](FAQs.html)'