Buckets:
| # معالج الفيديو | |
| توفر فئة `VideoProcessor` واجهة برمجة تطبيقات موحّدة لخطوط أنابيب الفيديو لتحضير المدخلات لتشفير VAE ومعالجة المخرجات بعد فك تشفيرها. ترث هذه الفئة [VaeImageProcessor](/docs/diffusers/v0.43.0/ar/api/image_processor#diffusers.VaeImageProcessor) لذا فهي تتضمن تحويلات مثل تغيير الحجم، والتطبيع، والتحويل بين مصفوفات PIL Image وPyTorch وNumPy. | |
| ## VideoProcessor[[diffusers.VideoProcessor.preprocess_video]] | |
| #### diffusers.VideoProcessor.preprocess_video[[diffusers.VideoProcessor.preprocess_video]] | |
| ```python | |
| diffusers.VideoProcessor.preprocess_video(video, height: int | None = None, width: int | None = None, **kwargs) | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/video_processor.py#L28) | |
| **المعاملات:** | |
| 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]] | |
| ```python | |
| diffusers.VideoProcessor.postprocess_video(video: Tensor, output_type: str = 'np', **kwargs) | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/video_processor.py#L93) | |
| **المعاملات:** | |
| video (`torch.Tensor`) : الفيديو على شكل متجه. | |
| output_type (`str`، الافتراضي `"np"`) : نوع المخرجات لموتر `video` بعد المعالجة. | |
| يحوّل متجه الفيديو إلى قائمة من الإطارات للتصدير. سيتم تمرير الحُجج ذات الأسماء إلى `VaeImageProcessor.postprocess`. | |
Xet Storage Details
- Size:
- 3.75 kB
- Xet hash:
- 846bbe7785fd815213384fc99a9d5daa9520dc77ac8a5806fd790b8d0ab3b1f9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.