import{S as js,i as Cs,s as ks,e as s,k as u,w as v,t as l,M as Us,c as n,d as o,m as g,a as r,x as w,h as i,b as d,G as e,g as _,y as M,q as F,o as N,B as $,v as Es,L as ao}from"../../chunks/vendor-hf-doc-builder.js";import{T as to}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ae}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 Is(T){let c,y,p,h,b;return h=new so({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZvY2FsTmV0Q29uZmlnJTJDJTIwRm9jYWxOZXRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGb2NhbE5ldCUyMG1pY3Jvc29mdCUyRmZvY2FsbmV0LXRpbnklMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwRm9jYWxOZXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWljcm9zb2Z0JTJGZm9jYWxuZXQtdGlueSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRm9jYWxOZXRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",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"),y=l("Example:"),p=u(),v(h.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);y=i(m,"Example:"),m.forEach(o),p=g(a),w(h.$$.fragment,a)},m(a,m){_(a,c,m),e(c,y),_(a,p,m),M(h,a,m),b=!0},p:ao,i(a){b||(F(h.$$.fragment,a),b=!0)},o(a){N(h.$$.fragment,a),b=!1},d(a){a&&o(c),a&&o(p),$(h,a)}}}function Zs(T){let c,y,p,h,b;return{c(){c=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=s("code"),h=l("Module"),b=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);y=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n(m,"CODE",{});var j=r(p);h=i(j,"Module"),j.forEach(o),b=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,y),e(c,p),e(p,h),e(c,b)},d(a){a&&o(c)}}}function Ws(T){let c,y,p,h,b;return h=new so({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZvY2FsTmV0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmZvY2FsbmV0LXRpbnklMjIpJTBBbW9kZWwlMjAlM0QlMjBGb2NhbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZmb2NhbG5ldC10aW55JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",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"),y=l("Example:"),p=u(),v(h.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);y=i(m,"Example:"),m.forEach(o),p=g(a),w(h.$$.fragment,a)},m(a,m){_(a,c,m),e(c,y),_(a,p,m),M(h,a,m),b=!0},p:ao,i(a){b||(F(h.$$.fragment,a),b=!0)},o(a){N(h.$$.fragment,a),b=!1},d(a){a&&o(c),a&&o(p),$(h,a)}}}function xs(T){let c,y,p,h,b;return{c(){c=s("p"),y=l("Note that we provide a script to pre-train this model on custom data in our "),p=s("a"),h=l(`examples
directory`),b=l("."),this.h()},l(a){c=n(a,"P",{});var m=r(c);y=i(m,"Note that we provide a script to pre-train this model on custom data in our "),p=n(m,"A",{href:!0,rel:!0});var j=r(p);h=i(j,`examples
directory`),j.forEach(o),b=i(m,"."),m.forEach(o),this.h()},h(){d(p,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),d(p,"rel","nofollow")},m(a,m){_(a,c,m),e(c,y),e(c,p),e(p,h),e(c,b)},d(a){a&&o(c)}}}function zs(T){let c,y,p,h,b;return{c(){c=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=s("code"),h=l("Module"),b=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);y=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n(m,"CODE",{});var j=r(p);h=i(j,"Module"),j.forEach(o),b=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,y),e(c,p),e(p,h),e(c,b)},d(a){a&&o(c)}}}function Js(T){let c,y,p,h,b;return h=new so({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZvY2FsTmV0Q29uZmlnJTJDJTIwRm9jYWxOZXRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmZvY2FsbmV0LWJhc2Utc2ltbWltLXdpbmRvdzYtMTkyJTIyKSUwQWNvbmZpZyUyMCUzRCUyMEZvY2FsTmV0Q29uZmlnKCklMEFtb2RlbCUyMCUzRCUyMEZvY2FsTmV0Rm9yTWFza2VkSW1hZ2VNb2RlbGluZyhjb25maWcpJTBBJTBBbnVtX3BhdGNoZXMlMjAlM0QlMjAobW9kZWwuY29uZmlnLmltYWdlX3NpemUlMjAlMkYlMkYlMjBtb2RlbC5jb25maWcucGF0Y2hfc2l6ZSklMjAqKiUyMDIlMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEElMjMlMjBjcmVhdGUlMjByYW5kb20lMjBib29sZWFuJTIwbWFzayUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9wYXRjaGVzKSUwQWJvb2xfbWFza2VkX3BvcyUyMCUzRCUyMHRvcmNoLnJhbmRpbnQobG93JTNEMCUyQyUyMGhpZ2glM0QyJTJDJTIwc2l6ZSUzRCgxJTJDJTIwbnVtX3BhdGNoZXMpKS5ib29sKCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzJTJDJTIwYm9vbF9tYXNrZWRfcG9zJTNEYm9vbF9tYXNrZWRfcG9zKSUwQWxvc3MlMkMlMjByZWNvbnN0cnVjdGVkX3BpeGVsX3ZhbHVlcyUyMCUzRCUyMG91dHB1dHMubG9zcyUyQyUyMG91dHB1dHMubG9naXRzJTBBbGlzdChyZWNvbnN0cnVjdGVkX3BpeGVsX3ZhbHVlcy5zaGFwZSk=",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"),y=l("Examples:"),p=u(),v(h.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);y=i(m,"Examples:"),m.forEach(o),p=g(a),w(h.$$.fragment,a)},m(a,m){_(a,c,m),e(c,y),_(a,p,m),M(h,a,m),b=!0},p:ao,i(a){b||(F(h.$$.fragment,a),b=!0)},o(a){N(h.$$.fragment,a),b=!1},d(a){a&&o(c),a&&o(p),$(h,a)}}}function Gs(T){let c,y,p,h,b;return{c(){c=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=s("code"),h=l("Module"),b=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);y=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n(m,"CODE",{});var j=r(p);h=i(j,"Module"),j.forEach(o),b=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,y),e(c,p),e(p,h),e(c,b)},d(a){a&&o(c)}}}function Rs(T){let c,y,p,h,b;return h=new so({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZvY2FsTmV0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZm9jYWxuZXQtdGlueSUyMiklMEFtb2RlbCUyMCUzRCUyMEZvY2FsTmV0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZm9jYWxuZXQtdGlueSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",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"),y=l("Example:"),p=u(),v(h.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);y=i(m,"Example:"),m.forEach(o),p=g(a),w(h.$$.fragment,a)},m(a,m){_(a,c,m),e(c,y),_(a,p,m),M(h,a,m),b=!0},p:ao,i(a){b||(F(h.$$.fragment,a),b=!0)},o(a){N(h.$$.fragment,a),b=!1},d(a){a&&o(c),a&&o(p),$(h,a)}}}function As(T){let c,y,p,h,b,a,m,j,no,Ut,G,q,it,pe,ro,ct,lo,Et,E,io,fe,co,mo,Se,ho,po,Pe,fo,uo,It,Be,go,Zt,Ve,dt,_o,Wt,Xe,bo,xt,Ye,ue,yo,Qe,vo,wo,zt,J,Mo,ge,Fo,No,_e,$o,To,Jt,R,O,mt,be,jo,ht,Co,Gt,k,ye,ko,A,Uo,qe,Eo,Io,ve,Zo,Wo,xo,S,zo,Oe,Jo,Go,De,Ro,Ao,So,D,Rt,P,H,pt,we,Po,ft,Bo,At,z,Me,Vo,Fe,Xo,Ne,Yo,Qo,qo,I,$e,Oo,B,Do,He,Ho,Lo,ut,Ko,ea,ta,L,oa,K,St,V,ee,gt,Te,aa,_t,sa,Pt,C,je,na,bt,ra,la,Ce,ia,ke,ca,da,ma,te,ha,Ue,pa,Ee,fa,ua,ga,Z,Ie,_a,X,ba,Le,ya,va,yt,wa,Ma,Fa,oe,Na,ae,Bt,Y,se,vt,Ze,$a,wt,Ta,Vt,U,We,ja,Mt,Ca,ka,xe,Ua,ze,Ea,Ia,Za,W,Je,Wa,Q,xa,Ke,za,Ja,Ft,Ga,Ra,Aa,ne,Sa,re,Xt;return a=new lt({}),pe=new lt({}),be=new lt({}),ye=new Ae({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.33.0/src/transformers/models/focalnet/configuration_focalnet.py#L29"}}),D=new oo({props:{anchor:"transformers.FocalNetConfig.example",$$slots:{default:[Is]},$$scope:{ctx:T}}}),we=new lt({}),Me=new Ae({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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/focalnet/modeling_focalnet.py#L696"}}),$e=new Ae({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.33.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.33.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.33.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.33.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>
`}}),L=new to({props:{$$slots:{default:[Zs]},$$scope:{ctx:T}}}),K=new oo({props:{anchor:"transformers.FocalNetModel.forward.example",$$slots:{default:[Ws]},$$scope:{ctx:T}}}),Te=new lt({}),je=new Ae({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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/focalnet/modeling_focalnet.py#L786"}}),te=new to({props:{$$slots:{default:[xs]},$$scope:{ctx:T}}}),Ie=new Ae({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.33.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.33.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.33.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.33.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:[zs]},$$scope:{ctx:T}}}),ae=new oo({props:{anchor:"transformers.FocalNetForMaskedImageModeling.forward.example",$$slots:{default:[Js]},$$scope:{ctx:T}}}),Ze=new lt({}),We=new Ae({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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/focalnet/modeling_focalnet.py#L894"}}),Je=new Ae({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.33.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.33.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.33.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.33.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:[Gs]},$$scope:{ctx:T}}}),re=new oo({props:{anchor:"transformers.FocalNetForImageClassification.forward.example",$$slots:{default:[Rs]},$$scope:{ctx:T}}}),{c(){c=s("meta"),y=u(),p=s("h1"),h=s("a"),b=s("span"),v(a.$$.fragment),m=u(),j=s("span"),no=l("FocalNet"),Ut=u(),G=s("h2"),q=s("a"),it=s("span"),v(pe.$$.fragment),ro=u(),ct=s("span"),lo=l("Overview"),Et=u(),E=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 `),Se=s("a"),ho=l("ViT"),po=l(" and "),Pe=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.`),It=u(),Be=s("p"),go=l("The abstract from the paper is the following:"),Zt=u(),Ve=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.`),Wt=u(),Xe=s("p"),bo=l("Tips:"),xt=u(),Ye=s("ul"),ue=s("li"),yo=l("One can use the "),Qe=s("a"),vo=l("AutoImageProcessor"),wo=l(" class to prepare images for the model."),zt=u(),J=s("p"),Mo=l("This model was contributed by "),ge=s("a"),Fo=l("nielsr"),No=l(`.
The original code can be found `),_e=s("a"),$o=l("here"),To=l("."),Jt=u(),R=s("h2"),O=s("a"),mt=s("span"),v(be.$$.fragment),jo=u(),ht=s("span"),Co=l("FocalNetConfig"),Gt=u(),k=s("div"),v(ye.$$.fragment),ko=u(),A=s("p"),Uo=l("This is the configuration class to store the configuration of a "),qe=s("a"),Eo=l("FocalNetModel"),Io=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
`),ve=s("a"),Zo=l("microsoft/focalnet-tiny"),Wo=l(" architecture."),xo=u(),S=s("p"),zo=l("Configuration objects inherit from "),Oe=s("a"),Jo=l("PretrainedConfig"),Go=l(` and can be used to control the model outputs. Read the
documentation from `),De=s("a"),Ro=l("PretrainedConfig"),Ao=l(" for more information."),So=u(),v(D.$$.fragment),Rt=u(),P=s("h2"),H=s("a"),pt=s("span"),v(we.$$.fragment),Po=u(),ft=s("span"),Bo=l("FocalNetModel"),At=u(),z=s("div"),v(Me.$$.fragment),Vo=u(),Fe=s("p"),Xo=l(`The bare FocalNet Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=s("a"),Yo=l("torch.nn.Module"),Qo=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.`),qo=u(),I=s("div"),v($e.$$.fragment),Oo=u(),B=s("p"),Do=l("The "),He=s("a"),Ho=l("FocalNetModel"),Lo=l(" forward method, overrides the "),ut=s("code"),Ko=l("__call__"),ea=l(" special method."),ta=u(),v(L.$$.fragment),oa=u(),v(K.$$.fragment),St=u(),V=s("h2"),ee=s("a"),gt=s("span"),v(Te.$$.fragment),aa=u(),_t=s("span"),sa=l("FocalNetForMaskedImageModeling"),Pt=u(),C=s("div"),v(je.$$.fragment),na=u(),bt=s("p"),ra=l("FocalNet Model with a decoder on top for masked image modeling."),la=u(),Ce=s("p"),ia=l("This follows the same implementation as in "),ke=s("a"),ca=l("SimMIM"),da=l("."),ma=u(),v(te.$$.fragment),ha=u(),Ue=s("p"),pa=l("This model is a PyTorch "),Ee=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(),Z=s("div"),v(Ie.$$.fragment),_a=u(),X=s("p"),ba=l("The "),Le=s("a"),ya=l("FocalNetForMaskedImageModeling"),va=l(" forward method, overrides the "),yt=s("code"),wa=l("__call__"),Ma=l(" special method."),Fa=u(),v(oe.$$.fragment),Na=u(),v(ae.$$.fragment),Bt=u(),Y=s("h2"),se=s("a"),vt=s("span"),v(Ze.$$.fragment),$a=u(),wt=s("span"),Ta=l("FocalNetForImageClassification"),Vt=u(),U=s("div"),v(We.$$.fragment),ja=u(),Mt=s("p"),Ca=l(`FocalNet Model with an image classification head on top (a linear layer on top of the pooled output) e.g. for
ImageNet.`),ka=u(),xe=s("p"),Ua=l("This model is a PyTorch "),ze=s("a"),Ea=l("torch.nn.Module"),Ia=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.`),Za=u(),W=s("div"),v(Je.$$.fragment),Wa=u(),Q=s("p"),xa=l("The "),Ke=s("a"),za=l("FocalNetForImageClassification"),Ja=l(" forward method, overrides the "),Ft=s("code"),Ga=l("__call__"),Ra=l(" special method."),Aa=u(),v(ne.$$.fragment),Sa=u(),v(re.$$.fragment),this.h()},l(t){const f=Us('[data-svelte="svelte-1phssyn"]',document.head);c=n(f,"META",{name:!0,content:!0}),f.forEach(o),y=g(t),p=n(t,"H1",{class:!0});var Ge=r(p);h=n(Ge,"A",{id:!0,class:!0,href:!0});var Nt=r(h);b=n(Nt,"SPAN",{});var $t=r(b);w(a.$$.fragment,$t),$t.forEach(o),Nt.forEach(o),m=g(Ge),j=n(Ge,"SPAN",{});var Tt=r(j);no=i(Tt,"FocalNet"),Tt.forEach(o),Ge.forEach(o),Ut=g(t),G=n(t,"H2",{class:!0});var Re=r(G);q=n(Re,"A",{id:!0,class:!0,href:!0});var jt=r(q);it=n(jt,"SPAN",{});var Ct=r(it);w(pe.$$.fragment,Ct),Ct.forEach(o),jt.forEach(o),ro=g(Re),ct=n(Re,"SPAN",{});var kt=r(ct);lo=i(kt,"Overview"),kt.forEach(o),Re.forEach(o),Et=g(t),E=n(t,"P",{});var le=r(E);io=i(le,"The FocalNet model was proposed in "),fe=n(le,"A",{href:!0,rel:!0});var Pa=r(fe);co=i(Pa,"Focal Modulation Networks"),Pa.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 `),Se=n(le,"A",{href:!0});var Ba=r(Se);ho=i(Ba,"ViT"),Ba.forEach(o),po=i(le," and "),Pe=n(le,"A",{href:!0});var Va=r(Pe);fo=i(Va,"Swin"),Va.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),It=g(t),Be=n(t,"P",{});var Xa=r(Be);go=i(Xa,"The abstract from the paper is the following:"),Xa.forEach(o),Zt=g(t),Ve=n(t,"P",{});var Ya=r(Ve);dt=n(Ya,"EM",{});var Qa=r(dt);_o=i(Qa,`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.`),Qa.forEach(o),Ya.forEach(o),Wt=g(t),Xe=n(t,"P",{});var qa=r(Xe);bo=i(qa,"Tips:"),qa.forEach(o),xt=g(t),Ye=n(t,"UL",{});var Oa=r(Ye);ue=n(Oa,"LI",{});var Yt=r(ue);yo=i(Yt,"One can use the "),Qe=n(Yt,"A",{href:!0});var Da=r(Qe);vo=i(Da,"AutoImageProcessor"),Da.forEach(o),wo=i(Yt," class to prepare images for the model."),Yt.forEach(o),Oa.forEach(o),zt=g(t),J=n(t,"P",{});var et=r(J);Mo=i(et,"This model was contributed by "),ge=n(et,"A",{href:!0,rel:!0});var Ha=r(ge);Fo=i(Ha,"nielsr"),Ha.forEach(o),No=i(et,`.
The original code can be found `),_e=n(et,"A",{href:!0,rel:!0});var La=r(_e);$o=i(La,"here"),La.forEach(o),To=i(et,"."),et.forEach(o),Jt=g(t),R=n(t,"H2",{class:!0});var Qt=r(R);O=n(Qt,"A",{id:!0,class:!0,href:!0});var Ka=r(O);mt=n(Ka,"SPAN",{});var es=r(mt);w(be.$$.fragment,es),es.forEach(o),Ka.forEach(o),jo=g(Qt),ht=n(Qt,"SPAN",{});var ts=r(ht);Co=i(ts,"FocalNetConfig"),ts.forEach(o),Qt.forEach(o),Gt=g(t),k=n(t,"DIV",{class:!0});var ie=r(k);w(ye.$$.fragment,ie),ko=g(ie),A=n(ie,"P",{});var tt=r(A);Uo=i(tt,"This is the configuration class to store the configuration of a "),qe=n(tt,"A",{href:!0});var os=r(qe);Eo=i(os,"FocalNetModel"),os.forEach(o),Io=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
`),ve=n(tt,"A",{href:!0,rel:!0});var as=r(ve);Zo=i(as,"microsoft/focalnet-tiny"),as.forEach(o),Wo=i(tt," architecture."),tt.forEach(o),xo=g(ie),S=n(ie,"P",{});var ot=r(S);zo=i(ot,"Configuration objects inherit from "),Oe=n(ot,"A",{href:!0});var ss=r(Oe);Jo=i(ss,"PretrainedConfig"),ss.forEach(o),Go=i(ot,` and can be used to control the model outputs. Read the
documentation from `),De=n(ot,"A",{href:!0});var ns=r(De);Ro=i(ns,"PretrainedConfig"),ns.forEach(o),Ao=i(ot," for more information."),ot.forEach(o),So=g(ie),w(D.$$.fragment,ie),ie.forEach(o),Rt=g(t),P=n(t,"H2",{class:!0});var qt=r(P);H=n(qt,"A",{id:!0,class:!0,href:!0});var rs=r(H);pt=n(rs,"SPAN",{});var ls=r(pt);w(we.$$.fragment,ls),ls.forEach(o),rs.forEach(o),Po=g(qt),ft=n(qt,"SPAN",{});var is=r(ft);Bo=i(is,"FocalNetModel"),is.forEach(o),qt.forEach(o),At=g(t),z=n(t,"DIV",{class:!0});var at=r(z);w(Me.$$.fragment,at),Vo=g(at),Fe=n(at,"P",{});var Ot=r(Fe);Xo=i(Ot,`The bare FocalNet Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=n(Ot,"A",{href:!0,rel:!0});var cs=r(Ne);Yo=i(cs,"torch.nn.Module"),cs.forEach(o),Qo=i(Ot,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ot.forEach(o),qo=g(at),I=n(at,"DIV",{class:!0});var ce=r(I);w($e.$$.fragment,ce),Oo=g(ce),B=n(ce,"P",{});var st=r(B);Do=i(st,"The "),He=n(st,"A",{href:!0});var ds=r(He);Ho=i(ds,"FocalNetModel"),ds.forEach(o),Lo=i(st," forward method, overrides the "),ut=n(st,"CODE",{});var ms=r(ut);Ko=i(ms,"__call__"),ms.forEach(o),ea=i(st," special method."),st.forEach(o),ta=g(ce),w(L.$$.fragment,ce),oa=g(ce),w(K.$$.fragment,ce),ce.forEach(o),at.forEach(o),St=g(t),V=n(t,"H2",{class:!0});var Dt=r(V);ee=n(Dt,"A",{id:!0,class:!0,href:!0});var hs=r(ee);gt=n(hs,"SPAN",{});var ps=r(gt);w(Te.$$.fragment,ps),ps.forEach(o),hs.forEach(o),aa=g(Dt),_t=n(Dt,"SPAN",{});var fs=r(_t);sa=i(fs,"FocalNetForMaskedImageModeling"),fs.forEach(o),Dt.forEach(o),Pt=g(t),C=n(t,"DIV",{class:!0});var x=r(C);w(je.$$.fragment,x),na=g(x),bt=n(x,"P",{});var us=r(bt);ra=i(us,"FocalNet Model with a decoder on top for masked image modeling."),us.forEach(o),la=g(x),Ce=n(x,"P",{});var Ht=r(Ce);ia=i(Ht,"This follows the same implementation as in "),ke=n(Ht,"A",{href:!0,rel:!0});var gs=r(ke);ca=i(gs,"SimMIM"),gs.forEach(o),da=i(Ht,"."),Ht.forEach(o),ma=g(x),w(te.$$.fragment,x),ha=g(x),Ue=n(x,"P",{});var Lt=r(Ue);pa=i(Lt,"This model is a PyTorch "),Ee=n(Lt,"A",{href:!0,rel:!0});var _s=r(Ee);fa=i(_s,"torch.nn.Module"),_s.forEach(o),ua=i(Lt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Lt.forEach(o),ga=g(x),Z=n(x,"DIV",{class:!0});var de=r(Z);w(Ie.$$.fragment,de),_a=g(de),X=n(de,"P",{});var nt=r(X);ba=i(nt,"The "),Le=n(nt,"A",{href:!0});var bs=r(Le);ya=i(bs,"FocalNetForMaskedImageModeling"),bs.forEach(o),va=i(nt," forward method, overrides the "),yt=n(nt,"CODE",{});var ys=r(yt);wa=i(ys,"__call__"),ys.forEach(o),Ma=i(nt," special method."),nt.forEach(o),Fa=g(de),w(oe.$$.fragment,de),Na=g(de),w(ae.$$.fragment,de),de.forEach(o),x.forEach(o),Bt=g(t),Y=n(t,"H2",{class:!0});var Kt=r(Y);se=n(Kt,"A",{id:!0,class:!0,href:!0});var vs=r(se);vt=n(vs,"SPAN",{});var ws=r(vt);w(Ze.$$.fragment,ws),ws.forEach(o),vs.forEach(o),$a=g(Kt),wt=n(Kt,"SPAN",{});var Ms=r(wt);Ta=i(Ms,"FocalNetForImageClassification"),Ms.forEach(o),Kt.forEach(o),Vt=g(t),U=n(t,"DIV",{class:!0});var me=r(U);w(We.$$.fragment,me),ja=g(me),Mt=n(me,"P",{});var Fs=r(Mt);Ca=i(Fs,`FocalNet Model with an image classification head on top (a linear layer on top of the pooled output) e.g. for
ImageNet.`),Fs.forEach(o),ka=g(me),xe=n(me,"P",{});var eo=r(xe);Ua=i(eo,"This model is a PyTorch "),ze=n(eo,"A",{href:!0,rel:!0});var Ns=r(ze);Ea=i(Ns,"torch.nn.Module"),Ns.forEach(o),Ia=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),Za=g(me),W=n(me,"DIV",{class:!0});var he=r(W);w(Je.$$.fragment,he),Wa=g(he),Q=n(he,"P",{});var rt=r(Q);xa=i(rt,"The "),Ke=n(rt,"A",{href:!0});var $s=r(Ke);za=i($s,"FocalNetForImageClassification"),$s.forEach(o),Ja=i(rt," forward method, overrides the "),Ft=n(rt,"CODE",{});var Ts=r(Ft);Ga=i(Ts,"__call__"),Ts.forEach(o),Ra=i(rt," special method."),rt.forEach(o),Aa=g(he),w(ne.$$.fragment,he),Sa=g(he),w(re.$$.fragment,he),he.forEach(o),me.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Ss)),d(h,"id","focalnet"),d(h,"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(h,"href","#focalnet"),d(p,"class","relative group"),d(q,"id","overview"),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","#overview"),d(G,"class","relative group"),d(fe,"href","https://arxiv.org/abs/2203.11926"),d(fe,"rel","nofollow"),d(Se,"href","vit"),d(Pe,"href","swin"),d(Qe,"href","/docs/transformers/v4.33.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(O,"id","transformers.FocalNetConfig"),d(O,"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(O,"href","#transformers.FocalNetConfig"),d(R,"class","relative group"),d(qe,"href","/docs/transformers/v4.33.0/en/model_doc/focalnet#transformers.FocalNetModel"),d(ve,"href","https://huggingface.co/microsoft/focalnet-tiny"),d(ve,"rel","nofollow"),d(Oe,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(De,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(H,"id","transformers.FocalNetModel"),d(H,"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(H,"href","#transformers.FocalNetModel"),d(P,"class","relative group"),d(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ne,"rel","nofollow"),d(He,"href","/docs/transformers/v4.33.0/en/model_doc/focalnet#transformers.FocalNetModel"),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(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(V,"class","relative group"),d(ke,"href","https://arxiv.org/abs/2111.09886"),d(ke,"rel","nofollow"),d(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ee,"rel","nofollow"),d(Le,"href","/docs/transformers/v4.33.0/en/model_doc/focalnet#transformers.FocalNetForMaskedImageModeling"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(Y,"class","relative group"),d(ze,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ze,"rel","nofollow"),d(Ke,"href","/docs/transformers/v4.33.0/en/model_doc/focalnet#transformers.FocalNetForImageClassification"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"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,y,f),_(t,p,f),e(p,h),e(h,b),M(a,b,null),e(p,m),e(p,j),e(j,no),_(t,Ut,f),_(t,G,f),e(G,q),e(q,it),M(pe,it,null),e(G,ro),e(G,ct),e(ct,lo),_(t,Et,f),_(t,E,f),e(E,io),e(E,fe),e(fe,co),e(E,mo),e(E,Se),e(Se,ho),e(E,po),e(E,Pe),e(Pe,fo),e(E,uo),_(t,It,f),_(t,Be,f),e(Be,go),_(t,Zt,f),_(t,Ve,f),e(Ve,dt),e(dt,_o),_(t,Wt,f),_(t,Xe,f),e(Xe,bo),_(t,xt,f),_(t,Ye,f),e(Ye,ue),e(ue,yo),e(ue,Qe),e(Qe,vo),e(ue,wo),_(t,zt,f),_(t,J,f),e(J,Mo),e(J,ge),e(ge,Fo),e(J,No),e(J,_e),e(_e,$o),e(J,To),_(t,Jt,f),_(t,R,f),e(R,O),e(O,mt),M(be,mt,null),e(R,jo),e(R,ht),e(ht,Co),_(t,Gt,f),_(t,k,f),M(ye,k,null),e(k,ko),e(k,A),e(A,Uo),e(A,qe),e(qe,Eo),e(A,Io),e(A,ve),e(ve,Zo),e(A,Wo),e(k,xo),e(k,S),e(S,zo),e(S,Oe),e(Oe,Jo),e(S,Go),e(S,De),e(De,Ro),e(S,Ao),e(k,So),M(D,k,null),_(t,Rt,f),_(t,P,f),e(P,H),e(H,pt),M(we,pt,null),e(P,Po),e(P,ft),e(ft,Bo),_(t,At,f),_(t,z,f),M(Me,z,null),e(z,Vo),e(z,Fe),e(Fe,Xo),e(Fe,Ne),e(Ne,Yo),e(Fe,Qo),e(z,qo),e(z,I),M($e,I,null),e(I,Oo),e(I,B),e(B,Do),e(B,He),e(He,Ho),e(B,Lo),e(B,ut),e(ut,Ko),e(B,ea),e(I,ta),M(L,I,null),e(I,oa),M(K,I,null),_(t,St,f),_(t,V,f),e(V,ee),e(ee,gt),M(Te,gt,null),e(V,aa),e(V,_t),e(_t,sa),_(t,Pt,f),_(t,C,f),M(je,C,null),e(C,na),e(C,bt),e(bt,ra),e(C,la),e(C,Ce),e(Ce,ia),e(Ce,ke),e(ke,ca),e(Ce,da),e(C,ma),M(te,C,null),e(C,ha),e(C,Ue),e(Ue,pa),e(Ue,Ee),e(Ee,fa),e(Ue,ua),e(C,ga),e(C,Z),M(Ie,Z,null),e(Z,_a),e(Z,X),e(X,ba),e(X,Le),e(Le,ya),e(X,va),e(X,yt),e(yt,wa),e(X,Ma),e(Z,Fa),M(oe,Z,null),e(Z,Na),M(ae,Z,null),_(t,Bt,f),_(t,Y,f),e(Y,se),e(se,vt),M(Ze,vt,null),e(Y,$a),e(Y,wt),e(wt,Ta),_(t,Vt,f),_(t,U,f),M(We,U,null),e(U,ja),e(U,Mt),e(Mt,Ca),e(U,ka),e(U,xe),e(xe,Ua),e(xe,ze),e(ze,Ea),e(xe,Ia),e(U,Za),e(U,W),M(Je,W,null),e(W,Wa),e(W,Q),e(Q,xa),e(Q,Ke),e(Ke,za),e(Q,Ja),e(Q,Ft),e(Ft,Ga),e(Q,Ra),e(W,Aa),M(ne,W,null),e(W,Sa),M(re,W,null),Xt=!0},p(t,[f]){const Ge={};f&2&&(Ge.$$scope={dirty:f,ctx:t}),D.$set(Ge);const Nt={};f&2&&(Nt.$$scope={dirty:f,ctx:t}),L.$set(Nt);const $t={};f&2&&($t.$$scope={dirty:f,ctx:t}),K.$set($t);const Tt={};f&2&&(Tt.$$scope={dirty:f,ctx:t}),te.$set(Tt);const Re={};f&2&&(Re.$$scope={dirty:f,ctx:t}),oe.$set(Re);const jt={};f&2&&(jt.$$scope={dirty:f,ctx:t}),ae.$set(jt);const Ct={};f&2&&(Ct.$$scope={dirty:f,ctx:t}),ne.$set(Ct);const kt={};f&2&&(kt.$$scope={dirty:f,ctx:t}),re.$set(kt)},i(t){Xt||(F(a.$$.fragment,t),F(pe.$$.fragment,t),F(be.$$.fragment,t),F(ye.$$.fragment,t),F(D.$$.fragment,t),F(we.$$.fragment,t),F(Me.$$.fragment,t),F($e.$$.fragment,t),F(L.$$.fragment,t),F(K.$$.fragment,t),F(Te.$$.fragment,t),F(je.$$.fragment,t),F(te.$$.fragment,t),F(Ie.$$.fragment,t),F(oe.$$.fragment,t),F(ae.$$.fragment,t),F(Ze.$$.fragment,t),F(We.$$.fragment,t),F(Je.$$.fragment,t),F(ne.$$.fragment,t),F(re.$$.fragment,t),Xt=!0)},o(t){N(a.$$.fragment,t),N(pe.$$.fragment,t),N(be.$$.fragment,t),N(ye.$$.fragment,t),N(D.$$.fragment,t),N(we.$$.fragment,t),N(Me.$$.fragment,t),N($e.$$.fragment,t),N(L.$$.fragment,t),N(K.$$.fragment,t),N(Te.$$.fragment,t),N(je.$$.fragment,t),N(te.$$.fragment,t),N(Ie.$$.fragment,t),N(oe.$$.fragment,t),N(ae.$$.fragment,t),N(Ze.$$.fragment,t),N(We.$$.fragment,t),N(Je.$$.fragment,t),N(ne.$$.fragment,t),N(re.$$.fragment,t),Xt=!1},d(t){o(c),t&&o(y),t&&o(p),$(a),t&&o(Ut),t&&o(G),$(pe),t&&o(Et),t&&o(E),t&&o(It),t&&o(Be),t&&o(Zt),t&&o(Ve),t&&o(Wt),t&&o(Xe),t&&o(xt),t&&o(Ye),t&&o(zt),t&&o(J),t&&o(Jt),t&&o(R),$(be),t&&o(Gt),t&&o(k),$(ye),$(D),t&&o(Rt),t&&o(P),$(we),t&&o(At),t&&o(z),$(Me),$($e),$(L),$(K),t&&o(St),t&&o(V),$(Te),t&&o(Pt),t&&o(C),$(je),$(te),$(Ie),$(oe),$(ae),t&&o(Bt),t&&o(Y),$(Ze),t&&o(Vt),t&&o(U),$(We),$(Je),$(ne),$(re)}}}const Ss={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 Ps(T){return Es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Os extends js{constructor(c){super();Cs(this,c,Ps,As,ks,{})}}export{Os as default,Ss as metadata};
