import{S as pr,i as hr,s as fr,e as a,k as m,w,t as l,M as ur,c as t,d as s,m as p,a as n,x as b,h as i,b as d,N as gr,G as o,g as f,y as v,q as T,o as j,B as J,v as Mr,L as sa}from"../../chunks/vendor-hf-doc-builder.js";import{T as ln}from"../../chunks/Tip-hf-doc-builder.js";import{D as B}from"../../chunks/Docstring-hf-doc-builder.js";import{C as aa}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ee}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as oa}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function _r(E){let h,y,M,u,_;return u=new aa({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpZGVvTUFFQ29uZmlnJTJDJTIwVmlkZW9NQUVNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBWaWRlb01BRSUyMHZpZGVvbWFlLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwVmlkZW9NQUVDb25maWcoKSUwQSUwQSUyMyUyMFJhbmRvbWx5JTIwaW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMFZpZGVvTUFFTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",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=a("p"),y=l("Example:"),M=m(),w(u.$$.fragment)},l(r){h=t(r,"P",{});var g=n(h);y=i(g,"Example:"),g.forEach(s),M=p(r),b(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,y),f(r,M,g),v(u,r,g),_=!0},p:sa,i(r){_||(T(u.$$.fragment,r),_=!0)},o(r){j(u.$$.fragment,r),_=!1},d(r){r&&s(h),r&&s(M),J(u,r)}}}function yr(E){let h,y,M,u,_;return{c(){h=a("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a("code"),u=l("Module"),_=l(`
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=t(r,"P",{});var g=n(h);y=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=t(g,"CODE",{});var U=n(M);u=i(U,"Module"),U.forEach(s),_=i(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,y),o(h,M),o(M,u),o(h,_)},d(r){r&&s(h)}}}function wr(E){let h,y,M,u,_;return u=new aa({props:{code:" ",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>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Sample a given number of frame indices from the video.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        clip_len (\`int\`): Total number of frames to sample.
<span class="hljs-meta">... </span>        frame_sample_rate (\`int\`): Sample every n-th frame.
<span class="hljs-meta">... </span>        seg_len (\`int\`): Maximum allowed index of sample&#x27;s last frame.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of sampled frame indices
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</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=a("p"),y=l("Examples:"),M=m(),w(u.$$.fragment)},l(r){h=t(r,"P",{});var g=n(h);y=i(g,"Examples:"),g.forEach(s),M=p(r),b(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,y),f(r,M,g),v(u,r,g),_=!0},p:sa,i(r){_||(T(u.$$.fragment,r),_=!0)},o(r){j(u.$$.fragment,r),_=!1},d(r){r&&s(h),r&&s(M),J(u,r)}}}function br(E){let h,y,M,u,_;return{c(){h=a("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a("code"),u=l("Module"),_=l(`
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=t(r,"P",{});var g=n(h);y=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=t(g,"CODE",{});var U=n(M);u=i(U,"Module"),U.forEach(s),_=i(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,y),o(h,M),o(M,u),o(h,_)},d(r){r&&s(h)}}}function vr(E){let h,y,M,u,_;return u=new aa({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpZGVvTUFFRm9yUHJlVHJhaW5pbmclMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQW51bV9mcmFtZXMlMjAlM0QlMjAxNiUwQXZpZGVvJTIwJTNEJTIwbGlzdChucC5yYW5kb20ucmFuZGludCgwJTJDJTIwMjU2JTJDJTIwKG51bV9mcmFtZXMlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KSkpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJNQ0ctTkpVJTJGdmlkZW9tYWUtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZpZGVvTUFFRm9yUHJlVHJhaW5pbmcuZnJvbV9wcmV0cmFpbmVkKCUyMk1DRy1OSlUlMkZ2aWRlb21hZS1iYXNlJTIyKSUwQSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMGltYWdlX3Byb2Nlc3Nvcih2aWRlbyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUwQW51bV9wYXRjaGVzX3Blcl9mcmFtZSUyMCUzRCUyMChtb2RlbC5jb25maWcuaW1hZ2Vfc2l6ZSUyMCUyRiUyRiUyMG1vZGVsLmNvbmZpZy5wYXRjaF9zaXplKSUyMCoqJTIwMiUwQXNlcV9sZW5ndGglMjAlM0QlMjAobnVtX2ZyYW1lcyUyMCUyRiUyRiUyMG1vZGVsLmNvbmZpZy50dWJlbGV0X3NpemUpJTIwKiUyMG51bV9wYXRjaGVzX3Blcl9mcmFtZSUwQWJvb2xfbWFza2VkX3BvcyUyMCUzRCUyMHRvcmNoLnJhbmRpbnQoMCUyQyUyMDIlMkMlMjAoMSUyQyUyMHNlcV9sZW5ndGgpKS5ib29sKCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzJTJDJTIwYm9vbF9tYXNrZWRfcG9zJTNEYm9vbF9tYXNrZWRfcG9zKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",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=a("p"),y=l("Examples:"),M=m(),w(u.$$.fragment)},l(r){h=t(r,"P",{});var g=n(h);y=i(g,"Examples:"),g.forEach(s),M=p(r),b(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,y),f(r,M,g),v(u,r,g),_=!0},p:sa,i(r){_||(T(u.$$.fragment,r),_=!0)},o(r){j(u.$$.fragment,r),_=!1},d(r){r&&s(h),r&&s(M),J(u,r)}}}function Tr(E){let h,y,M,u,_;return{c(){h=a("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a("code"),u=l("Module"),_=l(`
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=t(r,"P",{});var g=n(h);y=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=t(g,"CODE",{});var U=n(M);u=i(U,"Module"),U.forEach(s),_=i(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,y),o(h,M),o(M,u),o(h,_)},d(r){r&&s(h)}}}function jr(E){let h,y,M,u,_;return u=new aa({props:{code:" ",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>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Sample a given number of frame indices from the video.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        clip_len (\`int\`): Total number of frames to sample.
<span class="hljs-meta">... </span>        frame_sample_rate (\`int\`): Sample every n-th frame.
<span class="hljs-meta">... </span>        seg_len (\`int\`): Maximum allowed index of sample&#x27;s last frame.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of sampled frame indices
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</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=a("p"),y=l("Examples:"),M=m(),w(u.$$.fragment)},l(r){h=t(r,"P",{});var g=n(h);y=i(g,"Examples:"),g.forEach(s),M=p(r),b(u.$$.fragment,r)},m(r,g){f(r,h,g),o(h,y),f(r,M,g),v(u,r,g),_=!0},p:sa,i(r){_||(T(u.$$.fragment,r),_=!0)},o(r){j(u.$$.fragment,r),_=!1},d(r){r&&s(h),r&&s(M),J(u,r)}}}function Jr(E){let h,y,M,u,_,r,g,U,ta,hs,z,oe,Go,Je,na,xo,ra,fs,G,la,Ee,ia,da,no,ca,ma,us,ro,pa,gs,lo,Fo,ha,Ms,io,fa,_s,se,Ue,ua,co,ga,Ma,_a,mo,po,ya,wa,ys,ae,dn,ws,te,ba,ho,va,Ta,bs,x,ja,Ve,Ja,Ea,Ae,Ua,Va,vs,N,ne,zo,Ie,Aa,No,Ia,Ts,fo,Ca,js,uo,So,Za,Js,F,go,Ce,ka,Wa,$a,Ro,Mo,Ba,Ga,_o,Ze,xa,Fa,Es,S,re,Xo,ke,za,Po,Na,Us,V,We,Sa,R,Ra,yo,Xa,Pa,$e,Ya,Qa,Ha,X,Da,wo,La,qa,bo,Ka,Oa,et,le,Vs,P,ie,Yo,Be,ot,Qo,st,As,Y,Ge,at,de,xe,tt,Ho,nt,Is,Q,ce,Do,Fe,rt,Lo,lt,Cs,Z,ze,it,qo,dt,ct,me,Ne,mt,Ko,pt,Zs,H,pe,Oo,Se,ht,es,ft,ks,k,Re,ut,Xe,gt,Pe,Mt,_t,yt,A,Ye,wt,D,bt,vo,vt,Tt,os,jt,Jt,Et,he,Ut,fe,Ws,L,ue,ss,Qe,Vt,as,At,$s,W,He,It,De,Ct,Le,Zt,kt,Wt,I,qe,$t,q,Bt,To,Gt,xt,ts,Ft,zt,Nt,ge,St,Me,Bs,K,_e,ns,Ke,Rt,rs,Xt,Gs,$,Oe,Pt,eo,Yt,oo,Qt,Ht,Dt,C,so,Lt,O,qt,jo,Kt,Ot,ls,en,on,sn,ye,an,we,xs;return r=new ee({}),Je=new ee({}),Ie=new ee({}),ke=new ee({}),We=new B({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.33.0/src/transformers/models/videomae/configuration_videomae.py#L28"}}),le=new oa({props:{anchor:"transformers.VideoMAEConfig.example",$$slots:{default:[_r]},$$scope:{ctx:E}}}),Be=new ee({}),Ge=new B({props:{name:"class transformers.VideoMAEFeatureExtractor",anchor:"transformers.VideoMAEFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/videomae/feature_extraction_videomae.py#L26"}}),xe=new B({props:{name:"__call__",anchor:"transformers.VideoMAEFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/image_processing_utils.py#L544"}}),Fe=new ee({}),ze=new B({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.33.0/src/transformers/models/videomae/image_processing_videomae.py#L62"}}),Ne=new B({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:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VideoMAEImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,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"},{anchor:"transformers.VideoMAEImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/videomae/image_processing_videomae.py#L233"}}),Se=new ee({}),Re=new B({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.33.0/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.33.0/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.33.0/src/transformers/models/videomae/modeling_videomae.py#L535"}}),Ye=new B({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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.VideoMAEModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0). Each video in the
batch must have the same number of masked patches. If <code>None</code>, then all patches are considered. Sequence
length is <code>(num_frames // tubelet_size) * (image_size // patch_size) ** 2</code>.`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/videomae/modeling_videomae.py#L562",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/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.33.0/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.33.0/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:[yr]},$$scope:{ctx:E}}}),fe=new oa({props:{anchor:"transformers.VideoMAEModel.forward.example",$$slots:{default:[wr]},$$scope:{ctx:E}}}),Qe=new ee({}),He=new B({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.33.0/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.33.0/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.33.0/src/transformers/models/videomae/modeling_videomae.py#L768"}}),qe=new B({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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.VideoMAEForPreTraining.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0). Each video in the
batch must have the same number of masked patches. Sequence length is <code>(num_frames // tubelet_size) * (image_size // patch_size) ** 2</code>.`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/videomae/modeling_videomae.py#L786",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.33.0/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:[br]},$$scope:{ctx:E}}}),Me=new oa({props:{anchor:"transformers.VideoMAEForPreTraining.forward.example",$$slots:{default:[vr]},$$scope:{ctx:E}}}),Ke=new ee({}),Oe=new B({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.33.0/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.33.0/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.33.0/src/transformers/models/videomae/modeling_videomae.py#L952"}}),so=new B({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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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.33.0/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.33.0/src/transformers/models/videomae/modeling_videomae.py#L966",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/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.33.0/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.33.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new ln({props:{$$slots:{default:[Tr]},$$scope:{ctx:E}}}),we=new oa({props:{anchor:"transformers.VideoMAEForVideoClassification.forward.example",$$slots:{default:[jr]},$$scope:{ctx:E}}}),{c(){h=a("meta"),y=m(),M=a("h1"),u=a("a"),_=a("span"),w(r.$$.fragment),g=m(),U=a("span"),ta=l("VideoMAE"),hs=m(),z=a("h2"),oe=a("a"),Go=a("span"),w(Je.$$.fragment),na=m(),xo=a("span"),ra=l("Overview"),fs=m(),G=a("p"),la=l("The VideoMAE model was proposed in "),Ee=a("a"),ia=l("VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training"),da=l(` by Zhan Tong, Yibing Song, Jue Wang, Limin Wang.
VideoMAE extends masked auto encoders (`),no=a("a"),ca=l("MAE"),ma=l(") to video, claiming state-of-the-art performance on several video classification benchmarks."),us=m(),ro=a("p"),pa=l("The abstract from the paper is the following:"),gs=m(),lo=a("p"),Fo=a("em"),ha=l("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."),Ms=m(),io=a("p"),fa=l("Tips:"),_s=m(),se=a("ul"),Ue=a("li"),ua=l("One can use "),co=a("a"),ga=l("VideoMAEImageProcessor"),Ma=l(" to prepare videos for the model. It will resize + normalize all frames of a video for you."),_a=m(),mo=a("li"),po=a("a"),ya=l("VideoMAEForPreTraining"),wa=l(" includes the decoder on top for self-supervised pre-training."),ys=m(),ae=a("img"),ws=m(),te=a("small"),ba=l("VideoMAE pre-training. Taken from the "),ho=a("a"),va=l("original paper"),Ta=l("."),bs=m(),x=a("p"),ja=l("This model was contributed by "),Ve=a("a"),Ja=l("nielsr"),Ea=l(`.
The original code can be found `),Ae=a("a"),Ua=l("here"),Va=l("."),vs=m(),N=a("h2"),ne=a("a"),zo=a("span"),w(Ie.$$.fragment),Aa=m(),No=a("span"),Ia=l("Resources"),Ts=m(),fo=a("p"),Ca=l(`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.`),js=m(),uo=a("p"),So=a("strong"),Za=l("Video classification"),Js=m(),F=a("ul"),go=a("li"),Ce=a("a"),ka=l("A notebook"),Wa=l(` that shows how
to fine-tune a VideoMAE model on a custom dataset.`),$a=m(),Ro=a("li"),Mo=a("a"),Ba=l("Video classification task guide"),Ga=m(),_o=a("li"),Ze=a("a"),xa=l("A \u{1F917} Space"),Fa=l(" showing how to perform inference with a video classification model."),Es=m(),S=a("h2"),re=a("a"),Xo=a("span"),w(ke.$$.fragment),za=m(),Po=a("span"),Na=l("VideoMAEConfig"),Us=m(),V=a("div"),w(We.$$.fragment),Sa=m(),R=a("p"),Ra=l("This is the configuration class to store the configuration of a "),yo=a("a"),Xa=l("VideoMAEModel"),Pa=l(`. 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
`),$e=a("a"),Ya=l("MCG-NJU/videomae-base"),Qa=l(" architecture."),Ha=m(),X=a("p"),Da=l("Configuration objects inherit from "),wo=a("a"),La=l("PretrainedConfig"),qa=l(` and can be used to control the model outputs. Read the
documentation from `),bo=a("a"),Ka=l("PretrainedConfig"),Oa=l(" for more information."),et=m(),w(le.$$.fragment),Vs=m(),P=a("h2"),ie=a("a"),Yo=a("span"),w(Be.$$.fragment),ot=m(),Qo=a("span"),st=l("VideoMAEFeatureExtractor"),As=m(),Y=a("div"),w(Ge.$$.fragment),at=m(),de=a("div"),w(xe.$$.fragment),tt=m(),Ho=a("p"),nt=l("Preprocess an image or a batch of images."),Is=m(),Q=a("h2"),ce=a("a"),Do=a("span"),w(Fe.$$.fragment),rt=m(),Lo=a("span"),lt=l("VideoMAEImageProcessor"),Cs=m(),Z=a("div"),w(ze.$$.fragment),it=m(),qo=a("p"),dt=l("Constructs a VideoMAE image processor."),ct=m(),me=a("div"),w(Ne.$$.fragment),mt=m(),Ko=a("p"),pt=l("Preprocess an image or batch of images."),Zs=m(),H=a("h2"),pe=a("a"),Oo=a("span"),w(Se.$$.fragment),ht=m(),es=a("span"),ft=l("VideoMAEModel"),ks=m(),k=a("div"),w(Re.$$.fragment),ut=m(),Xe=a("p"),gt=l(`The bare VideoMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pe=a("a"),Mt=l("torch.nn.Module"),_t=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yt=m(),A=a("div"),w(Ye.$$.fragment),wt=m(),D=a("p"),bt=l("The "),vo=a("a"),vt=l("VideoMAEModel"),Tt=l(" forward method, overrides the "),os=a("code"),jt=l("__call__"),Jt=l(" special method."),Et=m(),w(he.$$.fragment),Ut=m(),w(fe.$$.fragment),Ws=m(),L=a("h2"),ue=a("a"),ss=a("span"),w(Qe.$$.fragment),Vt=m(),as=a("span"),At=l("VideoMAEForPreTraining"),$s=m(),W=a("div"),w(He.$$.fragment),It=m(),De=a("p"),Ct=l(`The VideoMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Le=a("a"),Zt=l("torch.nn.Module"),kt=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wt=m(),I=a("div"),w(qe.$$.fragment),$t=m(),q=a("p"),Bt=l("The "),To=a("a"),Gt=l("VideoMAEForPreTraining"),xt=l(" forward method, overrides the "),ts=a("code"),Ft=l("__call__"),zt=l(" special method."),Nt=m(),w(ge.$$.fragment),St=m(),w(Me.$$.fragment),Bs=m(),K=a("h2"),_e=a("a"),ns=a("span"),w(Ke.$$.fragment),Rt=m(),rs=a("span"),Xt=l("VideoMAEForVideoClassification"),Gs=m(),$=a("div"),w(Oe.$$.fragment),Pt=m(),eo=a("p"),Yt=l(`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("a"),Qt=l("torch.nn.Module"),Ht=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dt=m(),C=a("div"),w(so.$$.fragment),Lt=m(),O=a("p"),qt=l("The "),jo=a("a"),Kt=l("VideoMAEForVideoClassification"),Ot=l(" forward method, overrides the "),ls=a("code"),en=l("__call__"),on=l(" special method."),sn=m(),w(ye.$$.fragment),an=m(),w(we.$$.fragment),this.h()},l(e){const c=ur('[data-svelte="svelte-1phssyn"]',document.head);h=t(c,"META",{name:!0,content:!0}),c.forEach(s),y=p(e),M=t(e,"H1",{class:!0});var ao=n(M);u=t(ao,"A",{id:!0,class:!0,href:!0});var is=n(u);_=t(is,"SPAN",{});var ds=n(_);b(r.$$.fragment,ds),ds.forEach(s),is.forEach(s),g=p(ao),U=t(ao,"SPAN",{});var cs=n(U);ta=i(cs,"VideoMAE"),cs.forEach(s),ao.forEach(s),hs=p(e),z=t(e,"H2",{class:!0});var to=n(z);oe=t(to,"A",{id:!0,class:!0,href:!0});var ms=n(oe);Go=t(ms,"SPAN",{});var ps=n(Go);b(Je.$$.fragment,ps),ps.forEach(s),ms.forEach(s),na=p(to),xo=t(to,"SPAN",{});var cn=n(xo);ra=i(cn,"Overview"),cn.forEach(s),to.forEach(s),fs=p(e),G=t(e,"P",{});var Jo=n(G);la=i(Jo,"The VideoMAE model was proposed in "),Ee=t(Jo,"A",{href:!0,rel:!0});var mn=n(Ee);ia=i(mn,"VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training"),mn.forEach(s),da=i(Jo,` by Zhan Tong, Yibing Song, Jue Wang, Limin Wang.
VideoMAE extends masked auto encoders (`),no=t(Jo,"A",{href:!0});var pn=n(no);ca=i(pn,"MAE"),pn.forEach(s),ma=i(Jo,") to video, claiming state-of-the-art performance on several video classification benchmarks."),Jo.forEach(s),us=p(e),ro=t(e,"P",{});var hn=n(ro);pa=i(hn,"The abstract from the paper is the following:"),hn.forEach(s),gs=p(e),lo=t(e,"P",{});var fn=n(lo);Fo=t(fn,"EM",{});var un=n(Fo);ha=i(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),Ms=p(e),io=t(e,"P",{});var gn=n(io);fa=i(gn,"Tips:"),gn.forEach(s),_s=p(e),se=t(e,"UL",{});var Fs=n(se);Ue=t(Fs,"LI",{});var zs=n(Ue);ua=i(zs,"One can use "),co=t(zs,"A",{href:!0});var Mn=n(co);ga=i(Mn,"VideoMAEImageProcessor"),Mn.forEach(s),Ma=i(zs," to prepare videos for the model. It will resize + normalize all frames of a video for you."),zs.forEach(s),_a=p(Fs),mo=t(Fs,"LI",{});var tn=n(mo);po=t(tn,"A",{href:!0});var _n=n(po);ya=i(_n,"VideoMAEForPreTraining"),_n.forEach(s),wa=i(tn," includes the decoder on top for self-supervised pre-training."),tn.forEach(s),Fs.forEach(s),ys=p(e),ae=t(e,"IMG",{src:!0,alt:!0,width:!0}),ws=p(e),te=t(e,"SMALL",{});var Ns=n(te);ba=i(Ns,"VideoMAE pre-training. Taken from the "),ho=t(Ns,"A",{href:!0});var yn=n(ho);va=i(yn,"original paper"),yn.forEach(s),Ta=i(Ns,"."),Ns.forEach(s),bs=p(e),x=t(e,"P",{});var Eo=n(x);ja=i(Eo,"This model was contributed by "),Ve=t(Eo,"A",{href:!0,rel:!0});var wn=n(Ve);Ja=i(wn,"nielsr"),wn.forEach(s),Ea=i(Eo,`.
The original code can be found `),Ae=t(Eo,"A",{href:!0,rel:!0});var bn=n(Ae);Ua=i(bn,"here"),bn.forEach(s),Va=i(Eo,"."),Eo.forEach(s),vs=p(e),N=t(e,"H2",{class:!0});var Ss=n(N);ne=t(Ss,"A",{id:!0,class:!0,href:!0});var vn=n(ne);zo=t(vn,"SPAN",{});var Tn=n(zo);b(Ie.$$.fragment,Tn),Tn.forEach(s),vn.forEach(s),Aa=p(Ss),No=t(Ss,"SPAN",{});var jn=n(No);Ia=i(jn,"Resources"),jn.forEach(s),Ss.forEach(s),Ts=p(e),fo=t(e,"P",{});var Jn=n(fo);Ca=i(Jn,`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.`),Jn.forEach(s),js=p(e),uo=t(e,"P",{});var En=n(uo);So=t(En,"STRONG",{});var Un=n(So);Za=i(Un,"Video classification"),Un.forEach(s),En.forEach(s),Js=p(e),F=t(e,"UL",{});var Uo=n(F);go=t(Uo,"LI",{});var nn=n(go);Ce=t(nn,"A",{href:!0,rel:!0});var Vn=n(Ce);ka=i(Vn,"A notebook"),Vn.forEach(s),Wa=i(nn,` that shows how
to fine-tune a VideoMAE model on a custom dataset.`),nn.forEach(s),$a=p(Uo),Ro=t(Uo,"LI",{});var An=n(Ro);Mo=t(An,"A",{href:!0});var In=n(Mo);Ba=i(In,"Video classification task guide"),In.forEach(s),An.forEach(s),Ga=p(Uo),_o=t(Uo,"LI",{});var rn=n(_o);Ze=t(rn,"A",{href:!0,rel:!0});var Cn=n(Ze);xa=i(Cn,"A \u{1F917} Space"),Cn.forEach(s),Fa=i(rn," showing how to perform inference with a video classification model."),rn.forEach(s),Uo.forEach(s),Es=p(e),S=t(e,"H2",{class:!0});var Rs=n(S);re=t(Rs,"A",{id:!0,class:!0,href:!0});var Zn=n(re);Xo=t(Zn,"SPAN",{});var kn=n(Xo);b(ke.$$.fragment,kn),kn.forEach(s),Zn.forEach(s),za=p(Rs),Po=t(Rs,"SPAN",{});var Wn=n(Po);Na=i(Wn,"VideoMAEConfig"),Wn.forEach(s),Rs.forEach(s),Us=p(e),V=t(e,"DIV",{class:!0});var be=n(V);b(We.$$.fragment,be),Sa=p(be),R=t(be,"P",{});var Vo=n(R);Ra=i(Vo,"This is the configuration class to store the configuration of a "),yo=t(Vo,"A",{href:!0});var $n=n(yo);Xa=i($n,"VideoMAEModel"),$n.forEach(s),Pa=i(Vo,`. 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
`),$e=t(Vo,"A",{href:!0,rel:!0});var Bn=n($e);Ya=i(Bn,"MCG-NJU/videomae-base"),Bn.forEach(s),Qa=i(Vo," architecture."),Vo.forEach(s),Ha=p(be),X=t(be,"P",{});var Ao=n(X);Da=i(Ao,"Configuration objects inherit from "),wo=t(Ao,"A",{href:!0});var Gn=n(wo);La=i(Gn,"PretrainedConfig"),Gn.forEach(s),qa=i(Ao,` and can be used to control the model outputs. Read the
documentation from `),bo=t(Ao,"A",{href:!0});var xn=n(bo);Ka=i(xn,"PretrainedConfig"),xn.forEach(s),Oa=i(Ao," for more information."),Ao.forEach(s),et=p(be),b(le.$$.fragment,be),be.forEach(s),Vs=p(e),P=t(e,"H2",{class:!0});var Xs=n(P);ie=t(Xs,"A",{id:!0,class:!0,href:!0});var Fn=n(ie);Yo=t(Fn,"SPAN",{});var zn=n(Yo);b(Be.$$.fragment,zn),zn.forEach(s),Fn.forEach(s),ot=p(Xs),Qo=t(Xs,"SPAN",{});var Nn=n(Qo);st=i(Nn,"VideoMAEFeatureExtractor"),Nn.forEach(s),Xs.forEach(s),As=p(e),Y=t(e,"DIV",{class:!0});var Ps=n(Y);b(Ge.$$.fragment,Ps),at=p(Ps),de=t(Ps,"DIV",{class:!0});var Ys=n(de);b(xe.$$.fragment,Ys),tt=p(Ys),Ho=t(Ys,"P",{});var Sn=n(Ho);nt=i(Sn,"Preprocess an image or a batch of images."),Sn.forEach(s),Ys.forEach(s),Ps.forEach(s),Is=p(e),Q=t(e,"H2",{class:!0});var Qs=n(Q);ce=t(Qs,"A",{id:!0,class:!0,href:!0});var Rn=n(ce);Do=t(Rn,"SPAN",{});var Xn=n(Do);b(Fe.$$.fragment,Xn),Xn.forEach(s),Rn.forEach(s),rt=p(Qs),Lo=t(Qs,"SPAN",{});var Pn=n(Lo);lt=i(Pn,"VideoMAEImageProcessor"),Pn.forEach(s),Qs.forEach(s),Cs=p(e),Z=t(e,"DIV",{class:!0});var Io=n(Z);b(ze.$$.fragment,Io),it=p(Io),qo=t(Io,"P",{});var Yn=n(qo);dt=i(Yn,"Constructs a VideoMAE image processor."),Yn.forEach(s),ct=p(Io),me=t(Io,"DIV",{class:!0});var Hs=n(me);b(Ne.$$.fragment,Hs),mt=p(Hs),Ko=t(Hs,"P",{});var Qn=n(Ko);pt=i(Qn,"Preprocess an image or batch of images."),Qn.forEach(s),Hs.forEach(s),Io.forEach(s),Zs=p(e),H=t(e,"H2",{class:!0});var Ds=n(H);pe=t(Ds,"A",{id:!0,class:!0,href:!0});var Hn=n(pe);Oo=t(Hn,"SPAN",{});var Dn=n(Oo);b(Se.$$.fragment,Dn),Dn.forEach(s),Hn.forEach(s),ht=p(Ds),es=t(Ds,"SPAN",{});var Ln=n(es);ft=i(Ln,"VideoMAEModel"),Ln.forEach(s),Ds.forEach(s),ks=p(e),k=t(e,"DIV",{class:!0});var Co=n(k);b(Re.$$.fragment,Co),ut=p(Co),Xe=t(Co,"P",{});var Ls=n(Xe);gt=i(Ls,`The bare VideoMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pe=t(Ls,"A",{href:!0,rel:!0});var qn=n(Pe);Mt=i(qn,"torch.nn.Module"),qn.forEach(s),_t=i(Ls,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls.forEach(s),yt=p(Co),A=t(Co,"DIV",{class:!0});var ve=n(A);b(Ye.$$.fragment,ve),wt=p(ve),D=t(ve,"P",{});var Zo=n(D);bt=i(Zo,"The "),vo=t(Zo,"A",{href:!0});var Kn=n(vo);vt=i(Kn,"VideoMAEModel"),Kn.forEach(s),Tt=i(Zo," forward method, overrides the "),os=t(Zo,"CODE",{});var On=n(os);jt=i(On,"__call__"),On.forEach(s),Jt=i(Zo," special method."),Zo.forEach(s),Et=p(ve),b(he.$$.fragment,ve),Ut=p(ve),b(fe.$$.fragment,ve),ve.forEach(s),Co.forEach(s),Ws=p(e),L=t(e,"H2",{class:!0});var qs=n(L);ue=t(qs,"A",{id:!0,class:!0,href:!0});var er=n(ue);ss=t(er,"SPAN",{});var or=n(ss);b(Qe.$$.fragment,or),or.forEach(s),er.forEach(s),Vt=p(qs),as=t(qs,"SPAN",{});var sr=n(as);At=i(sr,"VideoMAEForPreTraining"),sr.forEach(s),qs.forEach(s),$s=p(e),W=t(e,"DIV",{class:!0});var ko=n(W);b(He.$$.fragment,ko),It=p(ko),De=t(ko,"P",{});var Ks=n(De);Ct=i(Ks,`The VideoMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Le=t(Ks,"A",{href:!0,rel:!0});var ar=n(Le);Zt=i(ar,"torch.nn.Module"),ar.forEach(s),kt=i(Ks,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ks.forEach(s),Wt=p(ko),I=t(ko,"DIV",{class:!0});var Te=n(I);b(qe.$$.fragment,Te),$t=p(Te),q=t(Te,"P",{});var Wo=n(q);Bt=i(Wo,"The "),To=t(Wo,"A",{href:!0});var tr=n(To);Gt=i(tr,"VideoMAEForPreTraining"),tr.forEach(s),xt=i(Wo," forward method, overrides the "),ts=t(Wo,"CODE",{});var nr=n(ts);Ft=i(nr,"__call__"),nr.forEach(s),zt=i(Wo," special method."),Wo.forEach(s),Nt=p(Te),b(ge.$$.fragment,Te),St=p(Te),b(Me.$$.fragment,Te),Te.forEach(s),ko.forEach(s),Bs=p(e),K=t(e,"H2",{class:!0});var Os=n(K);_e=t(Os,"A",{id:!0,class:!0,href:!0});var rr=n(_e);ns=t(rr,"SPAN",{});var lr=n(ns);b(Ke.$$.fragment,lr),lr.forEach(s),rr.forEach(s),Rt=p(Os),rs=t(Os,"SPAN",{});var ir=n(rs);Xt=i(ir,"VideoMAEForVideoClassification"),ir.forEach(s),Os.forEach(s),Gs=p(e),$=t(e,"DIV",{class:!0});var $o=n($);b(Oe.$$.fragment,$o),Pt=p($o),eo=t($o,"P",{});var ea=n(eo);Yt=i(ea,`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(ea,"A",{href:!0,rel:!0});var dr=n(oo);Qt=i(dr,"torch.nn.Module"),dr.forEach(s),Ht=i(ea,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ea.forEach(s),Dt=p($o),C=t($o,"DIV",{class:!0});var je=n(C);b(so.$$.fragment,je),Lt=p(je),O=t(je,"P",{});var Bo=n(O);qt=i(Bo,"The "),jo=t(Bo,"A",{href:!0});var cr=n(jo);Kt=i(cr,"VideoMAEForVideoClassification"),cr.forEach(s),Ot=i(Bo," forward method, overrides the "),ls=t(Bo,"CODE",{});var mr=n(ls);en=i(mr,"__call__"),mr.forEach(s),on=i(Bo," special method."),Bo.forEach(s),sn=p(je),b(ye.$$.fragment,je),an=p(je),b(we.$$.fragment,je),je.forEach(s),$o.forEach(s),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Er)),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(M,"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(z,"class","relative group"),d(Ee,"href","https://arxiv.org/abs/2203.12602"),d(Ee,"rel","nofollow"),d(no,"href","vit_mae"),d(co,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEImageProcessor"),d(po,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEForPreTraining"),gr(ae.src,dn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/videomae_architecture.jpeg")||d(ae,"src",dn),d(ae,"alt","drawing"),d(ae,"width","600"),d(ho,"href","https://arxiv.org/abs/2203.12602"),d(Ve,"href","https://huggingface.co/nielsr"),d(Ve,"rel","nofollow"),d(Ae,"href","https://github.com/MCG-NJU/VideoMAE"),d(Ae,"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(N,"class","relative group"),d(Ce,"href","https://github.com/huggingface/notebooks/blob/main/examples/video_classification.ipynb"),d(Ce,"rel","nofollow"),d(Mo,"href","../tasks/video-classification"),d(Ze,"href","https://huggingface.co/spaces/sayakpaul/video-classification-ucf101-subset"),d(Ze,"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(S,"class","relative group"),d(yo,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEModel"),d($e,"href","https://huggingface.co/MCG-NJU/videomae-base"),d($e,"rel","nofollow"),d(wo,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(bo,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"id","transformers.VideoMAEFeatureExtractor"),d(ie,"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(ie,"href","#transformers.VideoMAEFeatureExtractor"),d(P,"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(Y,"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(Q,"class","relative group"),d(me,"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(pe,"id","transformers.VideoMAEModel"),d(pe,"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(pe,"href","#transformers.VideoMAEModel"),d(H,"class","relative group"),d(Pe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Pe,"rel","nofollow"),d(vo,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEModel"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(L,"class","relative group"),d(Le,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Le,"rel","nofollow"),d(To,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEForPreTraining"),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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"id","transformers.VideoMAEForVideoClassification"),d(_e,"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(_e,"href","#transformers.VideoMAEForVideoClassification"),d(K,"class","relative group"),d(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(oo,"rel","nofollow"),d(jo,"href","/docs/transformers/v4.33.0/en/model_doc/videomae#transformers.VideoMAEForVideoClassification"),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($,"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,y,c),f(e,M,c),o(M,u),o(u,_),v(r,_,null),o(M,g),o(M,U),o(U,ta),f(e,hs,c),f(e,z,c),o(z,oe),o(oe,Go),v(Je,Go,null),o(z,na),o(z,xo),o(xo,ra),f(e,fs,c),f(e,G,c),o(G,la),o(G,Ee),o(Ee,ia),o(G,da),o(G,no),o(no,ca),o(G,ma),f(e,us,c),f(e,ro,c),o(ro,pa),f(e,gs,c),f(e,lo,c),o(lo,Fo),o(Fo,ha),f(e,Ms,c),f(e,io,c),o(io,fa),f(e,_s,c),f(e,se,c),o(se,Ue),o(Ue,ua),o(Ue,co),o(co,ga),o(Ue,Ma),o(se,_a),o(se,mo),o(mo,po),o(po,ya),o(mo,wa),f(e,ys,c),f(e,ae,c),f(e,ws,c),f(e,te,c),o(te,ba),o(te,ho),o(ho,va),o(te,Ta),f(e,bs,c),f(e,x,c),o(x,ja),o(x,Ve),o(Ve,Ja),o(x,Ea),o(x,Ae),o(Ae,Ua),o(x,Va),f(e,vs,c),f(e,N,c),o(N,ne),o(ne,zo),v(Ie,zo,null),o(N,Aa),o(N,No),o(No,Ia),f(e,Ts,c),f(e,fo,c),o(fo,Ca),f(e,js,c),f(e,uo,c),o(uo,So),o(So,Za),f(e,Js,c),f(e,F,c),o(F,go),o(go,Ce),o(Ce,ka),o(go,Wa),o(F,$a),o(F,Ro),o(Ro,Mo),o(Mo,Ba),o(F,Ga),o(F,_o),o(_o,Ze),o(Ze,xa),o(_o,Fa),f(e,Es,c),f(e,S,c),o(S,re),o(re,Xo),v(ke,Xo,null),o(S,za),o(S,Po),o(Po,Na),f(e,Us,c),f(e,V,c),v(We,V,null),o(V,Sa),o(V,R),o(R,Ra),o(R,yo),o(yo,Xa),o(R,Pa),o(R,$e),o($e,Ya),o(R,Qa),o(V,Ha),o(V,X),o(X,Da),o(X,wo),o(wo,La),o(X,qa),o(X,bo),o(bo,Ka),o(X,Oa),o(V,et),v(le,V,null),f(e,Vs,c),f(e,P,c),o(P,ie),o(ie,Yo),v(Be,Yo,null),o(P,ot),o(P,Qo),o(Qo,st),f(e,As,c),f(e,Y,c),v(Ge,Y,null),o(Y,at),o(Y,de),v(xe,de,null),o(de,tt),o(de,Ho),o(Ho,nt),f(e,Is,c),f(e,Q,c),o(Q,ce),o(ce,Do),v(Fe,Do,null),o(Q,rt),o(Q,Lo),o(Lo,lt),f(e,Cs,c),f(e,Z,c),v(ze,Z,null),o(Z,it),o(Z,qo),o(qo,dt),o(Z,ct),o(Z,me),v(Ne,me,null),o(me,mt),o(me,Ko),o(Ko,pt),f(e,Zs,c),f(e,H,c),o(H,pe),o(pe,Oo),v(Se,Oo,null),o(H,ht),o(H,es),o(es,ft),f(e,ks,c),f(e,k,c),v(Re,k,null),o(k,ut),o(k,Xe),o(Xe,gt),o(Xe,Pe),o(Pe,Mt),o(Xe,_t),o(k,yt),o(k,A),v(Ye,A,null),o(A,wt),o(A,D),o(D,bt),o(D,vo),o(vo,vt),o(D,Tt),o(D,os),o(os,jt),o(D,Jt),o(A,Et),v(he,A,null),o(A,Ut),v(fe,A,null),f(e,Ws,c),f(e,L,c),o(L,ue),o(ue,ss),v(Qe,ss,null),o(L,Vt),o(L,as),o(as,At),f(e,$s,c),f(e,W,c),v(He,W,null),o(W,It),o(W,De),o(De,Ct),o(De,Le),o(Le,Zt),o(De,kt),o(W,Wt),o(W,I),v(qe,I,null),o(I,$t),o(I,q),o(q,Bt),o(q,To),o(To,Gt),o(q,xt),o(q,ts),o(ts,Ft),o(q,zt),o(I,Nt),v(ge,I,null),o(I,St),v(Me,I,null),f(e,Bs,c),f(e,K,c),o(K,_e),o(_e,ns),v(Ke,ns,null),o(K,Rt),o(K,rs),o(rs,Xt),f(e,Gs,c),f(e,$,c),v(Oe,$,null),o($,Pt),o($,eo),o(eo,Yt),o(eo,oo),o(oo,Qt),o(eo,Ht),o($,Dt),o($,C),v(so,C,null),o(C,Lt),o(C,O),o(O,qt),o(O,jo),o(jo,Kt),o(O,Ot),o(O,ls),o(ls,en),o(O,on),o(C,sn),v(ye,C,null),o(C,an),v(we,C,null),xs=!0},p(e,[c]){const ao={};c&2&&(ao.$$scope={dirty:c,ctx:e}),le.$set(ao);const is={};c&2&&(is.$$scope={dirty:c,ctx:e}),he.$set(is);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 to={};c&2&&(to.$$scope={dirty:c,ctx:e}),Me.$set(to);const ms={};c&2&&(ms.$$scope={dirty:c,ctx:e}),ye.$set(ms);const ps={};c&2&&(ps.$$scope={dirty:c,ctx:e}),we.$set(ps)},i(e){xs||(T(r.$$.fragment,e),T(Je.$$.fragment,e),T(Ie.$$.fragment,e),T(ke.$$.fragment,e),T(We.$$.fragment,e),T(le.$$.fragment,e),T(Be.$$.fragment,e),T(Ge.$$.fragment,e),T(xe.$$.fragment,e),T(Fe.$$.fragment,e),T(ze.$$.fragment,e),T(Ne.$$.fragment,e),T(Se.$$.fragment,e),T(Re.$$.fragment,e),T(Ye.$$.fragment,e),T(he.$$.fragment,e),T(fe.$$.fragment,e),T(Qe.$$.fragment,e),T(He.$$.fragment,e),T(qe.$$.fragment,e),T(ge.$$.fragment,e),T(Me.$$.fragment,e),T(Ke.$$.fragment,e),T(Oe.$$.fragment,e),T(so.$$.fragment,e),T(ye.$$.fragment,e),T(we.$$.fragment,e),xs=!0)},o(e){j(r.$$.fragment,e),j(Je.$$.fragment,e),j(Ie.$$.fragment,e),j(ke.$$.fragment,e),j(We.$$.fragment,e),j(le.$$.fragment,e),j(Be.$$.fragment,e),j(Ge.$$.fragment,e),j(xe.$$.fragment,e),j(Fe.$$.fragment,e),j(ze.$$.fragment,e),j(Ne.$$.fragment,e),j(Se.$$.fragment,e),j(Re.$$.fragment,e),j(Ye.$$.fragment,e),j(he.$$.fragment,e),j(fe.$$.fragment,e),j(Qe.$$.fragment,e),j(He.$$.fragment,e),j(qe.$$.fragment,e),j(ge.$$.fragment,e),j(Me.$$.fragment,e),j(Ke.$$.fragment,e),j(Oe.$$.fragment,e),j(so.$$.fragment,e),j(ye.$$.fragment,e),j(we.$$.fragment,e),xs=!1},d(e){s(h),e&&s(y),e&&s(M),J(r),e&&s(hs),e&&s(z),J(Je),e&&s(fs),e&&s(G),e&&s(us),e&&s(ro),e&&s(gs),e&&s(lo),e&&s(Ms),e&&s(io),e&&s(_s),e&&s(se),e&&s(ys),e&&s(ae),e&&s(ws),e&&s(te),e&&s(bs),e&&s(x),e&&s(vs),e&&s(N),J(Ie),e&&s(Ts),e&&s(fo),e&&s(js),e&&s(uo),e&&s(Js),e&&s(F),e&&s(Es),e&&s(S),J(ke),e&&s(Us),e&&s(V),J(We),J(le),e&&s(Vs),e&&s(P),J(Be),e&&s(As),e&&s(Y),J(Ge),J(xe),e&&s(Is),e&&s(Q),J(Fe),e&&s(Cs),e&&s(Z),J(ze),J(Ne),e&&s(Zs),e&&s(H),J(Se),e&&s(ks),e&&s(k),J(Re),J(Ye),J(he),J(fe),e&&s(Ws),e&&s(L),J(Qe),e&&s($s),e&&s(W),J(He),J(qe),J(ge),J(Me),e&&s(Bs),e&&s(K),J(Ke),e&&s(Gs),e&&s($),J(Oe),J(so),J(ye),J(we)}}}const Er={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 Ur(E){return Mr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wr extends pr{constructor(h){super();hr(this,h,Ur,Jr,fr,{})}}export{Wr as default,Er as metadata};
