import{S as wa,i as va,s as ba,e as n,k as g,w as b,t as i,M as $a,c as s,d as o,m as _,a as r,x as $,h as l,b as c,G as t,g as h,y,q as S,o as T,B as k,v as ya,L as Eo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Io}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ge}from"../../chunks/Docstring-hf-doc-builder.js";import{C as jo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as xo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Sa}from"../../chunks/PipelineTag-hf-doc-builder.js";function Ta(M){let d,v,u,f,w;return f=new jo({props:{code:`from transformers import Swinv2Config, Swinv2Model

# Initializing a Swinv2 microsoft/swinv2-tiny-patch4-window8-256 style configuration
configuration = Swinv2Config()

# Initializing a model (with random weights) from the microsoft/swinv2-tiny-patch4-window8-256 style configuration
model = Swinv2Model(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> Swinv2Config, Swinv2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Swinv2 microsoft/swinv2-tiny-patch4-window8-256 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Swinv2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/swinv2-tiny-patch4-window8-256 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2Model(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(){d=n("p"),v=i("Example:"),u=g(),b(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(o),u=_(a),$(f.$$.fragment,a)},m(a,p){h(a,d,p),t(d,v),h(a,u,p),y(f,a,p),w=!0},p:Eo,i(a){w||(S(f.$$.fragment,a),w=!0)},o(a){T(f.$$.fragment,a),w=!1},d(a){a&&o(d),a&&o(u),k(f,a)}}}function ka(M){let d,v,u,f,w;return{c(){d=n("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),w=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(a){d=s(a,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var I=r(u);f=l(I,"Module"),I.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){h(a,d,p),t(d,v),t(d,u),t(u,f),t(d,w)},d(a){a&&o(d)}}}function Ma(M){let d,v,u,f,w;return f=new jo({props:{code:`from transformers import AutoImageProcessor, Swinv2Model
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")
model = Swinv2Model.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    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">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2Model
<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">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2Model.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, 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">&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">64</span>, <span class="hljs-number">768</span>]`}}),{c(){d=n("p"),v=i("Example:"),u=g(),b(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(o),u=_(a),$(f.$$.fragment,a)},m(a,p){h(a,d,p),t(d,v),h(a,u,p),y(f,a,p),w=!0},p:Eo,i(a){w||(S(f.$$.fragment,a),w=!0)},o(a){T(f.$$.fragment,a),w=!1},d(a){a&&o(d),a&&o(u),k(f,a)}}}function Ia(M){let d,v,u,f,w;return{c(){d=n("p"),v=i("Note that we provide a script to pre-train this model on custom data in our "),u=n("a"),f=i(`examples
directory`),w=i("."),this.h()},l(a){d=s(a,"P",{});var p=r(d);v=l(p,"Note that we provide a script to pre-train this model on custom data in our "),u=s(p,"A",{href:!0,rel:!0});var I=r(u);f=l(I,`examples
directory`),I.forEach(o),w=l(p,"."),p.forEach(o),this.h()},h(){c(u,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(u,"rel","nofollow")},m(a,p){h(a,d,p),t(d,v),t(d,u),t(u,f),t(d,w)},d(a){a&&o(d)}}}function xa(M){let d,v,u,f,w;return{c(){d=n("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),w=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(a){d=s(a,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var I=r(u);f=l(I,"Module"),I.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){h(a,d,p),t(d,v),t(d,u),t(u,f),t(d,w)},d(a){a&&o(d)}}}function Ea(M){let d,v,u,f,w;return f=new jo({props:{code:`from transformers import AutoImageProcessor, Swinv2ForMaskedImageModeling
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")
model = Swinv2ForMaskedImageModeling.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")

num_patches = (model.config.image_size // model.config.patch_size) ** 2
pixel_values = image_processor(images=image, return_tensors="pt").pixel_values
# create random boolean mask of shape (batch_size, num_patches)
bool_masked_pos = torch.randint(low=0, high=2, size=(1, num_patches)).bool()

outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
loss, reconstructed_pixel_values = outputs.loss, outputs.logits
list(reconstructed_pixel_values.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2ForMaskedImageModeling
<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">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2ForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(low=<span class="hljs-number">0</span>, high=<span class="hljs-number">2</span>, size=(<span class="hljs-number">1</span>, num_patches)).<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, reconstructed_pixel_values = outputs.loss, outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(reconstructed_pixel_values.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">256</span>, <span class="hljs-number">256</span>]`}}),{c(){d=n("p"),v=i("Examples:"),u=g(),b(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);v=l(p,"Examples:"),p.forEach(o),u=_(a),$(f.$$.fragment,a)},m(a,p){h(a,d,p),t(d,v),h(a,u,p),y(f,a,p),w=!0},p:Eo,i(a){w||(S(f.$$.fragment,a),w=!0)},o(a){T(f.$$.fragment,a),w=!1},d(a){a&&o(d),a&&o(u),k(f,a)}}}function ja(M){let d,v,u,f,w;return{c(){d=n("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),w=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(a){d=s(a,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var I=r(u);f=l(I,"Module"),I.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){h(a,d,p),t(d,v),t(d,u),t(u,f),t(d,w)},d(a){a&&o(d)}}}function Fa(M){let d,v,u,f,w;return f=new jo({props:{code:`from transformers import AutoImageProcessor, Swinv2ForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")
model = Swinv2ForImageClassification.from_pretrained("microsoft/swinv2-tiny-patch4-window8-256")

inputs = image_processor(image, return_tensors="pt")

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

# model predicts one of the 1000 ImageNet 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">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2ForImageClassification
<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">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, 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>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet 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])
Egyptian cat`}}),{c(){d=n("p"),v=i("Example:"),u=g(),b(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(o),u=_(a),$(f.$$.fragment,a)},m(a,p){h(a,d,p),t(d,v),h(a,u,p),y(f,a,p),w=!0},p:Eo,i(a){w||(S(f.$$.fragment,a),w=!0)},o(a){T(f.$$.fragment,a),w=!1},d(a){a&&o(d),a&&o(u),k(f,a)}}}function Pa(M){let d,v,u,f,w,a,p,I,Fo,Bt,O,G,yt,ge,Po,St,Co,Zt,K,Ao,_e,qo,zo,Yt,Je,No,Gt,Xe,Tt,Oo,Kt,Qe,Lo,Jt,et,we,Do,tt,Vo,Ho,Xt,q,Wo,ve,Ro,Uo,be,Bo,Zo,Qt,L,J,kt,$e,Yo,Mt,Go,eo,ot,Ko,to,ye,oo,nt,z,st,Jo,Xo,Se,Qo,en,Te,tn,on,no,at,nn,so,rt,X,it,sn,an,ke,rn,ln,ao,lt,dn,ro,D,Q,It,Me,cn,xt,mn,io,E,Ie,pn,V,hn,dt,fn,un,xe,gn,_n,wn,H,vn,ct,bn,$n,mt,yn,Sn,Tn,ee,lo,W,te,Et,Ee,kn,jt,Mn,co,A,je,In,Fe,xn,Pe,En,jn,Fn,F,Ce,Pn,R,Cn,pt,An,qn,Ft,zn,Nn,On,oe,Ln,ne,mo,U,se,Pt,Ae,Dn,Ct,Vn,po,x,qe,Hn,ze,Wn,Ne,Rn,Un,Bn,ae,Zn,Oe,Yn,Le,Gn,Kn,Jn,P,De,Xn,B,Qn,ht,es,ts,At,os,ns,ss,re,as,ie,ho,Z,le,qt,Ve,rs,zt,is,fo,j,He,ls,Nt,ds,cs,We,ms,Re,ps,hs,fs,C,Ue,us,Y,gs,ft,_s,ws,Ot,vs,bs,$s,de,ys,ce,uo;return a=new Ke({}),ge=new Ke({}),$e=new Ke({}),ye=new Sa({props:{pipeline:"image-classification"}}),Me=new Ke({}),Ie=new Ge({props:{name:"class transformers.Swinv2Config",anchor:"transformers.Swinv2Config",parameters:[{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"embed_dim",val:" = 96"},{name:"depths",val:" = [2, 2, 6, 2]"},{name:"num_heads",val:" = [3, 6, 12, 24]"},{name:"window_size",val:" = 7"},{name:"mlp_ratio",val:" = 4.0"},{name:"qkv_bias",val:" = True"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.1"},{name:"hidden_act",val:" = 'gelu'"},{name:"use_absolute_embeddings",val:" = False"},{name:"patch_norm",val:" = True"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"encoder_stride",val:" = 32"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Swinv2Config.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.Swinv2Config.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Swinv2Config.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.Swinv2Config.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 96) &#x2014;
Dimensionality of patch embedding.`,name:"embed_dim"},{anchor:"transformers.Swinv2Config.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 2, 6, 2]</code>) &#x2014;
Depth of each layer in the Transformer encoder.`,name:"depths"},{anchor:"transformers.Swinv2Config.num_heads",description:`<strong>num_heads</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[3, 6, 12, 24]</code>) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.Swinv2Config.window_size",description:`<strong>window_size</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
Size of windows.`,name:"window_size"},{anchor:"transformers.Swinv2Config.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Ratio of MLP hidden dimensionality to embedding dimensionality.`,name:"mlp_ratio"},{anchor:"transformers.Swinv2Config.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not a learnable bias should be added to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.Swinv2Config.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.Swinv2Config.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.Swinv2Config.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Stochastic depth rate.`,name:"drop_path_rate"},{anchor:"transformers.Swinv2Config.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. 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.Swinv2Config.use_absolute_embeddings",description:`<strong>use_absolute_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add absolute position embeddings to the patch embeddings.`,name:"use_absolute_embeddings"},{anchor:"transformers.Swinv2Config.patch_norm",description:`<strong>patch_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add layer normalization after patch embedding.`,name:"patch_norm"},{anchor:"transformers.Swinv2Config.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.Swinv2Config.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.Swinv2Config.encoder_stride",description:`<strong>encoder_stride</strong> (<code>int</code>, <code>optional</code>, defaults to 32) &#x2014;
Factor to increase the spatial resolution by in the decoder head for masked image modeling.`,name:"encoder_stride"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/swinv2/configuration_swinv2.py#L30"}}),ee=new xo({props:{anchor:"transformers.Swinv2Config.example",$$slots:{default:[Ta]},$$scope:{ctx:M}}}),Ee=new Ke({}),je=new Ge({props:{name:"class transformers.Swinv2Model",anchor:"transformers.Swinv2Model",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"},{name:"use_mask_token",val:" = False"}],parametersDescription:[{anchor:"transformers.Swinv2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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/main/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/main/src/transformers/models/swinv2/modeling_swinv2.py#L1016"}}),Ce=new Ge({props:{name:"forward",anchor:"transformers.Swinv2Model.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = 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.Swinv2Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2Model.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.Swinv2Model.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.Swinv2Model.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.Swinv2Model.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/swinv2/modeling_swinv2.py#L1043",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2ModelOutput</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/main/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</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>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>, returned when <code>add_pooling_layer=True</code> is passed) \u2014 Average pooling of the last layer hidden-state.</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 + one for the output of each stage) 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 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 stage) 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>
<li>
<p><strong>reshaped_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 stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2ModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new Io({props:{$$slots:{default:[ka]},$$scope:{ctx:M}}}),ne=new xo({props:{anchor:"transformers.Swinv2Model.forward.example",$$slots:{default:[Ma]},$$scope:{ctx:M}}}),Ae=new Ke({}),qe=new Ge({props:{name:"class transformers.Swinv2ForMaskedImageModeling",anchor:"transformers.Swinv2ForMaskedImageModeling",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swinv2ForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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/main/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/main/src/transformers/models/swinv2/modeling_swinv2.py#L1123"}}),ae=new Io({props:{$$slots:{default:[Ia]},$$scope:{ctx:M}}}),De=new Ge({props:{name:"forward",anchor:"transformers.Swinv2ForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = 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.Swinv2ForMaskedImageModeling.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2ForMaskedImageModeling.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.Swinv2ForMaskedImageModeling.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.Swinv2ForMaskedImageModeling.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.Swinv2ForMaskedImageModeling.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/swinv2/modeling_swinv2.py#L1140",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2MaskedImageModelingOutput</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/main/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</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>bool_masked_pos</code> is provided) \u2014 Masked image modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Reconstructed pixel values.</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 + one for the output of each stage) 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 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 stage) 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>
<li>
<p><strong>reshaped_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 stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2MaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new Io({props:{$$slots:{default:[xa]},$$scope:{ctx:M}}}),ie=new xo({props:{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.example",$$slots:{default:[Ea]},$$scope:{ctx:M}}}),Ve=new Ke({}),He=new Ge({props:{name:"class transformers.Swinv2ForImageClassification",anchor:"transformers.Swinv2ForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swinv2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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/main/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/main/src/transformers/models/swinv2/modeling_swinv2.py#L1235"}}),Ue=new Ge({props:{name:"forward",anchor:"transformers.Swinv2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.Swinv2ForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2ForImageClassification.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.Swinv2ForImageClassification.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.Swinv2ForImageClassification.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.Swinv2ForImageClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Swinv2ForImageClassification.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/main/src/transformers/models/swinv2/modeling_swinv2.py#L1250",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2ImageClassifierOutput</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/main/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</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 + one for the output of each stage) 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 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 stage) 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>
<li>
<p><strong>reshaped_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 stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2ImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new Io({props:{$$slots:{default:[ja]},$$scope:{ctx:M}}}),ce=new xo({props:{anchor:"transformers.Swinv2ForImageClassification.forward.example",$$slots:{default:[Fa]},$$scope:{ctx:M}}}),{c(){d=n("meta"),v=g(),u=n("h1"),f=n("a"),w=n("span"),b(a.$$.fragment),p=g(),I=n("span"),Fo=i("Swin Transformer V2"),Bt=g(),O=n("h2"),G=n("a"),yt=n("span"),b(ge.$$.fragment),Po=g(),St=n("span"),Co=i("Overview"),Zt=g(),K=n("p"),Ao=i("The Swin Transformer V2 model was proposed in "),_e=n("a"),qo=i("Swin Transformer V2: Scaling Up Capacity and Resolution"),zo=i(" by Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo."),Yt=g(),Je=n("p"),No=i("The abstract from the paper is the following:"),Gt=g(),Xe=n("p"),Tt=n("em"),Oo=i("Large-scale NLP models have been shown to significantly improve the performance on language tasks with no signs of saturation. They also demonstrate amazing few-shot capabilities like that of human beings. This paper aims to explore large-scale models in computer vision. We tackle three major issues in training and application of large vision models, including training instability, resolution gaps between pre-training and fine-tuning, and hunger on labelled data. Three main techniques are proposed: 1) a residual-post-norm method combined with cosine attention to improve training stability; 2) A log-spaced continuous position bias method to effectively transfer models pre-trained using low-resolution images to downstream tasks with high-resolution inputs; 3) A self-supervised pre-training method, SimMIM, to reduce the needs of vast labeled images. Through these techniques, this paper successfully trained a 3 billion-parameter Swin Transformer V2 model, which is the largest dense vision model to date, and makes it capable of training with images of up to 1,536\xD71,536 resolution. It set new performance records on 4 representative vision tasks, including ImageNet-V2 image classification, COCO object detection, ADE20K semantic segmentation, and Kinetics-400 video action classification. Also note our training is much more efficient than that in Google\u2019s billion-level visual models, which consumes 40 times less labelled data and 40 times less training time."),Kt=g(),Qe=n("p"),Lo=i("Tips:"),Jt=g(),et=n("ul"),we=n("li"),Do=i("One can use the "),tt=n("a"),Vo=i("AutoImageProcessor"),Ho=i(" API to prepare images for the model."),Xt=g(),q=n("p"),Wo=i("This model was contributed by "),ve=n("a"),Ro=i("nandwalritik"),Uo=i(`.
The original code can be found `),be=n("a"),Bo=i("here"),Zo=i("."),Qt=g(),L=n("h2"),J=n("a"),kt=n("span"),b($e.$$.fragment),Yo=g(),Mt=n("span"),Go=i("Resources"),eo=g(),ot=n("p"),Ko=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Swin Transformer v2."),to=g(),b(ye.$$.fragment),oo=g(),nt=n("ul"),z=n("li"),st=n("a"),Jo=i("Swinv2ForImageClassification"),Xo=i(" is supported by this "),Se=n("a"),Qo=i("example script"),en=i(" and "),Te=n("a"),tn=i("notebook"),on=i("."),no=g(),at=n("p"),nn=i("Besides that:"),so=g(),rt=n("ul"),X=n("li"),it=n("a"),sn=i("Swinv2ForMaskedImageModeling"),an=i(" is supported by this "),ke=n("a"),rn=i("example script"),ln=i("."),ao=g(),lt=n("p"),dn=i("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."),ro=g(),D=n("h2"),Q=n("a"),It=n("span"),b(Me.$$.fragment),cn=g(),xt=n("span"),mn=i("Swinv2Config"),io=g(),E=n("div"),b(Ie.$$.fragment),pn=g(),V=n("p"),hn=i("This is the configuration class to store the configuration of a "),dt=n("a"),fn=i("Swinv2Model"),un=i(`. It is used to instantiate a Swin
Transformer v2 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 Swin Transformer v2
`),xe=n("a"),gn=i("microsoft/swinv2-tiny-patch4-window8-256"),_n=i(`
architecture.`),wn=g(),H=n("p"),vn=i("Configuration objects inherit from "),ct=n("a"),bn=i("PretrainedConfig"),$n=i(` and can be used to control the model outputs. Read the
documentation from `),mt=n("a"),yn=i("PretrainedConfig"),Sn=i(" for more information."),Tn=g(),b(ee.$$.fragment),lo=g(),W=n("h2"),te=n("a"),Et=n("span"),b(Ee.$$.fragment),kn=g(),jt=n("span"),Mn=i("Swinv2Model"),co=g(),A=n("div"),b(je.$$.fragment),In=g(),Fe=n("p"),xn=i(`The bare Swinv2 Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pe=n("a"),En=i("torch.nn.Module"),jn=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fn=g(),F=n("div"),b(Ce.$$.fragment),Pn=g(),R=n("p"),Cn=i("The "),pt=n("a"),An=i("Swinv2Model"),qn=i(" forward method, overrides the "),Ft=n("code"),zn=i("__call__"),Nn=i(" special method."),On=g(),b(oe.$$.fragment),Ln=g(),b(ne.$$.fragment),mo=g(),U=n("h2"),se=n("a"),Pt=n("span"),b(Ae.$$.fragment),Dn=g(),Ct=n("span"),Vn=i("Swinv2ForMaskedImageModeling"),po=g(),x=n("div"),b(qe.$$.fragment),Hn=g(),ze=n("p"),Wn=i(`Swinv2 Model with a decoder on top for masked image modeling, as proposed in
`),Ne=n("a"),Rn=i("SimMIM"),Un=i("."),Bn=g(),b(ae.$$.fragment),Zn=g(),Oe=n("p"),Yn=i("This model is a PyTorch "),Le=n("a"),Gn=i("torch.nn.Module"),Kn=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jn=g(),P=n("div"),b(De.$$.fragment),Xn=g(),B=n("p"),Qn=i("The "),ht=n("a"),es=i("Swinv2ForMaskedImageModeling"),ts=i(" forward method, overrides the "),At=n("code"),os=i("__call__"),ns=i(" special method."),ss=g(),b(re.$$.fragment),as=g(),b(ie.$$.fragment),ho=g(),Z=n("h2"),le=n("a"),qt=n("span"),b(Ve.$$.fragment),rs=g(),zt=n("span"),is=i("Swinv2ForImageClassification"),fo=g(),j=n("div"),b(He.$$.fragment),ls=g(),Nt=n("p"),ds=i(`Swinv2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state
of the [CLS] token) e.g. for ImageNet.`),cs=g(),We=n("p"),ms=i("This model is a PyTorch "),Re=n("a"),ps=i("torch.nn.Module"),hs=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fs=g(),C=n("div"),b(Ue.$$.fragment),us=g(),Y=n("p"),gs=i("The "),ft=n("a"),_s=i("Swinv2ForImageClassification"),ws=i(" forward method, overrides the "),Ot=n("code"),vs=i("__call__"),bs=i(" special method."),$s=g(),b(de.$$.fragment),ys=g(),b(ce.$$.fragment),this.h()},l(e){const m=$a('[data-svelte="svelte-1phssyn"]',document.head);d=s(m,"META",{name:!0,content:!0}),m.forEach(o),v=_(e),u=s(e,"H1",{class:!0});var Be=r(u);f=s(Be,"A",{id:!0,class:!0,href:!0});var Lt=r(f);w=s(Lt,"SPAN",{});var Dt=r(w);$(a.$$.fragment,Dt),Dt.forEach(o),Lt.forEach(o),p=_(Be),I=s(Be,"SPAN",{});var Vt=r(I);Fo=l(Vt,"Swin Transformer V2"),Vt.forEach(o),Be.forEach(o),Bt=_(e),O=s(e,"H2",{class:!0});var Ze=r(O);G=s(Ze,"A",{id:!0,class:!0,href:!0});var Ht=r(G);yt=s(Ht,"SPAN",{});var Wt=r(yt);$(ge.$$.fragment,Wt),Wt.forEach(o),Ht.forEach(o),Po=_(Ze),St=s(Ze,"SPAN",{});var Rt=r(St);Co=l(Rt,"Overview"),Rt.forEach(o),Ze.forEach(o),Zt=_(e),K=s(e,"P",{});var go=r(K);Ao=l(go,"The Swin Transformer V2 model was proposed in "),_e=s(go,"A",{href:!0,rel:!0});var Ss=r(_e);qo=l(Ss,"Swin Transformer V2: Scaling Up Capacity and Resolution"),Ss.forEach(o),zo=l(go," by Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo."),go.forEach(o),Yt=_(e),Je=s(e,"P",{});var Ts=r(Je);No=l(Ts,"The abstract from the paper is the following:"),Ts.forEach(o),Gt=_(e),Xe=s(e,"P",{});var ks=r(Xe);Tt=s(ks,"EM",{});var Ms=r(Tt);Oo=l(Ms,"Large-scale NLP models have been shown to significantly improve the performance on language tasks with no signs of saturation. They also demonstrate amazing few-shot capabilities like that of human beings. This paper aims to explore large-scale models in computer vision. We tackle three major issues in training and application of large vision models, including training instability, resolution gaps between pre-training and fine-tuning, and hunger on labelled data. Three main techniques are proposed: 1) a residual-post-norm method combined with cosine attention to improve training stability; 2) A log-spaced continuous position bias method to effectively transfer models pre-trained using low-resolution images to downstream tasks with high-resolution inputs; 3) A self-supervised pre-training method, SimMIM, to reduce the needs of vast labeled images. Through these techniques, this paper successfully trained a 3 billion-parameter Swin Transformer V2 model, which is the largest dense vision model to date, and makes it capable of training with images of up to 1,536\xD71,536 resolution. It set new performance records on 4 representative vision tasks, including ImageNet-V2 image classification, COCO object detection, ADE20K semantic segmentation, and Kinetics-400 video action classification. Also note our training is much more efficient than that in Google\u2019s billion-level visual models, which consumes 40 times less labelled data and 40 times less training time."),Ms.forEach(o),ks.forEach(o),Kt=_(e),Qe=s(e,"P",{});var Is=r(Qe);Lo=l(Is,"Tips:"),Is.forEach(o),Jt=_(e),et=s(e,"UL",{});var xs=r(et);we=s(xs,"LI",{});var _o=r(we);Do=l(_o,"One can use the "),tt=s(_o,"A",{href:!0});var Es=r(tt);Vo=l(Es,"AutoImageProcessor"),Es.forEach(o),Ho=l(_o," API to prepare images for the model."),_o.forEach(o),xs.forEach(o),Xt=_(e),q=s(e,"P",{});var ut=r(q);Wo=l(ut,"This model was contributed by "),ve=s(ut,"A",{href:!0,rel:!0});var js=r(ve);Ro=l(js,"nandwalritik"),js.forEach(o),Uo=l(ut,`.
The original code can be found `),be=s(ut,"A",{href:!0,rel:!0});var Fs=r(be);Bo=l(Fs,"here"),Fs.forEach(o),Zo=l(ut,"."),ut.forEach(o),Qt=_(e),L=s(e,"H2",{class:!0});var wo=r(L);J=s(wo,"A",{id:!0,class:!0,href:!0});var Ps=r(J);kt=s(Ps,"SPAN",{});var Cs=r(kt);$($e.$$.fragment,Cs),Cs.forEach(o),Ps.forEach(o),Yo=_(wo),Mt=s(wo,"SPAN",{});var As=r(Mt);Go=l(As,"Resources"),As.forEach(o),wo.forEach(o),eo=_(e),ot=s(e,"P",{});var qs=r(ot);Ko=l(qs,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Swin Transformer v2."),qs.forEach(o),to=_(e),$(ye.$$.fragment,e),oo=_(e),nt=s(e,"UL",{});var zs=r(nt);z=s(zs,"LI",{});var Ye=r(z);st=s(Ye,"A",{href:!0});var Ns=r(st);Jo=l(Ns,"Swinv2ForImageClassification"),Ns.forEach(o),Xo=l(Ye," is supported by this "),Se=s(Ye,"A",{href:!0,rel:!0});var Os=r(Se);Qo=l(Os,"example script"),Os.forEach(o),en=l(Ye," and "),Te=s(Ye,"A",{href:!0,rel:!0});var Ls=r(Te);tn=l(Ls,"notebook"),Ls.forEach(o),on=l(Ye,"."),Ye.forEach(o),zs.forEach(o),no=_(e),at=s(e,"P",{});var Ds=r(at);nn=l(Ds,"Besides that:"),Ds.forEach(o),so=_(e),rt=s(e,"UL",{});var Vs=r(rt);X=s(Vs,"LI",{});var Ut=r(X);it=s(Ut,"A",{href:!0});var Hs=r(it);sn=l(Hs,"Swinv2ForMaskedImageModeling"),Hs.forEach(o),an=l(Ut," is supported by this "),ke=s(Ut,"A",{href:!0,rel:!0});var Ws=r(ke);rn=l(Ws,"example script"),Ws.forEach(o),ln=l(Ut,"."),Ut.forEach(o),Vs.forEach(o),ao=_(e),lt=s(e,"P",{});var Rs=r(lt);dn=l(Rs,"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."),Rs.forEach(o),ro=_(e),D=s(e,"H2",{class:!0});var vo=r(D);Q=s(vo,"A",{id:!0,class:!0,href:!0});var Us=r(Q);It=s(Us,"SPAN",{});var Bs=r(It);$(Me.$$.fragment,Bs),Bs.forEach(o),Us.forEach(o),cn=_(vo),xt=s(vo,"SPAN",{});var Zs=r(xt);mn=l(Zs,"Swinv2Config"),Zs.forEach(o),vo.forEach(o),io=_(e),E=s(e,"DIV",{class:!0});var me=r(E);$(Ie.$$.fragment,me),pn=_(me),V=s(me,"P",{});var gt=r(V);hn=l(gt,"This is the configuration class to store the configuration of a "),dt=s(gt,"A",{href:!0});var Ys=r(dt);fn=l(Ys,"Swinv2Model"),Ys.forEach(o),un=l(gt,`. It is used to instantiate a Swin
Transformer v2 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 Swin Transformer v2
`),xe=s(gt,"A",{href:!0,rel:!0});var Gs=r(xe);gn=l(Gs,"microsoft/swinv2-tiny-patch4-window8-256"),Gs.forEach(o),_n=l(gt,`
architecture.`),gt.forEach(o),wn=_(me),H=s(me,"P",{});var _t=r(H);vn=l(_t,"Configuration objects inherit from "),ct=s(_t,"A",{href:!0});var Ks=r(ct);bn=l(Ks,"PretrainedConfig"),Ks.forEach(o),$n=l(_t,` and can be used to control the model outputs. Read the
documentation from `),mt=s(_t,"A",{href:!0});var Js=r(mt);yn=l(Js,"PretrainedConfig"),Js.forEach(o),Sn=l(_t," for more information."),_t.forEach(o),Tn=_(me),$(ee.$$.fragment,me),me.forEach(o),lo=_(e),W=s(e,"H2",{class:!0});var bo=r(W);te=s(bo,"A",{id:!0,class:!0,href:!0});var Xs=r(te);Et=s(Xs,"SPAN",{});var Qs=r(Et);$(Ee.$$.fragment,Qs),Qs.forEach(o),Xs.forEach(o),kn=_(bo),jt=s(bo,"SPAN",{});var ea=r(jt);Mn=l(ea,"Swinv2Model"),ea.forEach(o),bo.forEach(o),co=_(e),A=s(e,"DIV",{class:!0});var wt=r(A);$(je.$$.fragment,wt),In=_(wt),Fe=s(wt,"P",{});var $o=r(Fe);xn=l($o,`The bare Swinv2 Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pe=s($o,"A",{href:!0,rel:!0});var ta=r(Pe);En=l(ta,"torch.nn.Module"),ta.forEach(o),jn=l($o,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$o.forEach(o),Fn=_(wt),F=s(wt,"DIV",{class:!0});var pe=r(F);$(Ce.$$.fragment,pe),Pn=_(pe),R=s(pe,"P",{});var vt=r(R);Cn=l(vt,"The "),pt=s(vt,"A",{href:!0});var oa=r(pt);An=l(oa,"Swinv2Model"),oa.forEach(o),qn=l(vt," forward method, overrides the "),Ft=s(vt,"CODE",{});var na=r(Ft);zn=l(na,"__call__"),na.forEach(o),Nn=l(vt," special method."),vt.forEach(o),On=_(pe),$(oe.$$.fragment,pe),Ln=_(pe),$(ne.$$.fragment,pe),pe.forEach(o),wt.forEach(o),mo=_(e),U=s(e,"H2",{class:!0});var yo=r(U);se=s(yo,"A",{id:!0,class:!0,href:!0});var sa=r(se);Pt=s(sa,"SPAN",{});var aa=r(Pt);$(Ae.$$.fragment,aa),aa.forEach(o),sa.forEach(o),Dn=_(yo),Ct=s(yo,"SPAN",{});var ra=r(Ct);Vn=l(ra,"Swinv2ForMaskedImageModeling"),ra.forEach(o),yo.forEach(o),po=_(e),x=s(e,"DIV",{class:!0});var N=r(x);$(qe.$$.fragment,N),Hn=_(N),ze=s(N,"P",{});var So=r(ze);Wn=l(So,`Swinv2 Model with a decoder on top for masked image modeling, as proposed in
`),Ne=s(So,"A",{href:!0,rel:!0});var ia=r(Ne);Rn=l(ia,"SimMIM"),ia.forEach(o),Un=l(So,"."),So.forEach(o),Bn=_(N),$(ae.$$.fragment,N),Zn=_(N),Oe=s(N,"P",{});var To=r(Oe);Yn=l(To,"This model is a PyTorch "),Le=s(To,"A",{href:!0,rel:!0});var la=r(Le);Gn=l(la,"torch.nn.Module"),la.forEach(o),Kn=l(To,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),To.forEach(o),Jn=_(N),P=s(N,"DIV",{class:!0});var he=r(P);$(De.$$.fragment,he),Xn=_(he),B=s(he,"P",{});var bt=r(B);Qn=l(bt,"The "),ht=s(bt,"A",{href:!0});var da=r(ht);es=l(da,"Swinv2ForMaskedImageModeling"),da.forEach(o),ts=l(bt," forward method, overrides the "),At=s(bt,"CODE",{});var ca=r(At);os=l(ca,"__call__"),ca.forEach(o),ns=l(bt," special method."),bt.forEach(o),ss=_(he),$(re.$$.fragment,he),as=_(he),$(ie.$$.fragment,he),he.forEach(o),N.forEach(o),ho=_(e),Z=s(e,"H2",{class:!0});var ko=r(Z);le=s(ko,"A",{id:!0,class:!0,href:!0});var ma=r(le);qt=s(ma,"SPAN",{});var pa=r(qt);$(Ve.$$.fragment,pa),pa.forEach(o),ma.forEach(o),rs=_(ko),zt=s(ko,"SPAN",{});var ha=r(zt);is=l(ha,"Swinv2ForImageClassification"),ha.forEach(o),ko.forEach(o),fo=_(e),j=s(e,"DIV",{class:!0});var fe=r(j);$(He.$$.fragment,fe),ls=_(fe),Nt=s(fe,"P",{});var fa=r(Nt);ds=l(fa,`Swinv2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state
of the [CLS] token) e.g. for ImageNet.`),fa.forEach(o),cs=_(fe),We=s(fe,"P",{});var Mo=r(We);ms=l(Mo,"This model is a PyTorch "),Re=s(Mo,"A",{href:!0,rel:!0});var ua=r(Re);ps=l(ua,"torch.nn.Module"),ua.forEach(o),hs=l(Mo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Mo.forEach(o),fs=_(fe),C=s(fe,"DIV",{class:!0});var ue=r(C);$(Ue.$$.fragment,ue),us=_(ue),Y=s(ue,"P",{});var $t=r(Y);gs=l($t,"The "),ft=s($t,"A",{href:!0});var ga=r(ft);_s=l(ga,"Swinv2ForImageClassification"),ga.forEach(o),ws=l($t," forward method, overrides the "),Ot=s($t,"CODE",{});var _a=r(Ot);vs=l(_a,"__call__"),_a.forEach(o),bs=l($t," special method."),$t.forEach(o),$s=_(ue),$(de.$$.fragment,ue),ys=_(ue),$(ce.$$.fragment,ue),ue.forEach(o),fe.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Ca)),c(f,"id","swin-transformer-v2"),c(f,"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"),c(f,"href","#swin-transformer-v2"),c(u,"class","relative group"),c(G,"id","overview"),c(G,"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"),c(G,"href","#overview"),c(O,"class","relative group"),c(_e,"href","https://arxiv.org/abs/2111.09883"),c(_e,"rel","nofollow"),c(tt,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor"),c(ve,"href","https://huggingface.co/nandwalritik"),c(ve,"rel","nofollow"),c(be,"href","https://github.com/microsoft/Swin-Transformer"),c(be,"rel","nofollow"),c(J,"id","resources"),c(J,"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"),c(J,"href","#resources"),c(L,"class","relative group"),c(st,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2ForImageClassification"),c(Se,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(Se,"rel","nofollow"),c(Te,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(Te,"rel","nofollow"),c(it,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2ForMaskedImageModeling"),c(ke,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(ke,"rel","nofollow"),c(Q,"id","transformers.Swinv2Config"),c(Q,"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"),c(Q,"href","#transformers.Swinv2Config"),c(D,"class","relative group"),c(dt,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2Model"),c(xe,"href","https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256"),c(xe,"rel","nofollow"),c(ct,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(mt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"id","transformers.Swinv2Model"),c(te,"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"),c(te,"href","#transformers.Swinv2Model"),c(W,"class","relative group"),c(Pe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Pe,"rel","nofollow"),c(pt,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2Model"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(se,"id","transformers.Swinv2ForMaskedImageModeling"),c(se,"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"),c(se,"href","#transformers.Swinv2ForMaskedImageModeling"),c(U,"class","relative group"),c(Ne,"href","https://arxiv.org/abs/2111.09886"),c(Ne,"rel","nofollow"),c(Le,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Le,"rel","nofollow"),c(ht,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2ForMaskedImageModeling"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(le,"id","transformers.Swinv2ForImageClassification"),c(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"),c(le,"href","#transformers.Swinv2ForImageClassification"),c(Z,"class","relative group"),c(Re,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Re,"rel","nofollow"),c(ft,"href","/docs/transformers/main/en/model_doc/swinv2#transformers.Swinv2ForImageClassification"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"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,m){t(document.head,d),h(e,v,m),h(e,u,m),t(u,f),t(f,w),y(a,w,null),t(u,p),t(u,I),t(I,Fo),h(e,Bt,m),h(e,O,m),t(O,G),t(G,yt),y(ge,yt,null),t(O,Po),t(O,St),t(St,Co),h(e,Zt,m),h(e,K,m),t(K,Ao),t(K,_e),t(_e,qo),t(K,zo),h(e,Yt,m),h(e,Je,m),t(Je,No),h(e,Gt,m),h(e,Xe,m),t(Xe,Tt),t(Tt,Oo),h(e,Kt,m),h(e,Qe,m),t(Qe,Lo),h(e,Jt,m),h(e,et,m),t(et,we),t(we,Do),t(we,tt),t(tt,Vo),t(we,Ho),h(e,Xt,m),h(e,q,m),t(q,Wo),t(q,ve),t(ve,Ro),t(q,Uo),t(q,be),t(be,Bo),t(q,Zo),h(e,Qt,m),h(e,L,m),t(L,J),t(J,kt),y($e,kt,null),t(L,Yo),t(L,Mt),t(Mt,Go),h(e,eo,m),h(e,ot,m),t(ot,Ko),h(e,to,m),y(ye,e,m),h(e,oo,m),h(e,nt,m),t(nt,z),t(z,st),t(st,Jo),t(z,Xo),t(z,Se),t(Se,Qo),t(z,en),t(z,Te),t(Te,tn),t(z,on),h(e,no,m),h(e,at,m),t(at,nn),h(e,so,m),h(e,rt,m),t(rt,X),t(X,it),t(it,sn),t(X,an),t(X,ke),t(ke,rn),t(X,ln),h(e,ao,m),h(e,lt,m),t(lt,dn),h(e,ro,m),h(e,D,m),t(D,Q),t(Q,It),y(Me,It,null),t(D,cn),t(D,xt),t(xt,mn),h(e,io,m),h(e,E,m),y(Ie,E,null),t(E,pn),t(E,V),t(V,hn),t(V,dt),t(dt,fn),t(V,un),t(V,xe),t(xe,gn),t(V,_n),t(E,wn),t(E,H),t(H,vn),t(H,ct),t(ct,bn),t(H,$n),t(H,mt),t(mt,yn),t(H,Sn),t(E,Tn),y(ee,E,null),h(e,lo,m),h(e,W,m),t(W,te),t(te,Et),y(Ee,Et,null),t(W,kn),t(W,jt),t(jt,Mn),h(e,co,m),h(e,A,m),y(je,A,null),t(A,In),t(A,Fe),t(Fe,xn),t(Fe,Pe),t(Pe,En),t(Fe,jn),t(A,Fn),t(A,F),y(Ce,F,null),t(F,Pn),t(F,R),t(R,Cn),t(R,pt),t(pt,An),t(R,qn),t(R,Ft),t(Ft,zn),t(R,Nn),t(F,On),y(oe,F,null),t(F,Ln),y(ne,F,null),h(e,mo,m),h(e,U,m),t(U,se),t(se,Pt),y(Ae,Pt,null),t(U,Dn),t(U,Ct),t(Ct,Vn),h(e,po,m),h(e,x,m),y(qe,x,null),t(x,Hn),t(x,ze),t(ze,Wn),t(ze,Ne),t(Ne,Rn),t(ze,Un),t(x,Bn),y(ae,x,null),t(x,Zn),t(x,Oe),t(Oe,Yn),t(Oe,Le),t(Le,Gn),t(Oe,Kn),t(x,Jn),t(x,P),y(De,P,null),t(P,Xn),t(P,B),t(B,Qn),t(B,ht),t(ht,es),t(B,ts),t(B,At),t(At,os),t(B,ns),t(P,ss),y(re,P,null),t(P,as),y(ie,P,null),h(e,ho,m),h(e,Z,m),t(Z,le),t(le,qt),y(Ve,qt,null),t(Z,rs),t(Z,zt),t(zt,is),h(e,fo,m),h(e,j,m),y(He,j,null),t(j,ls),t(j,Nt),t(Nt,ds),t(j,cs),t(j,We),t(We,ms),t(We,Re),t(Re,ps),t(We,hs),t(j,fs),t(j,C),y(Ue,C,null),t(C,us),t(C,Y),t(Y,gs),t(Y,ft),t(ft,_s),t(Y,ws),t(Y,Ot),t(Ot,vs),t(Y,bs),t(C,$s),y(de,C,null),t(C,ys),y(ce,C,null),uo=!0},p(e,[m]){const Be={};m&2&&(Be.$$scope={dirty:m,ctx:e}),ee.$set(Be);const Lt={};m&2&&(Lt.$$scope={dirty:m,ctx:e}),oe.$set(Lt);const Dt={};m&2&&(Dt.$$scope={dirty:m,ctx:e}),ne.$set(Dt);const Vt={};m&2&&(Vt.$$scope={dirty:m,ctx:e}),ae.$set(Vt);const Ze={};m&2&&(Ze.$$scope={dirty:m,ctx:e}),re.$set(Ze);const Ht={};m&2&&(Ht.$$scope={dirty:m,ctx:e}),ie.$set(Ht);const Wt={};m&2&&(Wt.$$scope={dirty:m,ctx:e}),de.$set(Wt);const Rt={};m&2&&(Rt.$$scope={dirty:m,ctx:e}),ce.$set(Rt)},i(e){uo||(S(a.$$.fragment,e),S(ge.$$.fragment,e),S($e.$$.fragment,e),S(ye.$$.fragment,e),S(Me.$$.fragment,e),S(Ie.$$.fragment,e),S(ee.$$.fragment,e),S(Ee.$$.fragment,e),S(je.$$.fragment,e),S(Ce.$$.fragment,e),S(oe.$$.fragment,e),S(ne.$$.fragment,e),S(Ae.$$.fragment,e),S(qe.$$.fragment,e),S(ae.$$.fragment,e),S(De.$$.fragment,e),S(re.$$.fragment,e),S(ie.$$.fragment,e),S(Ve.$$.fragment,e),S(He.$$.fragment,e),S(Ue.$$.fragment,e),S(de.$$.fragment,e),S(ce.$$.fragment,e),uo=!0)},o(e){T(a.$$.fragment,e),T(ge.$$.fragment,e),T($e.$$.fragment,e),T(ye.$$.fragment,e),T(Me.$$.fragment,e),T(Ie.$$.fragment,e),T(ee.$$.fragment,e),T(Ee.$$.fragment,e),T(je.$$.fragment,e),T(Ce.$$.fragment,e),T(oe.$$.fragment,e),T(ne.$$.fragment,e),T(Ae.$$.fragment,e),T(qe.$$.fragment,e),T(ae.$$.fragment,e),T(De.$$.fragment,e),T(re.$$.fragment,e),T(ie.$$.fragment,e),T(Ve.$$.fragment,e),T(He.$$.fragment,e),T(Ue.$$.fragment,e),T(de.$$.fragment,e),T(ce.$$.fragment,e),uo=!1},d(e){o(d),e&&o(v),e&&o(u),k(a),e&&o(Bt),e&&o(O),k(ge),e&&o(Zt),e&&o(K),e&&o(Yt),e&&o(Je),e&&o(Gt),e&&o(Xe),e&&o(Kt),e&&o(Qe),e&&o(Jt),e&&o(et),e&&o(Xt),e&&o(q),e&&o(Qt),e&&o(L),k($e),e&&o(eo),e&&o(ot),e&&o(to),k(ye,e),e&&o(oo),e&&o(nt),e&&o(no),e&&o(at),e&&o(so),e&&o(rt),e&&o(ao),e&&o(lt),e&&o(ro),e&&o(D),k(Me),e&&o(io),e&&o(E),k(Ie),k(ee),e&&o(lo),e&&o(W),k(Ee),e&&o(co),e&&o(A),k(je),k(Ce),k(oe),k(ne),e&&o(mo),e&&o(U),k(Ae),e&&o(po),e&&o(x),k(qe),k(ae),k(De),k(re),k(ie),e&&o(ho),e&&o(Z),k(Ve),e&&o(fo),e&&o(j),k(He),k(Ue),k(de),k(ce)}}}const Ca={local:"swin-transformer-v2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.Swinv2Config",title:"Swinv2Config"},{local:"transformers.Swinv2Model",title:"Swinv2Model"},{local:"transformers.Swinv2ForMaskedImageModeling",title:"Swinv2ForMaskedImageModeling"},{local:"transformers.Swinv2ForImageClassification",title:"Swinv2ForImageClassification"}],title:"Swin Transformer V2"};function Aa(M){return ya(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ha extends wa{constructor(d){super();va(this,d,Aa,Pa,ba,{})}}export{Ha as default,Ca as metadata};
