Video Processor¶
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.
mindone.diffusers.video_processor.VideoProcessor.preprocess_video(video, height=None, width=None)
¶
Preprocesses input video(s).
PARAMETER | DESCRIPTION |
---|---|
video |
The input video. It can be one of the following:
* List of the PIL images.
* List of list of PIL images.
* 4D MindSpore tensors (expected shape for each tensor
TYPE:
|
height |
The height in preprocessed frames of the video. If
TYPE:
|
width |
The width in preprocessed frames of the video. If
TYPE:
|
Source code in mindone/diffusers/video_processor.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
mindone.diffusers.video_processor.VideoProcessor.postprocess_video(video, output_type='np')
¶
Converts a video tensor to a list of frames for export.
PARAMETER | DESCRIPTION |
---|---|
video |
The video as a tensor.
TYPE:
|
output_type |
Output type of the postprocessed
TYPE:
|
Source code in mindone/diffusers/video_processor.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|