import{s as Rt,f as Lt,o as Bt,n as Pe}from"../chunks/scheduler.25b97de1.js";import{S as Ht,i as Vt,g,s,r as u,A as Gt,h as f,f as n,c as a,j as B,u as _,x as v,k,y as c,a as m,v as b,d as T,t as $,w as y}from"../chunks/index.d9030fc9.js";import{T as bt}from"../chunks/Tip.baa67368.js";import{D as G}from"../chunks/Docstring.e257edda.js";import{C as gt}from"../chunks/CodeBlock.e6cd0d95.js";import{F as qt,M as Et}from"../chunks/Markdown.7217f838.js";import{E as ct}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as Xt}from"../chunks/PipelineTag.5f100392.js";import{H as xe,E as Yt}from"../chunks/EditOnGithub.91d95064.js";function Dt(x){let t,h="Example:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function At(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function Qt(x){let t,h="Example:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function Ot(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function Kt(x){let t,h="Example:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function eo(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function to(x){let t,h="Examples:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function oo(x){let t,h,r,i,w,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/main/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,$e,de,Ie,oe,K,re,U,ne,ze,j,ke=`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`,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,ye,we,fe,Ye='The <a href="/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForImageClassification">SegformerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',ve,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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L500"}}),_e=new G({props:{name:"forward",anchor:"transformers.SegformerModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegformerModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L523",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new bt({props:{$$slots:{default:[At]},$$scope:{ctx:x}}}),Q=new ct({props:{anchor:"transformers.SegformerModel.forward.example",$$slots:{default:[Qt]},$$scope:{ctx:x}}}),Ce=new xe({props:{title:"SegformerDecodeHead",local:"transformers.SegformerDecodeHead",headingTag:"h2"}}),je=new G({props:{name:"class transformers.SegformerDecodeHead",anchor:"transformers.SegformerDecodeHead",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L675"}}),Ie=new G({props:{name:"forward",anchor:"transformers.SegformerDecodeHead.forward",parameters:[{name:"encoder_hidden_states",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L700"}}),K=new xe({props:{title:"SegformerForImageClassification",local:"transformers.SegformerForImageClassification",headingTag:"h2"}}),ne=new G({props:{name:"class transformers.SegformerForImageClassification",anchor:"transformers.SegformerForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L562"}}),ye=new G({props:{name:"forward",anchor:"transformers.SegformerForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegformerForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/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/main/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/main/src/transformers/models/segformer/modeling_segformer.py#L582",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.segformer.modeling_segformer.SegFormerImageClassifierOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/segformer#transformers.SegformerConfig"
>SegformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.segformer.modeling_segformer.SegFormerImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),N=new bt({props:{$$slots:{default:[Ot]},$$scope:{ctx:x}}}),Me=new ct({props:{anchor:"transformers.SegformerForImageClassification.forward.example",$$slots:{default:[Kt]},$$scope:{ctx:x}}}),se=new xe({props:{title:"SegformerForSemanticSegmentation",local:"transformers.SegformerForSemanticSegmentation",headingTag:"h2"}}),te=new G({props:{name:"class transformers.SegformerForSemanticSegmentation",anchor:"transformers.SegformerForSemanticSegmentation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_segformer.py#L733"}}),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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/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/main/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/main/src/transformers/models/segformer/modeling_segformer.py#L746",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new bt({props:{$$slots:{default:[eo]},$$scope:{ctx:x}}}),ue=new ct({props:{anchor:"transformers.SegformerForSemanticSegmentation.forward.example",$$slots:{default:[to]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=g("div"),u(i.$$.fragment),w=s(),o=g("p"),o.innerHTML=M,Ze=s(),I=g("div"),u(_e.$$.fragment),q=s(),X=g("p"),X.innerHTML=De,be=s(),u(O.$$.fragment),Xe=s(),u(Q.$$.fragment),Te=s(),u(Ce.$$.fragment),Y=s(),E=g("div"),u(je.$$.fragment),$e=s(),de=g("div"),u(Ie.$$.fragment),oe=s(),u(K.$$.fragment),re=s(),U=g("div"),u(ne.$$.fragment),ze=s(),j=g("p"),j.textContent=ke,Ee=s(),A=g("p"),A.innerHTML=Ke,Re=s(),J=g("div"),u(ye.$$.fragment),we=s(),fe=g("p"),fe.innerHTML=Ye,ve=s(),u(N.$$.fragment),ee=s(),u(Me.$$.fragment),pe=s(),u(se.$$.fragment),He=s(),R=g("div"),u(te.$$.fragment),Se=s(),he=g("p"),he.innerHTML=ae,Ve=s(),C=g("div"),u(V.$$.fragment),Le=s(),W=g("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=f(l,"DIV",{class:!0});var S=B(r);_(i.$$.fragment,S),w=a(S),o=f(S,"P",{"data-svelte-h":!0}),v(o)!=="svelte-1eq9zl9"&&(o.innerHTML=M),Ze=a(S),I=f(S,"DIV",{class:!0});var Z=B(I);_(_e.$$.fragment,Z),q=a(Z),X=f(Z,"P",{"data-svelte-h":!0}),v(X)!=="svelte-jczd7l"&&(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=f(l,"DIV",{class:!0});var Fe=B(E);_(je.$$.fragment,Fe),$e=a(Fe),de=f(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=f(l,"DIV",{class:!0});var L=B(U);_(ne.$$.fragment,L),ze=a(L),j=f(L,"P",{"data-svelte-h":!0}),v(j)!=="svelte-m32qg1"&&(j.textContent=ke),Ee=a(L),A=f(L,"P",{"data-svelte-h":!0}),v(A)!=="svelte-68lg8f"&&(A.innerHTML=Ke),Re=a(L),J=f(L,"DIV",{class:!0});var z=B(J);_(ye.$$.fragment,z),we=a(z),fe=f(z,"P",{"data-svelte-h":!0}),v(fe)!=="svelte-1t07fnn"&&(fe.innerHTML=Ye),ve=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=f(l,"DIV",{class:!0});var P=B(R);_(te.$$.fragment,P),Se=a(P),he=f(P,"P",{"data-svelte-h":!0}),v(he)!=="svelte-x9btf5"&&(he.innerHTML=ae),Ve=a(P),C=f(P,"DIV",{class:!0});var ce=B(C);_(V.$$.fragment,ce),Le=a(ce),W=f(ce,"P",{"data-svelte-h":!0}),v(W)!=="svelte-t24qt"&&(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,w),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,$e),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(ye,J,null),c(J,we),c(J,fe),c(J,ve),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(ye.$$.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){$(t.$$.fragment,l),$(i.$$.fragment,l),$(_e.$$.fragment,l),$(O.$$.fragment,l),$(Q.$$.fragment,l),$(Ce.$$.fragment,l),$(je.$$.fragment,l),$(Ie.$$.fragment,l),$(K.$$.fragment,l),$(ne.$$.fragment,l),$(ye.$$.fragment,l),$(N.$$.fragment,l),$(Me.$$.fragment,l),$(se.$$.fragment,l),$(te.$$.fragment,l),$(V.$$.fragment,l),$(D.$$.fragment,l),$(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)),y(t,l),y(i),y(_e),y(O),y(Q),y(Ce,l),y(je),y(Ie),y(K,l),y(ne),y(ye),y(N),y(Me),y(se,l),y(te),y(V),y(D),y(ue)}}}function ro(x){let t,h;return t=new Et({props:{$$slots:{default:[oo]},$$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 w={};i&2&&(w.$$scope={dirty:i,ctx:r}),t.$set(w)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){$(t.$$.fragment,r),h=!1},d(r){y(t,r)}}}function no(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function so(x){let t,h="Example:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function ao(x){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function io(x){let t,h="Example:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function lo(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=g("p"),t.innerHTML=h},l(r){t=f(r,"P",{"data-svelte-h":!0}),v(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,i){m(r,t,i)},p:Pe,d(r){r&&n(t)}}}function mo(x){let t,h="Examples:",r,i,w;return i=new gt({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=g("p"),t.textContent=h,r=s(),u(i.$$.fragment)},l(o){t=f(o,"P",{"data-svelte-h":!0}),v(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),w=!0},p:Pe,i(o){w||(T(i.$$.fragment,o),w=!0)},o(o){$(i.$$.fragment,o),w=!1},d(o){o&&(n(t),n(r)),y(i,o)}}}function co(x){let t,h,r,i,w,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/main/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Xe,Q,Te=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Ce,Y,E,je,$e,de='The <a href="/docs/transformers/main/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,ye=`This model inherits from <a href="/docs/transformers/main/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.)`,we,fe,Ye=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,ve,N,ee,Me,pe,se='The <a href="/docs/transformers/main/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/main/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ge,D,Ae=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,ue,H,l,S,Z,Fe='The <a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/segformer/modeling_tf_segformer.py#L705",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oe=new bt({props:{$$slots:{default:[no]},$$scope:{ctx:x}}}),re=new ct({props:{anchor:"transformers.TFSegformerModel.call.example",$$slots:{default:[so]},$$scope:{ctx:x}}}),ne=new xe({props:{title:"TFSegformerForImageClassification",local:"transformers.TFSegformerForImageClassification",headingTag:"h2"}}),ke=new G({props:{name:"class transformers.TFSegformerForImageClassification",anchor:"transformers.TFSegformerForImageClassification",parameters:[{name:"config",val:": SegformerConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSegformerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/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/main/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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/segformer/modeling_tf_segformer.py#L758",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),R=new bt({props:{$$slots:{default:[ao]},$$scope:{ctx:x}}}),Se=new ct({props:{anchor:"transformers.TFSegformerForImageClassification.call.example",$$slots:{default:[io]},$$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/main/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/main/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/main/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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/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/main/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/main/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/main/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 bt({props:{$$slots:{default:[lo]},$$scope:{ctx:x}}}),P=new ct({props:{anchor:"transformers.TFSegformerForSemanticSegmentation.call.example",$$slots:{default:[mo]},$$scope:{ctx:x}}}),{c(){u(t.$$.fragment),h=s(),r=g("div"),u(i.$$.fragment),w=s(),o=g("div"),u(M.$$.fragment),Ze=s(),u(I.$$.fragment),_e=s(),q=g("div"),u(X.$$.fragment),De=s(),be=g("p"),be.innerHTML=O,Xe=s(),Q=g("p"),Q.innerHTML=Te,Ce=s(),Y=g("div"),u(E.$$.fragment),je=s(),$e=g("p"),$e.innerHTML=de,Ie=s(),u(oe.$$.fragment),K=s(),u(re.$$.fragment),U=s(),u(ne.$$.fragment),ze=s(),j=g("div"),u(ke.$$.fragment),Ee=s(),A=g("p"),A.textContent=Ke,Re=s(),J=g("p"),J.innerHTML=ye,we=s(),fe=g("p"),fe.innerHTML=Ye,ve=s(),N=g("div"),u(ee.$$.fragment),Me=s(),pe=g("p"),pe.innerHTML=se,He=s(),u(R.$$.fragment),te=s(),u(Se.$$.fragment),he=s(),u(ae.$$.fragment),Ve=s(),C=g("div"),u(V.$$.fragment),Le=s(),W=g("p"),W.innerHTML=Ue,Ge=s(),D=g("p"),D.innerHTML=Ae,ue=s(),H=g("div"),u(l.$$.fragment),S=s(),Z=g("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=f(d,"DIV",{class:!0});var F=B(r);_(i.$$.fragment,F),w=a(F),o=f(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=f(d,"DIV",{class:!0});var ie=B(q);_(X.$$.fragment,ie),De=a(ie),be=f(ie,"P",{"data-svelte-h":!0}),v(be)!=="svelte-l7vec2"&&(be.innerHTML=O),Xe=a(ie),Q=f(ie,"P",{"data-svelte-h":!0}),v(Q)!=="svelte-1be7e3c"&&(Q.innerHTML=Te),Ce=a(ie),Y=f(ie,"DIV",{class:!0});var Je=B(Y);_(E.$$.fragment,Je),je=a(Je),$e=f(Je,"P",{"data-svelte-h":!0}),v($e)!=="svelte-1bcfza5"&&($e.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=f(d,"DIV",{class:!0});var ge=B(j);_(ke.$$.fragment,ge),Ee=a(ge),A=f(ge,"P",{"data-svelte-h":!0}),v(A)!=="svelte-m32qg1"&&(A.textContent=Ke),Re=a(ge),J=f(ge,"P",{"data-svelte-h":!0}),v(J)!=="svelte-1qaxm70"&&(J.innerHTML=ye),we=a(ge),fe=f(ge,"P",{"data-svelte-h":!0}),v(fe)!=="svelte-1be7e3c"&&(fe.innerHTML=Ye),ve=a(ge),N=f(ge,"DIV",{class:!0});var le=B(N);_(ee.$$.fragment,le),Me=a(le),pe=f(le,"P",{"data-svelte-h":!0}),v(pe)!=="svelte-p7zmrz"&&(pe.innerHTML=se),He=a(le),_(R.$$.fragment,le),te=a(le),_(Se.$$.fragment,le),le.forEach(n),ge.forEach(n),he=a(d),_(ae.$$.fragment,d),Ve=a(d),C=f(d,"DIV",{class:!0});var We=B(C);_(V.$$.fragment,We),Le=a(We),W=f(We,"P",{"data-svelte-h":!0}),v(W)!=="svelte-8r2i3i"&&(W.innerHTML=Ue),Ge=a(We),D=f(We,"P",{"data-svelte-h":!0}),v(D)!=="svelte-1be7e3c"&&(D.innerHTML=Ae),ue=a(We),H=f(We,"DIV",{class:!0});var Be=B(H);_(l.$$.fragment,Be),S=a(Be),Z=f(Be,"P",{"data-svelte-h":!0}),v(Z)!=="svelte-1vmjagp"&&(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,w),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,$e),c(Y,Ie),b(oe,Y,null),c(Y,K),b(re,Y,null),m(d,U,F),b(ne,d,F),m(d,ze,F),m(d,j,F),b(ke,j,null),c(j,Ee),c(j,A),c(j,Re),c(j,J),c(j,we),c(j,fe),c(j,ve),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 ge={};F&2&&(ge.$$scope={dirty:F,ctx:d}),Se.$set(ge);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){$(t.$$.fragment,d),$(i.$$.fragment,d),$(M.$$.fragment,d),$(I.$$.fragment,d),$(X.$$.fragment,d),$(E.$$.fragment,d),$(oe.$$.fragment,d),$(re.$$.fragment,d),$(ne.$$.fragment,d),$(ke.$$.fragment,d),$(ee.$$.fragment,d),$(R.$$.fragment,d),$(Se.$$.fragment,d),$(ae.$$.fragment,d),$(V.$$.fragment,d),$(l.$$.fragment,d),$(L.$$.fragment,d),$(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)),y(t,d),y(i),y(M),y(I,d),y(X),y(E),y(oe),y(re),y(ne,d),y(ke),y(ee),y(R),y(Se),y(ae,d),y(V),y(l),y(L),y(P)}}}function go(x){let t,h;return t=new Et({props:{$$slots:{default:[co]},$$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 w={};i&2&&(w.$$scope={dirty:i,ctx:r}),t.$set(w)},i(r){h||(T(t.$$.fragment,r),h=!0)},o(r){$(t.$$.fragment,r),h=!1},d(r){y(t,r)}}}function fo(x){let t,h,r,i,w,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,$e,de,Ie=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The TensorFlow version
of the model was contributed by <a href="https://huggingface.co/sayakpaul" rel="nofollow">sayakpaul</a>. The original code can be found <a href="https://github.com/NVlabs/SegFormer" rel="nofollow">here</a>.`,oe,K,re,U,ne=`<li>SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
<a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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,ye,we,fe="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with SegFormer.",Ye,ve,N,ee,Me='<li><a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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.",ge,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,jt,ft,kt='Converts the output of <a href="/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',$t,at,yt,Ne,it,It,pt,Ut="Constructs a Segformer image processor.",Jt,tt,lt,Wt,ht,Nt="Preprocess an image or batch of images.",Zt,ot,dt,zt,ut,Pt='Converts the output of <a href="/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation">SegformerForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',wt,rt,vt,mt,Mt,Tt,St;return w=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"}}),ve=new Xt({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/main/src/transformers/models/segformer/configuration_segformer.py#L31"}}),Z=new ct({props:{anchor:"transformers.SegformerConfig.example",$$slots:{default:[Dt]},$$scope:{ctx:x}}}),me=new xe({props:{title:"SegformerFeatureExtractor",local:"transformers.SegformerFeatureExtractor",headingTag:"h2"}}),P=new G({props:{name:"class transformers.SegformerFeatureExtractor",anchor:"transformers.SegformerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/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/main/src/transformers/models/segformer/image_processing_segformer.py#L314"}}),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/main/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/main/src/transformers/models/segformer/image_processing_segformer.py#L457",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/main/src/transformers/models/segformer/image_processing_segformer.py#L51"}}),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/main/src/transformers/models/segformer/image_processing_segformer.py#L323"}}),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/main/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/main/src/transformers/models/segformer/image_processing_segformer.py#L457",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


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