Files

1 line
24 KiB
JavaScript

"use strict";(globalThis.webpackChunkblog=globalThis.webpackChunkblog||[]).push([[6029],{28453:(n,e,s)=>{s.d(e,{R:()=>o,x:()=>c});var i=s(96540);const r={},t=i.createContext(r);function o(n){const e=i.useContext(t);return i.useMemo(function(){return"function"==typeof n?n(e):{...e,...n}},[e,n])}function c(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(r):n.components||r:o(n.components),i.createElement(t.Provider,{value:e},n.children)}},75226:(n,e,s)=>{s.r(e),s.d(e,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"\u4e2a\u4eba\u77e5\u8bc6\u5e93/AI/PyTorch/\u7b2c\u516b\u7ae0/8.2 \u56fe\u50cf - torchvision","title":"8.2 \u56fe\u50cf - torchvision.md","description":"|\u4f5c\u8005|\u4fee\u8ba2\u65f6\u95f4|","source":"@site/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/10.AI/01.PyTorch/08.\u7b2c\u516b\u7ae0/8.2 \u56fe\u50cf - torchvision.md","sourceDirName":"\u4e2a\u4eba\u77e5\u8bc6\u5e93/10.AI/01.PyTorch/08.\u7b2c\u516b\u7ae0","slug":"/\u4e2a\u4eba\u77e5\u8bc6\u5e93/AI/PyTorch/\u7b2c\u516b\u7ae0/8.2 \u56fe\u50cf - torchvision","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/AI/PyTorch/\u7b2c\u516b\u7ae0/8.2 \u56fe\u50cf - torchvision","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/10.AI/01.PyTorch/08.\u7b2c\u516b\u7ae0/8.2 \u56fe\u50cf - torchvision.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"8.1 \u672c\u7ae0\u7b80\u4ecb.md","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/AI/PyTorch/\u7b2c\u516b\u7ae0/8.1 \u672c\u7ae0\u7b80\u4ecb"},"next":{"title":"8.3 \u89c6\u9891 - PyTorchVideo.md","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/AI/PyTorch/\u7b2c\u516b\u7ae0/8.3 \u89c6\u9891 - PyTorchVideo"}}');var r=s(74848),t=s(28453);const o={},c="8.2 \u56fe\u50cf - torchvision.md",h={},l=[{value:"8.2.1 torchvision\u7b80\u4ecb",id:"821-torchvision\u7b80\u4ecb",level:2},{value:"8.2.2 torchvision.datasets",id:"822-torchvisiondatasets",level:2},{value:"8.2.3 torchvision.transforms",id:"823-torchvisiontransforms",level:2},{value:"8.2.4 torchvision.models",id:"824-torchvisionmodels",level:2},{value:"8.2.5 torchvision.io",id:"825-torchvisionio",level:2},{value:"8.2.6 torchvision.ops",id:"826-torchvisionops",level:2},{value:"8.2.7 torchvision.utils",id:"827-torchvisionutils",level:2}];function d(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.header,{children:(0,r.jsx)(e.h1,{id:"82-\u56fe\u50cf---torchvisionmd",children:"8.2 \u56fe\u50cf - torchvision.md"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{style:{textAlign:"left"},children:"\u4f5c\u8005"}),(0,r.jsx)(e.th,{style:{textAlign:"left"},children:"\u4fee\u8ba2\u65f6\u95f4"})]})}),(0,r.jsx)(e.tbody,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{style:{textAlign:"left"},children:(0,r.jsx)(e.img,{src:"https://img.shields.io/badge/wjlin0-%E4%B8%AA%E4%BA%BA%E7%9F%A5%E8%AF%86%E5%BA%93-green",alt:"wjlin0"})}),(0,r.jsx)(e.td,{style:{textAlign:"left"},children:"2026-06-07 20:53:30"})]})})]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{style:{textAlign:"left"},children:"\u4f5c\u8005"}),(0,r.jsx)(e.th,{style:{textAlign:"left"},children:"\u4fee\u8ba2\u65f6\u95f4"})]})}),(0,r.jsx)(e.tbody,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{style:{textAlign:"left"},children:(0,r.jsx)(e.img,{src:"https://img.shields.io/badge/wjlin0-%E4%B8%AA%E4%BA%BA%E7%9F%A5%E8%AF%86%E5%BA%93-green",alt:"wjlin0"})}),(0,r.jsx)(e.td,{style:{textAlign:"left"},children:"2025-10-31 15:44:29"})]})})]}),"\n",(0,r.jsx)(e.h1,{id:"82-torchvision",children:"8.2 torchvision"}),"\n",(0,r.jsx)(e.p,{children:"PyTorch\u4e4b\u6240\u4ee5\u4f1a\u5728\u77ed\u77ed\u7684\u51e0\u5e74\u65f6\u95f4\u91cc\u53d1\u5c55\u6210\u4e3a\u4e3b\u6d41\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u9664\u53bb\u6846\u67b6\u672c\u8eab\u7684\u4f18\u52bf\uff0c\u8fd8\u5728\u4e8ePyTorch\u6709\u7740\u826f\u597d\u7684\u751f\u6001\u5708\u3002\u5728\u524d\u9762\u7684\u5b66\u4e60\u548c\u5b9e\u6218\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u7528\u5230torchvision\u6765\u8c03\u7528\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u52a0\u8f7d\u6570\u636e\u96c6\uff0c\u5bf9\u56fe\u7247\u8fdb\u884c\u6570\u636e\u589e\u5f3a\u7684\u64cd\u4f5c\u3002\u5728\u672c\u7ae0\u6211\u4eec\u5c06\u7ed9\u5927\u5bb6\u7b80\u5355\u4ecb\u7ecd\u4e0btorchvision\u4ee5\u53ca\u76f8\u5173\u64cd\u4f5c\u3002"}),"\n",(0,r.jsx)(e.p,{children:"\u7ecf\u8fc7\u672c\u8282\u7684\u5b66\u4e60\uff0c\u4f60\u5c06\u6536\u83b7\uff1a"}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"\u4e86\u89e3torchvision"}),"\n",(0,r.jsx)(e.li,{children:"\u4e86\u89e3torchvision\u7684\u4f5c\u7528"}),"\n"]}),"\n",(0,r.jsx)(e.h2,{id:"821-torchvision\u7b80\u4ecb",children:"8.2.1 torchvision\u7b80\u4ecb"}),"\n",(0,r.jsx)(e.p,{children:'" The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision. "'}),"\n",(0,r.jsx)(e.p,{children:"\u6b63\u5982\u5f15\u8a00\u4ecb\u7ecd\u7684\u4e00\u6837\uff0c\u6211\u4eec\u53ef\u4ee5\u77e5\u9053torchvision\u5305\u542b\u4e86\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u5e38\u5e38\u7528\u5230\u7684\u6570\u636e\u96c6\uff0c\u6a21\u578b\u548c\u56fe\u50cf\u5904\u7406\u7684\u65b9\u5f0f\uff0c\u800c\u5177\u4f53\u7684torchvision\u5219\u5305\u62ec\u4e86\u4e0b\u9762\u8fd9\u51e0\u90e8\u5206\uff0c\u5e26 ***** \u7684\u90e8\u5206\u662f\u6211\u4eec\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5230\u7684\u4e00\u4e9b\u5e93\uff0c\u6240\u4ee5\u5728\u4e0b\u9762\u7684\u90e8\u5206\u6211\u4eec\u5bf9\u8fd9\u4e9b\u5e93\u8fdb\u884c\u4e00\u4e2a\u7b80\u5355\u7684\u4ecb\u7ecd\uff1a"}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"torchvision.datasets *"}),"\n",(0,r.jsx)(e.li,{children:"torchvision.models *"}),"\n",(0,r.jsx)(e.li,{children:"torchvision.tramsforms *"}),"\n",(0,r.jsx)(e.li,{children:"torchvision.io"}),"\n",(0,r.jsx)(e.li,{children:"torchvision.ops"}),"\n",(0,r.jsx)(e.li,{children:"torchvision.utils"}),"\n"]}),"\n",(0,r.jsx)(e.h2,{id:"822-torchvisiondatasets",children:"8.2.2 torchvision.datasets"}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.code,{children:"torchvision.datasets"}),"\u4e3b\u8981\u5305\u542b\u4e86\u4e00\u4e9b\u6211\u4eec\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u5e38\u89c1\u7684\u6570\u636e\u96c6\uff0c\u5728==0.10.0\u7248\u672c==\u7684",(0,r.jsx)(e.code,{children:"torchvision"}),"\u4e0b\uff0c\u6709\u4ee5\u4e0b\u7684\u6570\u636e\u96c6\uff1a"]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{children:"Caltech"}),(0,r.jsx)(e.th,{children:"CelebA"}),(0,r.jsx)(e.th,{children:"CIFAR"}),(0,r.jsx)(e.th,{children:"Cityscapes"})]})}),(0,r.jsxs)(e.tbody,{children:[(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"EMNIST"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"FakeData"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Fashion-MNIST"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Flickr"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"ImageNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Kinetics-400"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"KITTI"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"KMNIST"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"PhotoTour"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Places365"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"QMNIST"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"SBD"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"SEMEION"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"STL10"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"SVHN"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"UCF101"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"VOC"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"WIDERFace"})}),(0,r.jsx)(e.td,{}),(0,r.jsx)(e.td,{})]})]})]}),"\n",(0,r.jsx)(e.h2,{id:"823-torchvisiontransforms",children:"8.2.3 torchvision.transforms"}),"\n",(0,r.jsx)(e.p,{children:"\u6211\u4eec\u77e5\u9053\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u5904\u7406\u7684\u6570\u636e\u96c6\u6709\u5f88\u5927\u4e00\u90e8\u5206\u662f\u56fe\u7247\u7c7b\u578b\u7684\uff0c\u5982\u679c\u83b7\u53d6\u7684\u6570\u636e\u662f\u683c\u5f0f\u6216\u8005\u5927\u5c0f\u4e0d\u4e00\u7684\u56fe\u7247\uff0c\u5219\u9700\u8981\u8fdb\u884c\u5f52\u4e00\u5316\u548c\u5927\u5c0f\u7f29\u653e\u7b49\u64cd\u4f5c\uff0c\u8fd9\u4e9b\u662f\u5e38\u7528\u7684\u6570\u636e\u9884\u5904\u7406\u65b9\u6cd5\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u5f53\u56fe\u7247\u6570\u636e\u6709\u9650\u65f6\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u901a\u8fc7\u5bf9\u73b0\u6709\u56fe\u7247\u6570\u636e\u8fdb\u884c\u5404\u79cd\u53d8\u6362\uff0c\u5982\u7f29\u5c0f\u6216\u653e\u5927\u3001\u6c34\u5e73\u6216\u5782\u76f4\u7ffb\u8f6c\u7b49\uff0c\u8fd9\u4e9b\u662f\u5e38\u89c1\u7684\u6570\u636e\u589e\u5f3a\u65b9\u6cd5\u3002\u800ctorchvision.transforms\u4e2d\u5c31\u5305\u542b\u4e86\u8bb8\u591a\u8fd9\u6837\u7684\u64cd\u4f5c\u3002\u5728\u4e4b\u524d\u7b2c\u56db\u7ae0\u7684Fashion-mnist\u5b9e\u6218\u4e2d\u5bf9\u6570\u636e\u7684\u5904\u7406\u65f6\u6211\u4eec\u5c31\u7528\u5230\u4e86torchvision.transformer\uff1a"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"from torchvision import transforms\ndata_transform = transforms.Compose([\n transforms.ToPILImage(), # \u8fd9\u4e00\u6b65\u53d6\u51b3\u4e8e\u540e\u7eed\u7684\u6570\u636e\u8bfb\u53d6\u65b9\u5f0f\uff0c\u5982\u679c\u4f7f\u7528\u5185\u7f6e\u6570\u636e\u96c6\u5219\u4e0d\u9700\u8981\n transforms.Resize(image_size),\n transforms.ToTensor()\n])\n"})}),"\n",(0,r.jsxs)(e.p,{children:["\u9664\u4e86\u4e0a\u9762\u63d0\u5230\u7684\u51e0\u79cd\u6570\u636e\u589e\u5f3a\u64cd\u4f5c\uff0c\u5728torchvision\u5b98\u65b9\u6587\u6863\u91cc\u63d0\u5230\u4e86\u66f4\u591a\u7684\u64cd\u4f5c\uff0c\u5177\u4f53\u4f7f\u7528\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u53c2\u8003\u672c\u8282\u914d\u5957\u7684\u201dtransforms.ipynb\u201c\uff0c\u5728\u8fd9\u4e2anotebook\u4e2d\u6211\u4eec\u7ed9\u51fa\u4e86\u5e38\u89c1\u7684transforms\u7684API\u53ca\u5176\u4f7f\u7528\u65b9\u6cd5\uff0c\u66f4\u591a\u6570\u636e\u53d8\u6362\u7684\u64cd\u4f5c\u6211\u4eec\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/transforms.html",children:"\u8fd9\u91cc"}),"\u8fdb\u884c\u67e5\u770b\u3002"]}),"\n",(0,r.jsx)(e.h2,{id:"824-torchvisionmodels",children:"8.2.4 torchvision.models"}),"\n",(0,r.jsxs)(e.p,{children:["\u4e3a\u4e86\u63d0\u9ad8\u8bad\u7ec3\u6548\u7387\uff0c\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u91cd\u590d\u52b3\u52a8\uff0cPyTorch\u5b98\u65b9\u4e5f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u9884\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u4f9b\u6211\u4eec\u4f7f\u7528\uff0c\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://github.com/pytorch/vision/tree/master/torchvision/models",children:"\u8fd9\u91cc"}),"\u8fdb\u884c\u67e5\u770b\u73b0\u5728\u6709\u54ea\u4e9b\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u4e0b\u9762\u6211\u4eec\u5c06\u5bf9\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u6a21\u578b\u8fdb\u884c\u8be6\u7ec6\u4ecb\u7ecd\u3002 \u6b64\u5904\u6211\u4eec\u4ee5torchvision0.10.0 \u4e3a\u4f8b\uff0c\u5982\u679c\u5e0c\u671b\u83b7\u53d6\u66f4\u591a\u7684\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4f7f\u7528pretrained-models.pytorch\u4ed3\u5e93\u3002\u73b0\u6709\u9884\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u53ef\u4ee5\u5206\u4e3a\u4ee5\u4e0b\u51e0\u7c7b\uff1a"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"Classification"})}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:"\u5728\u56fe\u50cf\u5206\u7c7b\u91cc\u9762\uff0cPyTorch\u5b98\u65b9\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u6a21\u578b\uff0c\u5e76\u6b63\u5728\u4e0d\u65ad\u589e\u591a\u3002"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{children:"AlexNet"}),(0,r.jsx)(e.th,{children:"VGG"}),(0,r.jsx)(e.th,{children:"ResNet"}),(0,r.jsx)(e.th,{children:"SqueezeNet"})]})}),(0,r.jsxs)(e.tbody,{children:[(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"DenseNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Inception v3"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"GoogLeNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"ShuffleNet v2"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"MobileNetV2"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"MobileNetV3"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"ResNext"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"Wide ResNet"})})]}),(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"MNASNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"EfficientNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"RegNet"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"\u6301\u7eed\u66f4\u65b0"})})]})]})]}),"\n",(0,r.jsxs)(e.p,{children:["\u8fd9\u4e9b\u6a21\u578b\u662f\u5728ImageNet-1k\u8fdb\u884c\u9884\u8bad\u7ec3\u597d\u7684\uff0c\u5177\u4f53\u7684\u4f7f\u7528\u6211\u4eec\u4f1a\u5728\u540e\u9762\u8fdb\u884c\u4ecb\u7ecd\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/models.html#",children:"\u8fd9\u91cc"}),"\u53bb\u67e5\u770b\u8fd9\u4e9b\u6a21\u578b\u5728ImageNet-1k\u7684\u51c6\u786e\u7387\u3002"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"Semantic Segmentation"})}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:"\u8bed\u4e49\u5206\u5272\u7684\u9884\u8bad\u7ec3\u6a21\u578b\u662f\u5728COCO train2017\u7684\u5b50\u96c6\u4e0a\u8fdb\u884c\u8bad\u7ec3\u7684\uff0c\u63d0\u4f9b\u4e8620\u4e2a\u7c7b\u522b\uff0c\u5305\u62ecbackground, aeroplane, bicycle, bird, boat, bottle, bus, car, cat, chair, cow, diningtable, dog, horse, motorbike, person, pottedplant, sheep, sofa,train, tvmonitor\u3002"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"FCN ResNet50"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"FCN ResNet101"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"DeepLabV3 ResNet50"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"DeepLabV3 ResNet101"})})]})}),(0,r.jsx)(e.tbody,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"LR-ASPP MobileNetV3-Large"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"DeepLabV3 MobileNetV3-Large"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"\u672a\u5b8c\u5f85\u7eed"})}),(0,r.jsx)(e.td,{})]})})]}),"\n",(0,r.jsxs)(e.p,{children:["\u5177\u4f53\u6211\u4eec\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/models.html#semantic-segmentation",children:"\u8fd9\u91cc"}),"\u8fdb\u884c\u67e5\u770b\u9884\u8bad\u7ec3\u7684\u6a21\u578b\u7684",(0,r.jsx)(e.code,{children:"mean IOU"}),"\u548c",(0,r.jsx)(e.code,{children:" global pixelwise acc"})]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"Object Detection\uff0cinstance Segmentation and Keypoint Detection"})}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:"\u7269\u4f53\u68c0\u6d4b\uff0c\u5b9e\u4f8b\u5206\u5272\u548c\u4eba\u4f53\u5173\u952e\u70b9\u68c0\u6d4b\u7684\u6a21\u578b\u6211\u4eec\u540c\u6837\u662f\u5728COCO train2017\u8fdb\u884c\u8bad\u7ec3\u7684\uff0c\u5728\u4e0b\u65b9\u6211\u4eec\u63d0\u4f9b\u4e86\u5b9e\u4f8b\u5206\u5272\u7684\u7c7b\u522b\u548c\u4eba\u4f53\u5173\u952e\u70b9\u68c0\u6d4b\u7c7b\u522b\uff1a"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"COCO_INSTANCE_CATEGORY_NAMES = [\n '__background__', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus','train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'N/A', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'N/A', 'backpack', 'umbrella', 'N/A', 'N/A','handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball','kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket','bottle', 'N/A', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl','banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza','donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'N/A', 'dining table','N/A', 'N/A', 'toilet', 'N/A', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone','microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'N/A', 'book','clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush']\nCOCO_PERSON_KEYPOINT_NAMES =['nose','left_eye','right_eye','left_ear','right_ear','left_shoulder','right_shoulder','left_elbow','right_elbow','left_wrist','right_wrist','left_hip','right_hip','left_knee','right_knee','left_ankle','right_ankle']\n"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"Faster R-CNN"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"Mask R-CNN"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"RetinaNet"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"SSDlite"})})]})}),(0,r.jsx)(e.tbody,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"SSD"})}),(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"\u672a\u5b8c\u5f85\u7eed"})}),(0,r.jsx)(e.td,{}),(0,r.jsx)(e.td,{})]})})]}),"\n",(0,r.jsxs)(e.p,{children:["\u540c\u6837\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/models.html#object-detection-instance-segmentation-and-person-keypoint-detection",children:"\u8fd9\u91cc"}),"\u67e5\u770b\u8fd9\u4e9b\u6a21\u578b\u5728COCO train 2017\u4e0a\u7684",(0,r.jsx)(e.code,{children:"box AP"}),",",(0,r.jsx)(e.code,{children:"keypoint AP"}),",",(0,r.jsx)(e.code,{children:"mask AP"})]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"Video classification"})}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:"\u89c6\u9891\u5206\u7c7b\u6a21\u578b\u662f\u5728 Kinetics-400\u4e0a\u8fdb\u884c\u9884\u8bad\u7ec3\u7684"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(e.table,{children:[(0,r.jsx)(e.thead,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"ResNet 3D 18"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"ResNet MC 18"})}),(0,r.jsx)(e.th,{children:(0,r.jsx)(e.strong,{children:"ResNet (2+1) D"})})]})}),(0,r.jsx)(e.tbody,{children:(0,r.jsxs)(e.tr,{children:[(0,r.jsx)(e.td,{children:(0,r.jsx)(e.strong,{children:"\u672a\u5b8c\u5f85\u7eed"})}),(0,r.jsx)(e.td,{}),(0,r.jsx)(e.td,{})]})})]}),"\n",(0,r.jsxs)(e.p,{children:["\u540c\u6837\u6211\u4eec\u4e5f\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/models.html#video-classification",children:"\u8fd9\u91cc"}),"\u67e5\u770b\u8fd9\u4e9b\u6a21\u578b\u7684",(0,r.jsx)(e.code,{children:"Clip acc@1"}),",",(0,r.jsx)(e.code,{children:"Clip acc@5"})]}),"\n",(0,r.jsx)(e.h2,{id:"825-torchvisionio",children:"8.2.5 torchvision.io"}),"\n",(0,r.jsxs)(e.p,{children:["\u5728",(0,r.jsx)(e.code,{children:"torchvision.io"}),"\u63d0\u4f9b\u4e86\u89c6\u9891\u3001\u56fe\u7247\u548c\u6587\u4ef6\u7684 IO \u64cd\u4f5c\u7684\u529f\u80fd\uff0c\u5b83\u4eec\u5305\u62ec\u8bfb\u53d6\u3001\u5199\u5165\u3001\u7f16\u89e3\u7801\u5904\u7406\u64cd\u4f5c\u3002\u968f\u7740torchvision\u7684\u53d1\u5c55\uff0cio\u4e5f\u589e\u52a0\u4e86\u66f4\u591a\u5e95\u5c42\u7684\u9ad8\u6548\u7387\u7684API\u3002\u5728\u4f7f\u7528torchvision.io\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:["\u4e0d\u540c\u7248\u672c\u4e4b\u95f4\uff0c",(0,r.jsx)(e.code,{children:"torchvision.io"}),"\u6709\u7740\u8f83\u5927\u53d8\u5316\uff0c\u56e0\u6b64\u5728\u4f7f\u7528\u65f6\uff0c\u9700\u8981\u67e5\u770b\u4e0b\u6211\u4eec\u7684",(0,r.jsx)(e.code,{children:"torchvision"}),"\u7248\u672c\u662f\u5426\u5b58\u5728\u4f60\u60f3\u4f7f\u7528\u7684\u65b9\u6cd5\u3002"]}),"\n",(0,r.jsx)(e.li,{children:"\u9664\u4e86read_video()\u7b49\u65b9\u6cd5\uff0ctorchvision.io\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ec6\u7c92\u5ea6\u7684\u89c6\u9891API torchvision.io.VideoReader() \uff0c\u5b83\u5177\u6709\u66f4\u9ad8\u7684\u6548\u7387\u5e76\u4e14\u66f4\u52a0\u63a5\u8fd1\u5e95\u5c42\u5904\u7406\u3002\u5728\u4f7f\u7528\u65f6\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5ffmpeg\u7136\u540e\u4ece\u6e90\u7801\u91cd\u65b0\u7f16\u8bd1torchvision\u6211\u4eec\u624d\u80fd\u6211\u4eec\u80fd\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u3002"}),"\n",(0,r.jsx)(e.li,{children:"\u5728\u4f7f\u7528Video\u76f8\u5173API\u65f6\uff0c\u6211\u4eec\u6700\u597d\u63d0\u524d\u5b89\u88c5\u597dPyAV\u8fd9\u4e2a\u5e93\u3002"}),"\n"]}),"\n",(0,r.jsx)(e.h2,{id:"826-torchvisionops",children:"8.2.6 torchvision.ops"}),"\n",(0,r.jsxs)(e.p,{children:["torchvision.ops \u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u8bb8\u591a\u8ba1\u7b97\u673a\u89c6\u89c9\u7684\u7279\u5b9a\u64cd\u4f5c\uff0c\u5305\u62ec\u4f46\u4e0d\u4ec5\u9650\u4e8eNMS\uff0cRoIAlign\uff08MASK R-CNN\u4e2d\u5e94\u7528\u7684\u4e00\u79cd\u65b9\u6cd5\uff09\uff0cRoIPool\uff08Fast R-CNN\u4e2d\u7528\u5230\u7684\u4e00\u79cd\u65b9\u6cd5\uff09\u3002\u5728\u5408\u9002\u7684\u65f6\u95f4\u4f7f\u7528\u53ef\u4ee5\u5927\u5927\u964d\u4f4e\u6211\u4eec\u7684\u5de5\u4f5c\u91cf\uff0c\u907f\u514d\u91cd\u590d\u7684\u9020\u8f6e\u5b50\uff0c\u60f3\u770b\u66f4\u591a\u7684\u51fd\u6570\u4ecb\u7ecd\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/ops.html",children:"\u8fd9\u91cc"}),"\u8fdb\u884c\u7ec6\u81f4\u67e5\u770b\u3002"]}),"\n",(0,r.jsx)(e.h2,{id:"827-torchvisionutils",children:"8.2.7 torchvision.utils"}),"\n",(0,r.jsxs)(e.p,{children:["torchvision.utils \u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e9b\u53ef\u89c6\u5316\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5c06\u82e5\u5e72\u5f20\u56fe\u7247\u62fc\u63a5\u5728\u4e00\u8d77\u3001\u53ef\u89c6\u5316\u68c0\u6d4b\u548c\u5206\u5272\u7684\u6548\u679c\u3002\u5177\u4f53\u65b9\u6cd5\u53ef\u4ee5\u70b9\u51fb",(0,r.jsx)(e.a,{href:"https://pytorch.org/vision/stable/utils.html",children:"\u8fd9\u91cc"}),"\u8fdb\u884c\u67e5\u770b\u3002"]}),"\n",(0,r.jsx)(e.p,{children:"\u603b\u7684\u6765\u8bf4\uff0ctorchvision\u7684\u51fa\u73b0\u5e2e\u52a9\u6211\u4eec\u89e3\u51b3\u4e86\u5e38\u89c1\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u4e00\u4e9b\u91cd\u590d\u4e14\u8017\u65f6\u7684\u5de5\u4f5c\uff0c\u5e76\u5728\u6570\u636e\u96c6\u7684\u83b7\u53d6\u3001\u6570\u636e\u589e\u5f3a\u3001\u6a21\u578b\u9884\u8bad\u7ec3\u7b49\u65b9\u9762\u5927\u5927\u964d\u4f4e\u4e86\u6211\u4eec\u7684\u5de5\u4f5c\u96be\u5ea6\uff0c\u53ef\u4ee5\u8ba9\u6211\u4eec\u66f4\u52a0\u5feb\u901f\u4e0a\u624b\u4e00\u4e9b\u8ba1\u7b97\u673a\u89c6\u89c9\u4efb\u52a1\u3002"})]})}function x(n={}){const{wrapper:e}={...(0,t.R)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(d,{...n})}):d(n)}}}]);