import{S as mr,i as hr,s as fr,e as t,k as p,w as E,t as i,M as ur,c as a,d as s,m,a as n,x as y,h as l,b as d,N as gr,G as o,g as f,y as A,q as w,o as M,B as $,v as _r,L as st}from"../../chunks/vendor-hf-doc-builder.js";import{T as ln}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as tt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ee}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ot}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function vr(V){let h,b,_,u,v;return u=new tt({props:{code:`from transformers import VideoMAEConfig, VideoMAEModel

# Initializing a VideoMAE videomae-base style configuration
configuration = VideoMAEConfig()

# Randomly initializing a model from the configuration
model = VideoMAEModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VideoMAEConfig, VideoMAEModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a VideoMAE videomae-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = VideoMAEConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Randomly initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VideoMAEModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=t("p"),b=i("Example:"),_=p(),E(u.$$.fragment)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Example:"),g.forEach(s),_=m(r),y(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,b),f(r,_,g),A(u,r,g),v=!0},p:st,i(r){v||(w(u.$$.fragment,r),v=!0)},o(r){M(u.$$.fragment,r),v=!1},d(r){r&&s(h),r&&s(_),$(u,r)}}}function br(V){let h,b,_,u,v;return{c(){h=t("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),u=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var j=n(_);u=l(j,"Module"),j.forEach(s),v=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(s)},m(r,g){f(r,h,g),o(h,b),o(h,_),o(_,u),o(h,v)},d(r){r&&s(h)}}}function Er(V){let h,b,_,u,v;return u=new tt({props:{code:`import av
import numpy as np

from transformers import AutoImageProcessor, VideoMAEModel
from huggingface_hub import hf_hub_download

np.random.seed(0)


def read_video_pyav(container, indices):
    '''
    Decode the video with PyAV decoder.
    Args:
        container (\`av.container.input.InputContainer\`): PyAV container.
        indices (\`List[int]\`): List of frame indices to decode.
    Returns:
        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
    '''
    frames = []
    container.seek(0)
    start_index = indices[0]
    end_index = indices[-1]
    for i, frame in enumerate(container.decode(video=0)):
        if i > end_index:
            break
        if i >= start_index and i in indices:
            frames.append(frame)
    return np.stack([x.to_ndarray(format="rgb24") for x in frames])


def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
    converted_len = int(clip_len * frame_sample_rate)
    end_idx = np.random.randint(converted_len, seg_len)
    start_idx = end_idx - converted_len
    indices = np.linspace(start_idx, end_idx, num=clip_len)
    indices = np.clip(indices, start_idx, end_idx - 1).astype(np.int64)
    return indices


# video clip consists of 300 frames (10 seconds at 30 FPS)
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
container = av.open(file_path)

# sample 16 frames
indices = sample_frame_indices(clip_len=16, frame_sample_rate=1, seg_len=container.streams.video[0].frames)
video = read_video_pyav(container, indices)

image_processor = AutoImageProcessor.from_pretrained("MCG-NJU/videomae-base")
model = VideoMAEModel.from_pretrained("MCG-NJU/videomae-base")

# prepare video for the model
inputs = image_processor(list(video), return_tensors="pt")

# forward pass
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> av
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VideoMAEModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">0</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">read_video_pyav</span>(<span class="hljs-params">container, indices</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Decode the video with PyAV decoder.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        container (\`av.container.input.InputContainer\`): PyAV container.
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of frame indices to decode.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    frames = []
<span class="hljs-meta">... </span>    container.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>    start_index = indices[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    end_index = indices[-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, frame <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(container.decode(video=<span class="hljs-number">0</span>)):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt; end_index:
<span class="hljs-meta">... </span>            <span class="hljs-keyword">break</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt;= start_index <span class="hljs-keyword">and</span> i <span class="hljs-keyword">in</span> indices:
<span class="hljs-meta">... </span>            frames.append(frame)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> np.stack([x.to_ndarray(<span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;rgb24&quot;</span>) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> frames])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># video clip consists of 300 frames (10 seconds at 30 FPS)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>container = av.<span class="hljs-built_in">open</span>(file_path)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample 16 frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(clip_len=<span class="hljs-number">16</span>, frame_sample_rate=<span class="hljs-number">1</span>, seg_len=container.streams.video[<span class="hljs-number">0</span>].frames)
<span class="hljs-meta">&gt;&gt;&gt; </span>video = read_video_pyav(container, indices)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VideoMAEModel.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare video for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(<span class="hljs-built_in">list</span>(video), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1568</span>, <span class="hljs-number">768</span>]`}}),{c(){h=t("p"),b=i("Examples:"),_=p(),E(u.$$.fragment)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Examples:"),g.forEach(s),_=m(r),y(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,b),f(r,_,g),A(u,r,g),v=!0},p:st,i(r){v||(w(u.$$.fragment,r),v=!0)},o(r){M(u.$$.fragment,r),v=!1},d(r){r&&s(h),r&&s(_),$(u,r)}}}function yr(V){let h,b,_,u,v;return{c(){h=t("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),u=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var j=n(_);u=l(j,"Module"),j.forEach(s),v=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(s)},m(r,g){f(r,h,g),o(h,b),o(h,_),o(_,u),o(h,v)},d(r){r&&s(h)}}}function Ar(V){let h,b,_,u,v;return u=new tt({props:{code:`from transformers import AutoImageProcessor, VideoMAEForPreTraining
import numpy as np
import torch

num_frames = 16
video = list(np.random.randint(0, 256, (num_frames, 3, 224, 224)))

image_processor = AutoImageProcessor.from_pretrained("MCG-NJU/videomae-base")
model = VideoMAEForPreTraining.from_pretrained("MCG-NJU/videomae-base")

pixel_values = image_processor(video, return_tensors="pt").pixel_values

num_patches_per_frame = (model.config.image_size // model.config.patch_size) ** 2
seq_length = (num_frames // model.config.tubelet_size) * num_patches_per_frame
bool_masked_pos = torch.randint(0, 2, (1, seq_length)).bool()

outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VideoMAEForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>num_frames = <span class="hljs-number">16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video = <span class="hljs-built_in">list</span>(np.random.randint(<span class="hljs-number">0</span>, <span class="hljs-number">256</span>, (num_frames, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)))

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VideoMAEForPreTraining.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(video, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches_per_frame = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_length = (num_frames // model.config.tubelet_size) * num_patches_per_frame
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(<span class="hljs-number">0</span>, <span class="hljs-number">2</span>, (<span class="hljs-number">1</span>, seq_length)).<span class="hljs-built_in">bool</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){h=t("p"),b=i("Examples:"),_=p(),E(u.$$.fragment)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Examples:"),g.forEach(s),_=m(r),y(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,b),f(r,_,g),A(u,r,g),v=!0},p:st,i(r){v||(w(u.$$.fragment,r),v=!0)},o(r){M(u.$$.fragment,r),v=!1},d(r){r&&s(h),r&&s(_),$(u,r)}}}function wr(V){let h,b,_,u,v;return{c(){h=t("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),u=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var j=n(_);u=l(j,"Module"),j.forEach(s),v=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(s)},m(r,g){f(r,h,g),o(h,b),o(h,_),o(_,u),o(h,v)},d(r){r&&s(h)}}}function Mr(V){let h,b,_,u,v;return u=new tt({props:{code:`import av
import torch
import numpy as np

from transformers import AutoImageProcessor, VideoMAEForVideoClassification
from huggingface_hub import hf_hub_download

np.random.seed(0)


def read_video_pyav(container, indices):
    '''
    Decode the video with PyAV decoder.
    Args:
        container (\`av.container.input.InputContainer\`): PyAV container.
        indices (\`List[int]\`): List of frame indices to decode.
    Returns:
        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
    '''
    frames = []
    container.seek(0)
    start_index = indices[0]
    end_index = indices[-1]
    for i, frame in enumerate(container.decode(video=0)):
        if i > end_index:
            break
        if i >= start_index and i in indices:
            frames.append(frame)
    return np.stack([x.to_ndarray(format="rgb24") for x in frames])


def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
    converted_len = int(clip_len * frame_sample_rate)
    end_idx = np.random.randint(converted_len, seg_len)
    start_idx = end_idx - converted_len
    indices = np.linspace(start_idx, end_idx, num=clip_len)
    indices = np.clip(indices, start_idx, end_idx - 1).astype(np.int64)
    return indices


# video clip consists of 300 frames (10 seconds at 30 FPS)
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
container = av.open(file_path)

# sample 16 frames
indices = sample_frame_indices(clip_len=16, frame_sample_rate=1, seg_len=container.streams.video[0].frames)
video = read_video_pyav(container, indices)

image_processor = AutoImageProcessor.from_pretrained("MCG-NJU/videomae-base-finetuned-kinetics")
model = VideoMAEForVideoClassification.from_pretrained("MCG-NJU/videomae-base-finetuned-kinetics")

inputs = image_processor(list(video), return_tensors="pt")

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

# model predicts one of the 400 Kinetics-400 classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> av
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VideoMAEForVideoClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">0</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">read_video_pyav</span>(<span class="hljs-params">container, indices</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Decode the video with PyAV decoder.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        container (\`av.container.input.InputContainer\`): PyAV container.
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of frame indices to decode.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    frames = []
<span class="hljs-meta">... </span>    container.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>    start_index = indices[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    end_index = indices[-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, frame <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(container.decode(video=<span class="hljs-number">0</span>)):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt; end_index:
<span class="hljs-meta">... </span>            <span class="hljs-keyword">break</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt;= start_index <span class="hljs-keyword">and</span> i <span class="hljs-keyword">in</span> indices:
<span class="hljs-meta">... </span>            frames.append(frame)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> np.stack([x.to_ndarray(<span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;rgb24&quot;</span>) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> frames])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># video clip consists of 300 frames (10 seconds at 30 FPS)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>container = av.<span class="hljs-built_in">open</span>(file_path)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample 16 frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(clip_len=<span class="hljs-number">16</span>, frame_sample_rate=<span class="hljs-number">1</span>, seg_len=container.streams.video[<span class="hljs-number">0</span>].frames)
<span class="hljs-meta">&gt;&gt;&gt; </span>video = read_video_pyav(container, indices)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base-finetuned-kinetics&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VideoMAEForVideoClassification.from_pretrained(<span class="hljs-string">&quot;MCG-NJU/videomae-base-finetuned-kinetics&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(<span class="hljs-built_in">list</span>(video), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">... </span>    logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 400 Kinetics-400 classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
eating spaghetti`}}),{c(){h=t("p"),b=i("Examples:"),_=p(),E(u.$$.fragment)},l(r){h=a(r,"P",{});var g=n(h);b=l(g,"Examples:"),g.forEach(s),_=m(r),y(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,b),f(r,_,g),A(u,r,g),v=!0},p:st,i(r){v||(w(u.$$.fragment,r),v=!0)},o(r){M(u.$$.fragment,r),v=!1},d(r){r&&s(h),r&&s(_),$(u,r)}}}function $r(V){let h,b,_,u,v,r,g,j,at,hs,L,oe,qo,$e,nt,So,rt,fs,q,it,Ve,lt,dt,no,ct,pt,us,ro,mt,gs,io,Do,ht,_s,lo,ft,vs,se,je,ut,co,gt,_t,vt,po,mo,bt,Et,bs,te,dn,Es,ae,yt,ho,At,wt,ys,S,Mt,xe,$t,Vt,Te,jt,xt,As,O,ne,Lo,Pe,Tt,Oo,Pt,ws,fo,kt,Ms,uo,Ro,Ct,$s,D,go,ke,zt,It,Ft,Uo,_o,Nt,qt,vo,Ce,St,Dt,Vs,R,re,Wo,ze,Lt,Go,Ot,js,x,Ie,Rt,U,Ut,bo,Wt,Gt,Fe,Jt,Ht,Bt,W,Kt,Eo,Yt,Zt,yo,Xt,Qt,ea,ie,xs,G,le,Jo,Ne,oa,Ho,sa,Ts,J,qe,ta,de,Se,aa,Bo,na,Ps,H,ce,Ko,De,ra,Yo,ia,ks,C,Le,la,Zo,da,ca,pe,Oe,pa,Xo,ma,Cs,B,me,Qo,Re,ha,es,fa,zs,z,Ue,ua,We,ga,Ge,_a,va,ba,T,Je,Ea,K,ya,Ao,Aa,wa,os,Ma,$a,Va,he,ja,fe,Is,Y,ue,ss,He,xa,ts,Ta,Fs,I,Be,Pa,Ke,ka,Ye,Ca,za,Ia,P,Ze,Fa,Z,Na,wo,qa,Sa,as,Da,La,Oa,ge,Ra,_e,Ns,X,ve,ns,Xe,Ua,rs,Wa,qs,F,Qe,Ga,eo,Ja,oo,Ha,Ba,Ka,k,so,Ya,Q,Za,Mo,Xa,Qa,is,en,on,sn,be,tn,Ee,Ss;return r=new ee({}),$e=new ee({}),Pe=new ee({}),ze=new ee({}),Ie=new N({props:{name:"class transformers.VideoMAEConfig",anchor:"transformers.VideoMAEConfig",parameters:[{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"num_frames",val:" = 16"},{name:"tubelet_size",val:" = 2"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"qkv_bias",val:" = True"},{name:"use_mean_pooling",val:" = True"},{name:"decoder_num_attention_heads",val:" = 6"},{name:"decoder_hidden_size",val:" = 384"},{name:"decoder_num_hidden_layers",val:" = 4"},{name:"decoder_intermediate_size",val:" = 1536"},{name:"norm_pix_loss",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.VideoMAEConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.VideoMAEConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.VideoMAEConfig.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The number of frames in each video.`,name:"num_frames"},{anchor:"transformers.VideoMAEConfig.tubelet_size",description:`<strong>tubelet_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The number of tubelets.`,name:"tubelet_size"},{anchor:"transformers.VideoMAEConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.VideoMAEConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.VideoMAEConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.VideoMAEConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.VideoMAEConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.VideoMAEConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.VideoMAEConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.VideoMAEConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.VideoMAEConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.VideoMAEConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.VideoMAEConfig.use_mean_pooling",description:`<strong>use_mean_pooling</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to mean pool the final hidden states instead of using the final hidden state of the [CLS] token.`,name:"use_mean_pooling"},{anchor:"transformers.VideoMAEConfig.decoder_num_attention_heads",description:`<strong>decoder_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of attention heads for each attention layer in the decoder.`,name:"decoder_num_attention_heads"},{anchor:"transformers.VideoMAEConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
Dimensionality of the decoder.`,name:"decoder_hidden_size"},{anchor:"transformers.VideoMAEConfig.decoder_num_hidden_layers",description:`<strong>decoder_num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of hidden layers in the decoder.`,name:"decoder_num_hidden_layers"},{anchor:"transformers.VideoMAEConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1536) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the decoder.`,name:"decoder_intermediate_size"},{anchor:"transformers.VideoMAEConfig.norm_pix_loss",description:`<strong>norm_pix_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the target patch pixels.`,name:"norm_pix_loss"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/configuration_videomae.py#L28"}}),ie=new ot({props:{anchor:"transformers.VideoMAEConfig.example",$$slots:{default:[vr]},$$scope:{ctx:V}}}),Ne=new ee({}),qe=new N({props:{name:"class transformers.VideoMAEFeatureExtractor",anchor:"transformers.VideoMAEFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/feature_extraction_videomae.py#L26"}}),Se=new N({props:{name:"__call__",anchor:"transformers.VideoMAEFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/image_processing_utils.py#L456"}}),De=new ee({}),Le=new N({props:{name:"class transformers.VideoMAEImageProcessor",anchor:"transformers.VideoMAEImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.VideoMAEImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the output image after resizing. The shortest edge of the image will be resized to
<code>size[&quot;shortest_edge&quot;]</code> while maintaining the aspect ratio of the original image. Can be overriden by
<code>size</code> in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.VideoMAEImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.VideoMAEImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by the <code>do_center_crop</code>
parameter in the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.VideoMAEImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after applying the center crop. Can be overridden by the <code>crop_size</code> parameter in the
<code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.VideoMAEImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.VideoMAEImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Defines the scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter
in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.VideoMAEImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.VideoMAEImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.VideoMAEImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/image_processing_videomae.py#L63"}}),Oe=new N({props:{name:"preprocess",anchor:"transformers.VideoMAEImageProcessor.preprocess",parameters:[{name:"videos",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after applying resize.`,name:"size"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_centre_crop</code>) &#x2014;
Whether to centre crop the image.`,name:"do_center_crop"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after applying the centre crop.`,name:"crop_size"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the inferred channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/image_processing_videomae.py#L279"}}),Re=new ee({}),Ue=new N({props:{name:"class transformers.VideoMAEModel",anchor:"transformers.VideoMAEModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig">VideoMAEConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L535"}}),Je=new N({props:{name:"forward",anchor:"transformers.VideoMAEModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VideoMAEModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_frames, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">VideoMAEImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VideoMAEModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.VideoMAEModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.VideoMAEModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VideoMAEModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L562",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig"
>VideoMAEConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new ln({props:{$$slots:{default:[br]},$$scope:{ctx:V}}}),fe=new ot({props:{anchor:"transformers.VideoMAEModel.forward.example",$$slots:{default:[Er]},$$scope:{ctx:V}}}),He=new ee({}),Be=new N({props:{name:"class transformers.VideoMAEForPreTraining",anchor:"transformers.VideoMAEForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig">VideoMAEConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L754"}}),Ze=new N({props:{name:"forward",anchor:"transformers.VideoMAEForPreTraining.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"bool_masked_pos",val:": BoolTensor"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VideoMAEForPreTraining.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_frames, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">VideoMAEImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VideoMAEForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.VideoMAEForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.VideoMAEForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VideoMAEForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L772",returnDescription:`
<p>A <code>transformers.models.videomae.modeling_videomae.VideoMAEForPreTrainingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig"
>VideoMAEConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Pixel reconstruction loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size ** 2 * num_channels)</code>) \u2014 Pixel reconstruction logits.</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.videomae.modeling_videomae.VideoMAEForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ge=new ln({props:{$$slots:{default:[yr]},$$scope:{ctx:V}}}),_e=new ot({props:{anchor:"transformers.VideoMAEForPreTraining.forward.example",$$slots:{default:[Ar]},$$scope:{ctx:V}}}),Xe=new ee({}),Qe=new N({props:{name:"class transformers.VideoMAEForVideoClassification",anchor:"transformers.VideoMAEForVideoClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEForVideoClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig">VideoMAEConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L933"}}),so=new N({props:{name:"forward",anchor:"transformers.VideoMAEForVideoClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VideoMAEForVideoClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_frames, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">VideoMAEImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VideoMAEForVideoClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.VideoMAEForVideoClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.VideoMAEForVideoClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VideoMAEForVideoClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.VideoMAEForVideoClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/videomae/modeling_videomae.py#L947",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEConfig"
>VideoMAEConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new ln({props:{$$slots:{default:[wr]},$$scope:{ctx:V}}}),Ee=new ot({props:{anchor:"transformers.VideoMAEForVideoClassification.forward.example",$$slots:{default:[Mr]},$$scope:{ctx:V}}}),{c(){h=t("meta"),b=p(),_=t("h1"),u=t("a"),v=t("span"),E(r.$$.fragment),g=p(),j=t("span"),at=i("VideoMAE"),hs=p(),L=t("h2"),oe=t("a"),qo=t("span"),E($e.$$.fragment),nt=p(),So=t("span"),rt=i("Overview"),fs=p(),q=t("p"),it=i("The VideoMAE model was proposed in "),Ve=t("a"),lt=i("VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training"),dt=i(` by Zhan Tong, Yibing Song, Jue Wang, Limin Wang.
VideoMAE extends masked auto encoders (`),no=t("a"),ct=i("MAE"),pt=i(") to video, claiming state-of-the-art performance on several video classification benchmarks."),us=p(),ro=t("p"),mt=i("The abstract from the paper is the following:"),gs=p(),io=t("p"),Do=t("em"),ht=i("Pre-training video transformers on extra large-scale datasets is generally required to achieve premier performance on relatively small datasets. In this paper, we show that video masked autoencoders (VideoMAE) are data-efficient learners for self-supervised video pre-training (SSVP). We are inspired by the recent ImageMAE and propose customized video tube masking and reconstruction. These simple designs turn out to be effective for overcoming information leakage caused by the temporal correlation during video reconstruction. We obtain three important findings on SSVP: (1) An extremely high proportion of masking ratio (i.e., 90% to 95%) still yields favorable performance of VideoMAE. The temporally redundant video content enables higher masking ratio than that of images. (2) VideoMAE achieves impressive results on very small datasets (i.e., around 3k-4k videos) without using any extra data. This is partially ascribed to the challenging task of video reconstruction to enforce high-level structure learning. (3) VideoMAE shows that data quality is more important than data quantity for SSVP. Domain shift between pre-training and target datasets are important issues in SSVP. Notably, our VideoMAE with the vanilla ViT backbone can achieve 83.9% on Kinects-400, 75.3% on Something-Something V2, 90.8% on UCF101, and 61.1% on HMDB51 without using any extra data."),_s=p(),lo=t("p"),ft=i("Tips:"),vs=p(),se=t("ul"),je=t("li"),ut=i("One can use "),co=t("a"),gt=i("VideoMAEImageProcessor"),_t=i(" to prepare videos for the model. It will resize + normalize all frames of a video for you."),vt=p(),po=t("li"),mo=t("a"),bt=i("VideoMAEForPreTraining"),Et=i(" includes the decoder on top for self-supervised pre-training."),bs=p(),te=t("img"),Es=p(),ae=t("small"),yt=i("VideoMAE pre-training. Taken from the "),ho=t("a"),At=i("original paper"),wt=i("."),ys=p(),S=t("p"),Mt=i("This model was contributed by "),xe=t("a"),$t=i("nielsr"),Vt=i(`.
The original code can be found `),Te=t("a"),jt=i("here"),xt=i("."),As=p(),O=t("h2"),ne=t("a"),Lo=t("span"),E(Pe.$$.fragment),Tt=p(),Oo=t("span"),Pt=i("Resources"),ws=p(),fo=t("p"),kt=i(`A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VideoMAE. If
you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll
review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Ms=p(),uo=t("p"),Ro=t("strong"),Ct=i("Video classification"),$s=p(),D=t("ul"),go=t("li"),ke=t("a"),zt=i("A notebook"),It=i(` that shows how
to fine-tune a VideoMAE model on a custom dataset.`),Ft=p(),Uo=t("li"),_o=t("a"),Nt=i("Video classification task guide"),qt=p(),vo=t("li"),Ce=t("a"),St=i("A \u{1F917} Space"),Dt=i(" showing how to perform inference with a video classification model."),Vs=p(),R=t("h2"),re=t("a"),Wo=t("span"),E(ze.$$.fragment),Lt=p(),Go=t("span"),Ot=i("VideoMAEConfig"),js=p(),x=t("div"),E(Ie.$$.fragment),Rt=p(),U=t("p"),Ut=i("This is the configuration class to store the configuration of a "),bo=t("a"),Wt=i("VideoMAEModel"),Gt=i(`. It is used to instantiate a
VideoMAE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VideoMAE
`),Fe=t("a"),Jt=i("MCG-NJU/videomae-base"),Ht=i(" architecture."),Bt=p(),W=t("p"),Kt=i("Configuration objects inherit from "),Eo=t("a"),Yt=i("PretrainedConfig"),Zt=i(` and can be used to control the model outputs. Read the
documentation from `),yo=t("a"),Xt=i("PretrainedConfig"),Qt=i(" for more information."),ea=p(),E(ie.$$.fragment),xs=p(),G=t("h2"),le=t("a"),Jo=t("span"),E(Ne.$$.fragment),oa=p(),Ho=t("span"),sa=i("VideoMAEFeatureExtractor"),Ts=p(),J=t("div"),E(qe.$$.fragment),ta=p(),de=t("div"),E(Se.$$.fragment),aa=p(),Bo=t("p"),na=i("Preprocess an image or a batch of images."),Ps=p(),H=t("h2"),ce=t("a"),Ko=t("span"),E(De.$$.fragment),ra=p(),Yo=t("span"),ia=i("VideoMAEImageProcessor"),ks=p(),C=t("div"),E(Le.$$.fragment),la=p(),Zo=t("p"),da=i("Constructs a VideoMAE image processor."),ca=p(),pe=t("div"),E(Oe.$$.fragment),pa=p(),Xo=t("p"),ma=i("Preprocess an image or batch of images."),Cs=p(),B=t("h2"),me=t("a"),Qo=t("span"),E(Re.$$.fragment),ha=p(),es=t("span"),fa=i("VideoMAEModel"),zs=p(),z=t("div"),E(Ue.$$.fragment),ua=p(),We=t("p"),ga=i(`The bare VideoMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ge=t("a"),_a=i("torch.nn.Module"),va=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ba=p(),T=t("div"),E(Je.$$.fragment),Ea=p(),K=t("p"),ya=i("The "),Ao=t("a"),Aa=i("VideoMAEModel"),wa=i(" forward method, overrides the "),os=t("code"),Ma=i("__call__"),$a=i(" special method."),Va=p(),E(he.$$.fragment),ja=p(),E(fe.$$.fragment),Is=p(),Y=t("h2"),ue=t("a"),ss=t("span"),E(He.$$.fragment),xa=p(),ts=t("span"),Ta=i("VideoMAEForPreTraining"),Fs=p(),I=t("div"),E(Be.$$.fragment),Pa=p(),Ke=t("p"),ka=i(`The VideoMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Ye=t("a"),Ca=i("torch.nn.Module"),za=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ia=p(),P=t("div"),E(Ze.$$.fragment),Fa=p(),Z=t("p"),Na=i("The "),wo=t("a"),qa=i("VideoMAEForPreTraining"),Sa=i(" forward method, overrides the "),as=t("code"),Da=i("__call__"),La=i(" special method."),Oa=p(),E(ge.$$.fragment),Ra=p(),E(_e.$$.fragment),Ns=p(),X=t("h2"),ve=t("a"),ns=t("span"),E(Xe.$$.fragment),Ua=p(),rs=t("span"),Wa=i("VideoMAEForVideoClassification"),qs=p(),F=t("div"),E(Qe.$$.fragment),Ga=p(),eo=t("p"),Ja=i(`VideoMAE Model transformer with a video classification head on top (a linear layer on top of the average pooled hidden
states of all tokens) e.g. for ImageNet.
This model is a PyTorch `),oo=t("a"),Ha=i("torch.nn.Module"),Ba=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ka=p(),k=t("div"),E(so.$$.fragment),Ya=p(),Q=t("p"),Za=i("The "),Mo=t("a"),Xa=i("VideoMAEForVideoClassification"),Qa=i(" forward method, overrides the "),is=t("code"),en=i("__call__"),on=i(" special method."),sn=p(),E(be.$$.fragment),tn=p(),E(Ee.$$.fragment),this.h()},l(e){const c=ur('[data-svelte="svelte-1phssyn"]',document.head);h=a(c,"META",{name:!0,content:!0}),c.forEach(s),b=m(e),_=a(e,"H1",{class:!0});var to=n(_);u=a(to,"A",{id:!0,class:!0,href:!0});var ls=n(u);v=a(ls,"SPAN",{});var ds=n(v);y(r.$$.fragment,ds),ds.forEach(s),ls.forEach(s),g=m(to),j=a(to,"SPAN",{});var cs=n(j);at=l(cs,"VideoMAE"),cs.forEach(s),to.forEach(s),hs=m(e),L=a(e,"H2",{class:!0});var ao=n(L);oe=a(ao,"A",{id:!0,class:!0,href:!0});var ps=n(oe);qo=a(ps,"SPAN",{});var ms=n(qo);y($e.$$.fragment,ms),ms.forEach(s),ps.forEach(s),nt=m(ao),So=a(ao,"SPAN",{});var cn=n(So);rt=l(cn,"Overview"),cn.forEach(s),ao.forEach(s),fs=m(e),q=a(e,"P",{});var $o=n(q);it=l($o,"The VideoMAE model was proposed in "),Ve=a($o,"A",{href:!0,rel:!0});var pn=n(Ve);lt=l(pn,"VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training"),pn.forEach(s),dt=l($o,` by Zhan Tong, Yibing Song, Jue Wang, Limin Wang.
VideoMAE extends masked auto encoders (`),no=a($o,"A",{href:!0});var mn=n(no);ct=l(mn,"MAE"),mn.forEach(s),pt=l($o,") to video, claiming state-of-the-art performance on several video classification benchmarks."),$o.forEach(s),us=m(e),ro=a(e,"P",{});var hn=n(ro);mt=l(hn,"The abstract from the paper is the following:"),hn.forEach(s),gs=m(e),io=a(e,"P",{});var fn=n(io);Do=a(fn,"EM",{});var un=n(Do);ht=l(un,"Pre-training video transformers on extra large-scale datasets is generally required to achieve premier performance on relatively small datasets. In this paper, we show that video masked autoencoders (VideoMAE) are data-efficient learners for self-supervised video pre-training (SSVP). We are inspired by the recent ImageMAE and propose customized video tube masking and reconstruction. These simple designs turn out to be effective for overcoming information leakage caused by the temporal correlation during video reconstruction. We obtain three important findings on SSVP: (1) An extremely high proportion of masking ratio (i.e., 90% to 95%) still yields favorable performance of VideoMAE. The temporally redundant video content enables higher masking ratio than that of images. (2) VideoMAE achieves impressive results on very small datasets (i.e., around 3k-4k videos) without using any extra data. This is partially ascribed to the challenging task of video reconstruction to enforce high-level structure learning. (3) VideoMAE shows that data quality is more important than data quantity for SSVP. Domain shift between pre-training and target datasets are important issues in SSVP. Notably, our VideoMAE with the vanilla ViT backbone can achieve 83.9% on Kinects-400, 75.3% on Something-Something V2, 90.8% on UCF101, and 61.1% on HMDB51 without using any extra data."),un.forEach(s),fn.forEach(s),_s=m(e),lo=a(e,"P",{});var gn=n(lo);ft=l(gn,"Tips:"),gn.forEach(s),vs=m(e),se=a(e,"UL",{});var Ds=n(se);je=a(Ds,"LI",{});var Ls=n(je);ut=l(Ls,"One can use "),co=a(Ls,"A",{href:!0});var _n=n(co);gt=l(_n,"VideoMAEImageProcessor"),_n.forEach(s),_t=l(Ls," to prepare videos for the model. It will resize + normalize all frames of a video for you."),Ls.forEach(s),vt=m(Ds),po=a(Ds,"LI",{});var an=n(po);mo=a(an,"A",{href:!0});var vn=n(mo);bt=l(vn,"VideoMAEForPreTraining"),vn.forEach(s),Et=l(an," includes the decoder on top for self-supervised pre-training."),an.forEach(s),Ds.forEach(s),bs=m(e),te=a(e,"IMG",{src:!0,alt:!0,width:!0}),Es=m(e),ae=a(e,"SMALL",{});var Os=n(ae);yt=l(Os,"VideoMAE pre-training. Taken from the "),ho=a(Os,"A",{href:!0});var bn=n(ho);At=l(bn,"original paper"),bn.forEach(s),wt=l(Os,"."),Os.forEach(s),ys=m(e),S=a(e,"P",{});var Vo=n(S);Mt=l(Vo,"This model was contributed by "),xe=a(Vo,"A",{href:!0,rel:!0});var En=n(xe);$t=l(En,"nielsr"),En.forEach(s),Vt=l(Vo,`.
The original code can be found `),Te=a(Vo,"A",{href:!0,rel:!0});var yn=n(Te);jt=l(yn,"here"),yn.forEach(s),xt=l(Vo,"."),Vo.forEach(s),As=m(e),O=a(e,"H2",{class:!0});var Rs=n(O);ne=a(Rs,"A",{id:!0,class:!0,href:!0});var An=n(ne);Lo=a(An,"SPAN",{});var wn=n(Lo);y(Pe.$$.fragment,wn),wn.forEach(s),An.forEach(s),Tt=m(Rs),Oo=a(Rs,"SPAN",{});var Mn=n(Oo);Pt=l(Mn,"Resources"),Mn.forEach(s),Rs.forEach(s),ws=m(e),fo=a(e,"P",{});var $n=n(fo);kt=l($n,`A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VideoMAE. If
you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll
review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.`),$n.forEach(s),Ms=m(e),uo=a(e,"P",{});var Vn=n(uo);Ro=a(Vn,"STRONG",{});var jn=n(Ro);Ct=l(jn,"Video classification"),jn.forEach(s),Vn.forEach(s),$s=m(e),D=a(e,"UL",{});var jo=n(D);go=a(jo,"LI",{});var nn=n(go);ke=a(nn,"A",{href:!0,rel:!0});var xn=n(ke);zt=l(xn,"A notebook"),xn.forEach(s),It=l(nn,` that shows how
to fine-tune a VideoMAE model on a custom dataset.`),nn.forEach(s),Ft=m(jo),Uo=a(jo,"LI",{});var Tn=n(Uo);_o=a(Tn,"A",{href:!0});var Pn=n(_o);Nt=l(Pn,"Video classification task guide"),Pn.forEach(s),Tn.forEach(s),qt=m(jo),vo=a(jo,"LI",{});var rn=n(vo);Ce=a(rn,"A",{href:!0,rel:!0});var kn=n(Ce);St=l(kn,"A \u{1F917} Space"),kn.forEach(s),Dt=l(rn," showing how to perform inference with a video classification model."),rn.forEach(s),jo.forEach(s),Vs=m(e),R=a(e,"H2",{class:!0});var Us=n(R);re=a(Us,"A",{id:!0,class:!0,href:!0});var Cn=n(re);Wo=a(Cn,"SPAN",{});var zn=n(Wo);y(ze.$$.fragment,zn),zn.forEach(s),Cn.forEach(s),Lt=m(Us),Go=a(Us,"SPAN",{});var In=n(Go);Ot=l(In,"VideoMAEConfig"),In.forEach(s),Us.forEach(s),js=m(e),x=a(e,"DIV",{class:!0});var ye=n(x);y(Ie.$$.fragment,ye),Rt=m(ye),U=a(ye,"P",{});var xo=n(U);Ut=l(xo,"This is the configuration class to store the configuration of a "),bo=a(xo,"A",{href:!0});var Fn=n(bo);Wt=l(Fn,"VideoMAEModel"),Fn.forEach(s),Gt=l(xo,`. It is used to instantiate a
VideoMAE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VideoMAE
`),Fe=a(xo,"A",{href:!0,rel:!0});var Nn=n(Fe);Jt=l(Nn,"MCG-NJU/videomae-base"),Nn.forEach(s),Ht=l(xo," architecture."),xo.forEach(s),Bt=m(ye),W=a(ye,"P",{});var To=n(W);Kt=l(To,"Configuration objects inherit from "),Eo=a(To,"A",{href:!0});var qn=n(Eo);Yt=l(qn,"PretrainedConfig"),qn.forEach(s),Zt=l(To,` and can be used to control the model outputs. Read the
documentation from `),yo=a(To,"A",{href:!0});var Sn=n(yo);Xt=l(Sn,"PretrainedConfig"),Sn.forEach(s),Qt=l(To," for more information."),To.forEach(s),ea=m(ye),y(ie.$$.fragment,ye),ye.forEach(s),xs=m(e),G=a(e,"H2",{class:!0});var Ws=n(G);le=a(Ws,"A",{id:!0,class:!0,href:!0});var Dn=n(le);Jo=a(Dn,"SPAN",{});var Ln=n(Jo);y(Ne.$$.fragment,Ln),Ln.forEach(s),Dn.forEach(s),oa=m(Ws),Ho=a(Ws,"SPAN",{});var On=n(Ho);sa=l(On,"VideoMAEFeatureExtractor"),On.forEach(s),Ws.forEach(s),Ts=m(e),J=a(e,"DIV",{class:!0});var Gs=n(J);y(qe.$$.fragment,Gs),ta=m(Gs),de=a(Gs,"DIV",{class:!0});var Js=n(de);y(Se.$$.fragment,Js),aa=m(Js),Bo=a(Js,"P",{});var Rn=n(Bo);na=l(Rn,"Preprocess an image or a batch of images."),Rn.forEach(s),Js.forEach(s),Gs.forEach(s),Ps=m(e),H=a(e,"H2",{class:!0});var Hs=n(H);ce=a(Hs,"A",{id:!0,class:!0,href:!0});var Un=n(ce);Ko=a(Un,"SPAN",{});var Wn=n(Ko);y(De.$$.fragment,Wn),Wn.forEach(s),Un.forEach(s),ra=m(Hs),Yo=a(Hs,"SPAN",{});var Gn=n(Yo);ia=l(Gn,"VideoMAEImageProcessor"),Gn.forEach(s),Hs.forEach(s),ks=m(e),C=a(e,"DIV",{class:!0});var Po=n(C);y(Le.$$.fragment,Po),la=m(Po),Zo=a(Po,"P",{});var Jn=n(Zo);da=l(Jn,"Constructs a VideoMAE image processor."),Jn.forEach(s),ca=m(Po),pe=a(Po,"DIV",{class:!0});var Bs=n(pe);y(Oe.$$.fragment,Bs),pa=m(Bs),Xo=a(Bs,"P",{});var Hn=n(Xo);ma=l(Hn,"Preprocess an image or batch of images."),Hn.forEach(s),Bs.forEach(s),Po.forEach(s),Cs=m(e),B=a(e,"H2",{class:!0});var Ks=n(B);me=a(Ks,"A",{id:!0,class:!0,href:!0});var Bn=n(me);Qo=a(Bn,"SPAN",{});var Kn=n(Qo);y(Re.$$.fragment,Kn),Kn.forEach(s),Bn.forEach(s),ha=m(Ks),es=a(Ks,"SPAN",{});var Yn=n(es);fa=l(Yn,"VideoMAEModel"),Yn.forEach(s),Ks.forEach(s),zs=m(e),z=a(e,"DIV",{class:!0});var ko=n(z);y(Ue.$$.fragment,ko),ua=m(ko),We=a(ko,"P",{});var Ys=n(We);ga=l(Ys,`The bare VideoMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ge=a(Ys,"A",{href:!0,rel:!0});var Zn=n(Ge);_a=l(Zn,"torch.nn.Module"),Zn.forEach(s),va=l(Ys,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ys.forEach(s),ba=m(ko),T=a(ko,"DIV",{class:!0});var Ae=n(T);y(Je.$$.fragment,Ae),Ea=m(Ae),K=a(Ae,"P",{});var Co=n(K);ya=l(Co,"The "),Ao=a(Co,"A",{href:!0});var Xn=n(Ao);Aa=l(Xn,"VideoMAEModel"),Xn.forEach(s),wa=l(Co," forward method, overrides the "),os=a(Co,"CODE",{});var Qn=n(os);Ma=l(Qn,"__call__"),Qn.forEach(s),$a=l(Co," special method."),Co.forEach(s),Va=m(Ae),y(he.$$.fragment,Ae),ja=m(Ae),y(fe.$$.fragment,Ae),Ae.forEach(s),ko.forEach(s),Is=m(e),Y=a(e,"H2",{class:!0});var Zs=n(Y);ue=a(Zs,"A",{id:!0,class:!0,href:!0});var er=n(ue);ss=a(er,"SPAN",{});var or=n(ss);y(He.$$.fragment,or),or.forEach(s),er.forEach(s),xa=m(Zs),ts=a(Zs,"SPAN",{});var sr=n(ts);Ta=l(sr,"VideoMAEForPreTraining"),sr.forEach(s),Zs.forEach(s),Fs=m(e),I=a(e,"DIV",{class:!0});var zo=n(I);y(Be.$$.fragment,zo),Pa=m(zo),Ke=a(zo,"P",{});var Xs=n(Ke);ka=l(Xs,`The VideoMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Ye=a(Xs,"A",{href:!0,rel:!0});var tr=n(Ye);Ca=l(tr,"torch.nn.Module"),tr.forEach(s),za=l(Xs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xs.forEach(s),Ia=m(zo),P=a(zo,"DIV",{class:!0});var we=n(P);y(Ze.$$.fragment,we),Fa=m(we),Z=a(we,"P",{});var Io=n(Z);Na=l(Io,"The "),wo=a(Io,"A",{href:!0});var ar=n(wo);qa=l(ar,"VideoMAEForPreTraining"),ar.forEach(s),Sa=l(Io," forward method, overrides the "),as=a(Io,"CODE",{});var nr=n(as);Da=l(nr,"__call__"),nr.forEach(s),La=l(Io," special method."),Io.forEach(s),Oa=m(we),y(ge.$$.fragment,we),Ra=m(we),y(_e.$$.fragment,we),we.forEach(s),zo.forEach(s),Ns=m(e),X=a(e,"H2",{class:!0});var Qs=n(X);ve=a(Qs,"A",{id:!0,class:!0,href:!0});var rr=n(ve);ns=a(rr,"SPAN",{});var ir=n(ns);y(Xe.$$.fragment,ir),ir.forEach(s),rr.forEach(s),Ua=m(Qs),rs=a(Qs,"SPAN",{});var lr=n(rs);Wa=l(lr,"VideoMAEForVideoClassification"),lr.forEach(s),Qs.forEach(s),qs=m(e),F=a(e,"DIV",{class:!0});var Fo=n(F);y(Qe.$$.fragment,Fo),Ga=m(Fo),eo=a(Fo,"P",{});var et=n(eo);Ja=l(et,`VideoMAE Model transformer with a video classification head on top (a linear layer on top of the average pooled hidden
states of all tokens) e.g. for ImageNet.
This model is a PyTorch `),oo=a(et,"A",{href:!0,rel:!0});var dr=n(oo);Ha=l(dr,"torch.nn.Module"),dr.forEach(s),Ba=l(et,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),et.forEach(s),Ka=m(Fo),k=a(Fo,"DIV",{class:!0});var Me=n(k);y(so.$$.fragment,Me),Ya=m(Me),Q=a(Me,"P",{});var No=n(Q);Za=l(No,"The "),Mo=a(No,"A",{href:!0});var cr=n(Mo);Xa=l(cr,"VideoMAEForVideoClassification"),cr.forEach(s),Qa=l(No," forward method, overrides the "),is=a(No,"CODE",{});var pr=n(is);en=l(pr,"__call__"),pr.forEach(s),on=l(No," special method."),No.forEach(s),sn=m(Me),y(be.$$.fragment,Me),tn=m(Me),y(Ee.$$.fragment,Me),Me.forEach(s),Fo.forEach(s),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Vr)),d(u,"id","videomae"),d(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(u,"href","#videomae"),d(_,"class","relative group"),d(oe,"id","overview"),d(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(oe,"href","#overview"),d(L,"class","relative group"),d(Ve,"href","https://arxiv.org/abs/2203.12602"),d(Ve,"rel","nofollow"),d(no,"href","vit_mae"),d(co,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEImageProcessor"),d(mo,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEForPreTraining"),gr(te.src,dn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/videomae_architecture.jpeg")||d(te,"src",dn),d(te,"alt","drawing"),d(te,"width","600"),d(ho,"href","https://arxiv.org/abs/2203.12602"),d(xe,"href","https://huggingface.co/nielsr"),d(xe,"rel","nofollow"),d(Te,"href","https://github.com/MCG-NJU/VideoMAE"),d(Te,"rel","nofollow"),d(ne,"id","resources"),d(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ne,"href","#resources"),d(O,"class","relative group"),d(ke,"href","https://github.com/huggingface/notebooks/blob/main/examples/video_classification.ipynb"),d(ke,"rel","nofollow"),d(_o,"href","./tasks/video-classification"),d(Ce,"href","https://huggingface.co/spaces/sayakpaul/video-classification-ucf101-subset"),d(Ce,"rel","nofollow"),d(re,"id","transformers.VideoMAEConfig"),d(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(re,"href","#transformers.VideoMAEConfig"),d(R,"class","relative group"),d(bo,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEModel"),d(Fe,"href","https://huggingface.co/MCG-NJU/videomae-base"),d(Fe,"rel","nofollow"),d(Eo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(yo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"id","transformers.VideoMAEFeatureExtractor"),d(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(le,"href","#transformers.VideoMAEFeatureExtractor"),d(G,"class","relative group"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ce,"id","transformers.VideoMAEImageProcessor"),d(ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ce,"href","#transformers.VideoMAEImageProcessor"),d(H,"class","relative group"),d(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(me,"id","transformers.VideoMAEModel"),d(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(me,"href","#transformers.VideoMAEModel"),d(B,"class","relative group"),d(Ge,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ge,"rel","nofollow"),d(Ao,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEModel"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"id","transformers.VideoMAEForPreTraining"),d(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ue,"href","#transformers.VideoMAEForPreTraining"),d(Y,"class","relative group"),d(Ye,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ye,"rel","nofollow"),d(wo,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEForPreTraining"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"id","transformers.VideoMAEForVideoClassification"),d(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ve,"href","#transformers.VideoMAEForVideoClassification"),d(X,"class","relative group"),d(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(oo,"rel","nofollow"),d(Mo,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEForVideoClassification"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){o(document.head,h),f(e,b,c),f(e,_,c),o(_,u),o(u,v),A(r,v,null),o(_,g),o(_,j),o(j,at),f(e,hs,c),f(e,L,c),o(L,oe),o(oe,qo),A($e,qo,null),o(L,nt),o(L,So),o(So,rt),f(e,fs,c),f(e,q,c),o(q,it),o(q,Ve),o(Ve,lt),o(q,dt),o(q,no),o(no,ct),o(q,pt),f(e,us,c),f(e,ro,c),o(ro,mt),f(e,gs,c),f(e,io,c),o(io,Do),o(Do,ht),f(e,_s,c),f(e,lo,c),o(lo,ft),f(e,vs,c),f(e,se,c),o(se,je),o(je,ut),o(je,co),o(co,gt),o(je,_t),o(se,vt),o(se,po),o(po,mo),o(mo,bt),o(po,Et),f(e,bs,c),f(e,te,c),f(e,Es,c),f(e,ae,c),o(ae,yt),o(ae,ho),o(ho,At),o(ae,wt),f(e,ys,c),f(e,S,c),o(S,Mt),o(S,xe),o(xe,$t),o(S,Vt),o(S,Te),o(Te,jt),o(S,xt),f(e,As,c),f(e,O,c),o(O,ne),o(ne,Lo),A(Pe,Lo,null),o(O,Tt),o(O,Oo),o(Oo,Pt),f(e,ws,c),f(e,fo,c),o(fo,kt),f(e,Ms,c),f(e,uo,c),o(uo,Ro),o(Ro,Ct),f(e,$s,c),f(e,D,c),o(D,go),o(go,ke),o(ke,zt),o(go,It),o(D,Ft),o(D,Uo),o(Uo,_o),o(_o,Nt),o(D,qt),o(D,vo),o(vo,Ce),o(Ce,St),o(vo,Dt),f(e,Vs,c),f(e,R,c),o(R,re),o(re,Wo),A(ze,Wo,null),o(R,Lt),o(R,Go),o(Go,Ot),f(e,js,c),f(e,x,c),A(Ie,x,null),o(x,Rt),o(x,U),o(U,Ut),o(U,bo),o(bo,Wt),o(U,Gt),o(U,Fe),o(Fe,Jt),o(U,Ht),o(x,Bt),o(x,W),o(W,Kt),o(W,Eo),o(Eo,Yt),o(W,Zt),o(W,yo),o(yo,Xt),o(W,Qt),o(x,ea),A(ie,x,null),f(e,xs,c),f(e,G,c),o(G,le),o(le,Jo),A(Ne,Jo,null),o(G,oa),o(G,Ho),o(Ho,sa),f(e,Ts,c),f(e,J,c),A(qe,J,null),o(J,ta),o(J,de),A(Se,de,null),o(de,aa),o(de,Bo),o(Bo,na),f(e,Ps,c),f(e,H,c),o(H,ce),o(ce,Ko),A(De,Ko,null),o(H,ra),o(H,Yo),o(Yo,ia),f(e,ks,c),f(e,C,c),A(Le,C,null),o(C,la),o(C,Zo),o(Zo,da),o(C,ca),o(C,pe),A(Oe,pe,null),o(pe,pa),o(pe,Xo),o(Xo,ma),f(e,Cs,c),f(e,B,c),o(B,me),o(me,Qo),A(Re,Qo,null),o(B,ha),o(B,es),o(es,fa),f(e,zs,c),f(e,z,c),A(Ue,z,null),o(z,ua),o(z,We),o(We,ga),o(We,Ge),o(Ge,_a),o(We,va),o(z,ba),o(z,T),A(Je,T,null),o(T,Ea),o(T,K),o(K,ya),o(K,Ao),o(Ao,Aa),o(K,wa),o(K,os),o(os,Ma),o(K,$a),o(T,Va),A(he,T,null),o(T,ja),A(fe,T,null),f(e,Is,c),f(e,Y,c),o(Y,ue),o(ue,ss),A(He,ss,null),o(Y,xa),o(Y,ts),o(ts,Ta),f(e,Fs,c),f(e,I,c),A(Be,I,null),o(I,Pa),o(I,Ke),o(Ke,ka),o(Ke,Ye),o(Ye,Ca),o(Ke,za),o(I,Ia),o(I,P),A(Ze,P,null),o(P,Fa),o(P,Z),o(Z,Na),o(Z,wo),o(wo,qa),o(Z,Sa),o(Z,as),o(as,Da),o(Z,La),o(P,Oa),A(ge,P,null),o(P,Ra),A(_e,P,null),f(e,Ns,c),f(e,X,c),o(X,ve),o(ve,ns),A(Xe,ns,null),o(X,Ua),o(X,rs),o(rs,Wa),f(e,qs,c),f(e,F,c),A(Qe,F,null),o(F,Ga),o(F,eo),o(eo,Ja),o(eo,oo),o(oo,Ha),o(eo,Ba),o(F,Ka),o(F,k),A(so,k,null),o(k,Ya),o(k,Q),o(Q,Za),o(Q,Mo),o(Mo,Xa),o(Q,Qa),o(Q,is),o(is,en),o(Q,on),o(k,sn),A(be,k,null),o(k,tn),A(Ee,k,null),Ss=!0},p(e,[c]){const to={};c&2&&(to.$$scope={dirty:c,ctx:e}),ie.$set(to);const ls={};c&2&&(ls.$$scope={dirty:c,ctx:e}),he.$set(ls);const ds={};c&2&&(ds.$$scope={dirty:c,ctx:e}),fe.$set(ds);const cs={};c&2&&(cs.$$scope={dirty:c,ctx:e}),ge.$set(cs);const ao={};c&2&&(ao.$$scope={dirty:c,ctx:e}),_e.$set(ao);const ps={};c&2&&(ps.$$scope={dirty:c,ctx:e}),be.$set(ps);const ms={};c&2&&(ms.$$scope={dirty:c,ctx:e}),Ee.$set(ms)},i(e){Ss||(w(r.$$.fragment,e),w($e.$$.fragment,e),w(Pe.$$.fragment,e),w(ze.$$.fragment,e),w(Ie.$$.fragment,e),w(ie.$$.fragment,e),w(Ne.$$.fragment,e),w(qe.$$.fragment,e),w(Se.$$.fragment,e),w(De.$$.fragment,e),w(Le.$$.fragment,e),w(Oe.$$.fragment,e),w(Re.$$.fragment,e),w(Ue.$$.fragment,e),w(Je.$$.fragment,e),w(he.$$.fragment,e),w(fe.$$.fragment,e),w(He.$$.fragment,e),w(Be.$$.fragment,e),w(Ze.$$.fragment,e),w(ge.$$.fragment,e),w(_e.$$.fragment,e),w(Xe.$$.fragment,e),w(Qe.$$.fragment,e),w(so.$$.fragment,e),w(be.$$.fragment,e),w(Ee.$$.fragment,e),Ss=!0)},o(e){M(r.$$.fragment,e),M($e.$$.fragment,e),M(Pe.$$.fragment,e),M(ze.$$.fragment,e),M(Ie.$$.fragment,e),M(ie.$$.fragment,e),M(Ne.$$.fragment,e),M(qe.$$.fragment,e),M(Se.$$.fragment,e),M(De.$$.fragment,e),M(Le.$$.fragment,e),M(Oe.$$.fragment,e),M(Re.$$.fragment,e),M(Ue.$$.fragment,e),M(Je.$$.fragment,e),M(he.$$.fragment,e),M(fe.$$.fragment,e),M(He.$$.fragment,e),M(Be.$$.fragment,e),M(Ze.$$.fragment,e),M(ge.$$.fragment,e),M(_e.$$.fragment,e),M(Xe.$$.fragment,e),M(Qe.$$.fragment,e),M(so.$$.fragment,e),M(be.$$.fragment,e),M(Ee.$$.fragment,e),Ss=!1},d(e){s(h),e&&s(b),e&&s(_),$(r),e&&s(hs),e&&s(L),$($e),e&&s(fs),e&&s(q),e&&s(us),e&&s(ro),e&&s(gs),e&&s(io),e&&s(_s),e&&s(lo),e&&s(vs),e&&s(se),e&&s(bs),e&&s(te),e&&s(Es),e&&s(ae),e&&s(ys),e&&s(S),e&&s(As),e&&s(O),$(Pe),e&&s(ws),e&&s(fo),e&&s(Ms),e&&s(uo),e&&s($s),e&&s(D),e&&s(Vs),e&&s(R),$(ze),e&&s(js),e&&s(x),$(Ie),$(ie),e&&s(xs),e&&s(G),$(Ne),e&&s(Ts),e&&s(J),$(qe),$(Se),e&&s(Ps),e&&s(H),$(De),e&&s(ks),e&&s(C),$(Le),$(Oe),e&&s(Cs),e&&s(B),$(Re),e&&s(zs),e&&s(z),$(Ue),$(Je),$(he),$(fe),e&&s(Is),e&&s(Y),$(He),e&&s(Fs),e&&s(I),$(Be),$(Ze),$(ge),$(_e),e&&s(Ns),e&&s(X),$(Xe),e&&s(qs),e&&s(F),$(Qe),$(so),$(be),$(Ee)}}}const Vr={local:"videomae",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.VideoMAEConfig",title:"VideoMAEConfig"},{local:"transformers.VideoMAEFeatureExtractor",title:"VideoMAEFeatureExtractor"},{local:"transformers.VideoMAEImageProcessor",title:"VideoMAEImageProcessor"},{local:"transformers.VideoMAEModel",title:"VideoMAEModel"},{local:"transformers.VideoMAEForPreTraining",title:"VideoMAEForPreTraining"},{local:"transformers.VideoMAEForVideoClassification",title:"VideoMAEForVideoClassification"}],title:"VideoMAE"};function jr(V){return _r(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ir extends mr{constructor(h){super();hr(this,h,jr,$r,fr,{})}}export{Ir as default,Vr as metadata};
