# PE Video

[PE Video](https://huggingface.co/papers/2504.13181)は、MetaのPerception Encoderファミリーの動画向けモデルです。動画クリップとテキストを対照的にアラインして共有埋め込み空間に配置することで、事前学習済みバックボーン1つからゼロショットの動画分類と動画–テキスト検索を可能にします。

エンコーダーの回転位置埋め込み（rotary embeddings）とパッチエンベッダーは、時間軸を第一級の次元として扱います。そのため、各フレームを独立してタイル化することなく、可変長のクリップをエンコードできます。

公式のPE Audioチェックポイントはすべて、[perception-encoder-audio-visual](https://huggingface.co/collections/facebook/perception-encoder-audio-visual)コレクションの下で確認できます。

## クイックスタート

```py
import torch
from transformers import AutoProcessor, PeVideoModel
from transformers.video_utils import load_video

processor = AutoProcessor.from_pretrained("facebook/pe-av-large")
model = PeVideoModel.from_pretrained(
    "facebook/pe-av-large",
    device_map="auto",
)

video, _ = load_video("https://huggingface.co/datasets/hf-internal-testing/fixtures_videos/resolve/main/tennis.mp4")
labels = ["a person playing tennis", "a person cooking", "a cat sleeping"]

video_inputs = processor.video_processor(video, num_frames=16, return_tensors="pt").to(model.device)
text_inputs = processor.tokenizer(labels, padding=True, return_tensors="pt").to(model.device)
inputs = {**video_inputs, **text_inputs}

with torch.no_grad():
    outputs = model(**inputs)

probs = outputs.logits_video_text.sigmoid()
print({label: p.item() for label, p in zip(labels, probs[0])})
```

## 使用上のヒントと注意点

- 可変長の動画は`padding_mask_videos`（`attention_mask`ではありません）を使用します。動画プロセッサは`return_tensors`が設定されている場合のみ、パディングを行い、このマスクを返します。設定しないと、クリップごとのテンソルのリストが返され、マスクは得られません。
- `num_frames` を video processor に渡すことで、`[0, total_frames-1]` に対して固定長の均一サンプリングを行います。省略すると、ベースクラスの fps ベースのサンプリングにフォールバックします。チェックポイントは通常、特定のフレーム数で学習されているため、チェックポイントが想定するフレーム数に合わせる必要があります。
- エンコーダーの入力は`pixel_values_videos`です。エンコーダーの`main_input_name`は`"pixel_values_videos"`ですが、フルモデルでは`"input_ids"`です。`main_input_name`を参照する汎用ユーティリティ経由でルーティングを行う場合、この違いが重要になります。

## PeVideoConfig[[transformers.PeVideoConfig]]

#### transformers.PeVideoConfig[[transformers.PeVideoConfig]]

```python
transformers.PeVideoConfig(transformers_version: str | None = None, architectures: list[str] | None = None, output_hidden_states: bool | None = False, return_dict: bool | None = True, dtype: str | torch.dtype | None = None, chunk_size_feed_forward: int = 0, is_encoder_decoder: bool = False, id2label: dict[int, str] | dict[str, str] | None = None, label2id: dict[str, int] | dict[str, str] | None = None, problem_type: Literal['regression', 'single_label_classification', 'multi_label_classification'] | None = None, text_config: dict | transformers.configuration_utils.PreTrainedConfig | None = None, video_config: dict | transformers.configuration_utils.PreTrainedConfig | None = None)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/configuration_pe_video.py#L86)

**パラメータ:**

text_config (`Union[dict, ~configuration_utils.PreTrainedConfig]`, *任意*) : テキストバックボーンの config オブジェクトまたは辞書。

video_config (`dict` または `PreTrainedConfig`、*任意*) : ビデオエンコーダーコンポーネントの設定。

これはPeVideoModelの設定を保存するための設定クラスです。指定された引数に基づいてPe Videoモデルをインスタンス化し、モデルのアーキテクチャを定義するために使用されます。デフォルト値で設定をインスタンス化すると、[facebook/pe-av-large](https://huggingface.co/facebook/pe-av-large)と類似した設定が得られます。

設定オブジェクトは [PreTrainedConfig](/docs/transformers/main/ja/main_classes/configuration#transformers.PreTrainedConfig) を継承し、モデルの出力を制御するために使用できます。詳細については、[PreTrainedConfig](/docs/transformers/main/ja/main_classes/configuration#transformers.PreTrainedConfig) のドキュメントを参照してください。

```python
>>> from transformers import PeVideoModel, PeVideoConfig

>>> # Initializing a PeVideoModel style configuration
>>> configuration = PeVideoConfig()

>>> # Initializing a model from the pe-av-large style configuration
>>> model = PeVideoModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```

## PeVideoEncoderConfig[[transformers.PeVideoEncoderConfig]]

#### transformers.PeVideoEncoderConfig[[transformers.PeVideoEncoderConfig]]

```python
transformers.PeVideoEncoderConfig(transformers_version: str | None = None, architectures: list[str] | None = None, output_hidden_states: bool | None = False, return_dict: bool | None = True, dtype: str | torch.dtype | None = None, chunk_size_feed_forward: int = 0, is_encoder_decoder: bool = False, id2label: dict[int, str] | dict[str, str] | None = None, label2id: dict[str, int] | dict[str, str] | None = None, problem_type: Literal['regression', 'single_label_classification', 'multi_label_classification'] | None = None, vision_config: dict | transformers.configuration_utils.PreTrainedConfig | None = None, hidden_size: int = 1792, intermediate_size: int = 4800, num_hidden_layers: int = 6, num_attention_heads: int = 14, num_key_value_heads: int | None = None, head_dim: int = 128, hidden_act: str = 'silu', max_position_embeddings: int = 10000, initializer_range: float = 0.02, rms_norm_eps: float = 1e-05, rope_parameters: transformers.modeling_rope_utils.RopeParameters | dict | None = None, attention_bias: bool = False, attention_dropout: float | int = 0.0)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/configuration_pe_video.py#L27)

**パラメータ:**

vision_config (`Union[dict, ~configuration_utils.PreTrainedConfig]`, *任意*) : ビジョンバックボーンの config オブジェクトまたは辞書。

hidden_size (`int`、*optional*、デフォルトは`1792`) : 隠れ表現の次元数。

intermediate_size (`int`、*任意*、デフォルトは`4800`) : MLP 表現の次元数。

num_hidden_layers (`int`、*任意*、デフォルトは`6`) : Transformer デコーダーの隠れ層の数。

num_attention_heads (`int`、*任意*、デフォルトは`14`) : Transformerデコーダーの各アテンション層におけるアテンションヘッドの数。

num_key_value_heads (`int`, *optional*) : Grouped Query Attention を実装するために使用する key_value ヘッドの数です。`num_key_value_heads=num_attention_heads` の場合、モデルは Multi Head Attention (MHA) を使用し、`num_key_value_heads=1` の場合は Multi Query Attention (MQA) を使用し、それ以外の場合は GQA が使用されます。マルチヘッドのチェックポイントを GQA チェックポイントに変換する際は、各グループの key ヘッドと value ヘッドは、そのグループ内の元のすべてのヘッドを平均プーリングして構築する必要があります。詳細については、[この論文](https://huggingface.co/papers/2305.13245)を参照してください。指定されない場合、デフォルトで `num_attention_heads` が使用されます。

head_dim (`int`、*任意*、デフォルトは`128`) : アテンションヘッドの次元です。None の場合、hidden_size // num_attention_heads がデフォルトとして使用されます。

hidden_act (`str`、*任意*、デフォルトは`silu`) : デコーダーで使用する非線形活性化関数（関数または文字列）。例えば、`"gelu"`、`"relu"`、`"silu"`など。

max_position_embeddings (`int`、*任意*、デフォルトは`10000`) : このモデルが使用される可能性のある最大シーケンス長です。

initializer_range (`float`、*任意*、デフォルトは`0.02`) : すべての重み行列を初期化するためのtruncated_normal_initializerの標準偏差です。

rms_norm_eps (`float`、*任意*、デフォルトは`1e-05`) : rms 正規化レイヤーで使用する epsilon。

rope_parameters (`Union[~modeling_rope_utils.RopeParameters, dict]`, *optional*) : RoPE 埋め込みの設定パラメータを含む辞書です。この辞書には `rope_theta` の値が含まれていなければならず、より長い `max_position_embeddings` で RoPE を使用する場合、スケーリングに使用されるパラメータが任意で含まれます。

attention_bias (`bool`、*任意*、デフォルトは`False`) : セルフアテンションにおけるクエリ、キー、バリュー、出力の投影層でバイアスを使用するかどうか。

attention_dropout (`Union[float, int]`、*任意*、デフォルトは`0.0`) : 注意確率のドロップアウト率。

これはPeVideoModelの設定を保存するための設定クラスです。指定された引数に基づいてPe Videoモデルをインスタンス化し、モデルのアーキテクチャを定義するために使用されます。デフォルト値で設定をインスタンス化すると、[facebook/pe-av-large](https://huggingface.co/facebook/pe-av-large)と類似した設定が得られます。

設定オブジェクトは [PreTrainedConfig](/docs/transformers/main/ja/main_classes/configuration#transformers.PreTrainedConfig) を継承し、モデルの出力を制御するために使用できます。詳細については、[PreTrainedConfig](/docs/transformers/main/ja/main_classes/configuration#transformers.PreTrainedConfig) のドキュメントを参照してください。

例:

```python
>>> from transformers import PeAudioEncoder, PeAudioEncoderConfig

>>> # Initializing a PeAudioEncoder style configuration
>>> configuration = PeAudioEncoderConfig()

>>> # Initializing a model from the pe-av-large style configuration
>>> model = PeAudioEncoder(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```

## PeVideoVideoProcessor[[transformers.PeVideoVideoProcessor]]

#### transformers.PeVideoVideoProcessor[[transformers.PeVideoVideoProcessor]]

```python
transformers.PeVideoVideoProcessor(**kwargs: *<class 'transformers.processing_utils.VideosKwargs'>)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/video_processing_pe_video.py#L26)

**パラメータ:**

do_convert_rgb (`bool`, *kwargs*, *optional*) : 画像を RGB に変換するかどうか。

do_resize (`bool`, *kwargs*, *optional*) : 画像をリサイズするかどうか。

size (`Annotated[int | list[int] | tuple[int, ...] | dict[str, int] | None, None]`, *kwargs*) : モデルへの最大入力次元を記述します。

default_to_square (`bool`, *kwargs*, *任意*、デフォルトは `True`) : size が整数の場合、リサイズ時に正方形の画像をデフォルトとするかどうか。

resample (`Annotated[Union[int, PILImageResampling, NoneType], None]`, *kwargs*、デフォルト値は`2`) : 画像のリサイズ時に使用するリサンプリングフィルタです。これは列挙型`PILImageResampling`のいずれかになります。`do_resize`が`True`に設定されている場合のみ、効果が現れます。

do_rescale (`bool`, *kwargs*, *任意*) : 画像をリスケールするかどうか。

rescale_factor (`float`, *kwargs*, *optional*, デフォルトは `0.00392156862745098`) : `do_rescale` が `True` に設定されている場合、画像をリスケールするための係数。

do_normalize (`bool`, *kwargs*, *optional*) : 画像を正規化するかどうかを指定します。

image_mean (`Union[float, list[float], tuple[float, ...]]`, *kwargs*, *optional*) : 正規化に使用する画像の平均値。`do_normalize` が `True` に設定されている場合のみ有効です。

image_std (`Union[float, list[float], tuple[float, ...]]`, *kwargs*, *optional*) : 正規化に使用する画像の標準偏差。`do_normalize` が `True` に設定されている場合のみ有効です。

do_center_crop (`bool`, *kwargs*, *optional*) : 画像を中央クロップするかどうか。

do_pad (`bool`, *kwargs*, *任意*) : 画像にパディングを適用するかどうか。パディングは、バッチ内の最大サイズに合わせるか、画像ごとに固定の正方形サイズに合わせるかのいずれかで行われます。正確なパディング戦略はモデルによって異なります。

crop_size (`Annotated[int | list[int] | tuple[int, ...] | dict[str, int] | None, None]`, *kwargs*) : `center_crop` を適用した後の出力画像のサイズ。

data_format (`Union[str, ~image_utils.ChannelDimension]`、*kwargs*、*optional*) : 対応するのは `ChannelDimension.FIRST` のみです。slow processors との互換性のために追加されました。

input_data_format (`Union[str, ~image_utils.ChannelDimension]`, *kwargs*, *任意*) : 入力画像のチャネル次元の形式です。設定されていない場合、入力画像からチャネル次元の形式が推論されます。以下のいずれかになります: - `"channels_first"` または `ChannelDimension.FIRST`: (num_channels, height, width) 形式の画像。 - `"channels_last"` または `ChannelDimension.LAST`: (height, width, num_channels) 形式の画像。 - `"none"` または `ChannelDimension.NONE`: (height, width) 形式の画像。

device (`Annotated[Union[str, torch.device, NoneType], None]`, *kwargs*) : 動画を処理するデバイスです。未設定の場合、入力動画からデバイスが推論されます。

do_sample_frames (`bool`, *kwargs*, *optional*) : 処理前に動画からフレームをサンプリングするか、動画全体を処理するかを指定します。

video_metadata (`Annotated[~video_utils.VideoMetadata | dict | list[dict | ~video_utils.VideoMetadata] | list[list[dict | ~video_utils.VideoMetadata]] | None, None]`, *kwargs*) : 動画のメタデータ。総再生時間、fps、総フレーム数などの情報を含みます。動画からのフレームサンプリングやタイムスタンプの計算に使用されます。動画を処理する前に手動でデコードしようとしている場合を除き、メタデータは渡さないでください。

fps (`Annotated[int | float | None, None]`, *kwargs*) : `do_sample_frames=True` の場合、1 秒あたりにサンプリングするターゲットフレーム数。

num_frames (`Annotated[int | None, None]`, *kwargs*) : `do_sample_frames=True` の場合、サンプリングするフレームの最大数。

return_metadata (`bool`, *kwargs*, *任意*、デフォルトは `False`) : ビデオメタデータを返すかどうかを指定します。ビデオメタデータは、ビデオの長さ、fps、デコードバックエンドなどの情報を含むオブジェクトです。

return_tensors (`Annotated[str | ~utils.generic.TensorType | None, None]`, *kwargs*) : 設定されている場合、特定のフレームワークのテンソルを返します。許可される値は以下の通りです。 - `'pt'`: PyTorch の `torch.Tensor` オブジェクトを返します。 - `'np'`: NumPy の `np.ndarray` オブジェクトを返します。

- ****kwargs** ([VideosKwargs](/docs/transformers/main/ja/main_classes/processors#transformers.VideosKwargs)、*optional*) : 各モダリティ（テキスト、画像、動画、音声）の追加処理オプションです。モデル固有のパラメータは上記に記載されています。サポートされている引数の完全なリストについては、TypedDict クラスを参照してください。

PeVideoVideoProcessorのビデオプロセッサを構築します。

## PeVideoProcessor[[transformers.PeVideoProcessor]]

#### transformers.PeVideoProcessor[[transformers.PeVideoProcessor]]

```python
transformers.PeVideoProcessor(*args, **kwargs)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/processing_pe_video.py#L4)

## PeVideoEncoder[[transformers.PeVideoEncoder]]

#### transformers.PeVideoEncoder[[transformers.PeVideoEncoder]]

```python
transformers.PeVideoEncoder(config: PeVideoEncoderConfig)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/modeling_pe_video.py#L501)

**パラメータ:**

config ([PeVideoEncoderConfig](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoEncoderConfig)) : モデルのパラメータをすべて含むモデル設定クラスです。設定ファイルで初期化しても、モデルに関連する重みは読み込まれず、設定のみが読み込まれます。モデルの重みをロードするには、[from_pretrained()](/docs/transformers/main/ja/main_classes/model#transformers.PreTrainedModel.from_pretrained) メソッドを確認してください。

PeVideo Encoder モデル。

このモデルは [PreTrainedModel](/docs/transformers/main/ja/main_classes/model#transformers.PreTrainedModel) を継承しています。ライブラリがすべてのモデルに対して実装している汎用的なメソッド（ダウンロードや保存、入力埋め込みのリサイズ、ヘッドのプルーニングなど）については、スーパークラスのドキュメントを参照してください。

このモデルは、PyTorchの[torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module)のサブクラスでもあります。通常のPyTorch Moduleとして使用し、一般的な使用方法や動作に関する詳細については、PyTorchのドキュメントを参照してください。

#### forward[[transformers.PeVideoEncoder.forward]]

```python
forward(pixel_values_videos: Tensor, padding_mask_videos: typing.Optional[torch.Tensor] = None, **kwargs)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/modeling_pe_video.py#L520)

**パラメータ:**

pixel_values_videos (`torch.Tensor`、形状 `(batch_size, num_frames, num_channels, frame_size, frame_size)`) : 入力動画に対応するテンソルです。動画のピクセル値は [PeVideoVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoVideoProcessor) を使用して取得できます。詳細は [PeVideoVideoProcessor.__call__()](/docs/transformers/main/ja/model_doc/molmo2#transformers.Molmo2VideoProcessor.__call__) を参照してください（[PeVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoProcessor) は動画の処理に [PeVideoVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoVideoProcessor) を使用します）。

padding_mask_videos (`torch.Tensor`、形状 `(batch_size, num_frames)`、*任意*) : パディングされた動画フレームに対してアテンションを実行しないためのマスク。`[0, 1]` から選択されるマスクの値:  - **マスクされていない**フレームは 1、 - **マスクされている**フレームは 0。

**戻り値:** [BaseModelOutputWithPooling](/docs/transformers/main/ja/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling) または `tuple(torch.FloatTensor)`

設定（[PeVideoConfig](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoConfig)）と入力に応じて、さまざまな要素で構成される、[BaseModelOutputWithPooling](/docs/transformers/main/ja/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling) または `torch.FloatTensor` のタプル（`return_dict=False` が渡された場合、または `config.return_dict=False` の場合）。

[PeVideoEncoder](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoEncoder)のforwardメソッドは、`__call__`特殊メソッドをオーバーライドします。

この関数内でフォワードパスの手順を定義する必要がありますが、その後、この関数ではなく`Module`インスタンスを呼び出すべきです。前者は前処理と後処理の実行を適切に処理するのに対し、後者はそれらを無視してしまいます。

- **last_hidden_state** (`torch.FloatTensor`、shape `(batch_size, sequence_length, hidden_size)`) -- モデルの最終層の出力における隠れ状態のシーケンス。
- **pooler_output** (`torch.FloatTensor`、shape `(batch_size, hidden_size)`) -- 補助事前学習タスクに使用される層をさらに通して処理された後、シーケンスの最初のトークン（分類トークン）の最終層の隠れ状態です。例えば、BERT 系のモデルでは、線形層と tanh 活性化関数を経て処理された後の分類トークンを返します。この線形層の重みは、事前学習中の次文予測（分類）目的から学習されます。
- **hidden_states** (`tuple(torch.FloatTensor)`、*optional*、`output_hidden_states=True` が渡された場合または `config.output_hidden_states=True` の場合に返されます) -- `torch.FloatTensor` のタプル（埋め込み層を持つモデルの場合、埋め込みの出力用が 1 つ、各層の出力用が 1 つずつ）で、形状は `(batch_size, sequence_length, hidden_size)` です。

  各層の出力におけるモデルのHidden-states、および任意の初期埋め込み出力。
- **attentions** (`tuple(torch.FloatTensor)`、*optional*、`output_attentions=True` が渡された場合または `config.output_attentions=True` の場合に返されます) -- `torch.FloatTensor` のタプル（各レイヤーごとに1つ）で、形状は `(batch_size, num_heads, sequence_length, sequence_length)` です。

  アテンションのsoftmax後のアテンション重み。自己アテンションヘッド内で加重平均を計算するために使用されます。

## PeVideoModel[[transformers.PeVideoModel]]

#### transformers.PeVideoModel[[transformers.PeVideoModel]]

```python
transformers.PeVideoModel(config: PeVideoConfig)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/modeling_pe_video.py#L567)

#### forward[[transformers.PeVideoModel.forward]]

```python
forward(input_ids: Tensor, pixel_values_videos: Tensor, attention_mask: typing.Optional[torch.Tensor] = None, padding_mask_videos: typing.Optional[torch.Tensor] = None, return_loss: bool | None = None, **kwargs)
```

[ソース](https://github.com/huggingface/transformers/blob/main/src/transformers/models/pe_video/modeling_pe_video.py#L617)

**パラメータ:**

input_ids (`torch.Tensor`、shape `(batch_size, sequence_length)`) : 語彙における入力シーケンスのトークンインデックスです。デフォルトでは、パディングは無視されます。インデックスは [AutoTokenizer](/docs/transformers/main/ja/model_doc/auto#transformers.AutoTokenizer) を使用して取得できます。詳細については、[PreTrainedTokenizer.encode()](/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode) および [PreTrainedTokenizer.__call__()](/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__) を参照してください。 [入力IDとは何ですか？](../glossary#input-ids)

pixel_values_videos (`torch.Tensor`、形状 `(batch_size, num_frames, num_channels, frame_size, frame_size)`) : 入力動画に対応するテンソルです。動画のピクセル値は [PeVideoVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoVideoProcessor) を使用して取得できます。詳細は [PeVideoVideoProcessor.__call__()](/docs/transformers/main/ja/model_doc/molmo2#transformers.Molmo2VideoProcessor.__call__) を参照してください（[PeVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoProcessor) は動画の処理に [PeVideoVideoProcessor](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoVideoProcessor) を使用します）。

attention_mask (`torch.Tensor`、shape `(batch_size, sequence_length)`、*任意*) : padding トークンのインデックスに対する attention を回避するためのマスクです。マスクの値は `[0, 1]` から選択されます:  - **マスクされない**トークンは 1、- **マスクされる**トークンは 0。  [attention マスクとは?](../glossary#attention-mask)

padding_mask_videos (`torch.Tensor`、形状 `(batch_size, num_frames)`、*任意*) : パディングされた動画フレームに対してアテンションを実行しないためのマスク。`[0, 1]` から選択されるマスクの値:  - **マスクされていない**フレームは 1、 - **マスクされている**フレームは 0。

return_loss (`bool`, *任意*) : 損失を返すかどうか。

**戻り値:** `PeVideoOutput` または `tuple(torch.FloatTensor)`

`PeVideoOutput`、または`torch.FloatTensor`のタプル（`return_dict=False`が渡された場合、または`config.return_dict=False`の場合）。設定（[PeVideoConfig](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoConfig)）と入力に応じて、さまざまな要素で構成されます。

[PeVideoModel](/docs/transformers/main/ja/model_doc/pe_video#transformers.PeVideoModel)のforwardメソッドは、`__call__`特殊メソッドをオーバーライドします。

この関数内でフォワードパスの手順を定義する必要がありますが、その後、この関数ではなく`Module`インスタンスを呼び出すべきです。前者は前処理と後処理の実行を適切に処理するのに対し、後者はそれらを無視してしまいます。

- **loss** (`torch.FloatTensor`、shape `(1,)`、*optional*) -- 動画とテキストの表現間で計算される対比損失。
- **logits_video_text** (`torch.FloatTensor`、形状 `(batch_size, batch_size)`、*任意*) -- 動画とテキストの埋め込み間の類似度ロジット。
- **text_video_embeds** (`torch.FloatTensor`、形状 `(batch_size, hidden_size)`、*任意*) -- 動画テキスト空間に射影されたテキスト埋め込み。
- **video_embeds** (`torch.FloatTensor`、形状 `(batch_size, hidden_size)`、*任意*) -- ビデオテキスト空間に射影されたビデオ埋め込み。
- **text_outputs** (`BaseModelOutputWithPooling`、*任意*) -- テキストエンコーダーの出力。最終隠れ状態とプーリング済み出力を含みます。
- **video_outputs** (`BaseModelOutputWithPooling`、*任意*) -- 最終隠れ状態とプーリング出力を含む、ビデオエンコーダーのモデル出力。

