import{s as Pt,f as Et,o as Rt,n as Pe}from"../chunks/scheduler.9bc65507.js";import{S as Lt,i as Bt,g as f,s,r as u,A as Ht,h as g,f as n,c as a,j as B,u as _,x as w,k,y as c,a as m,v as b,d as T,t as v,w as $}from"../chunks/index.707bf1b6.js";import{T as _t}from"../chunks/Tip.c2ecdbf4.js";import{D as G}from"../chunks/Docstring.17db21ae.js";import{C as ct}from"../chunks/CodeBlock.54a9f38d.js";import{F as Vt,M as Nt}from"../chunks/Markdown.fef84341.js";import{E as mt}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as Gt}from"../chunks/PipelineTag.44585822.js";import{H as xe}from"../chunks/Heading.342b1fa6.js";function qt(x){let t,h="Example:",r,i,y;return i=new ct({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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function Xt(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function Yt(x){let t,h="Example:",r,i,y;return i=new ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNlZ2Zvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBTZWdmb3JtZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbWl0LWIwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",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>)
<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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function Dt(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function At(x){let t,h="Example:",r,i,y;return i=new ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNlZ2Zvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm1pdC1iMCUyMiklMEFtb2RlbCUyMCUzRCUyMFNlZ2Zvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm1pdC1iMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",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>)
<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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function Qt(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function Ot(x){let t,h="Examples:",r,i,y;return i=new ct({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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function Kt(x){let t,h,r,i,y,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.`,Ze,I,_e,q,X,De='The <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.SegformerModel">SegformerModel</a> forward method, overrides the <code>__call__</code> special method.',be,O,Xe,Q,Te,Ce,Y,E,je,ve,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.`,Ee,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.`,Re,J,$e,ye,ge,Ye='The <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.SegformerForImageClassification">SegformerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',we,N,ee,Me,pe,se,He,R,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.`,Ve,C,V,Le,W,Ue='The <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',Ge,D,Ae,ue,H;return t=new xe({props:{title:"SegformerModel",local:"transformers.SegformerModel",headingTag:"h2"}}),i=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/v4.37.1/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/v4.37.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L506"}}),_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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L529",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new _t({props:{$$slots:{default:[Xt]},$$scope:{ctx:x}}}),Q=new mt({props:{anchor:"transformers.SegformerModel.forward.example",$$slots:{default:[Yt]},$$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/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L681"}}),Ie=new G({props:{name:"forward",anchor:"transformers.SegformerDecodeHead.forward",parameters:[{name:"encoder_hidden_states",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L706"}}),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/v4.37.1/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/v4.37.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L568"}}),$e=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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L588",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/v4.37.1/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 _t({props:{$$slots:{default:[Dt]},$$scope:{ctx:x}}}),Me=new mt({props:{anchor:"transformers.SegformerForImageClassification.forward.example",$$slots:{default:[At]},$$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/v4.37.1/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/v4.37.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L739"}}),V=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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_segformer.py#L752",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new _t({props:{$$slots:{default:[Qt]},$$scope:{ctx:x}}}),ue=new mt({props:{anchor:"transformers.SegformerForSemanticSegmentation.forward.example",$$slots:{default:[Ot]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=f("div"),u(i.$$.fragment),y=s(),o=f("p"),o.innerHTML=M,Ze=s(),I=f("div"),u(_e.$$.fragment),q=s(),X=f("p"),X.innerHTML=De,be=s(),u(O.$$.fragment),Xe=s(),u(Q.$$.fragment),Te=s(),u(Ce.$$.fragment),Y=s(),E=f("div"),u(je.$$.fragment),ve=s(),de=f("div"),u(Ie.$$.fragment),oe=s(),u(K.$$.fragment),re=s(),U=f("div"),u(ne.$$.fragment),ze=s(),j=f("p"),j.textContent=ke,Ee=s(),A=f("p"),A.innerHTML=Ke,Re=s(),J=f("div"),u($e.$$.fragment),ye=s(),ge=f("p"),ge.innerHTML=Ye,we=s(),u(N.$$.fragment),ee=s(),u(Me.$$.fragment),pe=s(),u(se.$$.fragment),He=s(),R=f("div"),u(te.$$.fragment),Se=s(),he=f("p"),he.innerHTML=ae,Ve=s(),C=f("div"),u(V.$$.fragment),Le=s(),W=f("p"),W.innerHTML=Ue,Ge=s(),u(D.$$.fragment),Ae=s(),u(ue.$$.fragment),this.h()},l(l){_(t.$$.fragment,l),h=a(l),r=g(l,"DIV",{class:!0});var S=B(r);_(i.$$.fragment,S),y=a(S),o=g(S,"P",{"data-svelte-h":!0}),w(o)!=="svelte-1eq9zl9"&&(o.innerHTML=M),Ze=a(S),I=g(S,"DIV",{class:!0});var Z=B(I);_(_e.$$.fragment,Z),q=a(Z),X=g(Z,"P",{"data-svelte-h":!0}),w(X)!=="svelte-180b05"&&(X.innerHTML=De),be=a(Z),_(O.$$.fragment,Z),Xe=a(Z),_(Q.$$.fragment,Z),Z.forEach(n),S.forEach(n),Te=a(l),_(Ce.$$.fragment,l),Y=a(l),E=g(l,"DIV",{class:!0});var Fe=B(E);_(je.$$.fragment,Fe),ve=a(Fe),de=g(Fe,"DIV",{class:!0});var me=B(de);_(Ie.$$.fragment,me),me.forEach(n),Fe.forEach(n),oe=a(l),_(K.$$.fragment,l),re=a(l),U=g(l,"DIV",{class:!0});var L=B(U);_(ne.$$.fragment,L),ze=a(L),j=g(L,"P",{"data-svelte-h":!0}),w(j)!=="svelte-m32qg1"&&(j.textContent=ke),Ee=a(L),A=g(L,"P",{"data-svelte-h":!0}),w(A)!=="svelte-68lg8f"&&(A.innerHTML=Ke),Re=a(L),J=g(L,"DIV",{class:!0});var z=B(J);_($e.$$.fragment,z),ye=a(z),ge=g(z,"P",{"data-svelte-h":!0}),w(ge)!=="svelte-1343g3f"&&(ge.innerHTML=Ye),we=a(z),_(N.$$.fragment,z),ee=a(z),_(Me.$$.fragment,z),z.forEach(n),L.forEach(n),pe=a(l),_(se.$$.fragment,l),He=a(l),R=g(l,"DIV",{class:!0});var P=B(R);_(te.$$.fragment,P),Se=a(P),he=g(P,"P",{"data-svelte-h":!0}),w(he)!=="svelte-x9btf5"&&(he.innerHTML=ae),Ve=a(P),C=g(P,"DIV",{class:!0});var ce=B(C);_(V.$$.fragment,ce),Le=a(ce),W=g(ce,"P",{"data-svelte-h":!0}),w(W)!=="svelte-ubc5eh"&&(W.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(E,"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(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(l,S){b(t,l,S),m(l,h,S),m(l,r,S),b(i,r,null),c(r,y),c(r,o),c(r,Ze),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(l,Te,S),b(Ce,l,S),m(l,Y,S),m(l,E,S),b(je,E,null),c(E,ve),c(E,de),b(Ie,de,null),m(l,oe,S),b(K,l,S),m(l,re,S),m(l,U,S),b(ne,U,null),c(U,ze),c(U,j),c(U,Ee),c(U,A),c(U,Re),c(U,J),b($e,J,null),c(J,ye),c(J,ge),c(J,we),b(N,J,null),c(J,ee),b(Me,J,null),m(l,pe,S),b(se,l,S),m(l,He,S),m(l,R,S),b(te,R,null),c(R,Se),c(R,he),c(R,Ve),c(R,C),b(V,C,null),c(C,Le),c(C,W),c(C,Ge),b(D,C,null),c(C,Ae),b(ue,C,null),H=!0},p(l,S){const Z={};S&2&&(Z.$$scope={dirty:S,ctx:l}),O.$set(Z);const Fe={};S&2&&(Fe.$$scope={dirty:S,ctx:l}),Q.$set(Fe);const me={};S&2&&(me.$$scope={dirty:S,ctx:l}),N.$set(me);const L={};S&2&&(L.$$scope={dirty:S,ctx:l}),Me.$set(L);const z={};S&2&&(z.$$scope={dirty:S,ctx:l}),D.$set(z);const P={};S&2&&(P.$$scope={dirty:S,ctx:l}),ue.$set(P)},i(l){H||(T(t.$$.fragment,l),T(i.$$.fragment,l),T(_e.$$.fragment,l),T(O.$$.fragment,l),T(Q.$$.fragment,l),T(Ce.$$.fragment,l),T(je.$$.fragment,l),T(Ie.$$.fragment,l),T(K.$$.fragment,l),T(ne.$$.fragment,l),T($e.$$.fragment,l),T(N.$$.fragment,l),T(Me.$$.fragment,l),T(se.$$.fragment,l),T(te.$$.fragment,l),T(V.$$.fragment,l),T(D.$$.fragment,l),T(ue.$$.fragment,l),H=!0)},o(l){v(t.$$.fragment,l),v(i.$$.fragment,l),v(_e.$$.fragment,l),v(O.$$.fragment,l),v(Q.$$.fragment,l),v(Ce.$$.fragment,l),v(je.$$.fragment,l),v(Ie.$$.fragment,l),v(K.$$.fragment,l),v(ne.$$.fragment,l),v($e.$$.fragment,l),v(N.$$.fragment,l),v(Me.$$.fragment,l),v(se.$$.fragment,l),v(te.$$.fragment,l),v(V.$$.fragment,l),v(D.$$.fragment,l),v(ue.$$.fragment,l),H=!1},d(l){l&&(n(h),n(r),n(Te),n(Y),n(E),n(oe),n(re),n(U),n(pe),n(He),n(R)),$(t,l),$(i),$(_e),$(O),$(Q),$(Ce,l),$(je),$(Ie),$(K,l),$(ne),$($e),$(N),$(Me),$(se,l),$(te),$(V),$(D),$(ue)}}}function eo(x){let t,h;return t=new Nt({props:{$$slots:{default:[Kt]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,i){b(t,r,i),h=!0},p(r,i){const y={};i&2&&(y.$$scope={dirty:i,ctx:r}),t.$set(y)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){v(t.$$.fragment,r),h=!1},d(r){$(t,r)}}}function to(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function oo(x){let t,h="Example:",r,i,y;return i=new ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU2VnZm9ybWVyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlNlZ2Zvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",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>)
<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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function ro(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function no(x){let t,h="Example:",r,i,y;return i=new ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU2VnZm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbWl0LWIwJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZTZWdmb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZtaXQtYjAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",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>)
<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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function so(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=f("p"),t.innerHTML=h},l(r){t=g(r,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function ao(x){let t,h="Examples:",r,i,y;return i=new ct({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=f("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=g(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=h),r=a(o),_(i.$$.fragment,o)},m(o,M){m(o,t,M),m(o,r,M),b(i,o,M),y=!0},p:Pe,i(o){y||(T(i.$$.fragment,o),y=!0)},o(o){v(i.$$.fragment,o),y=!1},d(o){o&&(n(t),n(r)),$(i,o)}}}function io(x){let t,h,r,i,y,o,M,Ze,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/v4.37.1/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">tf.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,E,je,ve,de='The <a href="/docs/transformers/v4.37.1/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,Ee,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.`,Re,J,$e=`This model inherits from <a href="/docs/transformers/v4.37.1/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.)`,ye,ge,Ye=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.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,pe,se='The <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.TFSegformerForImageClassification">TFSegformerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',He,R,te,Se,he,ae,Ve,C,V,Le,W,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/v4.37.1/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">tf.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,H,l,S,Z,Fe='The <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation">TFSegformerForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',me,L,z,P,ce;return t=new xe({props:{title:"TFSegformerDecodeHead",local:"transformers.TFSegformerDecodeHead",headingTag:"h2"}}),i=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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_tf_segformer.py#L693"}}),E=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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_tf_segformer.py#L705",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oe=new _t({props:{$$slots:{default:[to]},$$scope:{ctx:x}}}),re=new mt({props:{anchor:"transformers.TFSegformerModel.call.example",$$slots:{default:[oo]},$$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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_tf_segformer.py#L758",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),R=new _t({props:{$$slots:{default:[ro]},$$scope:{ctx:x}}}),Se=new mt({props:{anchor:"transformers.TFSegformerForImageClassification.call.example",$$slots:{default:[no]},$$scope:{ctx:x}}}),ae=new xe({props:{title:"TFSegformerForSemanticSegmentation",local:"transformers.TFSegformerForSemanticSegmentation",headingTag:"h2"}}),V=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/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/modeling_tf_segformer.py#L917"}}),l=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/v4.37.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/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>
`}}),L=new _t({props:{$$slots:{default:[so]},$$scope:{ctx:x}}}),P=new mt({props:{anchor:"transformers.TFSegformerForSemanticSegmentation.call.example",$$slots:{default:[ao]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=f("div"),u(i.$$.fragment),y=s(),o=f("div"),u(M.$$.fragment),Ze=s(),u(I.$$.fragment),_e=s(),q=f("div"),u(X.$$.fragment),De=s(),be=f("p"),be.innerHTML=O,Xe=s(),Q=f("p"),Q.innerHTML=Te,Ce=s(),Y=f("div"),u(E.$$.fragment),je=s(),ve=f("p"),ve.innerHTML=de,Ie=s(),u(oe.$$.fragment),K=s(),u(re.$$.fragment),U=s(),u(ne.$$.fragment),ze=s(),j=f("div"),u(ke.$$.fragment),Ee=s(),A=f("p"),A.textContent=Ke,Re=s(),J=f("p"),J.innerHTML=$e,ye=s(),ge=f("p"),ge.innerHTML=Ye,we=s(),N=f("div"),u(ee.$$.fragment),Me=s(),pe=f("p"),pe.innerHTML=se,He=s(),u(R.$$.fragment),te=s(),u(Se.$$.fragment),he=s(),u(ae.$$.fragment),Ve=s(),C=f("div"),u(V.$$.fragment),Le=s(),W=f("p"),W.innerHTML=Ue,Ge=s(),D=f("p"),D.innerHTML=Ae,ue=s(),H=f("div"),u(l.$$.fragment),S=s(),Z=f("p"),Z.innerHTML=Fe,me=s(),u(L.$$.fragment),z=s(),u(P.$$.fragment),this.h()},l(d){_(t.$$.fragment,d),h=a(d),r=g(d,"DIV",{class:!0});var F=B(r);_(i.$$.fragment,F),y=a(F),o=g(F,"DIV",{class:!0});var Qe=B(o);_(M.$$.fragment,Qe),Qe.forEach(n),F.forEach(n),Ze=a(d),_(I.$$.fragment,d),_e=a(d),q=g(d,"DIV",{class:!0});var ie=B(q);_(X.$$.fragment,ie),De=a(ie),be=g(ie,"P",{"data-svelte-h":!0}),w(be)!=="svelte-1s5931w"&&(be.innerHTML=O),Xe=a(ie),Q=g(ie,"P",{"data-svelte-h":!0}),w(Q)!=="svelte-1ivrf8m"&&(Q.innerHTML=Te),Ce=a(ie),Y=g(ie,"DIV",{class:!0});var Je=B(Y);_(E.$$.fragment,Je),je=a(Je),ve=g(Je,"P",{"data-svelte-h":!0}),w(ve)!=="svelte-6ohno1"&&(ve.innerHTML=de),Ie=a(Je),_(oe.$$.fragment,Je),K=a(Je),_(re.$$.fragment,Je),Je.forEach(n),ie.forEach(n),U=a(d),_(ne.$$.fragment,d),ze=a(d),j=g(d,"DIV",{class:!0});var fe=B(j);_(ke.$$.fragment,fe),Ee=a(fe),A=g(fe,"P",{"data-svelte-h":!0}),w(A)!=="svelte-m32qg1"&&(A.textContent=Ke),Re=a(fe),J=g(fe,"P",{"data-svelte-h":!0}),w(J)!=="svelte-3w0ykq"&&(J.innerHTML=$e),ye=a(fe),ge=g(fe,"P",{"data-svelte-h":!0}),w(ge)!=="svelte-1ivrf8m"&&(ge.innerHTML=Ye),we=a(fe),N=g(fe,"DIV",{class:!0});var le=B(N);_(ee.$$.fragment,le),Me=a(le),pe=g(le,"P",{"data-svelte-h":!0}),w(pe)!=="svelte-1fu6y7b"&&(pe.innerHTML=se),He=a(le),_(R.$$.fragment,le),te=a(le),_(Se.$$.fragment,le),le.forEach(n),fe.forEach(n),he=a(d),_(ae.$$.fragment,d),Ve=a(d),C=g(d,"DIV",{class:!0});var We=B(C);_(V.$$.fragment,We),Le=a(We),W=g(We,"P",{"data-svelte-h":!0}),w(W)!=="svelte-7adoeo"&&(W.innerHTML=Ue),Ge=a(We),D=g(We,"P",{"data-svelte-h":!0}),w(D)!=="svelte-1ivrf8m"&&(D.innerHTML=Ae),ue=a(We),H=g(We,"DIV",{class:!0});var Be=B(H);_(l.$$.fragment,Be),S=a(Be),Z=g(Be,"P",{"data-svelte-h":!0}),w(Z)!=="svelte-1xnroh9"&&(Z.innerHTML=Fe),me=a(Be),_(L.$$.fragment,Be),z=a(Be),_(P.$$.fragment,Be),Be.forEach(n),We.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(H,"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(i,r,null),c(r,y),c(r,o),b(M,o,null),m(d,Ze,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(E,Y,null),c(Y,je),c(Y,ve),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,Ee),c(j,A),c(j,Re),c(j,J),c(j,ye),c(j,ge),c(j,we),c(j,N),b(ee,N,null),c(N,Me),c(N,pe),c(N,He),b(R,N,null),c(N,te),b(Se,N,null),m(d,he,F),b(ae,d,F),m(d,Ve,F),m(d,C,F),b(V,C,null),c(C,Le),c(C,W),c(C,Ge),c(C,D),c(C,ue),c(C,H),b(l,H,null),c(H,S),c(H,Z),c(H,me),b(L,H,null),c(H,z),b(P,H,null),ce=!0},p(d,F){const Qe={};F&2&&(Qe.$$scope={dirty:F,ctx:d}),oe.$set(Qe);const ie={};F&2&&(ie.$$scope={dirty:F,ctx:d}),re.$set(ie);const Je={};F&2&&(Je.$$scope={dirty:F,ctx:d}),R.$set(Je);const fe={};F&2&&(fe.$$scope={dirty:F,ctx:d}),Se.$set(fe);const le={};F&2&&(le.$$scope={dirty:F,ctx:d}),L.$set(le);const We={};F&2&&(We.$$scope={dirty:F,ctx:d}),P.$set(We)},i(d){ce||(T(t.$$.fragment,d),T(i.$$.fragment,d),T(M.$$.fragment,d),T(I.$$.fragment,d),T(X.$$.fragment,d),T(E.$$.fragment,d),T(oe.$$.fragment,d),T(re.$$.fragment,d),T(ne.$$.fragment,d),T(ke.$$.fragment,d),T(ee.$$.fragment,d),T(R.$$.fragment,d),T(Se.$$.fragment,d),T(ae.$$.fragment,d),T(V.$$.fragment,d),T(l.$$.fragment,d),T(L.$$.fragment,d),T(P.$$.fragment,d),ce=!0)},o(d){v(t.$$.fragment,d),v(i.$$.fragment,d),v(M.$$.fragment,d),v(I.$$.fragment,d),v(X.$$.fragment,d),v(E.$$.fragment,d),v(oe.$$.fragment,d),v(re.$$.fragment,d),v(ne.$$.fragment,d),v(ke.$$.fragment,d),v(ee.$$.fragment,d),v(R.$$.fragment,d),v(Se.$$.fragment,d),v(ae.$$.fragment,d),v(V.$$.fragment,d),v(l.$$.fragment,d),v(L.$$.fragment,d),v(P.$$.fragment,d),ce=!1},d(d){d&&(n(h),n(r),n(Ze),n(_e),n(q),n(U),n(ze),n(j),n(he),n(Ve),n(C)),$(t,d),$(i),$(M),$(I,d),$(X),$(E),$(oe),$(re),$(ne,d),$(ke),$(ee),$(R),$(Se),$(ae,d),$(V),$(l),$(L),$(P)}}}function lo(x){let t,h;return t=new Nt({props:{$$slots:{default:[io]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,i){b(t,r,i),h=!0},p(r,i){const y={};i&2&&(y.$$scope={dirty:i,ctx:r}),t.$set(y)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){v(t.$$.fragment,r),h=!1},d(r){$(t,r)}}}function mo(x){let t,h,r,i,y,o,M,Ze,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,E,je,ve,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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/en/model_doc/segformer#transformers.SegformerImageProcessor">SegformerImageProcessor</a> with
<code>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>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/v4.37.1/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>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>',Ee,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>.`,Re,J,$e,ye,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/v4.37.1/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>',pe,se,He="Semantic segmentation:",R,te,Se='<li><a href="/docs/transformers/v4.37.1/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/v4.37.1/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,Ve="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,V,Le,W,Ue,Ge,D,Ae=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.37.1/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,H,l=`Configuration objects inherit from <a href="/docs/transformers/v4.37.1/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/v4.37.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,S,Z,Fe,me,L,z,P,ce,d,F,Qe,ie,Je="Preprocesses a batch of images and optionally segmentation maps.",fe,le,We=`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.`,Be,et,st,xt,ft,Zt='Converts the output of <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',Tt,at,vt,Ne,it,Ct,gt,zt="Constructs a Segformer image processor.",jt,tt,lt,It,pt,kt="Preprocess an image or batch of images.",Jt,ot,dt,Wt,ht,Ut='Converts the output of <a href="/docs/transformers/v4.37.1/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',$t,rt,yt,bt,wt;return y=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 Gt({props:{pipeline:"image-classification"}}),V=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/v4.37.1/src/transformers/models/segformer/configuration_segformer.py#L38"}}),Z=new mt({props:{anchor:"transformers.SegformerConfig.example",$$slots:{default:[qt]},$$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/v4.37.1/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/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/image_processing_segformer.py#L441",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"}}),it=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/v4.37.1/src/transformers/models/segformer/image_processing_segformer.py#L49"}}),lt=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"},{name:"**kwargs",val:""}],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/v4.37.1/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/v4.37.1/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/v4.37.1/src/transformers/models/segformer/image_processing_segformer.py#L441",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 Vt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[lo],pytorch:[eo]},$$scope:{ctx:x}}}),{c(){t=f("meta"),h=s(),r=f("p"),i=s(),u(y.$$.fragment),o=s(),u(M.$$.fragment),Ze=s(),I=f("p"),I.innerHTML=_e,q=s(),X=f("p"),X.textContent=De,be=s(),O=f("p"),O.innerHTML=Xe,Q=s(),Te=f("p"),Te.innerHTML=Ce,Y=s(),E=f("img"),ve=s(),de=f("p"),de.innerHTML=Ie,oe=s(),u(K.$$.fragment),re=s(),U=f("ul"),U.innerHTML=ne,ze=s(),j=f("table"),j.innerHTML=ke,Ee=s(),A=f("p"),A.innerHTML=Ke,Re=s(),u(J.$$.fragment),$e=s(),ye=f("p"),ye.textContent=ge,Ye=s(),u(we.$$.fragment),N=s(),ee=f("ul"),ee.innerHTML=Me,pe=s(),se=f("p"),se.textContent=He,R=s(),te=f("ul"),te.innerHTML=Se,he=s(),ae=f("p"),ae.textContent=Ve,C=s(),u(V.$$.fragment),Le=s(),W=f("div"),u(Ue.$$.fragment),Ge=s(),D=f("p"),D.innerHTML=Ae,ue=s(),H=f("p"),H.innerHTML=l,S=s(),u(Z.$$.fragment),Fe=s(),u(me.$$.fragment),L=s(),z=f("div"),u(P.$$.fragment),ce=s(),d=f("div"),u(F.$$.fragment),Qe=s(),ie=f("p"),ie.textContent=Je,fe=s(),le=f("p"),le.innerHTML=We,Be=s(),et=f("div"),u(st.$$.fragment),xt=s(),ft=f("p"),ft.innerHTML=Zt,Tt=s(),u(at.$$.fragment),vt=s(),Ne=f("div"),u(it.$$.fragment),Ct=s(),gt=f("p"),gt.textContent=zt,jt=s(),tt=f("div"),u(lt.$$.fragment),It=s(),pt=f("p"),pt.textContent=kt,Jt=s(),ot=f("div"),u(dt.$$.fragment),Wt=s(),ht=f("p"),ht.innerHTML=Ut,$t=s(),u(rt.$$.fragment),yt=s(),bt=f("p"),this.h()},l(e){const p=Ht("svelte-u9bgzb",document.head);t=g(p,"META",{name:!0,content:!0}),p.forEach(n),h=a(e),r=g(e,"P",{}),B(r).forEach(n),i=a(e),_(y.$$.fragment,e),o=a(e),_(M.$$.fragment,e),Ze=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),E=g(e,"IMG",{width:!0,src:!0}),ve=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-vbyfed"&&(U.innerHTML=ne),ze=a(e),j=g(e,"TABLE",{"data-svelte-h":!0}),w(j)!=="svelte-1u5dqy3"&&(j.innerHTML=ke),Ee=a(e),A=g(e,"P",{"data-svelte-h":!0}),w(A)!=="svelte-1srzf2y"&&(A.innerHTML=Ke),Re=a(e),_(J.$$.fragment,e),$e=a(e),ye=g(e,"P",{"data-svelte-h":!0}),w(ye)!=="svelte-ka71ur"&&(ye.textContent=ge),Ye=a(e),_(we.$$.fragment,e),N=a(e),ee=g(e,"UL",{"data-svelte-h":!0}),w(ee)!=="svelte-1ghgzaf"&&(ee.innerHTML=Me),pe=a(e),se=g(e,"P",{"data-svelte-h":!0}),w(se)!=="svelte-15vx5o0"&&(se.textContent=He),R=a(e),te=g(e,"UL",{"data-svelte-h":!0}),w(te)!=="svelte-4f2tbn"&&(te.innerHTML=Se),he=a(e),ae=g(e,"P",{"data-svelte-h":!0}),w(ae)!=="svelte-1xesile"&&(ae.textContent=Ve),C=a(e),_(V.$$.fragment,e),Le=a(e),W=g(e,"DIV",{class:!0});var qe=B(W);_(Ue.$$.fragment,qe),Ge=a(qe),D=g(qe,"P",{"data-svelte-h":!0}),w(D)!=="svelte-fidpzp"&&(D.innerHTML=Ae),ue=a(qe),H=g(qe,"P",{"data-svelte-h":!0}),w(H)!=="svelte-1chy751"&&(H.innerHTML=l),S=a(qe),_(Z.$$.fragment,qe),qe.forEach(n),Fe=a(e),_(me.$$.fragment,e),L=a(e),z=g(e,"DIV",{class:!0});var Oe=B(z);_(P.$$.fragment,Oe),ce=a(Oe),d=g(Oe,"DIV",{class:!0});var ut=B(d);_(F.$$.fragment,ut),Qe=a(ut),ie=g(ut,"P",{"data-svelte-h":!0}),w(ie)!=="svelte-4612b7"&&(ie.textContent=Je),fe=a(ut),le=g(ut,"P",{"data-svelte-h":!0}),w(le)!=="svelte-b84uvg"&&(le.innerHTML=We),ut.forEach(n),Be=a(Oe),et=g(Oe,"DIV",{class:!0});var Mt=B(et);_(st.$$.fragment,Mt),xt=a(Mt),ft=g(Mt,"P",{"data-svelte-h":!0}),w(ft)!=="svelte-1scawd0"&&(ft.innerHTML=Zt),Mt.forEach(n),Oe.forEach(n),Tt=a(e),_(at.$$.fragment,e),vt=a(e),Ne=g(e,"DIV",{class:!0});var nt=B(Ne);_(it.$$.fragment,nt),Ct=a(nt),gt=g(nt,"P",{"data-svelte-h":!0}),w(gt)!=="svelte-ijd3ni"&&(gt.textContent=zt),jt=a(nt),tt=g(nt,"DIV",{class:!0});var St=B(tt);_(lt.$$.fragment,St),It=a(St),pt=g(St,"P",{"data-svelte-h":!0}),w(pt)!=="svelte-1x3yxsa"&&(pt.textContent=kt),St.forEach(n),Jt=a(nt),ot=g(nt,"DIV",{class:!0});var Ft=B(ot);_(dt.$$.fragment,Ft),Wt=a(Ft),ht=g(Ft,"P",{"data-svelte-h":!0}),w(ht)!=="svelte-1scawd0"&&(ht.innerHTML=Ut),Ft.forEach(n),nt.forEach(n),$t=a(e),_(rt.$$.fragment,e),yt=a(e),bt=g(e,"P",{}),B(bt).forEach(n),this.h()},h(){k(t,"name","hf:doc:metadata"),k(t,"content",co),k(E,"width","600"),Et(E.src,je="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/segformer_architecture.png")||k(E,"src",je),k(W,"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,p){c(document.head,t),m(e,h,p),m(e,r,p),m(e,i,p),b(y,e,p),m(e,o,p),b(M,e,p),m(e,Ze,p),m(e,I,p),m(e,q,p),m(e,X,p),m(e,be,p),m(e,O,p),m(e,Q,p),m(e,Te,p),m(e,Y,p),m(e,E,p),m(e,ve,p),m(e,de,p),m(e,oe,p),b(K,e,p),m(e,re,p),m(e,U,p),m(e,ze,p),m(e,j,p),m(e,Ee,p),m(e,A,p),m(e,Re,p),b(J,e,p),m(e,$e,p),m(e,ye,p),m(e,Ye,p),b(we,e,p),m(e,N,p),m(e,ee,p),m(e,pe,p),m(e,se,p),m(e,R,p),m(e,te,p),m(e,he,p),m(e,ae,p),m(e,C,p),b(V,e,p),m(e,Le,p),m(e,W,p),b(Ue,W,null),c(W,Ge),c(W,D),c(W,ue),c(W,H),c(W,S),b(Z,W,null),m(e,Fe,p),b(me,e,p),m(e,L,p),m(e,z,p),b(P,z,null),c(z,ce),c(z,d),b(F,d,null),c(d,Qe),c(d,ie),c(d,fe),c(d,le),c(z,Be),c(z,et),b(st,et,null),c(et,xt),c(et,ft),m(e,Tt,p),b(at,e,p),m(e,vt,p),m(e,Ne,p),b(it,Ne,null),c(Ne,Ct),c(Ne,gt),c(Ne,jt),c(Ne,tt),b(lt,tt,null),c(tt,It),c(tt,pt),c(Ne,Jt),c(Ne,ot),b(dt,ot,null),c(ot,Wt),c(ot,ht),m(e,$t,p),b(rt,e,p),m(e,yt,p),m(e,bt,p),wt=!0},p(e,[p]){const qe={};p&2&&(qe.$$scope={dirty:p,ctx:e}),Z.$set(qe);const Oe={};p&2&&(Oe.$$scope={dirty:p,ctx:e}),rt.$set(Oe)},i(e){wt||(T(y.$$.fragment,e),T(M.$$.fragment,e),T(K.$$.fragment,e),T(J.$$.fragment,e),T(we.$$.fragment,e),T(V.$$.fragment,e),T(Ue.$$.fragment,e),T(Z.$$.fragment,e),T(me.$$.fragment,e),T(P.$$.fragment,e),T(F.$$.fragment,e),T(st.$$.fragment,e),T(at.$$.fragment,e),T(it.$$.fragment,e),T(lt.$$.fragment,e),T(dt.$$.fragment,e),T(rt.$$.fragment,e),wt=!0)},o(e){v(y.$$.fragment,e),v(M.$$.fragment,e),v(K.$$.fragment,e),v(J.$$.fragment,e),v(we.$$.fragment,e),v(V.$$.fragment,e),v(Ue.$$.fragment,e),v(Z.$$.fragment,e),v(me.$$.fragment,e),v(P.$$.fragment,e),v(F.$$.fragment,e),v(st.$$.fragment,e),v(at.$$.fragment,e),v(it.$$.fragment,e),v(lt.$$.fragment,e),v(dt.$$.fragment,e),v(rt.$$.fragment,e),wt=!1},d(e){e&&(n(h),n(r),n(i),n(o),n(Ze),n(I),n(q),n(X),n(be),n(O),n(Q),n(Te),n(Y),n(E),n(ve),n(de),n(oe),n(re),n(U),n(ze),n(j),n(Ee),n(A),n(Re),n($e),n(ye),n(Ye),n(N),n(ee),n(pe),n(se),n(R),n(te),n(he),n(ae),n(C),n(Le),n(W),n(Fe),n(L),n(z),n(Tt),n(vt),n(Ne),n($t),n(yt),n(bt)),n(t),$(y,e),$(M,e),$(K,e),$(J,e),$(we,e),$(V,e),$(Ue),$(Z),$(me,e),$(P),$(F),$(st),$(at,e),$(it),$(lt),$(dt),$(rt,e)}}}const co='{"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 fo(x){return Rt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yo extends Lt{constructor(t){super(),Bt(this,t,fo,mo,Pt,{})}}export{yo as component};
