import{S as Ts,i as Is,s as xs,e as s,k as u,w as b,t as l,M as js,c as n,d as o,m as g,a as r,x as F,h as i,b as d,G as e,g as _,y as $,q as y,o as N,B as k,v as Cs,L as ao}from"../../chunks/vendor-hf-doc-builder.js";import{T as to}from"../../chunks/Tip-hf-doc-builder.js";import{D as Le}from"../../chunks/Docstring-hf-doc-builder.js";import{C as so}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as lt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as oo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Es(M){let c,w,h,p,v;return p=new so({props:{code:`from transformers import FocalNetConfig, FocalNetModel

# Initializing a FocalNet microsoft/focalnet-tiny style configuration
configuration = FocalNetConfig()

# Initializing a model (with random weights) from the microsoft/focalnet-tiny style configuration
model = FocalNetModel(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> FocalNetConfig, FocalNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FocalNet microsoft/focalnet-tiny style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FocalNetConfig()

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

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

image_processor = AutoImageProcessor.from_pretrained("microsoft/focalnet-tiny")
model = FocalNetModel.from_pretrained("microsoft/focalnet-tiny")

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, FocalNetModel
<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/focalnet-tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FocalNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/focalnet-tiny&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">49</span>, <span class="hljs-number">768</span>]`}}),{c(){c=s("p"),w=l("Example:"),h=u(),b(p.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);w=i(m,"Example:"),m.forEach(o),h=g(a),F(p.$$.fragment,a)},m(a,m){_(a,c,m),e(c,w),_(a,h,m),$(p,a,m),v=!0},p:ao,i(a){v||(y(p.$$.fragment,a),v=!0)},o(a){N(p.$$.fragment,a),v=!1},d(a){a&&o(c),a&&o(h),k(p,a)}}}function zs(M){let c,w,h,p,v;return{c(){c=s("p"),w=l("Note that we provide a script to pre-train this model on custom data in our "),h=s("a"),p=l(`examples
directory`),v=l("."),this.h()},l(a){c=n(a,"P",{});var m=r(c);w=i(m,"Note that we provide a script to pre-train this model on custom data in our "),h=n(m,"A",{href:!0,rel:!0});var T=r(h);p=i(T,`examples
directory`),T.forEach(o),v=i(m,"."),m.forEach(o),this.h()},h(){d(h,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),d(h,"rel","nofollow")},m(a,m){_(a,c,m),e(c,w),e(c,h),e(h,p),e(c,v)},d(a){a&&o(c)}}}function qs(M){let c,w,h,p,v;return{c(){c=s("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=s("code"),p=l("Module"),v=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(a){c=n(a,"P",{});var m=r(c);w=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(m,"CODE",{});var T=r(h);p=i(T,"Module"),T.forEach(o),v=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,w),e(c,h),e(h,p),e(c,v)},d(a){a&&o(c)}}}function Ss(M){let c,w,h,p,v;return p=new so({props:{code:`from transformers import AutoImageProcessor, FocalNetConfig, FocalNetForMaskedImageModeling
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/focalnet-base-simmim-window6-192")
config = FocalNetConfig()
model = FocalNetForMaskedImageModeling(config)

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, FocalNetConfig, FocalNetForMaskedImageModeling
<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/focalnet-base-simmim-window6-192&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = FocalNetConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FocalNetForMaskedImageModeling(config)

<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">192</span>, <span class="hljs-number">192</span>]`}}),{c(){c=s("p"),w=l("Examples:"),h=u(),b(p.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);w=i(m,"Examples:"),m.forEach(o),h=g(a),F(p.$$.fragment,a)},m(a,m){_(a,c,m),e(c,w),_(a,h,m),$(p,a,m),v=!0},p:ao,i(a){v||(y(p.$$.fragment,a),v=!0)},o(a){N(p.$$.fragment,a),v=!1},d(a){a&&o(c),a&&o(h),k(p,a)}}}function Os(M){let c,w,h,p,v;return{c(){c=s("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=s("code"),p=l("Module"),v=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(a){c=n(a,"P",{});var m=r(c);w=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(m,"CODE",{});var T=r(h);p=i(T,"Module"),T.forEach(o),v=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,w),e(c,h),e(h,p),e(c,v)},d(a){a&&o(c)}}}function Ds(M){let c,w,h,p,v;return p=new so({props:{code:`from transformers import AutoImageProcessor, FocalNetForImageClassification
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("microsoft/focalnet-tiny")
model = FocalNetForImageClassification.from_pretrained("microsoft/focalnet-tiny")

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, FocalNetForImageClassification
<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/focalnet-tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FocalNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/focalnet-tiny&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])
tabby, tabby cat`}}),{c(){c=s("p"),w=l("Example:"),h=u(),b(p.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);w=i(m,"Example:"),m.forEach(o),h=g(a),F(p.$$.fragment,a)},m(a,m){_(a,c,m),e(c,w),_(a,h,m),$(p,a,m),v=!0},p:ao,i(a){v||(y(p.$$.fragment,a),v=!0)},o(a){N(p.$$.fragment,a),v=!1},d(a){a&&o(c),a&&o(h),k(p,a)}}}function Ls(M){let c,w,h,p,v,a,m,T,no,jt,O,G,it,he,ro,ct,lo,Ct,C,io,fe,co,mo,Ue,po,ho,We,fo,uo,Et,He,go,Pt,Be,dt,_o,At,Ve,vo,zt,Re,ue,wo,Ke,bo,Fo,qt,S,$o,ge,yo,No,_e,ko,Mo,St,D,J,mt,ve,To,pt,Io,Ot,x,we,xo,L,jo,Ge,Co,Eo,be,Po,Ao,zo,U,qo,Je,So,Oo,Ye,Do,Lo,Uo,Y,Dt,W,Q,ht,Fe,Wo,ft,Ho,Lt,q,$e,Bo,ye,Vo,Ne,Ro,Ko,Go,E,ke,Jo,H,Yo,Qe,Qo,Xo,ut,Zo,ea,ta,X,oa,Z,Ut,B,ee,gt,Me,aa,_t,sa,Wt,I,Te,na,vt,ra,la,Ie,ia,xe,ca,da,ma,te,pa,je,ha,Ce,fa,ua,ga,P,Ee,_a,V,va,Xe,wa,ba,wt,Fa,$a,ya,oe,Na,ae,Ht,R,se,bt,Pe,ka,Ft,Ma,Bt,j,Ae,Ta,$t,Ia,xa,ze,ja,qe,Ca,Ea,Pa,A,Se,Aa,K,za,Ze,qa,Sa,yt,Oa,Da,La,ne,Ua,re,Vt;return a=new lt({}),he=new lt({}),ve=new lt({}),we=new Le({props:{name:"class transformers.FocalNetConfig",anchor:"transformers.FocalNetConfig",parameters:[{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"embed_dim",val:" = 96"},{name:"use_conv_embed",val:" = False"},{name:"hidden_sizes",val:" = [192, 384, 768, 768]"},{name:"depths",val:" = [2, 2, 6, 2]"},{name:"focal_levels",val:" = [2, 2, 2, 2]"},{name:"focal_windows",val:" = [3, 3, 3, 3]"},{name:"hidden_act",val:" = 'gelu'"},{name:"mlp_ratio",val:" = 4.0"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.1"},{name:"use_layerscale",val:" = False"},{name:"layerscale_value",val:" = 0.0001"},{name:"use_post_layernorm",val:" = False"},{name:"use_post_layernorm_in_modulation",val:" = False"},{name:"normalize_modulator",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"encoder_stride",val:" = 32"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FocalNetConfig.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.FocalNetConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch in the embeddings layer.`,name:"patch_size"},{anchor:"transformers.FocalNetConfig.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.FocalNetConfig.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.FocalNetConfig.use_conv_embed",description:`<strong>use_conv_embed</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use convolutional embedding. The authors noted that using convolutional embedding usually
improve the performance, but it&#x2019;s not used by default.`,name:"use_conv_embed"},{anchor:"transformers.FocalNetConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[192, 384, 768, 768]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.FocalNetConfig.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 2, 6, 2]</code>) &#x2014;
Depth (number of layers) of each stage in the encoder.`,name:"depths"},{anchor:"transformers.FocalNetConfig.focal_levels",description:`<strong>focal_levels</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 2, 2, 2]</code>) &#x2014;
Number of focal levels in each layer of the respective stages in the encoder.`,name:"focal_levels"},{anchor:"transformers.FocalNetConfig.focal_windows",description:`<strong>focal_windows</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[3, 3, 3, 3]</code>) &#x2014;
Focal window size in each layer of the respective stages in the encoder.`,name:"focal_windows"},{anchor:"transformers.FocalNetConfig.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.FocalNetConfig.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.FocalNetConfig.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.FocalNetConfig.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.FocalNetConfig.use_layerscale",description:`<strong>use_layerscale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use layer scale in the encoder.`,name:"use_layerscale"},{anchor:"transformers.FocalNetConfig.layerscale_value",description:`<strong>layerscale_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-4) &#x2014;
The initial value of the layer scale.`,name:"layerscale_value"},{anchor:"transformers.FocalNetConfig.use_post_layernorm",description:`<strong>use_post_layernorm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use post layer normalization in the encoder.`,name:"use_post_layernorm"},{anchor:"transformers.FocalNetConfig.use_post_layernorm_in_modulation",description:`<strong>use_post_layernorm_in_modulation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use post layer normalization in the modulation layer.`,name:"use_post_layernorm_in_modulation"},{anchor:"transformers.FocalNetConfig.normalize_modulator",description:`<strong>normalize_modulator</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to normalize the modulator.`,name:"normalize_modulator"},{anchor:"transformers.FocalNetConfig.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.FocalNetConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FocalNetConfig.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"},{anchor:"transformers.FocalNetConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage.`,name:"out_features"},{anchor:"transformers.FocalNetConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/focalnet/configuration_focalnet.py#L29"}}),Y=new oo({props:{anchor:"transformers.FocalNetConfig.example",$$slots:{default:[Es]},$$scope:{ctx:M}}}),Fe=new lt({}),$e=new Le({props:{name:"class transformers.FocalNetModel",anchor:"transformers.FocalNetModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"},{name:"use_mask_token",val:" = False"}],parametersDescription:[{anchor:"transformers.FocalNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetConfig">FocalNetConfig</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.29.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.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L696"}}),ke=new Le({props:{name:"forward",anchor:"transformers.FocalNetModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FocalNetModel.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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.FocalNetModel.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.FocalNetModel.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FocalNetModel.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/v4.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L715",returnDescription:`
<p>A <code>transformers.models.focalnet.modeling_focalnet.FocalNetModelOutput</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.29.0/en/model_doc/focalnet#transformers.FocalNetConfig"
>FocalNetConfig</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>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.focalnet.modeling_focalnet.FocalNetModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),X=new to({props:{$$slots:{default:[Ps]},$$scope:{ctx:M}}}),Z=new oo({props:{anchor:"transformers.FocalNetModel.forward.example",$$slots:{default:[As]},$$scope:{ctx:M}}}),Me=new lt({}),Te=new Le({props:{name:"class transformers.FocalNetForMaskedImageModeling",anchor:"transformers.FocalNetForMaskedImageModeling",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FocalNetForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetConfig">FocalNetConfig</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.29.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.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L786"}}),te=new to({props:{$$slots:{default:[zs]},$$scope:{ctx:M}}}),Ee=new Le({props:{name:"forward",anchor:"transformers.FocalNetForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FocalNetForMaskedImageModeling.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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.FocalNetForMaskedImageModeling.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.FocalNetForMaskedImageModeling.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FocalNetForMaskedImageModeling.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/v4.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L804",returnDescription:`
<p>A <code>transformers.models.focalnet.modeling_focalnet.FocalNetMaskedImageModelingOutput</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.29.0/en/model_doc/focalnet#transformers.FocalNetConfig"
>FocalNetConfig</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>reconstruction</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>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.focalnet.modeling_focalnet.FocalNetMaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new to({props:{$$slots:{default:[qs]},$$scope:{ctx:M}}}),ae=new oo({props:{anchor:"transformers.FocalNetForMaskedImageModeling.forward.example",$$slots:{default:[Ss]},$$scope:{ctx:M}}}),Pe=new lt({}),Ae=new Le({props:{name:"class transformers.FocalNetForImageClassification",anchor:"transformers.FocalNetForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FocalNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetConfig">FocalNetConfig</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.29.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.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L894"}}),Se=new Le({props:{name:"forward",anchor:"transformers.FocalNetForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FocalNetForImageClassification.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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.FocalNetForImageClassification.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.FocalNetForImageClassification.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FocalNetForImageClassification.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.29.0/src/transformers/models/focalnet/modeling_focalnet.py#L910",returnDescription:`
<p>A <code>transformers.models.focalnet.modeling_focalnet.FocalNetImageClassifierOutput</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.29.0/en/model_doc/focalnet#transformers.FocalNetConfig"
>FocalNetConfig</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>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.focalnet.modeling_focalnet.FocalNetImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new to({props:{$$slots:{default:[Os]},$$scope:{ctx:M}}}),re=new oo({props:{anchor:"transformers.FocalNetForImageClassification.forward.example",$$slots:{default:[Ds]},$$scope:{ctx:M}}}),{c(){c=s("meta"),w=u(),h=s("h1"),p=s("a"),v=s("span"),b(a.$$.fragment),m=u(),T=s("span"),no=l("FocalNet"),jt=u(),O=s("h2"),G=s("a"),it=s("span"),b(he.$$.fragment),ro=u(),ct=s("span"),lo=l("Overview"),Ct=u(),C=s("p"),io=l("The FocalNet model was proposed in "),fe=s("a"),co=l("Focal Modulation Networks"),mo=l(` by Jianwei Yang, Chunyuan Li, Xiyang Dai, Lu Yuan, Jianfeng Gao.
FocalNets completely replace self-attention (used in models like `),Ue=s("a"),po=l("ViT"),ho=l(" and "),We=s("a"),fo=l("Swin"),uo=l(`) by a focal modulation mechanism for modeling token interactions in vision.
The authors claim that FocalNets outperform self-attention based models with similar computational costs on the tasks of image classification, object detection, and segmentation.`),Et=u(),He=s("p"),go=l("The abstract from the paper is the following:"),Pt=u(),Be=s("p"),dt=s("em"),_o=l(`We propose focal modulation networks (FocalNets in short), where self-attention (SA) is completely replaced by a focal modulation mechanism for modeling token interactions in vision. Focal modulation comprises three components: (i) hierarchical contextualization, implemented using a stack of depth-wise convolutional layers, to encode visual contexts from short to long ranges, (ii) gated aggregation to selectively gather contexts for each query token based on its
content, and (iii) element-wise modulation or affine transformation to inject the aggregated context into the query. Extensive experiments show FocalNets outperform the state-of-the-art SA counterparts (e.g., Swin and Focal Transformers) with similar computational costs on the tasks of image classification, object detection, and segmentation. Specifically, FocalNets with tiny and base size achieve 82.3% and 83.9% top-1 accuracy on ImageNet-1K. After pretrained on ImageNet-22K in 224 resolution, it attains 86.5% and 87.3% top-1 accuracy when finetuned with resolution 224 and 384, respectively. When transferred to downstream tasks, FocalNets exhibit clear superiority. For object detection with Mask R-CNN, FocalNet base trained with 1\\times outperforms the Swin counterpart by 2.1 points and already surpasses Swin trained with 3\\times schedule (49.0 v.s. 48.5). For semantic segmentation with UPerNet, FocalNet base at single-scale outperforms Swin by 2.4, and beats Swin at multi-scale (50.5 v.s. 49.7). Using large FocalNet and Mask2former, we achieve 58.5 mIoU for ADE20K semantic segmentation, and 57.9 PQ for COCO Panoptic Segmentation. Using huge FocalNet and DINO, we achieved 64.3 and 64.4 mAP on COCO minival and test-dev, respectively, establishing new SoTA on top of much larger attention-based models like Swinv2-G and BEIT-3.`),At=u(),Ve=s("p"),vo=l("Tips:"),zt=u(),Re=s("ul"),ue=s("li"),wo=l("One can use the "),Ke=s("a"),bo=l("AutoImageProcessor"),Fo=l(" class to prepare images for the model."),qt=u(),S=s("p"),$o=l("This model was contributed by "),ge=s("a"),yo=l("nielsr"),No=l(`.
The original code can be found `),_e=s("a"),ko=l("here"),Mo=l("."),St=u(),D=s("h2"),J=s("a"),mt=s("span"),b(ve.$$.fragment),To=u(),pt=s("span"),Io=l("FocalNetConfig"),Ot=u(),x=s("div"),b(we.$$.fragment),xo=u(),L=s("p"),jo=l("This is the configuration class to store the configuration of a "),Ge=s("a"),Co=l("FocalNetModel"),Eo=l(`. It is used to instantiate a
FocalNet 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 FocalNet
`),be=s("a"),Po=l("microsoft/focalnet-tiny"),Ao=l(" architecture."),zo=u(),U=s("p"),qo=l("Configuration objects inherit from "),Je=s("a"),So=l("PretrainedConfig"),Oo=l(` and can be used to control the model outputs. Read the
documentation from `),Ye=s("a"),Do=l("PretrainedConfig"),Lo=l(" for more information."),Uo=u(),b(Y.$$.fragment),Dt=u(),W=s("h2"),Q=s("a"),ht=s("span"),b(Fe.$$.fragment),Wo=u(),ft=s("span"),Ho=l("FocalNetModel"),Lt=u(),q=s("div"),b($e.$$.fragment),Bo=u(),ye=s("p"),Vo=l(`The bare FocalNet Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=s("a"),Ro=l("torch.nn.Module"),Ko=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Go=u(),E=s("div"),b(ke.$$.fragment),Jo=u(),H=s("p"),Yo=l("The "),Qe=s("a"),Qo=l("FocalNetModel"),Xo=l(" forward method, overrides the "),ut=s("code"),Zo=l("__call__"),ea=l(" special method."),ta=u(),b(X.$$.fragment),oa=u(),b(Z.$$.fragment),Ut=u(),B=s("h2"),ee=s("a"),gt=s("span"),b(Me.$$.fragment),aa=u(),_t=s("span"),sa=l("FocalNetForMaskedImageModeling"),Wt=u(),I=s("div"),b(Te.$$.fragment),na=u(),vt=s("p"),ra=l("FocalNet Model with a decoder on top for masked image modeling."),la=u(),Ie=s("p"),ia=l("This follows the same implementation as in "),xe=s("a"),ca=l("SimMIM"),da=l("."),ma=u(),b(te.$$.fragment),pa=u(),je=s("p"),ha=l("This model is a PyTorch "),Ce=s("a"),fa=l("torch.nn.Module"),ua=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ga=u(),P=s("div"),b(Ee.$$.fragment),_a=u(),V=s("p"),va=l("The "),Xe=s("a"),wa=l("FocalNetForMaskedImageModeling"),ba=l(" forward method, overrides the "),wt=s("code"),Fa=l("__call__"),$a=l(" special method."),ya=u(),b(oe.$$.fragment),Na=u(),b(ae.$$.fragment),Ht=u(),R=s("h2"),se=s("a"),bt=s("span"),b(Pe.$$.fragment),ka=u(),Ft=s("span"),Ma=l("FocalNetForImageClassification"),Bt=u(),j=s("div"),b(Ae.$$.fragment),Ta=u(),$t=s("p"),Ia=l(`FocalNet Model with an image classification head on top (a linear layer on top of the pooled output) e.g. for
ImageNet.`),xa=u(),ze=s("p"),ja=l("This model is a PyTorch "),qe=s("a"),Ca=l("torch.nn.Module"),Ea=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pa=u(),A=s("div"),b(Se.$$.fragment),Aa=u(),K=s("p"),za=l("The "),Ze=s("a"),qa=l("FocalNetForImageClassification"),Sa=l(" forward method, overrides the "),yt=s("code"),Oa=l("__call__"),Da=l(" special method."),La=u(),b(ne.$$.fragment),Ua=u(),b(re.$$.fragment),this.h()},l(t){const f=js('[data-svelte="svelte-1phssyn"]',document.head);c=n(f,"META",{name:!0,content:!0}),f.forEach(o),w=g(t),h=n(t,"H1",{class:!0});var Oe=r(h);p=n(Oe,"A",{id:!0,class:!0,href:!0});var Nt=r(p);v=n(Nt,"SPAN",{});var kt=r(v);F(a.$$.fragment,kt),kt.forEach(o),Nt.forEach(o),m=g(Oe),T=n(Oe,"SPAN",{});var Mt=r(T);no=i(Mt,"FocalNet"),Mt.forEach(o),Oe.forEach(o),jt=g(t),O=n(t,"H2",{class:!0});var De=r(O);G=n(De,"A",{id:!0,class:!0,href:!0});var Tt=r(G);it=n(Tt,"SPAN",{});var It=r(it);F(he.$$.fragment,It),It.forEach(o),Tt.forEach(o),ro=g(De),ct=n(De,"SPAN",{});var xt=r(ct);lo=i(xt,"Overview"),xt.forEach(o),De.forEach(o),Ct=g(t),C=n(t,"P",{});var le=r(C);io=i(le,"The FocalNet model was proposed in "),fe=n(le,"A",{href:!0,rel:!0});var Wa=r(fe);co=i(Wa,"Focal Modulation Networks"),Wa.forEach(o),mo=i(le,` by Jianwei Yang, Chunyuan Li, Xiyang Dai, Lu Yuan, Jianfeng Gao.
FocalNets completely replace self-attention (used in models like `),Ue=n(le,"A",{href:!0});var Ha=r(Ue);po=i(Ha,"ViT"),Ha.forEach(o),ho=i(le," and "),We=n(le,"A",{href:!0});var Ba=r(We);fo=i(Ba,"Swin"),Ba.forEach(o),uo=i(le,`) by a focal modulation mechanism for modeling token interactions in vision.
The authors claim that FocalNets outperform self-attention based models with similar computational costs on the tasks of image classification, object detection, and segmentation.`),le.forEach(o),Et=g(t),He=n(t,"P",{});var Va=r(He);go=i(Va,"The abstract from the paper is the following:"),Va.forEach(o),Pt=g(t),Be=n(t,"P",{});var Ra=r(Be);dt=n(Ra,"EM",{});var Ka=r(dt);_o=i(Ka,`We propose focal modulation networks (FocalNets in short), where self-attention (SA) is completely replaced by a focal modulation mechanism for modeling token interactions in vision. Focal modulation comprises three components: (i) hierarchical contextualization, implemented using a stack of depth-wise convolutional layers, to encode visual contexts from short to long ranges, (ii) gated aggregation to selectively gather contexts for each query token based on its
content, and (iii) element-wise modulation or affine transformation to inject the aggregated context into the query. Extensive experiments show FocalNets outperform the state-of-the-art SA counterparts (e.g., Swin and Focal Transformers) with similar computational costs on the tasks of image classification, object detection, and segmentation. Specifically, FocalNets with tiny and base size achieve 82.3% and 83.9% top-1 accuracy on ImageNet-1K. After pretrained on ImageNet-22K in 224 resolution, it attains 86.5% and 87.3% top-1 accuracy when finetuned with resolution 224 and 384, respectively. When transferred to downstream tasks, FocalNets exhibit clear superiority. For object detection with Mask R-CNN, FocalNet base trained with 1\\times outperforms the Swin counterpart by 2.1 points and already surpasses Swin trained with 3\\times schedule (49.0 v.s. 48.5). For semantic segmentation with UPerNet, FocalNet base at single-scale outperforms Swin by 2.4, and beats Swin at multi-scale (50.5 v.s. 49.7). Using large FocalNet and Mask2former, we achieve 58.5 mIoU for ADE20K semantic segmentation, and 57.9 PQ for COCO Panoptic Segmentation. Using huge FocalNet and DINO, we achieved 64.3 and 64.4 mAP on COCO minival and test-dev, respectively, establishing new SoTA on top of much larger attention-based models like Swinv2-G and BEIT-3.`),Ka.forEach(o),Ra.forEach(o),At=g(t),Ve=n(t,"P",{});var Ga=r(Ve);vo=i(Ga,"Tips:"),Ga.forEach(o),zt=g(t),Re=n(t,"UL",{});var Ja=r(Re);ue=n(Ja,"LI",{});var Rt=r(ue);wo=i(Rt,"One can use the "),Ke=n(Rt,"A",{href:!0});var Ya=r(Ke);bo=i(Ya,"AutoImageProcessor"),Ya.forEach(o),Fo=i(Rt," class to prepare images for the model."),Rt.forEach(o),Ja.forEach(o),qt=g(t),S=n(t,"P",{});var et=r(S);$o=i(et,"This model was contributed by "),ge=n(et,"A",{href:!0,rel:!0});var Qa=r(ge);yo=i(Qa,"nielsr"),Qa.forEach(o),No=i(et,`.
The original code can be found `),_e=n(et,"A",{href:!0,rel:!0});var Xa=r(_e);ko=i(Xa,"here"),Xa.forEach(o),Mo=i(et,"."),et.forEach(o),St=g(t),D=n(t,"H2",{class:!0});var Kt=r(D);J=n(Kt,"A",{id:!0,class:!0,href:!0});var Za=r(J);mt=n(Za,"SPAN",{});var es=r(mt);F(ve.$$.fragment,es),es.forEach(o),Za.forEach(o),To=g(Kt),pt=n(Kt,"SPAN",{});var ts=r(pt);Io=i(ts,"FocalNetConfig"),ts.forEach(o),Kt.forEach(o),Ot=g(t),x=n(t,"DIV",{class:!0});var ie=r(x);F(we.$$.fragment,ie),xo=g(ie),L=n(ie,"P",{});var tt=r(L);jo=i(tt,"This is the configuration class to store the configuration of a "),Ge=n(tt,"A",{href:!0});var os=r(Ge);Co=i(os,"FocalNetModel"),os.forEach(o),Eo=i(tt,`. It is used to instantiate a
FocalNet 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 FocalNet
`),be=n(tt,"A",{href:!0,rel:!0});var as=r(be);Po=i(as,"microsoft/focalnet-tiny"),as.forEach(o),Ao=i(tt," architecture."),tt.forEach(o),zo=g(ie),U=n(ie,"P",{});var ot=r(U);qo=i(ot,"Configuration objects inherit from "),Je=n(ot,"A",{href:!0});var ss=r(Je);So=i(ss,"PretrainedConfig"),ss.forEach(o),Oo=i(ot,` and can be used to control the model outputs. Read the
documentation from `),Ye=n(ot,"A",{href:!0});var ns=r(Ye);Do=i(ns,"PretrainedConfig"),ns.forEach(o),Lo=i(ot," for more information."),ot.forEach(o),Uo=g(ie),F(Y.$$.fragment,ie),ie.forEach(o),Dt=g(t),W=n(t,"H2",{class:!0});var Gt=r(W);Q=n(Gt,"A",{id:!0,class:!0,href:!0});var rs=r(Q);ht=n(rs,"SPAN",{});var ls=r(ht);F(Fe.$$.fragment,ls),ls.forEach(o),rs.forEach(o),Wo=g(Gt),ft=n(Gt,"SPAN",{});var is=r(ft);Ho=i(is,"FocalNetModel"),is.forEach(o),Gt.forEach(o),Lt=g(t),q=n(t,"DIV",{class:!0});var at=r(q);F($e.$$.fragment,at),Bo=g(at),ye=n(at,"P",{});var Jt=r(ye);Vo=i(Jt,`The bare FocalNet Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=n(Jt,"A",{href:!0,rel:!0});var cs=r(Ne);Ro=i(cs,"torch.nn.Module"),cs.forEach(o),Ko=i(Jt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jt.forEach(o),Go=g(at),E=n(at,"DIV",{class:!0});var ce=r(E);F(ke.$$.fragment,ce),Jo=g(ce),H=n(ce,"P",{});var st=r(H);Yo=i(st,"The "),Qe=n(st,"A",{href:!0});var ds=r(Qe);Qo=i(ds,"FocalNetModel"),ds.forEach(o),Xo=i(st," forward method, overrides the "),ut=n(st,"CODE",{});var ms=r(ut);Zo=i(ms,"__call__"),ms.forEach(o),ea=i(st," special method."),st.forEach(o),ta=g(ce),F(X.$$.fragment,ce),oa=g(ce),F(Z.$$.fragment,ce),ce.forEach(o),at.forEach(o),Ut=g(t),B=n(t,"H2",{class:!0});var Yt=r(B);ee=n(Yt,"A",{id:!0,class:!0,href:!0});var ps=r(ee);gt=n(ps,"SPAN",{});var hs=r(gt);F(Me.$$.fragment,hs),hs.forEach(o),ps.forEach(o),aa=g(Yt),_t=n(Yt,"SPAN",{});var fs=r(_t);sa=i(fs,"FocalNetForMaskedImageModeling"),fs.forEach(o),Yt.forEach(o),Wt=g(t),I=n(t,"DIV",{class:!0});var z=r(I);F(Te.$$.fragment,z),na=g(z),vt=n(z,"P",{});var us=r(vt);ra=i(us,"FocalNet Model with a decoder on top for masked image modeling."),us.forEach(o),la=g(z),Ie=n(z,"P",{});var Qt=r(Ie);ia=i(Qt,"This follows the same implementation as in "),xe=n(Qt,"A",{href:!0,rel:!0});var gs=r(xe);ca=i(gs,"SimMIM"),gs.forEach(o),da=i(Qt,"."),Qt.forEach(o),ma=g(z),F(te.$$.fragment,z),pa=g(z),je=n(z,"P",{});var Xt=r(je);ha=i(Xt,"This model is a PyTorch "),Ce=n(Xt,"A",{href:!0,rel:!0});var _s=r(Ce);fa=i(_s,"torch.nn.Module"),_s.forEach(o),ua=i(Xt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xt.forEach(o),ga=g(z),P=n(z,"DIV",{class:!0});var de=r(P);F(Ee.$$.fragment,de),_a=g(de),V=n(de,"P",{});var nt=r(V);va=i(nt,"The "),Xe=n(nt,"A",{href:!0});var vs=r(Xe);wa=i(vs,"FocalNetForMaskedImageModeling"),vs.forEach(o),ba=i(nt," forward method, overrides the "),wt=n(nt,"CODE",{});var ws=r(wt);Fa=i(ws,"__call__"),ws.forEach(o),$a=i(nt," special method."),nt.forEach(o),ya=g(de),F(oe.$$.fragment,de),Na=g(de),F(ae.$$.fragment,de),de.forEach(o),z.forEach(o),Ht=g(t),R=n(t,"H2",{class:!0});var Zt=r(R);se=n(Zt,"A",{id:!0,class:!0,href:!0});var bs=r(se);bt=n(bs,"SPAN",{});var Fs=r(bt);F(Pe.$$.fragment,Fs),Fs.forEach(o),bs.forEach(o),ka=g(Zt),Ft=n(Zt,"SPAN",{});var $s=r(Ft);Ma=i($s,"FocalNetForImageClassification"),$s.forEach(o),Zt.forEach(o),Bt=g(t),j=n(t,"DIV",{class:!0});var me=r(j);F(Ae.$$.fragment,me),Ta=g(me),$t=n(me,"P",{});var ys=r($t);Ia=i(ys,`FocalNet Model with an image classification head on top (a linear layer on top of the pooled output) e.g. for
ImageNet.`),ys.forEach(o),xa=g(me),ze=n(me,"P",{});var eo=r(ze);ja=i(eo,"This model is a PyTorch "),qe=n(eo,"A",{href:!0,rel:!0});var Ns=r(qe);Ca=i(Ns,"torch.nn.Module"),Ns.forEach(o),Ea=i(eo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),eo.forEach(o),Pa=g(me),A=n(me,"DIV",{class:!0});var pe=r(A);F(Se.$$.fragment,pe),Aa=g(pe),K=n(pe,"P",{});var rt=r(K);za=i(rt,"The "),Ze=n(rt,"A",{href:!0});var ks=r(Ze);qa=i(ks,"FocalNetForImageClassification"),ks.forEach(o),Sa=i(rt," forward method, overrides the "),yt=n(rt,"CODE",{});var Ms=r(yt);Oa=i(Ms,"__call__"),Ms.forEach(o),Da=i(rt," special method."),rt.forEach(o),La=g(pe),F(ne.$$.fragment,pe),Ua=g(pe),F(re.$$.fragment,pe),pe.forEach(o),me.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Us)),d(p,"id","focalnet"),d(p,"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(p,"href","#focalnet"),d(h,"class","relative group"),d(G,"id","overview"),d(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"),d(G,"href","#overview"),d(O,"class","relative group"),d(fe,"href","https://arxiv.org/abs/2203.11926"),d(fe,"rel","nofollow"),d(Ue,"href","vit"),d(We,"href","swin"),d(Ke,"href","/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor"),d(ge,"href","https://huggingface.co/nielsr"),d(ge,"rel","nofollow"),d(_e,"href","https://github.com/microsoft/FocalNet"),d(_e,"rel","nofollow"),d(J,"id","transformers.FocalNetConfig"),d(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"),d(J,"href","#transformers.FocalNetConfig"),d(D,"class","relative group"),d(Ge,"href","/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetModel"),d(be,"href","https://huggingface.co/microsoft/focalnet-tiny"),d(be,"rel","nofollow"),d(Je,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ye,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"id","transformers.FocalNetModel"),d(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"),d(Q,"href","#transformers.FocalNetModel"),d(W,"class","relative group"),d(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ne,"rel","nofollow"),d(Qe,"href","/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetModel"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"id","transformers.FocalNetForMaskedImageModeling"),d(ee,"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(ee,"href","#transformers.FocalNetForMaskedImageModeling"),d(B,"class","relative group"),d(xe,"href","https://arxiv.org/abs/2111.09886"),d(xe,"rel","nofollow"),d(Ce,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ce,"rel","nofollow"),d(Xe,"href","/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetForMaskedImageModeling"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"id","transformers.FocalNetForImageClassification"),d(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"),d(se,"href","#transformers.FocalNetForImageClassification"),d(R,"class","relative group"),d(qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(qe,"rel","nofollow"),d(Ze,"href","/docs/transformers/v4.29.0/en/model_doc/focalnet#transformers.FocalNetForImageClassification"),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(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(t,f){e(document.head,c),_(t,w,f),_(t,h,f),e(h,p),e(p,v),$(a,v,null),e(h,m),e(h,T),e(T,no),_(t,jt,f),_(t,O,f),e(O,G),e(G,it),$(he,it,null),e(O,ro),e(O,ct),e(ct,lo),_(t,Ct,f),_(t,C,f),e(C,io),e(C,fe),e(fe,co),e(C,mo),e(C,Ue),e(Ue,po),e(C,ho),e(C,We),e(We,fo),e(C,uo),_(t,Et,f),_(t,He,f),e(He,go),_(t,Pt,f),_(t,Be,f),e(Be,dt),e(dt,_o),_(t,At,f),_(t,Ve,f),e(Ve,vo),_(t,zt,f),_(t,Re,f),e(Re,ue),e(ue,wo),e(ue,Ke),e(Ke,bo),e(ue,Fo),_(t,qt,f),_(t,S,f),e(S,$o),e(S,ge),e(ge,yo),e(S,No),e(S,_e),e(_e,ko),e(S,Mo),_(t,St,f),_(t,D,f),e(D,J),e(J,mt),$(ve,mt,null),e(D,To),e(D,pt),e(pt,Io),_(t,Ot,f),_(t,x,f),$(we,x,null),e(x,xo),e(x,L),e(L,jo),e(L,Ge),e(Ge,Co),e(L,Eo),e(L,be),e(be,Po),e(L,Ao),e(x,zo),e(x,U),e(U,qo),e(U,Je),e(Je,So),e(U,Oo),e(U,Ye),e(Ye,Do),e(U,Lo),e(x,Uo),$(Y,x,null),_(t,Dt,f),_(t,W,f),e(W,Q),e(Q,ht),$(Fe,ht,null),e(W,Wo),e(W,ft),e(ft,Ho),_(t,Lt,f),_(t,q,f),$($e,q,null),e(q,Bo),e(q,ye),e(ye,Vo),e(ye,Ne),e(Ne,Ro),e(ye,Ko),e(q,Go),e(q,E),$(ke,E,null),e(E,Jo),e(E,H),e(H,Yo),e(H,Qe),e(Qe,Qo),e(H,Xo),e(H,ut),e(ut,Zo),e(H,ea),e(E,ta),$(X,E,null),e(E,oa),$(Z,E,null),_(t,Ut,f),_(t,B,f),e(B,ee),e(ee,gt),$(Me,gt,null),e(B,aa),e(B,_t),e(_t,sa),_(t,Wt,f),_(t,I,f),$(Te,I,null),e(I,na),e(I,vt),e(vt,ra),e(I,la),e(I,Ie),e(Ie,ia),e(Ie,xe),e(xe,ca),e(Ie,da),e(I,ma),$(te,I,null),e(I,pa),e(I,je),e(je,ha),e(je,Ce),e(Ce,fa),e(je,ua),e(I,ga),e(I,P),$(Ee,P,null),e(P,_a),e(P,V),e(V,va),e(V,Xe),e(Xe,wa),e(V,ba),e(V,wt),e(wt,Fa),e(V,$a),e(P,ya),$(oe,P,null),e(P,Na),$(ae,P,null),_(t,Ht,f),_(t,R,f),e(R,se),e(se,bt),$(Pe,bt,null),e(R,ka),e(R,Ft),e(Ft,Ma),_(t,Bt,f),_(t,j,f),$(Ae,j,null),e(j,Ta),e(j,$t),e($t,Ia),e(j,xa),e(j,ze),e(ze,ja),e(ze,qe),e(qe,Ca),e(ze,Ea),e(j,Pa),e(j,A),$(Se,A,null),e(A,Aa),e(A,K),e(K,za),e(K,Ze),e(Ze,qa),e(K,Sa),e(K,yt),e(yt,Oa),e(K,Da),e(A,La),$(ne,A,null),e(A,Ua),$(re,A,null),Vt=!0},p(t,[f]){const Oe={};f&2&&(Oe.$$scope={dirty:f,ctx:t}),Y.$set(Oe);const Nt={};f&2&&(Nt.$$scope={dirty:f,ctx:t}),X.$set(Nt);const kt={};f&2&&(kt.$$scope={dirty:f,ctx:t}),Z.$set(kt);const Mt={};f&2&&(Mt.$$scope={dirty:f,ctx:t}),te.$set(Mt);const De={};f&2&&(De.$$scope={dirty:f,ctx:t}),oe.$set(De);const Tt={};f&2&&(Tt.$$scope={dirty:f,ctx:t}),ae.$set(Tt);const It={};f&2&&(It.$$scope={dirty:f,ctx:t}),ne.$set(It);const xt={};f&2&&(xt.$$scope={dirty:f,ctx:t}),re.$set(xt)},i(t){Vt||(y(a.$$.fragment,t),y(he.$$.fragment,t),y(ve.$$.fragment,t),y(we.$$.fragment,t),y(Y.$$.fragment,t),y(Fe.$$.fragment,t),y($e.$$.fragment,t),y(ke.$$.fragment,t),y(X.$$.fragment,t),y(Z.$$.fragment,t),y(Me.$$.fragment,t),y(Te.$$.fragment,t),y(te.$$.fragment,t),y(Ee.$$.fragment,t),y(oe.$$.fragment,t),y(ae.$$.fragment,t),y(Pe.$$.fragment,t),y(Ae.$$.fragment,t),y(Se.$$.fragment,t),y(ne.$$.fragment,t),y(re.$$.fragment,t),Vt=!0)},o(t){N(a.$$.fragment,t),N(he.$$.fragment,t),N(ve.$$.fragment,t),N(we.$$.fragment,t),N(Y.$$.fragment,t),N(Fe.$$.fragment,t),N($e.$$.fragment,t),N(ke.$$.fragment,t),N(X.$$.fragment,t),N(Z.$$.fragment,t),N(Me.$$.fragment,t),N(Te.$$.fragment,t),N(te.$$.fragment,t),N(Ee.$$.fragment,t),N(oe.$$.fragment,t),N(ae.$$.fragment,t),N(Pe.$$.fragment,t),N(Ae.$$.fragment,t),N(Se.$$.fragment,t),N(ne.$$.fragment,t),N(re.$$.fragment,t),Vt=!1},d(t){o(c),t&&o(w),t&&o(h),k(a),t&&o(jt),t&&o(O),k(he),t&&o(Ct),t&&o(C),t&&o(Et),t&&o(He),t&&o(Pt),t&&o(Be),t&&o(At),t&&o(Ve),t&&o(zt),t&&o(Re),t&&o(qt),t&&o(S),t&&o(St),t&&o(D),k(ve),t&&o(Ot),t&&o(x),k(we),k(Y),t&&o(Dt),t&&o(W),k(Fe),t&&o(Lt),t&&o(q),k($e),k(ke),k(X),k(Z),t&&o(Ut),t&&o(B),k(Me),t&&o(Wt),t&&o(I),k(Te),k(te),k(Ee),k(oe),k(ae),t&&o(Ht),t&&o(R),k(Pe),t&&o(Bt),t&&o(j),k(Ae),k(Se),k(ne),k(re)}}}const Us={local:"focalnet",sections:[{local:"overview",title:"Overview"},{local:"transformers.FocalNetConfig",title:"FocalNetConfig"},{local:"transformers.FocalNetModel",title:"FocalNetModel"},{local:"transformers.FocalNetForMaskedImageModeling",title:"FocalNetForMaskedImageModeling"},{local:"transformers.FocalNetForImageClassification",title:"FocalNetForImageClassification"}],title:"FocalNet"};function Ws(M){return Cs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Js extends Ts{constructor(c){super();Is(this,c,Ws,Ls,xs,{})}}export{Js as default,Us as metadata};
