Skip to content

Commit fdb1baa

Browse files
authored
[docs] VideoProcessor (#7965)
* fix? * fix? * fix
1 parent 6529ee6 commit fdb1baa

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

docs/source/en/api/video_processor.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ specific language governing permissions and limitations under the License.
1212

1313
# Video Processor
1414

15-
The `VideoProcessor` provides a unified API for video pipelines to prepare inputs for VAE encoding and post-processing outputs once they're decoded. The class inherits [`VaeImageProcessor`] so it includes transformations such as resizing, normalization, and conversion between PIL Image, PyTorch, and NumPy arrays.
15+
The [`VideoProcessor`] provides a unified API for video pipelines to prepare inputs for VAE encoding and post-processing outputs once they're decoded. The class inherits [`VaeImageProcessor`] so it includes transformations such as resizing, normalization, and conversion between PIL Image, PyTorch, and NumPy arrays.
16+
17+
## VideoProcessor
18+
19+
[[autodoc]] video_processor.VideoProcessor.preprocess_video
20+
21+
[[autodoc]] video_processor.VideoProcessor.postprocess_video

src/diffusers/video_processor.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ def preprocess_video(self, video, height: Optional[int] = None, width: Optional[
3030
Preprocesses input video(s).
3131
3232
Args:
33-
video: The input video. It can be one of the following:
33+
video (`List[PIL.Image]`, `List[List[PIL.Image]]`, `torch.Tensor`, `np.array`, `List[torch.Tensor]`, `List[np.array]`):
34+
The input video. It can be one of the following:
3435
* List of the PIL images.
3536
* List of list of PIL images.
36-
* 4D Torch tensors (expected shape for each tensor: (num_frames, num_channels, height, width)).
37-
* 4D NumPy arrays (expected shape for each array: (num_frames, height, width, num_channels)).
38-
* List of 4D Torch tensors (expected shape for each tensor: (num_frames, num_channels, height, width)).
39-
* List of 4D NumPy arrays (expected shape for each array: (num_frames, height, width, num_channels)).
40-
* 5D NumPy arrays: expected shape for each array: (batch_size, num_frames, height, width,
41-
num_channels).
42-
* 5D Torch tensors: expected shape for each array: (batch_size, num_frames, num_channels, height,
43-
width).
37+
* 4D Torch tensors (expected shape for each tensor `(num_frames, num_channels, height, width)`).
38+
* 4D NumPy arrays (expected shape for each array `(num_frames, height, width, num_channels)`).
39+
* List of 4D Torch tensors (expected shape for each tensor `(num_frames, num_channels, height,
40+
width)`).
41+
* List of 4D NumPy arrays (expected shape for each array `(num_frames, height, width, num_channels)`).
42+
* 5D NumPy arrays: expected shape for each array `(batch_size, num_frames, height, width,
43+
num_channels)`.
44+
* 5D Torch tensors: expected shape for each array `(batch_size, num_frames, num_channels, height,
45+
width)`.
4446
height (`int`, *optional*, defaults to `None`):
4547
The height in preprocessed frames of the video. If `None`, will use the `get_default_height_width()` to
4648
get default height.

0 commit comments

Comments
 (0)