import{s as Et,f as Vt,o as Ht,n as Pe}from"../chunks/scheduler.25b97de1.js";import{S as Lt,i as Bt,g as p,s,r as u,A as Gt,h as g,f as n,c as a,j as H,u as _,x as w,k,y as c,a as m,v as b,d as T,t as $,w as y}from"../chunks/index.d9030fc9.js";import{T as bt}from"../chunks/Tip.baa67368.js";import{D as G}from"../chunks/Docstring.e257edda.js";import{C as pt}from"../chunks/CodeBlock.e6cd0d95.js";import{F as qt,M as Rt}from"../chunks/Markdown.7217f838.js";import{E as ct}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as Xt}from"../chunks/PipelineTag.5f100392.js";import{H as xe,E as Yt}from"../chunks/EditOnGithub.91d95064.js";function Dt(x){let t,h="Example:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlZ2Zvcm1lck1vZGVsJTJDJTIwU2VnZm9ybWVyQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFNlZ0Zvcm1lciUyMG52aWRpYSUyRnNlZ2Zvcm1lci1iMC1maW5ldHVuZWQtYWRlLTUxMi01MTIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU2VnZm9ybWVyQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbnZpZGlhJTJGc2VnZm9ybWVyLWIwLWZpbmV0dW5lZC1hZGUtNTEyLTUxMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwU2VnZm9ybWVyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerModel, SegformerConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SegFormer nvidia/segformer-b0-finetuned-ade-512-512 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SegformerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the nvidia/segformer-b0-finetuned-ade-512-512 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegformerModel(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`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function At(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function Qt(x){let t,h="Example:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNlZ2Zvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBTZWdmb3JtZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbWl0LWIwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SegformerModel
<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>, trust_remote_code=<span class="hljs-literal">True</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;nvidia/mit-b0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegformerModel.from_pretrained(<span class="hljs-string">&quot;nvidia/mit-b0&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">256</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function Ot(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function Kt(x){let t,h="Example:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNlZ2Zvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm1pdC1iMCUyMiklMEFtb2RlbCUyMCUzRCUyMFNlZ2Zvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm1pdC1iMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SegformerForImageClassification
<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>, trust_remote_code=<span class="hljs-literal">True</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;nvidia/mit-b0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegformerForImageClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/mit-b0&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`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function eo(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function to(x){let t,h="Examples:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNlZ2Zvcm1lckZvclNlbWFudGljU2VnbWVudGF0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRnNlZ2Zvcm1lci1iMC1maW5ldHVuZWQtYWRlLTUxMi01MTIlMjIpJTBBbW9kZWwlMjAlM0QlMjBTZWdmb3JtZXJGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGc2VnZm9ybWVyLWIwLWZpbmV0dW5lZC1hZGUtNTEyLTUxMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMjAlMjAlMjMlMjBzaGFwZSUyMChiYXRjaF9zaXplJTJDJTIwbnVtX2xhYmVscyUyQyUyMGhlaWdodCUyRjQlMkMlMjB3aWR0aCUyRjQpJTBBbGlzdChsb2dpdHMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SegformerForSemanticSegmentation
<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>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/segformer-b0-finetuned-ade-512-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegformerForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;nvidia/segformer-b0-finetuned-ade-512-512&quot;</span>)

<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>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits  <span class="hljs-comment"># shape (batch_size, num_labels, height/4, width/4)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">150</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function oo(x){let t,h,r,l,v,o,M=`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,We,I,_e,q,X,De='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerModel">SegformerModel</a> forward method, overrides the <code>__call__</code> special method.',be,O,Xe,Q,Te,Ce,Y,R,je,$e,de,Ie,oe,K,re,U,ne,ze,j,ke=`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`,Re,A,Ke=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Ee,J,ye,ve,ge,Ye='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForImageClassification">SegformerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',we,N,ee,Me,fe,se,Le,E,te,Se,he,ae=`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Be,C,B,Ve,Z,Ue='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',Ge,D,Ae,ue,L;return t=new xe({props:{title:"SegformerModel",local:"transformers.SegformerModel",headingTag:"h2"}}),l=new G({props:{name:"class transformers.SegformerModel",anchor:"transformers.SegformerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/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/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L500"}}),_e=new G({props:{name:"forward",anchor:"transformers.SegformerModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegformerModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerModel.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.SegformerModel.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/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L523",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new bt({props:{$$slots:{default:[At]},$$scope:{ctx:x}}}),Q=new ct({props:{anchor:"transformers.SegformerModel.forward.example",$$slots:{default:[Qt]},$$scope:{ctx:x}}}),Ce=new xe({props:{title:"SegformerDecodeHead",local:"transformers.SegformerDecodeHead",headingTag:"h2"}}),je=new G({props:{name:"class transformers.SegformerDecodeHead",anchor:"transformers.SegformerDecodeHead",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L675"}}),Ie=new G({props:{name:"forward",anchor:"transformers.SegformerDecodeHead.forward",parameters:[{name:"encoder_hidden_states",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L700"}}),K=new xe({props:{title:"SegformerForImageClassification",local:"transformers.SegformerForImageClassification",headingTag:"h2"}}),ne=new G({props:{name:"class transformers.SegformerForImageClassification",anchor:"transformers.SegformerForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/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/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L562"}}),ye=new G({props:{name:"forward",anchor:"transformers.SegformerForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegformerForImageClassification.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerForImageClassification.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.SegformerForImageClassification.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/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegformerForImageClassification.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/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L582",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.segformer.modeling_segformer.SegFormerImageClassifierOutput</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/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</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) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.segformer.modeling_segformer.SegFormerImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),N=new bt({props:{$$slots:{default:[Ot]},$$scope:{ctx:x}}}),Me=new ct({props:{anchor:"transformers.SegformerForImageClassification.forward.example",$$slots:{default:[Kt]},$$scope:{ctx:x}}}),se=new xe({props:{title:"SegformerForSemanticSegmentation",local:"transformers.SegformerForSemanticSegmentation",headingTag:"h2"}}),te=new G({props:{name:"class transformers.SegformerForSemanticSegmentation",anchor:"transformers.SegformerForSemanticSegmentation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/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/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L733"}}),B=new G({props:{name:"forward",anchor:"transformers.SegformerForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegformerForSemanticSegmentation.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerForSemanticSegmentation.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.SegformerForSemanticSegmentation.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/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_segformer.py#L746",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</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) — 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, logits_height, logits_width)</code>) — Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new bt({props:{$$slots:{default:[eo]},$$scope:{ctx:x}}}),ue=new ct({props:{anchor:"transformers.SegformerForSemanticSegmentation.forward.example",$$slots:{default:[to]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=p("div"),u(l.$$.fragment),v=s(),o=p("p"),o.innerHTML=M,We=s(),I=p("div"),u(_e.$$.fragment),q=s(),X=p("p"),X.innerHTML=De,be=s(),u(O.$$.fragment),Xe=s(),u(Q.$$.fragment),Te=s(),u(Ce.$$.fragment),Y=s(),R=p("div"),u(je.$$.fragment),$e=s(),de=p("div"),u(Ie.$$.fragment),oe=s(),u(K.$$.fragment),re=s(),U=p("div"),u(ne.$$.fragment),ze=s(),j=p("p"),j.textContent=ke,Re=s(),A=p("p"),A.innerHTML=Ke,Ee=s(),J=p("div"),u(ye.$$.fragment),ve=s(),ge=p("p"),ge.innerHTML=Ye,we=s(),u(N.$$.fragment),ee=s(),u(Me.$$.fragment),fe=s(),u(se.$$.fragment),Le=s(),E=p("div"),u(te.$$.fragment),Se=s(),he=p("p"),he.innerHTML=ae,Be=s(),C=p("div"),u(B.$$.fragment),Ve=s(),Z=p("p"),Z.innerHTML=Ue,Ge=s(),u(D.$$.fragment),Ae=s(),u(ue.$$.fragment),this.h()},l(i){_(t.$$.fragment,i),h=a(i),r=g(i,"DIV",{class:!0});var S=H(r);_(l.$$.fragment,S),v=a(S),o=g(S,"P",{"data-svelte-h":!0}),w(o)!=="svelte-1eq9zl9"&&(o.innerHTML=M),We=a(S),I=g(S,"DIV",{class:!0});var W=H(I);_(_e.$$.fragment,W),q=a(W),X=g(W,"P",{"data-svelte-h":!0}),w(X)!=="svelte-lkt6tl"&&(X.innerHTML=De),be=a(W),_(O.$$.fragment,W),Xe=a(W),_(Q.$$.fragment,W),W.forEach(n),S.forEach(n),Te=a(i),_(Ce.$$.fragment,i),Y=a(i),R=g(i,"DIV",{class:!0});var Fe=H(R);_(je.$$.fragment,Fe),$e=a(Fe),de=g(Fe,"DIV",{class:!0});var me=H(de);_(Ie.$$.fragment,me),me.forEach(n),Fe.forEach(n),oe=a(i),_(K.$$.fragment,i),re=a(i),U=g(i,"DIV",{class:!0});var V=H(U);_(ne.$$.fragment,V),ze=a(V),j=g(V,"P",{"data-svelte-h":!0}),w(j)!=="svelte-m32qg1"&&(j.textContent=ke),Re=a(V),A=g(V,"P",{"data-svelte-h":!0}),w(A)!=="svelte-68lg8f"&&(A.innerHTML=Ke),Ee=a(V),J=g(V,"DIV",{class:!0});var z=H(J);_(ye.$$.fragment,z),ve=a(z),ge=g(z,"P",{"data-svelte-h":!0}),w(ge)!=="svelte-4f985r"&&(ge.innerHTML=Ye),we=a(z),_(N.$$.fragment,z),ee=a(z),_(Me.$$.fragment,z),z.forEach(n),V.forEach(n),fe=a(i),_(se.$$.fragment,i),Le=a(i),E=g(i,"DIV",{class:!0});var P=H(E);_(te.$$.fragment,P),Se=a(P),he=g(P,"P",{"data-svelte-h":!0}),w(he)!=="svelte-x9btf5"&&(he.innerHTML=ae),Be=a(P),C=g(P,"DIV",{class:!0});var ce=H(C);_(B.$$.fragment,ce),Ve=a(ce),Z=g(ce,"P",{"data-svelte-h":!0}),w(Z)!=="svelte-12r3lj9"&&(Z.innerHTML=Ue),Ge=a(ce),_(D.$$.fragment,ce),Ae=a(ce),_(ue.$$.fragment,ce),ce.forEach(n),P.forEach(n),this.h()},h(){k(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,S){b(t,i,S),m(i,h,S),m(i,r,S),b(l,r,null),c(r,v),c(r,o),c(r,We),c(r,I),b(_e,I,null),c(I,q),c(I,X),c(I,be),b(O,I,null),c(I,Xe),b(Q,I,null),m(i,Te,S),b(Ce,i,S),m(i,Y,S),m(i,R,S),b(je,R,null),c(R,$e),c(R,de),b(Ie,de,null),m(i,oe,S),b(K,i,S),m(i,re,S),m(i,U,S),b(ne,U,null),c(U,ze),c(U,j),c(U,Re),c(U,A),c(U,Ee),c(U,J),b(ye,J,null),c(J,ve),c(J,ge),c(J,we),b(N,J,null),c(J,ee),b(Me,J,null),m(i,fe,S),b(se,i,S),m(i,Le,S),m(i,E,S),b(te,E,null),c(E,Se),c(E,he),c(E,Be),c(E,C),b(B,C,null),c(C,Ve),c(C,Z),c(C,Ge),b(D,C,null),c(C,Ae),b(ue,C,null),L=!0},p(i,S){const W={};S&2&&(W.$$scope={dirty:S,ctx:i}),O.$set(W);const Fe={};S&2&&(Fe.$$scope={dirty:S,ctx:i}),Q.$set(Fe);const me={};S&2&&(me.$$scope={dirty:S,ctx:i}),N.$set(me);const V={};S&2&&(V.$$scope={dirty:S,ctx:i}),Me.$set(V);const z={};S&2&&(z.$$scope={dirty:S,ctx:i}),D.$set(z);const P={};S&2&&(P.$$scope={dirty:S,ctx:i}),ue.$set(P)},i(i){L||(T(t.$$.fragment,i),T(l.$$.fragment,i),T(_e.$$.fragment,i),T(O.$$.fragment,i),T(Q.$$.fragment,i),T(Ce.$$.fragment,i),T(je.$$.fragment,i),T(Ie.$$.fragment,i),T(K.$$.fragment,i),T(ne.$$.fragment,i),T(ye.$$.fragment,i),T(N.$$.fragment,i),T(Me.$$.fragment,i),T(se.$$.fragment,i),T(te.$$.fragment,i),T(B.$$.fragment,i),T(D.$$.fragment,i),T(ue.$$.fragment,i),L=!0)},o(i){$(t.$$.fragment,i),$(l.$$.fragment,i),$(_e.$$.fragment,i),$(O.$$.fragment,i),$(Q.$$.fragment,i),$(Ce.$$.fragment,i),$(je.$$.fragment,i),$(Ie.$$.fragment,i),$(K.$$.fragment,i),$(ne.$$.fragment,i),$(ye.$$.fragment,i),$(N.$$.fragment,i),$(Me.$$.fragment,i),$(se.$$.fragment,i),$(te.$$.fragment,i),$(B.$$.fragment,i),$(D.$$.fragment,i),$(ue.$$.fragment,i),L=!1},d(i){i&&(n(h),n(r),n(Te),n(Y),n(R),n(oe),n(re),n(U),n(fe),n(Le),n(E)),y(t,i),y(l),y(_e),y(O),y(Q),y(Ce,i),y(je),y(Ie),y(K,i),y(ne),y(ye),y(N),y(Me),y(se,i),y(te),y(B),y(D),y(ue)}}}function ro(x){let t,h;return t=new Rt({props:{$$slots:{default:[oo]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,l){b(t,r,l),h=!0},p(r,l){const v={};l&2&&(v.$$scope={dirty:l,ctx:r}),t.$set(v)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){$(t.$$.fragment,r),h=!1},d(r){y(t,r)}}}function no(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function so(x){let t,h="Example:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU2VnZm9ybWVyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlNlZ2Zvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSegformerModel
<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>, trust_remote_code=<span class="hljs-literal">True</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;nvidia/mit-b0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSegformerModel.from_pretrained(<span class="hljs-string">&quot;nvidia/mit-b0&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">256</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function ao(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function lo(x){let t,h="Example:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU2VnZm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbWl0LWIwJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZTZWdmb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSegformerForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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>, trust_remote_code=<span class="hljs-literal">True</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;nvidia/mit-b0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSegformerForImageClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/mit-b0&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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 = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function io(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,l){m(r,t,l)},p:Pe,d(r){r&&n(t)}}}function mo(x){let t,h="Examples:",r,l,v;return l=new pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU2VnZm9ybWVyRm9yU2VtYW50aWNTZWdtZW50YXRpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRnNlZ2Zvcm1lci1iMC1maW5ldHVuZWQtYWRlLTUxMi01MTIlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlNlZ2Zvcm1lckZvclNlbWFudGljU2VnbWVudGF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZzZWdmb3JtZXItYjAtZmluZXR1bmVkLWFkZS01MTItNTEyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwdHJhaW5pbmclM0RGYWxzZSklMEElMjMlMjBsb2dpdHMlMjBhcmUlMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fbGFiZWxzJTJDJTIwaGVpZ2h0JTJGNCUyQyUyMHdpZHRoJTJGNCklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxpc3QobG9naXRzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSegformerForSemanticSegmentation
<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;nvidia/segformer-b0-finetuned-ade-512-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSegformerForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;nvidia/segformer-b0-finetuned-ade-512-512&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, training=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height/4, width/4)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">150</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=h,r=s(),u(l.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=h),r=a(o),_(l.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(l,o,M),v=!0},p:Pe,i(o){v||(T(l.$$.fragment,o),v=!0)},o(o){$(l.$$.fragment,o),v=!1},d(o){o&&(n(t),n(r)),y(l,o)}}}function co(x){let t,h,r,l,v,o,M,We,I,_e,q,X,De,be,O=`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Xe,Q,Te=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Ce,Y,R,je,$e,de='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.TFSegformerModel">TFSegformerModel</a> forward method, overrides the <code>__call__</code> special method.',Ie,oe,K,re,U,ne,ze,j,ke,Re,A,Ke=`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`,Ee,J,ye=`This model inherits from <a href="/docs/transformers/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ve,ge,Ye=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,we,N,ee,Me,fe,se='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.TFSegformerForImageClassification">TFSegformerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Le,E,te,Se,he,ae,Be,C,B,Ve,Z,Ue=`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model inherits from <a href="/docs/transformers/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ge,D,Ae=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,ue,L,i,S,W,Fe='The <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation">TFSegformerForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',me,V,z,P,ce;return t=new xe({props:{title:"TFSegformerDecodeHead",local:"transformers.TFSegformerDecodeHead",headingTag:"h2"}}),l=new G({props:{name:"class transformers.TFSegformerDecodeHead",anchor:"transformers.TFSegformerDecodeHead",parameters:[{name:"config",val:": SegformerConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L842"}}),M=new G({props:{name:"call",anchor:"transformers.TFSegformerDecodeHead.call",parameters:[{name:"encoder_hidden_states",val:": tf.Tensor"},{name:"training",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L864"}}),I=new xe({props:{title:"TFSegformerModel",local:"transformers.TFSegformerModel",headingTag:"h2"}}),X=new G({props:{name:"class transformers.TFSegformerModel",anchor:"transformers.TFSegformerModel",parameters:[{name:"config",val:": SegformerConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSegformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L693"}}),R=new G({props:{name:"call",anchor:"transformers.TFSegformerModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFSegformerModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L705",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</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/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oe=new bt({props:{$$slots:{default:[no]},$$scope:{ctx:x}}}),re=new ct({props:{anchor:"transformers.TFSegformerModel.call.example",$$slots:{default:[so]},$$scope:{ctx:x}}}),ne=new xe({props:{title:"TFSegformerForImageClassification",local:"transformers.TFSegformerForImageClassification",headingTag:"h2"}}),ke=new G({props:{name:"class transformers.TFSegformerForImageClassification",anchor:"transformers.TFSegformerForImageClassification",parameters:[{name:"config",val:": SegformerConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSegformerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L740"}}),ee=new G({props:{name:"call",anchor:"transformers.TFSegformerForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFSegformerForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerForImageClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerForImageClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L758",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</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/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31031/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),E=new bt({props:{$$slots:{default:[ao]},$$scope:{ctx:x}}}),Se=new ct({props:{anchor:"transformers.TFSegformerForImageClassification.call.example",$$slots:{default:[lo]},$$scope:{ctx:x}}}),ae=new xe({props:{title:"TFSegformerForSemanticSegmentation",local:"transformers.TFSegformerForSemanticSegmentation",headingTag:"h2"}}),B=new G({props:{name:"class transformers.TFSegformerForSemanticSegmentation",anchor:"transformers.TFSegformerForSemanticSegmentation",parameters:[{name:"config",val:": SegformerConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSegformerForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</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/pr_31031/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L917"}}),i=new G({props:{name:"call",anchor:"transformers.TFSegformerForSemanticSegmentation.call",parameters:[{name:"pixel_values",val:": tf.Tensor"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFSegformerForSemanticSegmentation.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_31031/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_31031/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a (per-pixel) classification loss is computed
(Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/modeling_tf_segformer.py#L947",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutput</code> or a tuple of <code>tf.Tensor</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/pr_31031/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) — Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),V=new bt({props:{$$slots:{default:[io]},$$scope:{ctx:x}}}),P=new ct({props:{anchor:"transformers.TFSegformerForSemanticSegmentation.call.example",$$slots:{default:[mo]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=p("div"),u(l.$$.fragment),v=s(),o=p("div"),u(M.$$.fragment),We=s(),u(I.$$.fragment),_e=s(),q=p("div"),u(X.$$.fragment),De=s(),be=p("p"),be.innerHTML=O,Xe=s(),Q=p("p"),Q.innerHTML=Te,Ce=s(),Y=p("div"),u(R.$$.fragment),je=s(),$e=p("p"),$e.innerHTML=de,Ie=s(),u(oe.$$.fragment),K=s(),u(re.$$.fragment),U=s(),u(ne.$$.fragment),ze=s(),j=p("div"),u(ke.$$.fragment),Re=s(),A=p("p"),A.textContent=Ke,Ee=s(),J=p("p"),J.innerHTML=ye,ve=s(),ge=p("p"),ge.innerHTML=Ye,we=s(),N=p("div"),u(ee.$$.fragment),Me=s(),fe=p("p"),fe.innerHTML=se,Le=s(),u(E.$$.fragment),te=s(),u(Se.$$.fragment),he=s(),u(ae.$$.fragment),Be=s(),C=p("div"),u(B.$$.fragment),Ve=s(),Z=p("p"),Z.innerHTML=Ue,Ge=s(),D=p("p"),D.innerHTML=Ae,ue=s(),L=p("div"),u(i.$$.fragment),S=s(),W=p("p"),W.innerHTML=Fe,me=s(),u(V.$$.fragment),z=s(),u(P.$$.fragment),this.h()},l(d){_(t.$$.fragment,d),h=a(d),r=g(d,"DIV",{class:!0});var F=H(r);_(l.$$.fragment,F),v=a(F),o=g(F,"DIV",{class:!0});var Qe=H(o);_(M.$$.fragment,Qe),Qe.forEach(n),F.forEach(n),We=a(d),_(I.$$.fragment,d),_e=a(d),q=g(d,"DIV",{class:!0});var le=H(q);_(X.$$.fragment,le),De=a(le),be=g(le,"P",{"data-svelte-h":!0}),w(be)!=="svelte-zbcvbe"&&(be.innerHTML=O),Xe=a(le),Q=g(le,"P",{"data-svelte-h":!0}),w(Q)!=="svelte-1be7e3c"&&(Q.innerHTML=Te),Ce=a(le),Y=g(le,"DIV",{class:!0});var Je=H(Y);_(R.$$.fragment,Je),je=a(Je),$e=g(Je,"P",{"data-svelte-h":!0}),w($e)!=="svelte-lcdh25"&&($e.innerHTML=de),Ie=a(Je),_(oe.$$.fragment,Je),K=a(Je),_(re.$$.fragment,Je),Je.forEach(n),le.forEach(n),U=a(d),_(ne.$$.fragment,d),ze=a(d),j=g(d,"DIV",{class:!0});var pe=H(j);_(ke.$$.fragment,pe),Re=a(pe),A=g(pe,"P",{"data-svelte-h":!0}),w(A)!=="svelte-m32qg1"&&(A.textContent=Ke),Ee=a(pe),J=g(pe,"P",{"data-svelte-h":!0}),w(J)!=="svelte-3kj8r8"&&(J.innerHTML=ye),ve=a(pe),ge=g(pe,"P",{"data-svelte-h":!0}),w(ge)!=="svelte-1be7e3c"&&(ge.innerHTML=Ye),we=a(pe),N=g(pe,"DIV",{class:!0});var ie=H(N);_(ee.$$.fragment,ie),Me=a(ie),fe=g(ie,"P",{"data-svelte-h":!0}),w(fe)!=="svelte-191peeb"&&(fe.innerHTML=se),Le=a(ie),_(E.$$.fragment,ie),te=a(ie),_(Se.$$.fragment,ie),ie.forEach(n),pe.forEach(n),he=a(d),_(ae.$$.fragment,d),Be=a(d),C=g(d,"DIV",{class:!0});var Ze=H(C);_(B.$$.fragment,Ze),Ve=a(Ze),Z=g(Ze,"P",{"data-svelte-h":!0}),w(Z)!=="svelte-c8cz9y"&&(Z.innerHTML=Ue),Ge=a(Ze),D=g(Ze,"P",{"data-svelte-h":!0}),w(D)!=="svelte-1be7e3c"&&(D.innerHTML=Ae),ue=a(Ze),L=g(Ze,"DIV",{class:!0});var He=H(L);_(i.$$.fragment,He),S=a(He),W=g(He,"P",{"data-svelte-h":!0}),w(W)!=="svelte-1ioygo1"&&(W.innerHTML=Fe),me=a(He),_(V.$$.fragment,He),z=a(He),_(P.$$.fragment,He),He.forEach(n),Ze.forEach(n),this.h()},h(){k(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(d,F){b(t,d,F),m(d,h,F),m(d,r,F),b(l,r,null),c(r,v),c(r,o),b(M,o,null),m(d,We,F),b(I,d,F),m(d,_e,F),m(d,q,F),b(X,q,null),c(q,De),c(q,be),c(q,Xe),c(q,Q),c(q,Ce),c(q,Y),b(R,Y,null),c(Y,je),c(Y,$e),c(Y,Ie),b(oe,Y,null),c(Y,K),b(re,Y,null),m(d,U,F),b(ne,d,F),m(d,ze,F),m(d,j,F),b(ke,j,null),c(j,Re),c(j,A),c(j,Ee),c(j,J),c(j,ve),c(j,ge),c(j,we),c(j,N),b(ee,N,null),c(N,Me),c(N,fe),c(N,Le),b(E,N,null),c(N,te),b(Se,N,null),m(d,he,F),b(ae,d,F),m(d,Be,F),m(d,C,F),b(B,C,null),c(C,Ve),c(C,Z),c(C,Ge),c(C,D),c(C,ue),c(C,L),b(i,L,null),c(L,S),c(L,W),c(L,me),b(V,L,null),c(L,z),b(P,L,null),ce=!0},p(d,F){const Qe={};F&2&&(Qe.$$scope={dirty:F,ctx:d}),oe.$set(Qe);const le={};F&2&&(le.$$scope={dirty:F,ctx:d}),re.$set(le);const Je={};F&2&&(Je.$$scope={dirty:F,ctx:d}),E.$set(Je);const pe={};F&2&&(pe.$$scope={dirty:F,ctx:d}),Se.$set(pe);const ie={};F&2&&(ie.$$scope={dirty:F,ctx:d}),V.$set(ie);const Ze={};F&2&&(Ze.$$scope={dirty:F,ctx:d}),P.$set(Ze)},i(d){ce||(T(t.$$.fragment,d),T(l.$$.fragment,d),T(M.$$.fragment,d),T(I.$$.fragment,d),T(X.$$.fragment,d),T(R.$$.fragment,d),T(oe.$$.fragment,d),T(re.$$.fragment,d),T(ne.$$.fragment,d),T(ke.$$.fragment,d),T(ee.$$.fragment,d),T(E.$$.fragment,d),T(Se.$$.fragment,d),T(ae.$$.fragment,d),T(B.$$.fragment,d),T(i.$$.fragment,d),T(V.$$.fragment,d),T(P.$$.fragment,d),ce=!0)},o(d){$(t.$$.fragment,d),$(l.$$.fragment,d),$(M.$$.fragment,d),$(I.$$.fragment,d),$(X.$$.fragment,d),$(R.$$.fragment,d),$(oe.$$.fragment,d),$(re.$$.fragment,d),$(ne.$$.fragment,d),$(ke.$$.fragment,d),$(ee.$$.fragment,d),$(E.$$.fragment,d),$(Se.$$.fragment,d),$(ae.$$.fragment,d),$(B.$$.fragment,d),$(i.$$.fragment,d),$(V.$$.fragment,d),$(P.$$.fragment,d),ce=!1},d(d){d&&(n(h),n(r),n(We),n(_e),n(q),n(U),n(ze),n(j),n(he),n(Be),n(C)),y(t,d),y(l),y(M),y(I,d),y(X),y(R),y(oe),y(re),y(ne,d),y(ke),y(ee),y(E),y(Se),y(ae,d),y(B),y(i),y(V),y(P)}}}function po(x){let t,h;return t=new Rt({props:{$$slots:{default:[co]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,l){b(t,r,l),h=!0},p(r,l){const v={};l&2&&(v.$$scope={dirty:l,ctx:r}),t.$set(v)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){$(t.$$.fragment,r),h=!1},d(r){y(t,r)}}}function go(x){let t,h,r,l,v,o,M,We,I,_e=`The SegFormer model was proposed in <a href="https://arxiv.org/abs/2105.15203" rel="nofollow">SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers</a> by Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez, Ping
Luo. The model consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great
results on image segmentation benchmarks such as ADE20K and Cityscapes.`,q,X,De="The abstract from the paper is the following:",be,O,Xe=`<em>We present SegFormer, a simple, efficient yet powerful semantic segmentation framework which unifies Transformers with
lightweight multilayer perception (MLP) decoders. SegFormer has two appealing features: 1) SegFormer comprises a novel
hierarchically structured Transformer encoder which outputs multiscale features. It does not need positional encoding,
thereby avoiding the interpolation of positional codes which leads to decreased performance when the testing resolution
differs from training. 2) SegFormer avoids complex decoders. The proposed MLP decoder aggregates information from
different layers, and thus combining both local attention and global attention to render powerful representations. We
show that this simple and lightweight design is the key to efficient segmentation on Transformers. We scale our
approach up to obtain a series of models from SegFormer-B0 to SegFormer-B5, reaching significantly better performance
and efficiency than previous counterparts. For example, SegFormer-B4 achieves 50.3% mIoU on ADE20K with 64M parameters,
being 5x smaller and 2.2% better than the previous best method. Our best model, SegFormer-B5, achieves 84.0% mIoU on
Cityscapes validation set and shows excellent zero-shot robustness on Cityscapes-C.</em>`,Q,Te,Ce='The figure below illustrates the architecture of SegFormer. Taken from the <a href="https://arxiv.org/abs/2105.15203" rel="nofollow">original paper</a>.',Y,R,je,$e,de,Ie=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The TensorFlow version
of the model was contributed by <a href="https://huggingface.co/sayakpaul" rel="nofollow">sayakpaul</a>. The original code can be found <a href="https://github.com/NVlabs/SegFormer" rel="nofollow">here</a>.`,oe,K,re,U,ne=`<li>SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerModel">SegformerModel</a> is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> adds the all-MLP decoder head on
top to perform semantic segmentation of images. In addition, there’s
<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForImageClassification">SegformerForImageClassification</a> which can be used to - you guessed it - classify images. The
authors of SegFormer first pre-trained the Transformer encoder on ImageNet-1k to classify images. Next, they throw
away the classification head, and replace it by the all-MLP decode head. Next, they fine-tune the model altogether on
ADE20K, Cityscapes and COCO-stuff, which are important benchmarks for semantic segmentation. All checkpoints can be
found on the <a href="https://huggingface.co/models?other=segformer" rel="nofollow">hub</a>.</li> <li>The quickest way to get started with SegFormer is by checking the <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/SegFormer" rel="nofollow">example notebooks</a> (which showcase both inference and
fine-tuning on custom data). One can also check out the <a href="https://huggingface.co/blog/fine-tune-segformer" rel="nofollow">blog post</a> introducing SegFormer and illustrating how it can be fine-tuned on custom data.</li> <li>TensorFlow users should refer to <a href="https://github.com/deep-diver/segformer-tf-transformers" rel="nofollow">this repository</a> that shows off-the-shelf inference and fine-tuning.</li> <li>One can also check out <a href="https://huggingface.co/spaces/chansung/segformer-tf-transformers" rel="nofollow">this interactive demo on Hugging Face Spaces</a>
to try out a SegFormer model on custom images.</li> <li>SegFormer works on any input size, as it pads the input to be divisible by <code>config.patch_sizes</code>.</li> <li>One can use <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerImageProcessor">SegformerImageProcessor</a> to prepare images and corresponding segmentation maps
for the model. Note that this image processor is fairly basic and does not include all data augmentations used in
the original paper. The original preprocessing pipelines (for the ADE20k dataset for instance) can be found <a href="https://github.com/NVlabs/SegFormer/blob/master/local_configs/_base_/datasets/ade20k_repeat.py" rel="nofollow">here</a>. The most
important preprocessing step is that images and segmentation maps are randomly cropped and padded to the same size,
such as 512x512 or 640x640, after which they are normalized.</li> <li>One additional thing to keep in mind is that one can initialize <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerImageProcessor">SegformerImageProcessor</a> with
<code>do_reduce_labels</code> set to <code>True</code> or <code>False</code>. In some datasets (like ADE20k), the 0 index is used in the annotated
segmentation maps for background. However, ADE20k doesn’t include the “background” class in its 150 labels.
Therefore, <code>do_reduce_labels</code> is used to reduce all labels by 1, and to make sure no loss is computed for the
background class (i.e. it replaces 0 in the annotated maps by 255, which is the <em>ignore_index</em> of the loss function
used by <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a>). However, other datasets use the 0 index as
background class and include this class as part of all labels. In that case, <code>do_reduce_labels</code> should be set to
<code>False</code>, as loss should also be computed for the background class.</li> <li>As most models, SegFormer comes in different sizes, the details of which can be found in the table below
(taken from Table 7 of the <a href="https://arxiv.org/abs/2105.15203" rel="nofollow">original paper</a>).</li>`,ze,j,ke='<thead><tr><th align="center"><strong>Model variant</strong></th> <th><strong>Depths</strong></th> <th><strong>Hidden sizes</strong></th> <th align="center"><strong>Decoder hidden size</strong></th> <th align="center"><strong>Params (M)</strong></th> <th align="center"><strong>ImageNet-1k Top 1</strong></th></tr></thead> <tbody><tr><td align="center">MiT-b0</td> <td>[2, 2, 2, 2]</td> <td>[32, 64, 160, 256]</td> <td align="center">256</td> <td align="center">3.7</td> <td align="center">70.5</td></tr> <tr><td align="center">MiT-b1</td> <td>[2, 2, 2, 2]</td> <td>[64, 128, 320, 512]</td> <td align="center">256</td> <td align="center">14.0</td> <td align="center">78.7</td></tr> <tr><td align="center">MiT-b2</td> <td>[3, 4, 6, 3]</td> <td>[64, 128, 320, 512]</td> <td align="center">768</td> <td align="center">25.4</td> <td align="center">81.6</td></tr> <tr><td align="center">MiT-b3</td> <td>[3, 4, 18, 3]</td> <td>[64, 128, 320, 512]</td> <td align="center">768</td> <td align="center">45.2</td> <td align="center">83.1</td></tr> <tr><td align="center">MiT-b4</td> <td>[3, 8, 27, 3]</td> <td>[64, 128, 320, 512]</td> <td align="center">768</td> <td align="center">62.6</td> <td align="center">83.6</td></tr> <tr><td align="center">MiT-b5</td> <td>[3, 6, 40, 3]</td> <td>[64, 128, 320, 512]</td> <td align="center">768</td> <td align="center">82.0</td> <td align="center">83.8</td></tr></tbody>',Re,A,Ke=`Note that MiT in the above table refers to the Mix Transformer encoder backbone introduced in SegFormer. For
SegFormer’s results on the segmentation datasets like ADE20k, refer to the <a href="https://arxiv.org/abs/2105.15203" rel="nofollow">paper</a>.`,Ee,J,ye,ve,ge="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with SegFormer.",Ye,we,N,ee,Me='<li><a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForImageClassification">SegformerForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li><a href="../tasks/image_classification">Image classification task guide</a></li>',fe,se,Le="Semantic segmentation:",E,te,Se='<li><a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/semantic-segmentation" rel="nofollow">example script</a>.</li> <li>A blog on fine-tuning SegFormer on a custom dataset can be found <a href="https://huggingface.co/blog/fine-tune-segformer" rel="nofollow">here</a>.</li> <li>More demo notebooks on SegFormer (both inference + fine-tuning on a custom dataset) can be found <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/SegFormer" rel="nofollow">here</a>.</li> <li><a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation">TFSegformerForSemanticSegmentation</a> is supported by this <a href="https://github.com/huggingface/notebooks/blob/main/examples/semantic_segmentation-tf.ipynb" rel="nofollow">example notebook</a>.</li> <li><a href="../tasks/semantic_segmentation">Semantic segmentation task guide</a></li>',he,ae,Be="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",C,B,Ve,Z,Ue,Ge,D,Ae=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerModel">SegformerModel</a>. It is used to instantiate an
SegFormer 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 SegFormer
<a href="https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512" rel="nofollow">nvidia/segformer-b0-finetuned-ade-512-512</a>
architecture.`,ue,L,i=`Configuration objects inherit from <a href="/docs/transformers/pr_31031/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31031/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,S,W,Fe,me,V,z,P,ce,d,F,Qe,le,Je="Preprocesses a batch of images and optionally segmentation maps.",pe,ie,Ze=`Overrides the <code>__call__</code> method of the <code>Preprocessor</code> class so that both images and segmentation maps can be
passed in as positional arguments.`,He,et,st,jt,gt,kt='Converts the output of <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',$t,at,yt,Ne,lt,It,ft,Ut="Constructs a Segformer image processor.",Jt,tt,it,Zt,ht,Nt="Preprocess an image or batch of images.",Wt,ot,dt,zt,ut,Pt='Converts the output of <a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',vt,rt,wt,mt,Mt,Tt,St;return v=new xe({props:{title:"SegFormer",local:"segformer",headingTag:"h1"}}),M=new xe({props:{title:"Overview",local:"overview",headingTag:"h2"}}),K=new xe({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),J=new xe({props:{title:"Resources",local:"resources",headingTag:"h2"}}),we=new Xt({props:{pipeline:"image-classification"}}),B=new xe({props:{title:"SegformerConfig",local:"transformers.SegformerConfig",headingTag:"h2"}}),Ue=new G({props:{name:"class transformers.SegformerConfig",anchor:"transformers.SegformerConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"num_encoder_blocks",val:" = 4"},{name:"depths",val:" = [2, 2, 2, 2]"},{name:"sr_ratios",val:" = [8, 4, 2, 1]"},{name:"hidden_sizes",val:" = [32, 64, 160, 256]"},{name:"patch_sizes",val:" = [7, 3, 3, 3]"},{name:"strides",val:" = [4, 2, 2, 2]"},{name:"num_attention_heads",val:" = [1, 2, 5, 8]"},{name:"mlp_ratios",val:" = [4, 4, 4, 4]"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"drop_path_rate",val:" = 0.1"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"decoder_hidden_size",val:" = 256"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegformerConfig.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.SegformerConfig.num_encoder_blocks",description:`<strong>num_encoder_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of encoder blocks (i.e. stages in the Mix Transformer encoder).`,name:"num_encoder_blocks"},{anchor:"transformers.SegformerConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 2, 2]</code>) &#x2014;
The number of layers in each encoder block.`,name:"depths"},{anchor:"transformers.SegformerConfig.sr_ratios",description:`<strong>sr_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[8, 4, 2, 1]</code>) &#x2014;
Sequence reduction ratios in each encoder block.`,name:"sr_ratios"},{anchor:"transformers.SegformerConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 64, 160, 256]</code>) &#x2014;
Dimension of each of the encoder blocks.`,name:"hidden_sizes"},{anchor:"transformers.SegformerConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[7, 3, 3, 3]</code>) &#x2014;
Patch size before each encoder block.`,name:"patch_sizes"},{anchor:"transformers.SegformerConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 2, 2]</code>) &#x2014;
Stride before each encoder block.`,name:"strides"},{anchor:"transformers.SegformerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 5, 8]</code>) &#x2014;
Number of attention heads for each attention layer in each block of the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.SegformerConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 4, 4, 4]</code>) &#x2014;
Ratio of the size of the hidden layer compared to the size of the input layer of the Mix FFNs in the
encoder blocks.`,name:"mlp_ratios"},{anchor:"transformers.SegformerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SegformerConfig.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, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SegformerConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.SegformerConfig.classifier_dropout_prob",description:`<strong>classifier_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability before the classification head.`,name:"classifier_dropout_prob"},{anchor:"transformers.SegformerConfig.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.SegformerConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for stochastic depth, used in the blocks of the Transformer encoder.`,name:"drop_path_rate"},{anchor:"transformers.SegformerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.SegformerConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The dimension of the all-MLP decode head.`,name:"decoder_hidden_size"},{anchor:"transformers.SegformerConfig.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/configuration_segformer.py#L31"}}),W=new ct({props:{anchor:"transformers.SegformerConfig.example",$$slots:{default:[Dt]},$$scope:{ctx:x}}}),me=new xe({props:{title:"SegformerFeatureExtractor",local:"transformers.SegformerFeatureExtractor",headingTag:"h2"}}),P=new G({props:{name:"class transformers.SegformerFeatureExtractor",anchor:"transformers.SegformerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/feature_extraction_segformer.py#L26"}}),F=new G({props:{name:"__call__",anchor:"transformers.SegformerFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/image_processing_segformer.py#L296"}}),st=new G({props:{name:"post_process_semantic_segmentation",anchor:"transformers.SegformerFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": List = None"}],parametersDescription:[{anchor:"transformers.SegformerFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.SegformerFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If unset,
predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/image_processing_segformer.py#L438",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>semantic_segmentation</p>
`}}),at=new xe({props:{title:"SegformerImageProcessor",local:"transformers.SegformerImageProcessor",headingTag:"h2"}}),lt=new G({props:{name:"class transformers.SegformerImageProcessor",anchor:"transformers.SegformerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_reduce_labels",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegformerImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. Can be overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.SegformerImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 512, &quot;width&quot;: 512}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.SegformerImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.SegformerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.SegformerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.SegformerImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.SegformerImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.SegformerImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.SegformerImageProcessor.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is
used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). The
background label will be replaced by 255. Can be overridden by the <code>do_reduce_labels</code> parameter in the
<code>preprocess</code> method.`,name:"do_reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/image_processing_segformer.py#L57"}}),it=new G({props:{name:"preprocess",anchor:"transformers.SegformerImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"segmentation_maps",val:": Union = None"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_reduce_labels",val:": Optional = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"}],parametersDescription:[{anchor:"transformers.SegformerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.SegformerImageProcessor.preprocess.segmentation_maps",description:`<strong>segmentation_maps</strong> (<code>ImageInput</code>, <em>optional</em>) &#x2014;
Segmentation map to preprocess.`,name:"segmentation_maps"},{anchor:"transformers.SegformerImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.SegformerImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after <code>resize</code> is applied.`,name:"size"},{anchor:"transformers.SegformerImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.SegformerImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.SegformerImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.SegformerImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.SegformerImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.SegformerImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.SegformerImageProcessor.preprocess.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_reduce_labels</code>) &#x2014;
Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g.
ADE20k). The background label will be replaced by 255.`,name:"do_reduce_labels"},{anchor:"transformers.SegformerImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.SegformerImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"},{anchor:"transformers.SegformerImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/image_processing_segformer.py#L305"}}),dt=new G({props:{name:"post_process_semantic_segmentation",anchor:"transformers.SegformerImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": List = None"}],parametersDescription:[{anchor:"transformers.SegformerImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_31031/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.SegformerImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If unset,
predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_31031/src/transformers/models/segformer/image_processing_segformer.py#L438",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>semantic_segmentation</p>
`}}),rt=new qt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[po],pytorch:[ro]},$$scope:{ctx:x}}}),mt=new Yt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/segformer.md"}}),{c(){t=p("meta"),h=s(),r=p("p"),l=s(),u(v.$$.fragment),o=s(),u(M.$$.fragment),We=s(),I=p("p"),I.innerHTML=_e,q=s(),X=p("p"),X.textContent=De,be=s(),O=p("p"),O.innerHTML=Xe,Q=s(),Te=p("p"),Te.innerHTML=Ce,Y=s(),R=p("img"),$e=s(),de=p("p"),de.innerHTML=Ie,oe=s(),u(K.$$.fragment),re=s(),U=p("ul"),U.innerHTML=ne,ze=s(),j=p("table"),j.innerHTML=ke,Re=s(),A=p("p"),A.innerHTML=Ke,Ee=s(),u(J.$$.fragment),ye=s(),ve=p("p"),ve.textContent=ge,Ye=s(),u(we.$$.fragment),N=s(),ee=p("ul"),ee.innerHTML=Me,fe=s(),se=p("p"),se.textContent=Le,E=s(),te=p("ul"),te.innerHTML=Se,he=s(),ae=p("p"),ae.textContent=Be,C=s(),u(B.$$.fragment),Ve=s(),Z=p("div"),u(Ue.$$.fragment),Ge=s(),D=p("p"),D.innerHTML=Ae,ue=s(),L=p("p"),L.innerHTML=i,S=s(),u(W.$$.fragment),Fe=s(),u(me.$$.fragment),V=s(),z=p("div"),u(P.$$.fragment),ce=s(),d=p("div"),u(F.$$.fragment),Qe=s(),le=p("p"),le.textContent=Je,pe=s(),ie=p("p"),ie.innerHTML=Ze,He=s(),et=p("div"),u(st.$$.fragment),jt=s(),gt=p("p"),gt.innerHTML=kt,$t=s(),u(at.$$.fragment),yt=s(),Ne=p("div"),u(lt.$$.fragment),It=s(),ft=p("p"),ft.textContent=Ut,Jt=s(),tt=p("div"),u(it.$$.fragment),Zt=s(),ht=p("p"),ht.textContent=Nt,Wt=s(),ot=p("div"),u(dt.$$.fragment),zt=s(),ut=p("p"),ut.innerHTML=Pt,vt=s(),u(rt.$$.fragment),wt=s(),u(mt.$$.fragment),Mt=s(),Tt=p("p"),this.h()},l(e){const f=Gt("svelte-u9bgzb",document.head);t=g(f,"META",{name:!0,content:!0}),f.forEach(n),h=a(e),r=g(e,"P",{}),H(r).forEach(n),l=a(e),_(v.$$.fragment,e),o=a(e),_(M.$$.fragment,e),We=a(e),I=g(e,"P",{"data-svelte-h":!0}),w(I)!=="svelte-1rmm4pp"&&(I.innerHTML=_e),q=a(e),X=g(e,"P",{"data-svelte-h":!0}),w(X)!=="svelte-vfdo9a"&&(X.textContent=De),be=a(e),O=g(e,"P",{"data-svelte-h":!0}),w(O)!=="svelte-1abqxvb"&&(O.innerHTML=Xe),Q=a(e),Te=g(e,"P",{"data-svelte-h":!0}),w(Te)!=="svelte-1xgqs41"&&(Te.innerHTML=Ce),Y=a(e),R=g(e,"IMG",{width:!0,src:!0}),$e=a(e),de=g(e,"P",{"data-svelte-h":!0}),w(de)!=="svelte-1794tdg"&&(de.innerHTML=Ie),oe=a(e),_(K.$$.fragment,e),re=a(e),U=g(e,"UL",{"data-svelte-h":!0}),w(U)!=="svelte-13nonlt"&&(U.innerHTML=ne),ze=a(e),j=g(e,"TABLE",{"data-svelte-h":!0}),w(j)!=="svelte-1u5dqy3"&&(j.innerHTML=ke),Re=a(e),A=g(e,"P",{"data-svelte-h":!0}),w(A)!=="svelte-1srzf2y"&&(A.innerHTML=Ke),Ee=a(e),_(J.$$.fragment,e),ye=a(e),ve=g(e,"P",{"data-svelte-h":!0}),w(ve)!=="svelte-ka71ur"&&(ve.textContent=ge),Ye=a(e),_(we.$$.fragment,e),N=a(e),ee=g(e,"UL",{"data-svelte-h":!0}),w(ee)!=="svelte-1s4w0wt"&&(ee.innerHTML=Me),fe=a(e),se=g(e,"P",{"data-svelte-h":!0}),w(se)!=="svelte-15vx5o0"&&(se.textContent=Le),E=a(e),te=g(e,"UL",{"data-svelte-h":!0}),w(te)!=="svelte-bmeaab"&&(te.innerHTML=Se),he=a(e),ae=g(e,"P",{"data-svelte-h":!0}),w(ae)!=="svelte-1xesile"&&(ae.textContent=Be),C=a(e),_(B.$$.fragment,e),Ve=a(e),Z=g(e,"DIV",{class:!0});var qe=H(Z);_(Ue.$$.fragment,qe),Ge=a(qe),D=g(qe,"P",{"data-svelte-h":!0}),w(D)!=="svelte-sen5jz"&&(D.innerHTML=Ae),ue=a(qe),L=g(qe,"P",{"data-svelte-h":!0}),w(L)!=="svelte-13bqdwz"&&(L.innerHTML=i),S=a(qe),_(W.$$.fragment,qe),qe.forEach(n),Fe=a(e),_(me.$$.fragment,e),V=a(e),z=g(e,"DIV",{class:!0});var Oe=H(z);_(P.$$.fragment,Oe),ce=a(Oe),d=g(Oe,"DIV",{class:!0});var _t=H(d);_(F.$$.fragment,_t),Qe=a(_t),le=g(_t,"P",{"data-svelte-h":!0}),w(le)!=="svelte-4612b7"&&(le.textContent=Je),pe=a(_t),ie=g(_t,"P",{"data-svelte-h":!0}),w(ie)!=="svelte-b84uvg"&&(ie.innerHTML=Ze),_t.forEach(n),He=a(Oe),et=g(Oe,"DIV",{class:!0});var Ft=H(et);_(st.$$.fragment,Ft),jt=a(Ft),gt=g(Ft,"P",{"data-svelte-h":!0}),w(gt)!=="svelte-r02h8q"&&(gt.innerHTML=kt),Ft.forEach(n),Oe.forEach(n),$t=a(e),_(at.$$.fragment,e),yt=a(e),Ne=g(e,"DIV",{class:!0});var nt=H(Ne);_(lt.$$.fragment,nt),It=a(nt),ft=g(nt,"P",{"data-svelte-h":!0}),w(ft)!=="svelte-ijd3ni"&&(ft.textContent=Ut),Jt=a(nt),tt=g(nt,"DIV",{class:!0});var xt=H(tt);_(it.$$.fragment,xt),Zt=a(xt),ht=g(xt,"P",{"data-svelte-h":!0}),w(ht)!=="svelte-1x3yxsa"&&(ht.textContent=Nt),xt.forEach(n),Wt=a(nt),ot=g(nt,"DIV",{class:!0});var Ct=H(ot);_(dt.$$.fragment,Ct),zt=a(Ct),ut=g(Ct,"P",{"data-svelte-h":!0}),w(ut)!=="svelte-r02h8q"&&(ut.innerHTML=Pt),Ct.forEach(n),nt.forEach(n),vt=a(e),_(rt.$$.fragment,e),wt=a(e),_(mt.$$.fragment,e),Mt=a(e),Tt=g(e,"P",{}),H(Tt).forEach(n),this.h()},h(){k(t,"name","hf:doc:metadata"),k(t,"content",fo),k(R,"width","600"),Vt(R.src,je="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/segformer_architecture.png")||k(R,"src",je),k(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,f){c(document.head,t),m(e,h,f),m(e,r,f),m(e,l,f),b(v,e,f),m(e,o,f),b(M,e,f),m(e,We,f),m(e,I,f),m(e,q,f),m(e,X,f),m(e,be,f),m(e,O,f),m(e,Q,f),m(e,Te,f),m(e,Y,f),m(e,R,f),m(e,$e,f),m(e,de,f),m(e,oe,f),b(K,e,f),m(e,re,f),m(e,U,f),m(e,ze,f),m(e,j,f),m(e,Re,f),m(e,A,f),m(e,Ee,f),b(J,e,f),m(e,ye,f),m(e,ve,f),m(e,Ye,f),b(we,e,f),m(e,N,f),m(e,ee,f),m(e,fe,f),m(e,se,f),m(e,E,f),m(e,te,f),m(e,he,f),m(e,ae,f),m(e,C,f),b(B,e,f),m(e,Ve,f),m(e,Z,f),b(Ue,Z,null),c(Z,Ge),c(Z,D),c(Z,ue),c(Z,L),c(Z,S),b(W,Z,null),m(e,Fe,f),b(me,e,f),m(e,V,f),m(e,z,f),b(P,z,null),c(z,ce),c(z,d),b(F,d,null),c(d,Qe),c(d,le),c(d,pe),c(d,ie),c(z,He),c(z,et),b(st,et,null),c(et,jt),c(et,gt),m(e,$t,f),b(at,e,f),m(e,yt,f),m(e,Ne,f),b(lt,Ne,null),c(Ne,It),c(Ne,ft),c(Ne,Jt),c(Ne,tt),b(it,tt,null),c(tt,Zt),c(tt,ht),c(Ne,Wt),c(Ne,ot),b(dt,ot,null),c(ot,zt),c(ot,ut),m(e,vt,f),b(rt,e,f),m(e,wt,f),b(mt,e,f),m(e,Mt,f),m(e,Tt,f),St=!0},p(e,[f]){const qe={};f&2&&(qe.$$scope={dirty:f,ctx:e}),W.$set(qe);const Oe={};f&2&&(Oe.$$scope={dirty:f,ctx:e}),rt.$set(Oe)},i(e){St||(T(v.$$.fragment,e),T(M.$$.fragment,e),T(K.$$.fragment,e),T(J.$$.fragment,e),T(we.$$.fragment,e),T(B.$$.fragment,e),T(Ue.$$.fragment,e),T(W.$$.fragment,e),T(me.$$.fragment,e),T(P.$$.fragment,e),T(F.$$.fragment,e),T(st.$$.fragment,e),T(at.$$.fragment,e),T(lt.$$.fragment,e),T(it.$$.fragment,e),T(dt.$$.fragment,e),T(rt.$$.fragment,e),T(mt.$$.fragment,e),St=!0)},o(e){$(v.$$.fragment,e),$(M.$$.fragment,e),$(K.$$.fragment,e),$(J.$$.fragment,e),$(we.$$.fragment,e),$(B.$$.fragment,e),$(Ue.$$.fragment,e),$(W.$$.fragment,e),$(me.$$.fragment,e),$(P.$$.fragment,e),$(F.$$.fragment,e),$(st.$$.fragment,e),$(at.$$.fragment,e),$(lt.$$.fragment,e),$(it.$$.fragment,e),$(dt.$$.fragment,e),$(rt.$$.fragment,e),$(mt.$$.fragment,e),St=!1},d(e){e&&(n(h),n(r),n(l),n(o),n(We),n(I),n(q),n(X),n(be),n(O),n(Q),n(Te),n(Y),n(R),n($e),n(de),n(oe),n(re),n(U),n(ze),n(j),n(Re),n(A),n(Ee),n(ye),n(ve),n(Ye),n(N),n(ee),n(fe),n(se),n(E),n(te),n(he),n(ae),n(C),n(Ve),n(Z),n(Fe),n(V),n(z),n($t),n(yt),n(Ne),n(vt),n(wt),n(Mt),n(Tt)),n(t),y(v,e),y(M,e),y(K,e),y(J,e),y(we,e),y(B,e),y(Ue),y(W),y(me,e),y(P),y(F),y(st),y(at,e),y(lt),y(it),y(dt),y(rt,e),y(mt,e)}}}const fo='{"title":"SegFormer","local":"segformer","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"SegformerConfig","local":"transformers.SegformerConfig","sections":[],"depth":2},{"title":"SegformerFeatureExtractor","local":"transformers.SegformerFeatureExtractor","sections":[],"depth":2},{"title":"SegformerImageProcessor","local":"transformers.SegformerImageProcessor","sections":[],"depth":2},{"title":"SegformerModel","local":"transformers.SegformerModel","sections":[],"depth":2},{"title":"SegformerDecodeHead","local":"transformers.SegformerDecodeHead","sections":[],"depth":2},{"title":"SegformerForImageClassification","local":"transformers.SegformerForImageClassification","sections":[],"depth":2},{"title":"SegformerForSemanticSegmentation","local":"transformers.SegformerForSemanticSegmentation","sections":[],"depth":2},{"title":"TFSegformerDecodeHead","local":"transformers.TFSegformerDecodeHead","sections":[],"depth":2},{"title":"TFSegformerModel","local":"transformers.TFSegformerModel","sections":[],"depth":2},{"title":"TFSegformerForImageClassification","local":"transformers.TFSegformerForImageClassification","sections":[],"depth":2},{"title":"TFSegformerForSemanticSegmentation","local":"transformers.TFSegformerForSemanticSegmentation","sections":[],"depth":2}],"depth":1}';function ho(x){return Ht(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class So extends Lt{constructor(t){super(),Bt(this,t,ho,go,Et,{})}}export{So as component};
