Buckets:
| import"../chunks/DsnmJJEf.js";import{i as y,h as b,C as x,H as p,D as h,E as V,s as T}from"../chunks/BtE7mKSK.js";import{p as I,o as D,s as e,f as N,a as l,b as L,c as f,d as m,n as r,r as u}from"../chunks/jDjavuwI.js";const z='{"title":"Video Processor","local":"video-processor","sections":[{"title":"VideoProcessor","local":"diffusers.VideoProcessor.preprocess_video","sections":[],"depth":2}],"depth":1}';var k=m('<meta name="hf:doc:metadata"/>'),A=m('<p></p> <!> <!> <p>The <code>VideoProcessor</code> provides a unified API for video pipelines to prepare inputs for VAE encoding and post-processing outputs once they’re decoded. The class inherits <a href="/docs/diffusers/pr_14261/en/api/image_processor#diffusers.VaeImageProcessor">VaeImageProcessor</a> so it includes transformations such as resizing, normalization, and conversion between PIL Image, PyTorch, and NumPy arrays.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Preprocesses input video(s). Keyword arguments will be forwarded to <code>VaeImageProcessor.preprocess</code>.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Converts a video tensor to a list of frames for export. Keyword arguments will be forwarded to <code>VaeImageProcessor.postprocess</code>.</p></div> <!> <p></p>',1);function q(g,v){I(v,!1),D(()=>{new URLSearchParams(window.location.search).get("fw")}),y();var t=A();b("16sekus",n=>{var c=k();T(c,"content",z),l(n,c)});var i=e(N(t),2);x(i,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var d=e(i,2);p(d,{title:"Video Processor",local:"video-processor",headingTag:"h1"});var a=e(d,4);p(a,{title:"VideoProcessor",local:"diffusers.VideoProcessor.preprocess_video",headingTag:"h2"});var o=e(a,2),_=f(o);h(_,{name:"diffusers.VideoProcessor.preprocess_video",anchor:"diffusers.VideoProcessor.preprocess_video",source:"https://github.com/huggingface/diffusers/blob/vr_14261/src/diffusers/video_processor.py#L28",parameters:[{name:"video",val:""},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.VideoProcessor.preprocess_video.video",description:`<strong>video</strong> (<code>list[PIL.Image]</code>, <code>list[list[PIL.Image]]</code>, <code>torch.Tensor</code>, <code>np.array</code>, <code>list[torch.Tensor]</code>, <code>list[np.array]</code>) — | |
| The input video. It can be one of the following: | |
| <ul> | |
| <li>list of the PIL images.</li> | |
| <li>list of list of PIL images.</li> | |
| <li>4D Torch tensors (expected shape for each tensor <code>(num_frames, num_channels, height, width)</code>).</li> | |
| <li>4D NumPy arrays (expected shape for each array <code>(num_frames, height, width, num_channels)</code>).</li> | |
| <li>list of 4D Torch tensors (expected shape for each tensor <code>(num_frames, num_channels, height, width)</code>).</li> | |
| <li>list of 4D NumPy arrays (expected shape for each array <code>(num_frames, height, width, num_channels)</code>).</li> | |
| <li>5D NumPy arrays: expected shape for each array <code>(batch_size, num_frames, height, width, num_channels)</code>.</li> | |
| <li>5D Torch tensors: expected shape for each array <code>(batch_size, num_frames, num_channels, height, width)</code>.</li> | |
| </ul>`,name:"video"},{anchor:"diffusers.VideoProcessor.preprocess_video.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The height in preprocessed frames of the video. If <code>None</code>, will use the <code>get_default_height_width()</code> to | |
| get default height.`,name:"height"},{anchor:"diffusers.VideoProcessor.preprocess_video.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em><code>, defaults to </code>None<code>) -- The width in preprocessed frames of the video. If </code>None<code>, will use get_default_height_width()</code> to get | |
| the default width.`,name:"width"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A 5D tensor holding the batched channels-first video(s).</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>torch.Tensor</code> of shape <code>(batch_size, num_channels, num_frames, height, width)</code></p> | |
| `}),r(2),u(o);var s=e(o,2),P=f(s);h(P,{name:"diffusers.VideoProcessor.postprocess_video",anchor:"diffusers.VideoProcessor.postprocess_video",source:"https://github.com/huggingface/diffusers/blob/vr_14261/src/diffusers/video_processor.py#L93",parameters:[{name:"video",val:": Tensor"},{name:"output_type",val:": str = 'np'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.VideoProcessor.postprocess_video.video",description:"<strong>video</strong> (<code>torch.Tensor</code>) — The video as a tensor.",name:"video"},{anchor:"diffusers.VideoProcessor.postprocess_video.output_type",description:"<strong>output_type</strong> (<code>str</code>, defaults to <code>"np"</code>) — Output type of the postprocessed <code>video</code> tensor.",name:"output_type"}]}),r(2),u(s);var w=e(s,2);V(w,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/video_processor.md"}),r(2),l(g,t),L()}export{q as component}; | |
Xet Storage Details
- Size:
- 5.39 kB
- Xet hash:
- 91f92e617256c66366eea8fd5d11bc844dde58e1a72f186e3ba60b6d98bd82cc
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.