Buckets:
معالج الفيديو
توفر فئة VideoProcessor واجهة برمجة تطبيقات موحّدة لخطوط أنابيب الفيديو لتحضير المدخلات لتشفير VAE ومعالجة المخرجات بعد فك تشفيرها. ترث هذه الفئة VaeImageProcessor لذا فهي تتضمن تحويلات مثل تغيير الحجم، والتطبيع، والتحويل بين مصفوفات PIL Image وPyTorch وNumPy.
VideoProcessor[[diffusers.VideoProcessor.preprocess_video]]
diffusers.VideoProcessor.preprocess_video[[diffusers.VideoProcessor.preprocess_video]]
diffusers.VideoProcessor.preprocess_video(video, height: int | None = None, width: int | None = None, **kwargs)
المعاملات:
video (list[PIL.Image]، list[list[PIL.Image]]، torch.Tensor، np.array، list[torch.Tensor]، list[np.array]) : الفيديو المُدخل. يمكن أن يكون أحد ما يلي: * قائمة من صور PIL. * قائمة من قوائم صور PIL. * تينسورات Torch رباعية الأبعاد (الشكل المتوقع لكل تينسور (num_frames, num_channels, height, width)). * مصفوفات NumPy رباعية الأبعاد (الشكل المتوقع لكل مصفوفة (num_frames, height, width, num_channels)). * قائمة من تينسورات Torch رباعية الأبعاد (الشكل المتوقع لكل تينسور (num_frames, num_channels, height, width)). * قائمة من مصفوفات NumPy رباعية الأبعاد (الشكل المتوقع لكل مصفوفة (num_frames, height, width, num_channels)). * مصفوفات NumPy خماسية الأبعاد: الشكل المتوقع لكل مصفوفة (batch_size, num_frames, height, width, num_channels). * تينسورات Torch خماسية الأبعاد: الشكل المتوقع لكل مصفوفة (batch_size, num_frames, num_channels, height, width).
height (int، اختياري، القيمة الافتراضية None) : الارتفاع بالأطارات المُعالجة مسبقًا للفيديو. إذا كانت None، فسيتم استخدام get_default_height_width() للحصول على الارتفاع الافتراضي.
width (int, optional, defaults to None) : The width in preprocessed frames of the video. If None, will use get_default_height_width() to get the default width.
يعيد: torch.Tensor من الشكل (batch_size, num_channels, num_frames, height, width)
مصفوفة خماسية الأبعاد تحتوي على مقاطع الفيديو المُجمّعة مع وضع القنوات أولاً.
يعالج الفيديو(الفيديوهات) المدخلة مسبقاً. سيتم تمرير الحُجج ذات الأسماء إلى VaeImageProcessor.preprocess.
diffusers.VideoProcessor.postprocess_video[[diffusers.VideoProcessor.postprocess_video]]
diffusers.VideoProcessor.postprocess_video(video: Tensor, output_type: str = 'np', **kwargs)
المعاملات:
video (torch.Tensor) : الفيديو على شكل متجه.
output_type (str، الافتراضي "np") : نوع المخرجات لموتر video بعد المعالجة.
يحوّل متجه الفيديو إلى قائمة من الإطارات للتصدير. سيتم تمرير الحُجج ذات الأسماء إلى VaeImageProcessor.postprocess.
Xet Storage Details
- Size:
- 3.74 kB
- Xet hash:
- 20adc45d7b2726c43e9ac0c49c75936b0b32cefcb26fd04bcf9b38c403669392
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.