import{S as v_,i as y_,s as T_,e as r,k as d,w as v,t as n,M as w_,c as a,d as t,m as c,a as s,x as y,h as l,b as i,N as S_,G as e,g as p,y as T,q as w,o as S,B as $,v as $_,L as br}from"../../chunks/vendor-hf-doc-builder.js";import{T as Da}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as vr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as B}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _r}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as M_}from"../../chunks/PipelineTag-hf-doc-builder.js";function F_(F){let f,M,_,u,b;return u=new vr({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`}}),{c(){f=r("p"),M=n("Example:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Example:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function E_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function I_(F){let f,M,_,u,b;return u=new vr({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>]`}}),{c(){f=r("p"),M=n("Example:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Example:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function k_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function C_(F){let f,M,_,u,b;return u=new vr({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`}}),{c(){f=r("p"),M=n("Example:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Example:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function j_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function x_(F){let f,M,_,u,b;return u=new vr({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>]`}}),{c(){f=r("p"),M=n("Examples:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Examples:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function J_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function W_(F){let f,M,_,u,b;return u=new vr({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>]`}}),{c(){f=r("p"),M=n("Example:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Example:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function z_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function Z_(F){let f,M,_,u,b;return u=new vr({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`}}),{c(){f=r("p"),M=n("Example:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Example:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function U_(F){let f,M,_,u,b;return{c(){f=r("p"),M=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(g,"CODE",{});var E=s(_);u=l(E,"Module"),E.forEach(t),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(m,g){p(m,f,g),e(f,M),e(f,_),e(_,u),e(f,b)},d(m){m&&t(f)}}}function P_(F){let f,M,_,u,b;return u=new vr({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>]`}}),{c(){f=r("p"),M=n("Examples:"),_=d(),v(u.$$.fragment)},l(m){f=a(m,"P",{});var g=s(f);M=l(g,"Examples:"),g.forEach(t),_=c(m),y(u.$$.fragment,m)},m(m,g){p(m,f,g),e(f,M),p(m,_,g),T(u,m,g),b=!0},p:br,i(m){b||(w(u.$$.fragment,m),b=!0)},o(m){S(u.$$.fragment,m),b=!1},d(m){m&&t(f),m&&t(_),$(u,m)}}}function N_(F){let f,M,_,u,b,m,g,E,Vl,vn,ve,Ge,Ba,Nt,Gl,Va,Ll,yn,Le,ql,At,Hl,Xl,Tn,yr,Yl,wn,Tr,Ga,Ol,Sn,qe,Ql,Rt,Kl,ei,$n,Dt,up,Mn,Y,ti,Bt,oi,ri,Vt,ai,si,Gt,ni,li,Fn,wr,ii,En,C,V,di,Sr,ci,mi,$r,fi,hi,Mr,pi,gi,Lt,ui,_i,bi,ye,vi,qt,yi,Ti,Ht,wi,Si,$i,Xt,Mi,Yt,Fi,Ei,Ii,Ot,ki,Qt,Ci,ji,xi,Kt,Ji,La,Wi,zi,Zi,Te,Ui,Fr,Pi,Ni,eo,Ai,Ri,Di,I,Bi,Er,Vi,Gi,qa,Li,qi,Ha,Hi,Xi,Xa,Yi,Oi,Ya,Qi,Ki,Oa,ed,td,Ir,od,rd,Qa,ad,sd,Ka,nd,ld,id,to,dd,oo,cd,md,In,He,es,J,kr,ts,fd,hd,os,rs,pd,gd,as,ss,ud,_d,Cr,ns,bd,vd,jr,ls,yd,Td,xr,is,wd,Sd,W,z,Jr,$d,Md,ds,Fd,Ed,cs,Id,kd,Wr,Cd,jd,zr,xd,Jd,Zr,Wd,zd,Z,Ur,Zd,Ud,ms,Pd,Nd,fs,Ad,Rd,Pr,Dd,Bd,Nr,Vd,Gd,Ar,Ld,qd,U,Rr,Hd,Xd,hs,Yd,Od,ps,Qd,Kd,Dr,ec,tc,Br,oc,rc,Vr,ac,sc,P,Gr,nc,lc,gs,ic,dc,us,cc,mc,Lr,fc,hc,qr,pc,gc,Hr,uc,_c,N,Xr,bc,vc,_s,yc,Tc,bs,wc,Sc,Yr,$c,Mc,Or,Fc,Ec,Qr,Ic,kc,A,Kr,Cc,jc,vs,xc,Jc,ys,Wc,zc,ea,Zc,Uc,ta,Pc,Nc,oa,Ac,kn,Xe,Rc,ro,Dc,Bc,Cn,we,Ye,Ts,ao,Vc,ws,Gc,jn,ra,Lc,xn,so,Jn,Oe,pe,aa,qc,Hc,no,Xc,Yc,lo,Oc,Qc,Kc,Ss,sa,em,Wn,na,tm,zn,D,Qe,la,om,rm,io,am,sm,nm,co,lm,mo,im,dm,cm,fo,mm,ho,fm,hm,pm,Ke,ia,gm,um,po,_m,bm,vm,$s,da,ym,Zn,ca,Tm,Un,Se,et,Ms,go,wm,Fs,Sm,Pn,G,uo,$m,$e,Mm,ma,Fm,Em,_o,Im,km,Cm,Me,jm,fa,xm,Jm,ha,Wm,zm,Zm,tt,Nn,Fe,ot,Es,bo,Um,Is,Pm,An,me,vo,Nm,ge,yo,Am,ks,Rm,Dm,Ee,Bm,Cs,Vm,Gm,js,Lm,qm,Hm,rt,To,Xm,wo,Ym,pa,Om,Qm,Rn,Ie,at,xs,So,Km,Js,ef,Dn,L,$o,tf,Ws,of,rf,st,Mo,af,zs,sf,nf,nt,Fo,lf,Eo,df,ga,cf,mf,Bn,ke,lt,Zs,Io,ff,Us,hf,Vn,fe,ko,pf,Co,gf,jo,uf,_f,bf,O,xo,vf,Ce,yf,ua,Tf,wf,Ps,Sf,$f,Mf,it,Ff,dt,Gn,je,ct,Ns,Jo,Ef,As,If,Ln,xe,Wo,kf,_a,zo,qn,Je,mt,Rs,Zo,Cf,Ds,jf,Hn,q,Uo,xf,Bs,Jf,Wf,Po,zf,No,Zf,Uf,Pf,Q,Ao,Nf,We,Af,ba,Rf,Df,Vs,Bf,Vf,Gf,ft,Lf,ht,Xn,ze,pt,Gs,Ro,qf,Ls,Hf,Yn,he,Do,Xf,Bo,Yf,Vo,Of,Qf,Kf,K,Go,eh,Ze,th,va,oh,rh,qs,ah,sh,nh,gt,lh,ut,On,Ue,_t,Hs,Lo,ih,Xs,dh,Qn,Pe,qo,ch,ya,Ho,Kn,Ne,bt,Ys,Xo,mh,Os,fh,el,H,Yo,hh,Oo,ph,Ta,gh,uh,_h,Qo,bh,Ko,vh,yh,Th,ee,er,wh,Ae,Sh,wa,$h,Mh,Qs,Fh,Eh,Ih,vt,kh,yt,tl,Re,Tt,Ks,tr,Ch,en,jh,ol,R,or,xh,tn,Jh,Wh,rr,zh,Sa,Zh,Uh,Ph,ar,Nh,sr,Ah,Rh,Dh,te,nr,Bh,De,Vh,$a,Gh,Lh,on,qh,Hh,Xh,wt,Yh,St,rl,Be,$t,rn,lr,Oh,an,Qh,al,X,ir,Kh,dr,ep,Ma,tp,op,rp,cr,ap,mr,sp,np,lp,oe,fr,ip,Ve,dp,Fa,cp,mp,sn,fp,hp,pp,Mt,gp,Ft,sl;return m=new B({}),Nt=new B({}),ao=new B({}),so=new M_({props:{pipeline:"image-classification"}}),go=new B({}),uo=new k({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 [2, 2, 2, 2]) &#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 [8, 4, 2, 1]) &#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 [32, 64, 160, 256]) &#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 [7, 3, 3, 3]) &#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 [4, 2, 2, 2]) &#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 [1, 2, 5, 8]) &#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 [4, 4, 4, 4]) &#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-6) &#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#L38"}}),tt=new _r({props:{anchor:"transformers.SegformerConfig.example",$$slots:{default:[F_]},$$scope:{ctx:F}}}),bo=new B({}),vo=new k({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"}}),yo=new k({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#L296"}}),To=new k({props:{name:"post_process_semantic_segmentation",anchor:"transformers.SegformerFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = 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#L441",returnDescription:`
<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:`
<p>semantic_segmentation</p>
`}}),So=new B({}),$o=new k({props:{name:"class transformers.SegformerImageProcessor",anchor:"transformers.SegformerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = 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>PILImageResampling.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#L49"}}),Mo=new k({props:{name:"preprocess",anchor:"transformers.SegformerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')], NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_reduce_labels",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = 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#L305"}}),Fo=new k({props:{name:"post_process_semantic_segmentation",anchor:"transformers.SegformerImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = 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#L441",returnDescription:`
<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:`
<p>semantic_segmentation</p>
`}}),Io=new B({}),ko=new k({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#L510"}}),xo=new k({props:{name:"forward",anchor:"transformers.SegformerModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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#L529",returnDescription:`
<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>) \u2014 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>) \u2014 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>) \u2014 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:`
<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>
`}}),it=new Da({props:{$$slots:{default:[E_]},$$scope:{ctx:F}}}),dt=new _r({props:{anchor:"transformers.SegformerModel.forward.example",$$slots:{default:[I_]},$$scope:{ctx:F}}}),Jo=new B({}),Wo=new k({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#L681"}}),zo=new k({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#L706"}}),Zo=new B({}),Uo=new k({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#L575"}}),Ao=new k({props:{name:"forward",anchor:"transformers.SegformerForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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#L588",returnDescription:`
<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) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, 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>) \u2014 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:`
<p><code>transformers.models.segformer.modeling_segformer.SegFormerImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new Da({props:{$$slots:{default:[k_]},$$scope:{ctx:F}}}),ht=new _r({props:{anchor:"transformers.SegformerForImageClassification.forward.example",$$slots:{default:[C_]},$$scope:{ctx:F}}}),Ro=new B({}),Do=new k({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#L743"}}),Go=new k({props:{name:"forward",anchor:"transformers.SegformerForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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#L752",returnDescription:`
<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) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 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>) \u2014 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>) \u2014 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:`
<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>
`}}),gt=new Da({props:{$$slots:{default:[j_]},$$scope:{ctx:F}}}),ut=new _r({props:{anchor:"transformers.SegformerForSemanticSegmentation.forward.example",$$slots:{default:[x_]},$$scope:{ctx:F}}}),Lo=new B({}),qo=new k({props:{name:"class transformers.TFSegformerDecodeHead",anchor:"transformers.TFSegformerDecodeHead",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_tf_segformer.py#L690"}}),Ho=new k({props:{name:"call",anchor:"transformers.TFSegformerDecodeHead.call",parameters:[{name:"encoder_hidden_states",val:""},{name:"training",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/segformer/modeling_tf_segformer.py#L712"}}),Xo=new B({}),Yo=new k({props:{name:"class transformers.TFSegformerModel",anchor:"transformers.TFSegformerModel",parameters:[{name:"*args",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#L574"}}),er=new k({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#L582",returnDescription:`
<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>) \u2014 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>) \u2014 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>) \u2014 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:`
<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>
`}}),vt=new Da({props:{$$slots:{default:[J_]},$$scope:{ctx:F}}}),yt=new _r({props:{anchor:"transformers.TFSegformerModel.call.example",$$slots:{default:[W_]},$$scope:{ctx:F}}}),tr=new B({}),or=new k({props:{name:"class transformers.TFSegformerForImageClassification",anchor:"transformers.TFSegformerForImageClassification",parameters:[{name:"*args",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#L616"}}),nr=new k({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#L626",returnDescription:`
<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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<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>
`}}),wt=new Da({props:{$$slots:{default:[z_]},$$scope:{ctx:F}}}),St=new _r({props:{anchor:"transformers.TFSegformerForImageClassification.call.example",$$slots:{default:[Z_]},$$scope:{ctx:F}}}),lr=new B({}),ir=new k({props:{name:"class transformers.TFSegformerForSemanticSegmentation",anchor:"transformers.TFSegformerForSemanticSegmentation",parameters:[{name:"*args",val:""},{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#L749"}}),fr=new k({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#L775",returnDescription:`
<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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Mt=new Da({props:{$$slots:{default:[U_]},$$scope:{ctx:F}}}),Ft=new _r({props:{anchor:"transformers.TFSegformerForSemanticSegmentation.call.example",$$slots:{default:[P_]},$$scope:{ctx:F}}}),{c(){f=r("meta"),M=d(),_=r("h1"),u=r("a"),b=r("span"),v(m.$$.fragment),g=d(),E=r("span"),Vl=n("SegFormer"),vn=d(),ve=r("h2"),Ge=r("a"),Ba=r("span"),v(Nt.$$.fragment),Gl=d(),Va=r("span"),Ll=n("Overview"),yn=d(),Le=r("p"),ql=n("The SegFormer model was proposed in "),At=r("a"),Hl=n("SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers"),Xl=n(` 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.`),Tn=d(),yr=r("p"),Yl=n("The abstract from the paper is the following:"),wn=d(),Tr=r("p"),Ga=r("em"),Ol=n(`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.`),Sn=d(),qe=r("p"),Ql=n("The figure below illustrates the architecture of SegFormer. Taken from the "),Rt=r("a"),Kl=n("original paper"),ei=n("."),$n=d(),Dt=r("img"),Mn=d(),Y=r("p"),ti=n("This model was contributed by "),Bt=r("a"),oi=n("nielsr"),ri=n(`. The TensorFlow version
of the model was contributed by `),Vt=r("a"),ai=n("sayakpaul"),si=n(". The original code can be found "),Gt=r("a"),ni=n("here"),li=n("."),Fn=d(),wr=r("p"),ii=n("Tips:"),En=d(),C=r("ul"),V=r("li"),di=n(`SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
`),Sr=r("a"),ci=n("SegformerModel"),mi=n(` is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). `),$r=r("a"),fi=n("SegformerForSemanticSegmentation"),hi=n(` adds the all-MLP decoder head on
top to perform semantic segmentation of images. In addition, there\u2019s
`),Mr=r("a"),pi=n("SegformerForImageClassification"),gi=n(` 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 `),Lt=r("a"),ui=n("hub"),_i=n("."),bi=d(),ye=r("li"),vi=n("The quickest way to get started with SegFormer is by checking the "),qt=r("a"),yi=n("example notebooks"),Ti=n(` (which showcase both inference and
fine-tuning on custom data). One can also check out the `),Ht=r("a"),wi=n("blog post"),Si=n(" introducing SegFormer and illustrating how it can be fine-tuned on custom data."),$i=d(),Xt=r("li"),Mi=n("TensorFlow users should refer to "),Yt=r("a"),Fi=n("this repository"),Ei=n(" that shows off-the-shelf inference and fine-tuning."),Ii=d(),Ot=r("li"),ki=n("One can also check out "),Qt=r("a"),Ci=n("this interactive demo on Hugging Face Spaces"),ji=n(`
to try out a SegFormer model on custom images.`),xi=d(),Kt=r("li"),Ji=n("SegFormer works on any input size, as it pads the input to be divisible by "),La=r("code"),Wi=n("config.patch_sizes"),zi=n("."),Zi=d(),Te=r("li"),Ui=n("One can use "),Fr=r("a"),Pi=n("SegformerImageProcessor"),Ni=n(` 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 `),eo=r("a"),Ai=n("here"),Ri=n(`. 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.`),Di=d(),I=r("li"),Bi=n("One additional thing to keep in mind is that one can initialize "),Er=r("a"),Vi=n("SegformerImageProcessor"),Gi=n(` with
`),qa=r("code"),Li=n("reduce_labels"),qi=n(" set to "),Ha=r("code"),Hi=n("True"),Xi=n(" or "),Xa=r("code"),Yi=n("False"),Oi=n(`. In some datasets (like ADE20k), the 0 index is used in the annotated
segmentation maps for background. However, ADE20k doesn\u2019t include the \u201Cbackground\u201D class in its 150 labels.
Therefore, `),Ya=r("code"),Qi=n("reduce_labels"),Ki=n(` 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 `),Oa=r("em"),ed=n("ignore_index"),td=n(` of the loss function
used by `),Ir=r("a"),od=n("SegformerForSemanticSegmentation"),rd=n(`). However, other datasets use the 0 index as
background class and include this class as part of all labels. In that case, `),Qa=r("code"),ad=n("reduce_labels"),sd=n(` should be set to
`),Ka=r("code"),nd=n("False"),ld=n(", as loss should also be computed for the background class."),id=d(),to=r("li"),dd=n(`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 `),oo=r("a"),cd=n("original paper"),md=n(")."),In=d(),He=r("table"),es=r("thead"),J=r("tr"),kr=r("th"),ts=r("strong"),fd=n("Model variant"),hd=d(),os=r("th"),rs=r("strong"),pd=n("Depths"),gd=d(),as=r("th"),ss=r("strong"),ud=n("Hidden sizes"),_d=d(),Cr=r("th"),ns=r("strong"),bd=n("Decoder hidden size"),vd=d(),jr=r("th"),ls=r("strong"),yd=n("Params (M)"),Td=d(),xr=r("th"),is=r("strong"),wd=n("ImageNet-1k Top 1"),Sd=d(),W=r("tbody"),z=r("tr"),Jr=r("td"),$d=n("MiT-b0"),Md=d(),ds=r("td"),Fd=n("[2, 2, 2, 2]"),Ed=d(),cs=r("td"),Id=n("[32, 64, 160, 256]"),kd=d(),Wr=r("td"),Cd=n("256"),jd=d(),zr=r("td"),xd=n("3.7"),Jd=d(),Zr=r("td"),Wd=n("70.5"),zd=d(),Z=r("tr"),Ur=r("td"),Zd=n("MiT-b1"),Ud=d(),ms=r("td"),Pd=n("[2, 2, 2, 2]"),Nd=d(),fs=r("td"),Ad=n("[64, 128, 320, 512]"),Rd=d(),Pr=r("td"),Dd=n("256"),Bd=d(),Nr=r("td"),Vd=n("14.0"),Gd=d(),Ar=r("td"),Ld=n("78.7"),qd=d(),U=r("tr"),Rr=r("td"),Hd=n("MiT-b2"),Xd=d(),hs=r("td"),Yd=n("[3, 4, 6, 3]"),Od=d(),ps=r("td"),Qd=n("[64, 128, 320, 512]"),Kd=d(),Dr=r("td"),ec=n("768"),tc=d(),Br=r("td"),oc=n("25.4"),rc=d(),Vr=r("td"),ac=n("81.6"),sc=d(),P=r("tr"),Gr=r("td"),nc=n("MiT-b3"),lc=d(),gs=r("td"),ic=n("[3, 4, 18, 3]"),dc=d(),us=r("td"),cc=n("[64, 128, 320, 512]"),mc=d(),Lr=r("td"),fc=n("768"),hc=d(),qr=r("td"),pc=n("45.2"),gc=d(),Hr=r("td"),uc=n("83.1"),_c=d(),N=r("tr"),Xr=r("td"),bc=n("MiT-b4"),vc=d(),_s=r("td"),yc=n("[3, 8, 27, 3]"),Tc=d(),bs=r("td"),wc=n("[64, 128, 320, 512]"),Sc=d(),Yr=r("td"),$c=n("768"),Mc=d(),Or=r("td"),Fc=n("62.6"),Ec=d(),Qr=r("td"),Ic=n("83.6"),kc=d(),A=r("tr"),Kr=r("td"),Cc=n("MiT-b5"),jc=d(),vs=r("td"),xc=n("[3, 6, 40, 3]"),Jc=d(),ys=r("td"),Wc=n("[64, 128, 320, 512]"),zc=d(),ea=r("td"),Zc=n("768"),Uc=d(),ta=r("td"),Pc=n("82.0"),Nc=d(),oa=r("td"),Ac=n("83.8"),kn=d(),Xe=r("p"),Rc=n(`Note that MiT in the above table refers to the Mix Transformer encoder backbone introduced in SegFormer. For
SegFormer\u2019s results on the segmentation datasets like ADE20k, refer to the `),ro=r("a"),Dc=n("paper"),Bc=n("."),Cn=d(),we=r("h2"),Ye=r("a"),Ts=r("span"),v(ao.$$.fragment),Vc=d(),ws=r("span"),Gc=n("Resources"),jn=d(),ra=r("p"),Lc=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with SegFormer."),xn=d(),v(so.$$.fragment),Jn=d(),Oe=r("ul"),pe=r("li"),aa=r("a"),qc=n("SegformerForImageClassification"),Hc=n(" is supported by this "),no=r("a"),Xc=n("example script"),Yc=n(" and "),lo=r("a"),Oc=n("notebook"),Qc=n("."),Kc=d(),Ss=r("li"),sa=r("a"),em=n("Image classification task guide"),Wn=d(),na=r("p"),tm=n("Semantic segmentation:"),zn=d(),D=r("ul"),Qe=r("li"),la=r("a"),om=n("SegformerForSemanticSegmentation"),rm=n(" is supported by this "),io=r("a"),am=n("example script"),sm=n("."),nm=d(),co=r("li"),lm=n("A blog on fine-tuning SegFormer on a custom dataset can be found "),mo=r("a"),im=n("here"),dm=n("."),cm=d(),fo=r("li"),mm=n("More demo notebooks on SegFormer (both inference + fine-tuning on a custom dataset) can be found "),ho=r("a"),fm=n("here"),hm=n("."),pm=d(),Ke=r("li"),ia=r("a"),gm=n("TFSegformerForSemanticSegmentation"),um=n(" is supported by this "),po=r("a"),_m=n("example notebook"),bm=n("."),vm=d(),$s=r("li"),da=r("a"),ym=n("Semantic segmentation task guide"),Zn=d(),ca=r("p"),Tm=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Un=d(),Se=r("h2"),et=r("a"),Ms=r("span"),v(go.$$.fragment),wm=d(),Fs=r("span"),Sm=n("SegformerConfig"),Pn=d(),G=r("div"),v(uo.$$.fragment),$m=d(),$e=r("p"),Mm=n("This is the configuration class to store the configuration of a "),ma=r("a"),Fm=n("SegformerModel"),Em=n(`. 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
`),_o=r("a"),Im=n("nvidia/segformer-b0-finetuned-ade-512-512"),km=n(`
architecture.`),Cm=d(),Me=r("p"),jm=n("Configuration objects inherit from "),fa=r("a"),xm=n("PretrainedConfig"),Jm=n(` and can be used to control the model outputs. Read the
documentation from `),ha=r("a"),Wm=n("PretrainedConfig"),zm=n(" for more information."),Zm=d(),v(tt.$$.fragment),Nn=d(),Fe=r("h2"),ot=r("a"),Es=r("span"),v(bo.$$.fragment),Um=d(),Is=r("span"),Pm=n("SegformerFeatureExtractor"),An=d(),me=r("div"),v(vo.$$.fragment),Nm=d(),ge=r("div"),v(yo.$$.fragment),Am=d(),ks=r("p"),Rm=n("Preprocesses a batch of images and optionally segmentation maps."),Dm=d(),Ee=r("p"),Bm=n("Overrides the "),Cs=r("code"),Vm=n("__call__"),Gm=n(" method of the "),js=r("code"),Lm=n("Preprocessor"),qm=n(` class so that both images and segmentation maps can be
passed in as positional arguments.`),Hm=d(),rt=r("div"),v(To.$$.fragment),Xm=d(),wo=r("p"),Ym=n("Converts the output of "),pa=r("a"),Om=n("SegformerForSemanticSegmentation"),Qm=n(` into semantic segmentation maps. Only supports
PyTorch.`),Rn=d(),Ie=r("h2"),at=r("a"),xs=r("span"),v(So.$$.fragment),Km=d(),Js=r("span"),ef=n("SegformerImageProcessor"),Dn=d(),L=r("div"),v($o.$$.fragment),tf=d(),Ws=r("p"),of=n("Constructs a Segformer image processor."),rf=d(),st=r("div"),v(Mo.$$.fragment),af=d(),zs=r("p"),sf=n("Preprocess an image or batch of images."),nf=d(),nt=r("div"),v(Fo.$$.fragment),lf=d(),Eo=r("p"),df=n("Converts the output of "),ga=r("a"),cf=n("SegformerForSemanticSegmentation"),mf=n(` into semantic segmentation maps. Only supports
PyTorch.`),Bn=d(),ke=r("h2"),lt=r("a"),Zs=r("span"),v(Io.$$.fragment),ff=d(),Us=r("span"),hf=n("SegformerModel"),Vn=d(),fe=r("div"),v(ko.$$.fragment),pf=d(),Co=r("p"),gf=n(`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),jo=r("a"),uf=n("torch.nn.Module"),_f=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),bf=d(),O=r("div"),v(xo.$$.fragment),vf=d(),Ce=r("p"),yf=n("The "),ua=r("a"),Tf=n("SegformerModel"),wf=n(" forward method, overrides the "),Ps=r("code"),Sf=n("__call__"),$f=n(" special method."),Mf=d(),v(it.$$.fragment),Ff=d(),v(dt.$$.fragment),Gn=d(),je=r("h2"),ct=r("a"),Ns=r("span"),v(Jo.$$.fragment),Ef=d(),As=r("span"),If=n("SegformerDecodeHead"),Ln=d(),xe=r("div"),v(Wo.$$.fragment),kf=d(),_a=r("div"),v(zo.$$.fragment),qn=d(),Je=r("h2"),mt=r("a"),Rs=r("span"),v(Zo.$$.fragment),Cf=d(),Ds=r("span"),jf=n("SegformerForImageClassification"),Hn=d(),q=r("div"),v(Uo.$$.fragment),xf=d(),Bs=r("p"),Jf=n(`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),Wf=d(),Po=r("p"),zf=n("This model is a PyTorch "),No=r("a"),Zf=n("torch.nn.Module"),Uf=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pf=d(),Q=r("div"),v(Ao.$$.fragment),Nf=d(),We=r("p"),Af=n("The "),ba=r("a"),Rf=n("SegformerForImageClassification"),Df=n(" forward method, overrides the "),Vs=r("code"),Bf=n("__call__"),Vf=n(" special method."),Gf=d(),v(ft.$$.fragment),Lf=d(),v(ht.$$.fragment),Xn=d(),ze=r("h2"),pt=r("a"),Gs=r("span"),v(Ro.$$.fragment),qf=d(),Ls=r("span"),Hf=n("SegformerForSemanticSegmentation"),Yn=d(),he=r("div"),v(Do.$$.fragment),Xf=d(),Bo=r("p"),Yf=n(`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model is a PyTorch `),Vo=r("a"),Of=n("torch.nn.Module"),Qf=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kf=d(),K=r("div"),v(Go.$$.fragment),eh=d(),Ze=r("p"),th=n("The "),va=r("a"),oh=n("SegformerForSemanticSegmentation"),rh=n(" forward method, overrides the "),qs=r("code"),ah=n("__call__"),sh=n(" special method."),nh=d(),v(gt.$$.fragment),lh=d(),v(ut.$$.fragment),On=d(),Ue=r("h2"),_t=r("a"),Hs=r("span"),v(Lo.$$.fragment),ih=d(),Xs=r("span"),dh=n("TFSegformerDecodeHead"),Qn=d(),Pe=r("div"),v(qo.$$.fragment),ch=d(),ya=r("div"),v(Ho.$$.fragment),Kn=d(),Ne=r("h2"),bt=r("a"),Ys=r("span"),v(Xo.$$.fragment),mh=d(),Os=r("span"),fh=n("TFSegformerModel"),el=d(),H=r("div"),v(Yo.$$.fragment),hh=d(),Oo=r("p"),ph=n(`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model inherits from `),Ta=r("a"),gh=n("TFPreTrainedModel"),uh=n(`. 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.)`),_h=d(),Qo=r("p"),bh=n("This model is also a "),Ko=r("a"),vh=n("tf.keras.Model"),yh=n(` 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.`),Th=d(),ee=r("div"),v(er.$$.fragment),wh=d(),Ae=r("p"),Sh=n("The "),wa=r("a"),$h=n("TFSegformerModel"),Mh=n(" forward method, overrides the "),Qs=r("code"),Fh=n("__call__"),Eh=n(" special method."),Ih=d(),v(vt.$$.fragment),kh=d(),v(yt.$$.fragment),tl=d(),Re=r("h2"),Tt=r("a"),Ks=r("span"),v(tr.$$.fragment),Ch=d(),en=r("span"),jh=n("TFSegformerForImageClassification"),ol=d(),R=r("div"),v(or.$$.fragment),xh=d(),tn=r("p"),Jh=n(`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),Wh=d(),rr=r("p"),zh=n("This model inherits from "),Sa=r("a"),Zh=n("TFPreTrainedModel"),Uh=n(`. 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.)`),Ph=d(),ar=r("p"),Nh=n("This model is also a "),sr=r("a"),Ah=n("tf.keras.Model"),Rh=n(` 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.`),Dh=d(),te=r("div"),v(nr.$$.fragment),Bh=d(),De=r("p"),Vh=n("The "),$a=r("a"),Gh=n("TFSegformerForImageClassification"),Lh=n(" forward method, overrides the "),on=r("code"),qh=n("__call__"),Hh=n(" special method."),Xh=d(),v(wt.$$.fragment),Yh=d(),v(St.$$.fragment),rl=d(),Be=r("h2"),$t=r("a"),rn=r("span"),v(lr.$$.fragment),Oh=d(),an=r("span"),Qh=n("TFSegformerForSemanticSegmentation"),al=d(),X=r("div"),v(ir.$$.fragment),Kh=d(),dr=r("p"),ep=n(`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model inherits from `),Ma=r("a"),tp=n("TFPreTrainedModel"),op=n(`. 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.)`),rp=d(),cr=r("p"),ap=n("This model is also a "),mr=r("a"),sp=n("tf.keras.Model"),np=n(` 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.`),lp=d(),oe=r("div"),v(fr.$$.fragment),ip=d(),Ve=r("p"),dp=n("The "),Fa=r("a"),cp=n("TFSegformerForSemanticSegmentation"),mp=n(" forward method, overrides the "),sn=r("code"),fp=n("__call__"),hp=n(" special method."),pp=d(),v(Mt.$$.fragment),gp=d(),v(Ft.$$.fragment),this.h()},l(o){const h=w_('[data-svelte="svelte-1phssyn"]',document.head);f=a(h,"META",{name:!0,content:!0}),h.forEach(t),M=c(o),_=a(o,"H1",{class:!0});var hr=s(_);u=a(hr,"A",{id:!0,class:!0,href:!0});var nn=s(u);b=a(nn,"SPAN",{});var ln=s(b);y(m.$$.fragment,ln),ln.forEach(t),nn.forEach(t),g=c(hr),E=a(hr,"SPAN",{});var dn=s(E);Vl=l(dn,"SegFormer"),dn.forEach(t),hr.forEach(t),vn=c(o),ve=a(o,"H2",{class:!0});var pr=s(ve);Ge=a(pr,"A",{id:!0,class:!0,href:!0});var cn=s(Ge);Ba=a(cn,"SPAN",{});var mn=s(Ba);y(Nt.$$.fragment,mn),mn.forEach(t),cn.forEach(t),Gl=c(pr),Va=a(pr,"SPAN",{});var fn=s(Va);Ll=l(fn,"Overview"),fn.forEach(t),pr.forEach(t),yn=c(o),Le=a(o,"P",{});var gr=s(Le);ql=l(gr,"The SegFormer model was proposed in "),At=a(gr,"A",{href:!0,rel:!0});var hn=s(At);Hl=l(hn,"SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers"),hn.forEach(t),Xl=l(gr,` 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.`),gr.forEach(t),Tn=c(o),yr=a(o,"P",{});var pn=s(yr);Yl=l(pn,"The abstract from the paper is the following:"),pn.forEach(t),wn=c(o),Tr=a(o,"P",{});var gn=s(Tr);Ga=a(gn,"EM",{});var un=s(Ga);Ol=l(un,`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.`),un.forEach(t),gn.forEach(t),Sn=c(o),qe=a(o,"P",{});var nl=s(qe);Ql=l(nl,"The figure below illustrates the architecture of SegFormer. Taken from the "),Rt=a(nl,"A",{href:!0,rel:!0});var _p=s(Rt);Kl=l(_p,"original paper"),_p.forEach(t),ei=l(nl,"."),nl.forEach(t),$n=c(o),Dt=a(o,"IMG",{width:!0,src:!0}),Mn=c(o),Y=a(o,"P",{});var Et=s(Y);ti=l(Et,"This model was contributed by "),Bt=a(Et,"A",{href:!0,rel:!0});var bp=s(Bt);oi=l(bp,"nielsr"),bp.forEach(t),ri=l(Et,`. The TensorFlow version
of the model was contributed by `),Vt=a(Et,"A",{href:!0,rel:!0});var vp=s(Vt);ai=l(vp,"sayakpaul"),vp.forEach(t),si=l(Et,". The original code can be found "),Gt=a(Et,"A",{href:!0,rel:!0});var yp=s(Gt);ni=l(yp,"here"),yp.forEach(t),li=l(Et,"."),Et.forEach(t),Fn=c(o),wr=a(o,"P",{});var Tp=s(wr);ii=l(Tp,"Tips:"),Tp.forEach(t),En=c(o),C=a(o,"UL",{});var x=s(C);V=a(x,"LI",{});var ue=s(V);di=l(ue,`SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
`),Sr=a(ue,"A",{href:!0});var wp=s(Sr);ci=l(wp,"SegformerModel"),wp.forEach(t),mi=l(ue,` is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). `),$r=a(ue,"A",{href:!0});var Sp=s($r);fi=l(Sp,"SegformerForSemanticSegmentation"),Sp.forEach(t),hi=l(ue,` adds the all-MLP decoder head on
top to perform semantic segmentation of images. In addition, there\u2019s
`),Mr=a(ue,"A",{href:!0});var $p=s(Mr);pi=l($p,"SegformerForImageClassification"),$p.forEach(t),gi=l(ue,` 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 `),Lt=a(ue,"A",{href:!0,rel:!0});var Mp=s(Lt);ui=l(Mp,"hub"),Mp.forEach(t),_i=l(ue,"."),ue.forEach(t),bi=c(x),ye=a(x,"LI",{});var Ea=s(ye);vi=l(Ea,"The quickest way to get started with SegFormer is by checking the "),qt=a(Ea,"A",{href:!0,rel:!0});var Fp=s(qt);yi=l(Fp,"example notebooks"),Fp.forEach(t),Ti=l(Ea,` (which showcase both inference and
fine-tuning on custom data). One can also check out the `),Ht=a(Ea,"A",{href:!0,rel:!0});var Ep=s(Ht);wi=l(Ep,"blog post"),Ep.forEach(t),Si=l(Ea," introducing SegFormer and illustrating how it can be fine-tuned on custom data."),Ea.forEach(t),$i=c(x),Xt=a(x,"LI",{});var ll=s(Xt);Mi=l(ll,"TensorFlow users should refer to "),Yt=a(ll,"A",{href:!0,rel:!0});var Ip=s(Yt);Fi=l(Ip,"this repository"),Ip.forEach(t),Ei=l(ll," that shows off-the-shelf inference and fine-tuning."),ll.forEach(t),Ii=c(x),Ot=a(x,"LI",{});var il=s(Ot);ki=l(il,"One can also check out "),Qt=a(il,"A",{href:!0,rel:!0});var kp=s(Qt);Ci=l(kp,"this interactive demo on Hugging Face Spaces"),kp.forEach(t),ji=l(il,`
to try out a SegFormer model on custom images.`),il.forEach(t),xi=c(x),Kt=a(x,"LI",{});var dl=s(Kt);Ji=l(dl,"SegFormer works on any input size, as it pads the input to be divisible by "),La=a(dl,"CODE",{});var Cp=s(La);Wi=l(Cp,"config.patch_sizes"),Cp.forEach(t),zi=l(dl,"."),dl.forEach(t),Zi=c(x),Te=a(x,"LI",{});var Ia=s(Te);Ui=l(Ia,"One can use "),Fr=a(Ia,"A",{href:!0});var jp=s(Fr);Pi=l(jp,"SegformerImageProcessor"),jp.forEach(t),Ni=l(Ia,` 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 `),eo=a(Ia,"A",{href:!0,rel:!0});var xp=s(eo);Ai=l(xp,"here"),xp.forEach(t),Ri=l(Ia,`. 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.`),Ia.forEach(t),Di=c(x),I=a(x,"LI",{});var j=s(I);Bi=l(j,"One additional thing to keep in mind is that one can initialize "),Er=a(j,"A",{href:!0});var Jp=s(Er);Vi=l(Jp,"SegformerImageProcessor"),Jp.forEach(t),Gi=l(j,` with
`),qa=a(j,"CODE",{});var Wp=s(qa);Li=l(Wp,"reduce_labels"),Wp.forEach(t),qi=l(j," set to "),Ha=a(j,"CODE",{});var zp=s(Ha);Hi=l(zp,"True"),zp.forEach(t),Xi=l(j," or "),Xa=a(j,"CODE",{});var Zp=s(Xa);Yi=l(Zp,"False"),Zp.forEach(t),Oi=l(j,`. In some datasets (like ADE20k), the 0 index is used in the annotated
segmentation maps for background. However, ADE20k doesn\u2019t include the \u201Cbackground\u201D class in its 150 labels.
Therefore, `),Ya=a(j,"CODE",{});var Up=s(Ya);Qi=l(Up,"reduce_labels"),Up.forEach(t),Ki=l(j,` 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 `),Oa=a(j,"EM",{});var Pp=s(Oa);ed=l(Pp,"ignore_index"),Pp.forEach(t),td=l(j,` of the loss function
used by `),Ir=a(j,"A",{href:!0});var Np=s(Ir);od=l(Np,"SegformerForSemanticSegmentation"),Np.forEach(t),rd=l(j,`). However, other datasets use the 0 index as
background class and include this class as part of all labels. In that case, `),Qa=a(j,"CODE",{});var Ap=s(Qa);ad=l(Ap,"reduce_labels"),Ap.forEach(t),sd=l(j,` should be set to
`),Ka=a(j,"CODE",{});var Rp=s(Ka);nd=l(Rp,"False"),Rp.forEach(t),ld=l(j,", as loss should also be computed for the background class."),j.forEach(t),id=c(x),to=a(x,"LI",{});var cl=s(to);dd=l(cl,`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 `),oo=a(cl,"A",{href:!0,rel:!0});var Dp=s(oo);cd=l(Dp,"original paper"),Dp.forEach(t),md=l(cl,")."),cl.forEach(t),x.forEach(t),In=c(o),He=a(o,"TABLE",{});var ml=s(He);es=a(ml,"THEAD",{});var Bp=s(es);J=a(Bp,"TR",{});var re=s(J);kr=a(re,"TH",{align:!0});var Vp=s(kr);ts=a(Vp,"STRONG",{});var Gp=s(ts);fd=l(Gp,"Model variant"),Gp.forEach(t),Vp.forEach(t),hd=c(re),os=a(re,"TH",{});var Lp=s(os);rs=a(Lp,"STRONG",{});var qp=s(rs);pd=l(qp,"Depths"),qp.forEach(t),Lp.forEach(t),gd=c(re),as=a(re,"TH",{});var Hp=s(as);ss=a(Hp,"STRONG",{});var Xp=s(ss);ud=l(Xp,"Hidden sizes"),Xp.forEach(t),Hp.forEach(t),_d=c(re),Cr=a(re,"TH",{align:!0});var Yp=s(Cr);ns=a(Yp,"STRONG",{});var Op=s(ns);bd=l(Op,"Decoder hidden size"),Op.forEach(t),Yp.forEach(t),vd=c(re),jr=a(re,"TH",{align:!0});var Qp=s(jr);ls=a(Qp,"STRONG",{});var Kp=s(ls);yd=l(Kp,"Params (M)"),Kp.forEach(t),Qp.forEach(t),Td=c(re),xr=a(re,"TH",{align:!0});var eg=s(xr);is=a(eg,"STRONG",{});var tg=s(is);wd=l(tg,"ImageNet-1k Top 1"),tg.forEach(t),eg.forEach(t),re.forEach(t),Bp.forEach(t),Sd=c(ml),W=a(ml,"TBODY",{});var ae=s(W);z=a(ae,"TR",{});var se=s(z);Jr=a(se,"TD",{align:!0});var og=s(Jr);$d=l(og,"MiT-b0"),og.forEach(t),Md=c(se),ds=a(se,"TD",{});var rg=s(ds);Fd=l(rg,"[2, 2, 2, 2]"),rg.forEach(t),Ed=c(se),cs=a(se,"TD",{});var ag=s(cs);Id=l(ag,"[32, 64, 160, 256]"),ag.forEach(t),kd=c(se),Wr=a(se,"TD",{align:!0});var sg=s(Wr);Cd=l(sg,"256"),sg.forEach(t),jd=c(se),zr=a(se,"TD",{align:!0});var ng=s(zr);xd=l(ng,"3.7"),ng.forEach(t),Jd=c(se),Zr=a(se,"TD",{align:!0});var lg=s(Zr);Wd=l(lg,"70.5"),lg.forEach(t),se.forEach(t),zd=c(ae),Z=a(ae,"TR",{});var ne=s(Z);Ur=a(ne,"TD",{align:!0});var ig=s(Ur);Zd=l(ig,"MiT-b1"),ig.forEach(t),Ud=c(ne),ms=a(ne,"TD",{});var dg=s(ms);Pd=l(dg,"[2, 2, 2, 2]"),dg.forEach(t),Nd=c(ne),fs=a(ne,"TD",{});var cg=s(fs);Ad=l(cg,"[64, 128, 320, 512]"),cg.forEach(t),Rd=c(ne),Pr=a(ne,"TD",{align:!0});var mg=s(Pr);Dd=l(mg,"256"),mg.forEach(t),Bd=c(ne),Nr=a(ne,"TD",{align:!0});var fg=s(Nr);Vd=l(fg,"14.0"),fg.forEach(t),Gd=c(ne),Ar=a(ne,"TD",{align:!0});var hg=s(Ar);Ld=l(hg,"78.7"),hg.forEach(t),ne.forEach(t),qd=c(ae),U=a(ae,"TR",{});var le=s(U);Rr=a(le,"TD",{align:!0});var pg=s(Rr);Hd=l(pg,"MiT-b2"),pg.forEach(t),Xd=c(le),hs=a(le,"TD",{});var gg=s(hs);Yd=l(gg,"[3, 4, 6, 3]"),gg.forEach(t),Od=c(le),ps=a(le,"TD",{});var ug=s(ps);Qd=l(ug,"[64, 128, 320, 512]"),ug.forEach(t),Kd=c(le),Dr=a(le,"TD",{align:!0});var _g=s(Dr);ec=l(_g,"768"),_g.forEach(t),tc=c(le),Br=a(le,"TD",{align:!0});var bg=s(Br);oc=l(bg,"25.4"),bg.forEach(t),rc=c(le),Vr=a(le,"TD",{align:!0});var vg=s(Vr);ac=l(vg,"81.6"),vg.forEach(t),le.forEach(t),sc=c(ae),P=a(ae,"TR",{});var ie=s(P);Gr=a(ie,"TD",{align:!0});var yg=s(Gr);nc=l(yg,"MiT-b3"),yg.forEach(t),lc=c(ie),gs=a(ie,"TD",{});var Tg=s(gs);ic=l(Tg,"[3, 4, 18, 3]"),Tg.forEach(t),dc=c(ie),us=a(ie,"TD",{});var wg=s(us);cc=l(wg,"[64, 128, 320, 512]"),wg.forEach(t),mc=c(ie),Lr=a(ie,"TD",{align:!0});var Sg=s(Lr);fc=l(Sg,"768"),Sg.forEach(t),hc=c(ie),qr=a(ie,"TD",{align:!0});var $g=s(qr);pc=l($g,"45.2"),$g.forEach(t),gc=c(ie),Hr=a(ie,"TD",{align:!0});var Mg=s(Hr);uc=l(Mg,"83.1"),Mg.forEach(t),ie.forEach(t),_c=c(ae),N=a(ae,"TR",{});var de=s(N);Xr=a(de,"TD",{align:!0});var Fg=s(Xr);bc=l(Fg,"MiT-b4"),Fg.forEach(t),vc=c(de),_s=a(de,"TD",{});var Eg=s(_s);yc=l(Eg,"[3, 8, 27, 3]"),Eg.forEach(t),Tc=c(de),bs=a(de,"TD",{});var Ig=s(bs);wc=l(Ig,"[64, 128, 320, 512]"),Ig.forEach(t),Sc=c(de),Yr=a(de,"TD",{align:!0});var kg=s(Yr);$c=l(kg,"768"),kg.forEach(t),Mc=c(de),Or=a(de,"TD",{align:!0});var Cg=s(Or);Fc=l(Cg,"62.6"),Cg.forEach(t),Ec=c(de),Qr=a(de,"TD",{align:!0});var jg=s(Qr);Ic=l(jg,"83.6"),jg.forEach(t),de.forEach(t),kc=c(ae),A=a(ae,"TR",{});var ce=s(A);Kr=a(ce,"TD",{align:!0});var xg=s(Kr);Cc=l(xg,"MiT-b5"),xg.forEach(t),jc=c(ce),vs=a(ce,"TD",{});var Jg=s(vs);xc=l(Jg,"[3, 6, 40, 3]"),Jg.forEach(t),Jc=c(ce),ys=a(ce,"TD",{});var Wg=s(ys);Wc=l(Wg,"[64, 128, 320, 512]"),Wg.forEach(t),zc=c(ce),ea=a(ce,"TD",{align:!0});var zg=s(ea);Zc=l(zg,"768"),zg.forEach(t),Uc=c(ce),ta=a(ce,"TD",{align:!0});var Zg=s(ta);Pc=l(Zg,"82.0"),Zg.forEach(t),Nc=c(ce),oa=a(ce,"TD",{align:!0});var Ug=s(oa);Ac=l(Ug,"83.8"),Ug.forEach(t),ce.forEach(t),ae.forEach(t),ml.forEach(t),kn=c(o),Xe=a(o,"P",{});var fl=s(Xe);Rc=l(fl,`Note that MiT in the above table refers to the Mix Transformer encoder backbone introduced in SegFormer. For
SegFormer\u2019s results on the segmentation datasets like ADE20k, refer to the `),ro=a(fl,"A",{href:!0,rel:!0});var Pg=s(ro);Dc=l(Pg,"paper"),Pg.forEach(t),Bc=l(fl,"."),fl.forEach(t),Cn=c(o),we=a(o,"H2",{class:!0});var hl=s(we);Ye=a(hl,"A",{id:!0,class:!0,href:!0});var Ng=s(Ye);Ts=a(Ng,"SPAN",{});var Ag=s(Ts);y(ao.$$.fragment,Ag),Ag.forEach(t),Ng.forEach(t),Vc=c(hl),ws=a(hl,"SPAN",{});var Rg=s(ws);Gc=l(Rg,"Resources"),Rg.forEach(t),hl.forEach(t),jn=c(o),ra=a(o,"P",{});var Dg=s(ra);Lc=l(Dg,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with SegFormer."),Dg.forEach(t),xn=c(o),y(so.$$.fragment,o),Jn=c(o),Oe=a(o,"UL",{});var pl=s(Oe);pe=a(pl,"LI",{});var ur=s(pe);aa=a(ur,"A",{href:!0});var Bg=s(aa);qc=l(Bg,"SegformerForImageClassification"),Bg.forEach(t),Hc=l(ur," is supported by this "),no=a(ur,"A",{href:!0,rel:!0});var Vg=s(no);Xc=l(Vg,"example script"),Vg.forEach(t),Yc=l(ur," and "),lo=a(ur,"A",{href:!0,rel:!0});var Gg=s(lo);Oc=l(Gg,"notebook"),Gg.forEach(t),Qc=l(ur,"."),ur.forEach(t),Kc=c(pl),Ss=a(pl,"LI",{});var Lg=s(Ss);sa=a(Lg,"A",{href:!0});var qg=s(sa);em=l(qg,"Image classification task guide"),qg.forEach(t),Lg.forEach(t),pl.forEach(t),Wn=c(o),na=a(o,"P",{});var Hg=s(na);tm=l(Hg,"Semantic segmentation:"),Hg.forEach(t),zn=c(o),D=a(o,"UL",{});var _e=s(D);Qe=a(_e,"LI",{});var _n=s(Qe);la=a(_n,"A",{href:!0});var Xg=s(la);om=l(Xg,"SegformerForSemanticSegmentation"),Xg.forEach(t),rm=l(_n," is supported by this "),io=a(_n,"A",{href:!0,rel:!0});var Yg=s(io);am=l(Yg,"example script"),Yg.forEach(t),sm=l(_n,"."),_n.forEach(t),nm=c(_e),co=a(_e,"LI",{});var gl=s(co);lm=l(gl,"A blog on fine-tuning SegFormer on a custom dataset can be found "),mo=a(gl,"A",{href:!0,rel:!0});var Og=s(mo);im=l(Og,"here"),Og.forEach(t),dm=l(gl,"."),gl.forEach(t),cm=c(_e),fo=a(_e,"LI",{});var ul=s(fo);mm=l(ul,"More demo notebooks on SegFormer (both inference + fine-tuning on a custom dataset) can be found "),ho=a(ul,"A",{href:!0,rel:!0});var Qg=s(ho);fm=l(Qg,"here"),Qg.forEach(t),hm=l(ul,"."),ul.forEach(t),pm=c(_e),Ke=a(_e,"LI",{});var bn=s(Ke);ia=a(bn,"A",{href:!0});var Kg=s(ia);gm=l(Kg,"TFSegformerForSemanticSegmentation"),Kg.forEach(t),um=l(bn," is supported by this "),po=a(bn,"A",{href:!0,rel:!0});var eu=s(po);_m=l(eu,"example notebook"),eu.forEach(t),bm=l(bn,"."),bn.forEach(t),vm=c(_e),$s=a(_e,"LI",{});var tu=s($s);da=a(tu,"A",{href:!0});var ou=s(da);ym=l(ou,"Semantic segmentation task guide"),ou.forEach(t),tu.forEach(t),_e.forEach(t),Zn=c(o),ca=a(o,"P",{});var ru=s(ca);Tm=l(ru,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ru.forEach(t),Un=c(o),Se=a(o,"H2",{class:!0});var _l=s(Se);et=a(_l,"A",{id:!0,class:!0,href:!0});var au=s(et);Ms=a(au,"SPAN",{});var su=s(Ms);y(go.$$.fragment,su),su.forEach(t),au.forEach(t),wm=c(_l),Fs=a(_l,"SPAN",{});var nu=s(Fs);Sm=l(nu,"SegformerConfig"),nu.forEach(t),_l.forEach(t),Pn=c(o),G=a(o,"DIV",{class:!0});var It=s(G);y(uo.$$.fragment,It),$m=c(It),$e=a(It,"P",{});var ka=s($e);Mm=l(ka,"This is the configuration class to store the configuration of a "),ma=a(ka,"A",{href:!0});var lu=s(ma);Fm=l(lu,"SegformerModel"),lu.forEach(t),Em=l(ka,`. 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
`),_o=a(ka,"A",{href:!0,rel:!0});var iu=s(_o);Im=l(iu,"nvidia/segformer-b0-finetuned-ade-512-512"),iu.forEach(t),km=l(ka,`
architecture.`),ka.forEach(t),Cm=c(It),Me=a(It,"P",{});var Ca=s(Me);jm=l(Ca,"Configuration objects inherit from "),fa=a(Ca,"A",{href:!0});var du=s(fa);xm=l(du,"PretrainedConfig"),du.forEach(t),Jm=l(Ca,` and can be used to control the model outputs. Read the
documentation from `),ha=a(Ca,"A",{href:!0});var cu=s(ha);Wm=l(cu,"PretrainedConfig"),cu.forEach(t),zm=l(Ca," for more information."),Ca.forEach(t),Zm=c(It),y(tt.$$.fragment,It),It.forEach(t),Nn=c(o),Fe=a(o,"H2",{class:!0});var bl=s(Fe);ot=a(bl,"A",{id:!0,class:!0,href:!0});var mu=s(ot);Es=a(mu,"SPAN",{});var fu=s(Es);y(bo.$$.fragment,fu),fu.forEach(t),mu.forEach(t),Um=c(bl),Is=a(bl,"SPAN",{});var hu=s(Is);Pm=l(hu,"SegformerFeatureExtractor"),hu.forEach(t),bl.forEach(t),An=c(o),me=a(o,"DIV",{class:!0});var ja=s(me);y(vo.$$.fragment,ja),Nm=c(ja),ge=a(ja,"DIV",{class:!0});var xa=s(ge);y(yo.$$.fragment,xa),Am=c(xa),ks=a(xa,"P",{});var pu=s(ks);Rm=l(pu,"Preprocesses a batch of images and optionally segmentation maps."),pu.forEach(t),Dm=c(xa),Ee=a(xa,"P",{});var Ja=s(Ee);Bm=l(Ja,"Overrides the "),Cs=a(Ja,"CODE",{});var gu=s(Cs);Vm=l(gu,"__call__"),gu.forEach(t),Gm=l(Ja," method of the "),js=a(Ja,"CODE",{});var uu=s(js);Lm=l(uu,"Preprocessor"),uu.forEach(t),qm=l(Ja,` class so that both images and segmentation maps can be
passed in as positional arguments.`),Ja.forEach(t),xa.forEach(t),Hm=c(ja),rt=a(ja,"DIV",{class:!0});var vl=s(rt);y(To.$$.fragment,vl),Xm=c(vl),wo=a(vl,"P",{});var yl=s(wo);Ym=l(yl,"Converts the output of "),pa=a(yl,"A",{href:!0});var _u=s(pa);Om=l(_u,"SegformerForSemanticSegmentation"),_u.forEach(t),Qm=l(yl,` into semantic segmentation maps. Only supports
PyTorch.`),yl.forEach(t),vl.forEach(t),ja.forEach(t),Rn=c(o),Ie=a(o,"H2",{class:!0});var Tl=s(Ie);at=a(Tl,"A",{id:!0,class:!0,href:!0});var bu=s(at);xs=a(bu,"SPAN",{});var vu=s(xs);y(So.$$.fragment,vu),vu.forEach(t),bu.forEach(t),Km=c(Tl),Js=a(Tl,"SPAN",{});var yu=s(Js);ef=l(yu,"SegformerImageProcessor"),yu.forEach(t),Tl.forEach(t),Dn=c(o),L=a(o,"DIV",{class:!0});var kt=s(L);y($o.$$.fragment,kt),tf=c(kt),Ws=a(kt,"P",{});var Tu=s(Ws);of=l(Tu,"Constructs a Segformer image processor."),Tu.forEach(t),rf=c(kt),st=a(kt,"DIV",{class:!0});var wl=s(st);y(Mo.$$.fragment,wl),af=c(wl),zs=a(wl,"P",{});var wu=s(zs);sf=l(wu,"Preprocess an image or batch of images."),wu.forEach(t),wl.forEach(t),nf=c(kt),nt=a(kt,"DIV",{class:!0});var Sl=s(nt);y(Fo.$$.fragment,Sl),lf=c(Sl),Eo=a(Sl,"P",{});var $l=s(Eo);df=l($l,"Converts the output of "),ga=a($l,"A",{href:!0});var Su=s(ga);cf=l(Su,"SegformerForSemanticSegmentation"),Su.forEach(t),mf=l($l,` into semantic segmentation maps. Only supports
PyTorch.`),$l.forEach(t),Sl.forEach(t),kt.forEach(t),Bn=c(o),ke=a(o,"H2",{class:!0});var Ml=s(ke);lt=a(Ml,"A",{id:!0,class:!0,href:!0});var $u=s(lt);Zs=a($u,"SPAN",{});var Mu=s(Zs);y(Io.$$.fragment,Mu),Mu.forEach(t),$u.forEach(t),ff=c(Ml),Us=a(Ml,"SPAN",{});var Fu=s(Us);hf=l(Fu,"SegformerModel"),Fu.forEach(t),Ml.forEach(t),Vn=c(o),fe=a(o,"DIV",{class:!0});var Wa=s(fe);y(ko.$$.fragment,Wa),pf=c(Wa),Co=a(Wa,"P",{});var Fl=s(Co);gf=l(Fl,`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),jo=a(Fl,"A",{href:!0,rel:!0});var Eu=s(jo);uf=l(Eu,"torch.nn.Module"),Eu.forEach(t),_f=l(Fl,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fl.forEach(t),bf=c(Wa),O=a(Wa,"DIV",{class:!0});var Ct=s(O);y(xo.$$.fragment,Ct),vf=c(Ct),Ce=a(Ct,"P",{});var za=s(Ce);yf=l(za,"The "),ua=a(za,"A",{href:!0});var Iu=s(ua);Tf=l(Iu,"SegformerModel"),Iu.forEach(t),wf=l(za," forward method, overrides the "),Ps=a(za,"CODE",{});var ku=s(Ps);Sf=l(ku,"__call__"),ku.forEach(t),$f=l(za," special method."),za.forEach(t),Mf=c(Ct),y(it.$$.fragment,Ct),Ff=c(Ct),y(dt.$$.fragment,Ct),Ct.forEach(t),Wa.forEach(t),Gn=c(o),je=a(o,"H2",{class:!0});var El=s(je);ct=a(El,"A",{id:!0,class:!0,href:!0});var Cu=s(ct);Ns=a(Cu,"SPAN",{});var ju=s(Ns);y(Jo.$$.fragment,ju),ju.forEach(t),Cu.forEach(t),Ef=c(El),As=a(El,"SPAN",{});var xu=s(As);If=l(xu,"SegformerDecodeHead"),xu.forEach(t),El.forEach(t),Ln=c(o),xe=a(o,"DIV",{class:!0});var Il=s(xe);y(Wo.$$.fragment,Il),kf=c(Il),_a=a(Il,"DIV",{class:!0});var Ju=s(_a);y(zo.$$.fragment,Ju),Ju.forEach(t),Il.forEach(t),qn=c(o),Je=a(o,"H2",{class:!0});var kl=s(Je);mt=a(kl,"A",{id:!0,class:!0,href:!0});var Wu=s(mt);Rs=a(Wu,"SPAN",{});var zu=s(Rs);y(Zo.$$.fragment,zu),zu.forEach(t),Wu.forEach(t),Cf=c(kl),Ds=a(kl,"SPAN",{});var Zu=s(Ds);jf=l(Zu,"SegformerForImageClassification"),Zu.forEach(t),kl.forEach(t),Hn=c(o),q=a(o,"DIV",{class:!0});var jt=s(q);y(Uo.$$.fragment,jt),xf=c(jt),Bs=a(jt,"P",{});var Uu=s(Bs);Jf=l(Uu,`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),Uu.forEach(t),Wf=c(jt),Po=a(jt,"P",{});var Cl=s(Po);zf=l(Cl,"This model is a PyTorch "),No=a(Cl,"A",{href:!0,rel:!0});var Pu=s(No);Zf=l(Pu,"torch.nn.Module"),Pu.forEach(t),Uf=l(Cl,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cl.forEach(t),Pf=c(jt),Q=a(jt,"DIV",{class:!0});var xt=s(Q);y(Ao.$$.fragment,xt),Nf=c(xt),We=a(xt,"P",{});var Za=s(We);Af=l(Za,"The "),ba=a(Za,"A",{href:!0});var Nu=s(ba);Rf=l(Nu,"SegformerForImageClassification"),Nu.forEach(t),Df=l(Za," forward method, overrides the "),Vs=a(Za,"CODE",{});var Au=s(Vs);Bf=l(Au,"__call__"),Au.forEach(t),Vf=l(Za," special method."),Za.forEach(t),Gf=c(xt),y(ft.$$.fragment,xt),Lf=c(xt),y(ht.$$.fragment,xt),xt.forEach(t),jt.forEach(t),Xn=c(o),ze=a(o,"H2",{class:!0});var jl=s(ze);pt=a(jl,"A",{id:!0,class:!0,href:!0});var Ru=s(pt);Gs=a(Ru,"SPAN",{});var Du=s(Gs);y(Ro.$$.fragment,Du),Du.forEach(t),Ru.forEach(t),qf=c(jl),Ls=a(jl,"SPAN",{});var Bu=s(Ls);Hf=l(Bu,"SegformerForSemanticSegmentation"),Bu.forEach(t),jl.forEach(t),Yn=c(o),he=a(o,"DIV",{class:!0});var Ua=s(he);y(Do.$$.fragment,Ua),Xf=c(Ua),Bo=a(Ua,"P",{});var xl=s(Bo);Yf=l(xl,`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model is a PyTorch `),Vo=a(xl,"A",{href:!0,rel:!0});var Vu=s(Vo);Of=l(Vu,"torch.nn.Module"),Vu.forEach(t),Qf=l(xl,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xl.forEach(t),Kf=c(Ua),K=a(Ua,"DIV",{class:!0});var Jt=s(K);y(Go.$$.fragment,Jt),eh=c(Jt),Ze=a(Jt,"P",{});var Pa=s(Ze);th=l(Pa,"The "),va=a(Pa,"A",{href:!0});var Gu=s(va);oh=l(Gu,"SegformerForSemanticSegmentation"),Gu.forEach(t),rh=l(Pa," forward method, overrides the "),qs=a(Pa,"CODE",{});var Lu=s(qs);ah=l(Lu,"__call__"),Lu.forEach(t),sh=l(Pa," special method."),Pa.forEach(t),nh=c(Jt),y(gt.$$.fragment,Jt),lh=c(Jt),y(ut.$$.fragment,Jt),Jt.forEach(t),Ua.forEach(t),On=c(o),Ue=a(o,"H2",{class:!0});var Jl=s(Ue);_t=a(Jl,"A",{id:!0,class:!0,href:!0});var qu=s(_t);Hs=a(qu,"SPAN",{});var Hu=s(Hs);y(Lo.$$.fragment,Hu),Hu.forEach(t),qu.forEach(t),ih=c(Jl),Xs=a(Jl,"SPAN",{});var Xu=s(Xs);dh=l(Xu,"TFSegformerDecodeHead"),Xu.forEach(t),Jl.forEach(t),Qn=c(o),Pe=a(o,"DIV",{class:!0});var Wl=s(Pe);y(qo.$$.fragment,Wl),ch=c(Wl),ya=a(Wl,"DIV",{class:!0});var Yu=s(ya);y(Ho.$$.fragment,Yu),Yu.forEach(t),Wl.forEach(t),Kn=c(o),Ne=a(o,"H2",{class:!0});var zl=s(Ne);bt=a(zl,"A",{id:!0,class:!0,href:!0});var Ou=s(bt);Ys=a(Ou,"SPAN",{});var Qu=s(Ys);y(Xo.$$.fragment,Qu),Qu.forEach(t),Ou.forEach(t),mh=c(zl),Os=a(zl,"SPAN",{});var Ku=s(Os);fh=l(Ku,"TFSegformerModel"),Ku.forEach(t),zl.forEach(t),el=c(o),H=a(o,"DIV",{class:!0});var Wt=s(H);y(Yo.$$.fragment,Wt),hh=c(Wt),Oo=a(Wt,"P",{});var Zl=s(Oo);ph=l(Zl,`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model inherits from `),Ta=a(Zl,"A",{href:!0});var e_=s(Ta);gh=l(e_,"TFPreTrainedModel"),e_.forEach(t),uh=l(Zl,`. 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.)`),Zl.forEach(t),_h=c(Wt),Qo=a(Wt,"P",{});var Ul=s(Qo);bh=l(Ul,"This model is also a "),Ko=a(Ul,"A",{href:!0,rel:!0});var t_=s(Ko);vh=l(t_,"tf.keras.Model"),t_.forEach(t),yh=l(Ul,` 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.`),Ul.forEach(t),Th=c(Wt),ee=a(Wt,"DIV",{class:!0});var zt=s(ee);y(er.$$.fragment,zt),wh=c(zt),Ae=a(zt,"P",{});var Na=s(Ae);Sh=l(Na,"The "),wa=a(Na,"A",{href:!0});var o_=s(wa);$h=l(o_,"TFSegformerModel"),o_.forEach(t),Mh=l(Na," forward method, overrides the "),Qs=a(Na,"CODE",{});var r_=s(Qs);Fh=l(r_,"__call__"),r_.forEach(t),Eh=l(Na," special method."),Na.forEach(t),Ih=c(zt),y(vt.$$.fragment,zt),kh=c(zt),y(yt.$$.fragment,zt),zt.forEach(t),Wt.forEach(t),tl=c(o),Re=a(o,"H2",{class:!0});var Pl=s(Re);Tt=a(Pl,"A",{id:!0,class:!0,href:!0});var a_=s(Tt);Ks=a(a_,"SPAN",{});var s_=s(Ks);y(tr.$$.fragment,s_),s_.forEach(t),a_.forEach(t),Ch=c(Pl),en=a(Pl,"SPAN",{});var n_=s(en);jh=l(n_,"TFSegformerForImageClassification"),n_.forEach(t),Pl.forEach(t),ol=c(o),R=a(o,"DIV",{class:!0});var be=s(R);y(or.$$.fragment,be),xh=c(be),tn=a(be,"P",{});var l_=s(tn);Jh=l(l_,`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),l_.forEach(t),Wh=c(be),rr=a(be,"P",{});var Nl=s(rr);zh=l(Nl,"This model inherits from "),Sa=a(Nl,"A",{href:!0});var i_=s(Sa);Zh=l(i_,"TFPreTrainedModel"),i_.forEach(t),Uh=l(Nl,`. 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.)`),Nl.forEach(t),Ph=c(be),ar=a(be,"P",{});var Al=s(ar);Nh=l(Al,"This model is also a "),sr=a(Al,"A",{href:!0,rel:!0});var d_=s(sr);Ah=l(d_,"tf.keras.Model"),d_.forEach(t),Rh=l(Al,` 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.`),Al.forEach(t),Dh=c(be),te=a(be,"DIV",{class:!0});var Zt=s(te);y(nr.$$.fragment,Zt),Bh=c(Zt),De=a(Zt,"P",{});var Aa=s(De);Vh=l(Aa,"The "),$a=a(Aa,"A",{href:!0});var c_=s($a);Gh=l(c_,"TFSegformerForImageClassification"),c_.forEach(t),Lh=l(Aa," forward method, overrides the "),on=a(Aa,"CODE",{});var m_=s(on);qh=l(m_,"__call__"),m_.forEach(t),Hh=l(Aa," special method."),Aa.forEach(t),Xh=c(Zt),y(wt.$$.fragment,Zt),Yh=c(Zt),y(St.$$.fragment,Zt),Zt.forEach(t),be.forEach(t),rl=c(o),Be=a(o,"H2",{class:!0});var Rl=s(Be);$t=a(Rl,"A",{id:!0,class:!0,href:!0});var f_=s($t);rn=a(f_,"SPAN",{});var h_=s(rn);y(lr.$$.fragment,h_),h_.forEach(t),f_.forEach(t),Oh=c(Rl),an=a(Rl,"SPAN",{});var p_=s(an);Qh=l(p_,"TFSegformerForSemanticSegmentation"),p_.forEach(t),Rl.forEach(t),al=c(o),X=a(o,"DIV",{class:!0});var Ut=s(X);y(ir.$$.fragment,Ut),Kh=c(Ut),dr=a(Ut,"P",{});var Dl=s(dr);ep=l(Dl,`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model inherits from `),Ma=a(Dl,"A",{href:!0});var g_=s(Ma);tp=l(g_,"TFPreTrainedModel"),g_.forEach(t),op=l(Dl,`. 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.)`),Dl.forEach(t),rp=c(Ut),cr=a(Ut,"P",{});var Bl=s(cr);ap=l(Bl,"This model is also a "),mr=a(Bl,"A",{href:!0,rel:!0});var u_=s(mr);sp=l(u_,"tf.keras.Model"),u_.forEach(t),np=l(Bl,` 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.`),Bl.forEach(t),lp=c(Ut),oe=a(Ut,"DIV",{class:!0});var Pt=s(oe);y(fr.$$.fragment,Pt),ip=c(Pt),Ve=a(Pt,"P",{});var Ra=s(Ve);dp=l(Ra,"The "),Fa=a(Ra,"A",{href:!0});var __=s(Fa);cp=l(__,"TFSegformerForSemanticSegmentation"),__.forEach(t),mp=l(Ra," forward method, overrides the "),sn=a(Ra,"CODE",{});var b_=s(sn);fp=l(b_,"__call__"),b_.forEach(t),hp=l(Ra," special method."),Ra.forEach(t),pp=c(Pt),y(Mt.$$.fragment,Pt),gp=c(Pt),y(Ft.$$.fragment,Pt),Pt.forEach(t),Ut.forEach(t),this.h()},h(){i(f,"name","hf:doc:metadata"),i(f,"content",JSON.stringify(A_)),i(u,"id","segformer"),i(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(u,"href","#segformer"),i(_,"class","relative group"),i(Ge,"id","overview"),i(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Ge,"href","#overview"),i(ve,"class","relative group"),i(At,"href","https://arxiv.org/abs/2105.15203"),i(At,"rel","nofollow"),i(Rt,"href","https://arxiv.org/abs/2105.15203"),i(Rt,"rel","nofollow"),i(Dt,"width","600"),S_(Dt.src,up="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/segformer_architecture.png")||i(Dt,"src",up),i(Bt,"href","https://huggingface.co/nielsr"),i(Bt,"rel","nofollow"),i(Vt,"href","https://huggingface.co/sayakpaul"),i(Vt,"rel","nofollow"),i(Gt,"href","https://github.com/NVlabs/SegFormer"),i(Gt,"rel","nofollow"),i(Sr,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerModel"),i($r,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(Mr,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForImageClassification"),i(Lt,"href","https://huggingface.co/models?other=segformer"),i(Lt,"rel","nofollow"),i(qt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/SegFormer"),i(qt,"rel","nofollow"),i(Ht,"href","https://huggingface.co/blog/fine-tune-segformer"),i(Ht,"rel","nofollow"),i(Yt,"href","https://github.com/deep-diver/segformer-tf-transformers"),i(Yt,"rel","nofollow"),i(Qt,"href","https://huggingface.co/spaces/chansung/segformer-tf-transformers"),i(Qt,"rel","nofollow"),i(Fr,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerImageProcessor"),i(eo,"href","https://github.com/NVlabs/SegFormer/blob/master/local_configs/_base_/datasets/ade20k_repeat.py"),i(eo,"rel","nofollow"),i(Er,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerImageProcessor"),i(Ir,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(oo,"href","https://arxiv.org/abs/2105.15203"),i(oo,"rel","nofollow"),i(kr,"align","center"),i(Cr,"align","center"),i(jr,"align","center"),i(xr,"align","center"),i(Jr,"align","center"),i(Wr,"align","center"),i(zr,"align","center"),i(Zr,"align","center"),i(Ur,"align","center"),i(Pr,"align","center"),i(Nr,"align","center"),i(Ar,"align","center"),i(Rr,"align","center"),i(Dr,"align","center"),i(Br,"align","center"),i(Vr,"align","center"),i(Gr,"align","center"),i(Lr,"align","center"),i(qr,"align","center"),i(Hr,"align","center"),i(Xr,"align","center"),i(Yr,"align","center"),i(Or,"align","center"),i(Qr,"align","center"),i(Kr,"align","center"),i(ea,"align","center"),i(ta,"align","center"),i(oa,"align","center"),i(ro,"href","https://arxiv.org/abs/2105.15203"),i(ro,"rel","nofollow"),i(Ye,"id","resources"),i(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Ye,"href","#resources"),i(we,"class","relative group"),i(aa,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForImageClassification"),i(no,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),i(no,"rel","nofollow"),i(lo,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),i(lo,"rel","nofollow"),i(sa,"href","../tasks/image_classification"),i(la,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(io,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/semantic-segmentation"),i(io,"rel","nofollow"),i(mo,"href","https://huggingface.co/blog/fine-tune-segformer"),i(mo,"rel","nofollow"),i(ho,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/SegFormer"),i(ho,"rel","nofollow"),i(ia,"href","/docs/transformers/main/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation"),i(po,"href","https://github.com/huggingface/notebooks/blob/main/examples/semantic_segmentation-tf.ipynb"),i(po,"rel","nofollow"),i(da,"href","../tasks/semantic_segmentation"),i(et,"id","transformers.SegformerConfig"),i(et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(et,"href","#transformers.SegformerConfig"),i(Se,"class","relative group"),i(ma,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerModel"),i(_o,"href","https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512"),i(_o,"rel","nofollow"),i(fa,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(ha,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ot,"id","transformers.SegformerFeatureExtractor"),i(ot,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ot,"href","#transformers.SegformerFeatureExtractor"),i(Fe,"class","relative group"),i(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(pa,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(at,"id","transformers.SegformerImageProcessor"),i(at,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(at,"href","#transformers.SegformerImageProcessor"),i(Ie,"class","relative group"),i(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ga,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(lt,"id","transformers.SegformerModel"),i(lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(lt,"href","#transformers.SegformerModel"),i(ke,"class","relative group"),i(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(jo,"rel","nofollow"),i(ua,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerModel"),i(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ct,"id","transformers.SegformerDecodeHead"),i(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ct,"href","#transformers.SegformerDecodeHead"),i(je,"class","relative group"),i(_a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(mt,"id","transformers.SegformerForImageClassification"),i(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(mt,"href","#transformers.SegformerForImageClassification"),i(Je,"class","relative group"),i(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(No,"rel","nofollow"),i(ba,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForImageClassification"),i(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(pt,"id","transformers.SegformerForSemanticSegmentation"),i(pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(pt,"href","#transformers.SegformerForSemanticSegmentation"),i(ze,"class","relative group"),i(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(Vo,"rel","nofollow"),i(va,"href","/docs/transformers/main/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),i(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(_t,"id","transformers.TFSegformerDecodeHead"),i(_t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(_t,"href","#transformers.TFSegformerDecodeHead"),i(Ue,"class","relative group"),i(ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(bt,"id","transformers.TFSegformerModel"),i(bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(bt,"href","#transformers.TFSegformerModel"),i(Ne,"class","relative group"),i(Ta,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),i(Ko,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),i(Ko,"rel","nofollow"),i(wa,"href","/docs/transformers/main/en/model_doc/segformer#transformers.TFSegformerModel"),i(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Tt,"id","transformers.TFSegformerForImageClassification"),i(Tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Tt,"href","#transformers.TFSegformerForImageClassification"),i(Re,"class","relative group"),i(Sa,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),i(sr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),i(sr,"rel","nofollow"),i($a,"href","/docs/transformers/main/en/model_doc/segformer#transformers.TFSegformerForImageClassification"),i(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i($t,"id","transformers.TFSegformerForSemanticSegmentation"),i($t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i($t,"href","#transformers.TFSegformerForSemanticSegmentation"),i(Be,"class","relative group"),i(Ma,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),i(mr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),i(mr,"rel","nofollow"),i(Fa,"href","/docs/transformers/main/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation"),i(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,h){e(document.head,f),p(o,M,h),p(o,_,h),e(_,u),e(u,b),T(m,b,null),e(_,g),e(_,E),e(E,Vl),p(o,vn,h),p(o,ve,h),e(ve,Ge),e(Ge,Ba),T(Nt,Ba,null),e(ve,Gl),e(ve,Va),e(Va,Ll),p(o,yn,h),p(o,Le,h),e(Le,ql),e(Le,At),e(At,Hl),e(Le,Xl),p(o,Tn,h),p(o,yr,h),e(yr,Yl),p(o,wn,h),p(o,Tr,h),e(Tr,Ga),e(Ga,Ol),p(o,Sn,h),p(o,qe,h),e(qe,Ql),e(qe,Rt),e(Rt,Kl),e(qe,ei),p(o,$n,h),p(o,Dt,h),p(o,Mn,h),p(o,Y,h),e(Y,ti),e(Y,Bt),e(Bt,oi),e(Y,ri),e(Y,Vt),e(Vt,ai),e(Y,si),e(Y,Gt),e(Gt,ni),e(Y,li),p(o,Fn,h),p(o,wr,h),e(wr,ii),p(o,En,h),p(o,C,h),e(C,V),e(V,di),e(V,Sr),e(Sr,ci),e(V,mi),e(V,$r),e($r,fi),e(V,hi),e(V,Mr),e(Mr,pi),e(V,gi),e(V,Lt),e(Lt,ui),e(V,_i),e(C,bi),e(C,ye),e(ye,vi),e(ye,qt),e(qt,yi),e(ye,Ti),e(ye,Ht),e(Ht,wi),e(ye,Si),e(C,$i),e(C,Xt),e(Xt,Mi),e(Xt,Yt),e(Yt,Fi),e(Xt,Ei),e(C,Ii),e(C,Ot),e(Ot,ki),e(Ot,Qt),e(Qt,Ci),e(Ot,ji),e(C,xi),e(C,Kt),e(Kt,Ji),e(Kt,La),e(La,Wi),e(Kt,zi),e(C,Zi),e(C,Te),e(Te,Ui),e(Te,Fr),e(Fr,Pi),e(Te,Ni),e(Te,eo),e(eo,Ai),e(Te,Ri),e(C,Di),e(C,I),e(I,Bi),e(I,Er),e(Er,Vi),e(I,Gi),e(I,qa),e(qa,Li),e(I,qi),e(I,Ha),e(Ha,Hi),e(I,Xi),e(I,Xa),e(Xa,Yi),e(I,Oi),e(I,Ya),e(Ya,Qi),e(I,Ki),e(I,Oa),e(Oa,ed),e(I,td),e(I,Ir),e(Ir,od),e(I,rd),e(I,Qa),e(Qa,ad),e(I,sd),e(I,Ka),e(Ka,nd),e(I,ld),e(C,id),e(C,to),e(to,dd),e(to,oo),e(oo,cd),e(to,md),p(o,In,h),p(o,He,h),e(He,es),e(es,J),e(J,kr),e(kr,ts),e(ts,fd),e(J,hd),e(J,os),e(os,rs),e(rs,pd),e(J,gd),e(J,as),e(as,ss),e(ss,ud),e(J,_d),e(J,Cr),e(Cr,ns),e(ns,bd),e(J,vd),e(J,jr),e(jr,ls),e(ls,yd),e(J,Td),e(J,xr),e(xr,is),e(is,wd),e(He,Sd),e(He,W),e(W,z),e(z,Jr),e(Jr,$d),e(z,Md),e(z,ds),e(ds,Fd),e(z,Ed),e(z,cs),e(cs,Id),e(z,kd),e(z,Wr),e(Wr,Cd),e(z,jd),e(z,zr),e(zr,xd),e(z,Jd),e(z,Zr),e(Zr,Wd),e(W,zd),e(W,Z),e(Z,Ur),e(Ur,Zd),e(Z,Ud),e(Z,ms),e(ms,Pd),e(Z,Nd),e(Z,fs),e(fs,Ad),e(Z,Rd),e(Z,Pr),e(Pr,Dd),e(Z,Bd),e(Z,Nr),e(Nr,Vd),e(Z,Gd),e(Z,Ar),e(Ar,Ld),e(W,qd),e(W,U),e(U,Rr),e(Rr,Hd),e(U,Xd),e(U,hs),e(hs,Yd),e(U,Od),e(U,ps),e(ps,Qd),e(U,Kd),e(U,Dr),e(Dr,ec),e(U,tc),e(U,Br),e(Br,oc),e(U,rc),e(U,Vr),e(Vr,ac),e(W,sc),e(W,P),e(P,Gr),e(Gr,nc),e(P,lc),e(P,gs),e(gs,ic),e(P,dc),e(P,us),e(us,cc),e(P,mc),e(P,Lr),e(Lr,fc),e(P,hc),e(P,qr),e(qr,pc),e(P,gc),e(P,Hr),e(Hr,uc),e(W,_c),e(W,N),e(N,Xr),e(Xr,bc),e(N,vc),e(N,_s),e(_s,yc),e(N,Tc),e(N,bs),e(bs,wc),e(N,Sc),e(N,Yr),e(Yr,$c),e(N,Mc),e(N,Or),e(Or,Fc),e(N,Ec),e(N,Qr),e(Qr,Ic),e(W,kc),e(W,A),e(A,Kr),e(Kr,Cc),e(A,jc),e(A,vs),e(vs,xc),e(A,Jc),e(A,ys),e(ys,Wc),e(A,zc),e(A,ea),e(ea,Zc),e(A,Uc),e(A,ta),e(ta,Pc),e(A,Nc),e(A,oa),e(oa,Ac),p(o,kn,h),p(o,Xe,h),e(Xe,Rc),e(Xe,ro),e(ro,Dc),e(Xe,Bc),p(o,Cn,h),p(o,we,h),e(we,Ye),e(Ye,Ts),T(ao,Ts,null),e(we,Vc),e(we,ws),e(ws,Gc),p(o,jn,h),p(o,ra,h),e(ra,Lc),p(o,xn,h),T(so,o,h),p(o,Jn,h),p(o,Oe,h),e(Oe,pe),e(pe,aa),e(aa,qc),e(pe,Hc),e(pe,no),e(no,Xc),e(pe,Yc),e(pe,lo),e(lo,Oc),e(pe,Qc),e(Oe,Kc),e(Oe,Ss),e(Ss,sa),e(sa,em),p(o,Wn,h),p(o,na,h),e(na,tm),p(o,zn,h),p(o,D,h),e(D,Qe),e(Qe,la),e(la,om),e(Qe,rm),e(Qe,io),e(io,am),e(Qe,sm),e(D,nm),e(D,co),e(co,lm),e(co,mo),e(mo,im),e(co,dm),e(D,cm),e(D,fo),e(fo,mm),e(fo,ho),e(ho,fm),e(fo,hm),e(D,pm),e(D,Ke),e(Ke,ia),e(ia,gm),e(Ke,um),e(Ke,po),e(po,_m),e(Ke,bm),e(D,vm),e(D,$s),e($s,da),e(da,ym),p(o,Zn,h),p(o,ca,h),e(ca,Tm),p(o,Un,h),p(o,Se,h),e(Se,et),e(et,Ms),T(go,Ms,null),e(Se,wm),e(Se,Fs),e(Fs,Sm),p(o,Pn,h),p(o,G,h),T(uo,G,null),e(G,$m),e(G,$e),e($e,Mm),e($e,ma),e(ma,Fm),e($e,Em),e($e,_o),e(_o,Im),e($e,km),e(G,Cm),e(G,Me),e(Me,jm),e(Me,fa),e(fa,xm),e(Me,Jm),e(Me,ha),e(ha,Wm),e(Me,zm),e(G,Zm),T(tt,G,null),p(o,Nn,h),p(o,Fe,h),e(Fe,ot),e(ot,Es),T(bo,Es,null),e(Fe,Um),e(Fe,Is),e(Is,Pm),p(o,An,h),p(o,me,h),T(vo,me,null),e(me,Nm),e(me,ge),T(yo,ge,null),e(ge,Am),e(ge,ks),e(ks,Rm),e(ge,Dm),e(ge,Ee),e(Ee,Bm),e(Ee,Cs),e(Cs,Vm),e(Ee,Gm),e(Ee,js),e(js,Lm),e(Ee,qm),e(me,Hm),e(me,rt),T(To,rt,null),e(rt,Xm),e(rt,wo),e(wo,Ym),e(wo,pa),e(pa,Om),e(wo,Qm),p(o,Rn,h),p(o,Ie,h),e(Ie,at),e(at,xs),T(So,xs,null),e(Ie,Km),e(Ie,Js),e(Js,ef),p(o,Dn,h),p(o,L,h),T($o,L,null),e(L,tf),e(L,Ws),e(Ws,of),e(L,rf),e(L,st),T(Mo,st,null),e(st,af),e(st,zs),e(zs,sf),e(L,nf),e(L,nt),T(Fo,nt,null),e(nt,lf),e(nt,Eo),e(Eo,df),e(Eo,ga),e(ga,cf),e(Eo,mf),p(o,Bn,h),p(o,ke,h),e(ke,lt),e(lt,Zs),T(Io,Zs,null),e(ke,ff),e(ke,Us),e(Us,hf),p(o,Vn,h),p(o,fe,h),T(ko,fe,null),e(fe,pf),e(fe,Co),e(Co,gf),e(Co,jo),e(jo,uf),e(Co,_f),e(fe,bf),e(fe,O),T(xo,O,null),e(O,vf),e(O,Ce),e(Ce,yf),e(Ce,ua),e(ua,Tf),e(Ce,wf),e(Ce,Ps),e(Ps,Sf),e(Ce,$f),e(O,Mf),T(it,O,null),e(O,Ff),T(dt,O,null),p(o,Gn,h),p(o,je,h),e(je,ct),e(ct,Ns),T(Jo,Ns,null),e(je,Ef),e(je,As),e(As,If),p(o,Ln,h),p(o,xe,h),T(Wo,xe,null),e(xe,kf),e(xe,_a),T(zo,_a,null),p(o,qn,h),p(o,Je,h),e(Je,mt),e(mt,Rs),T(Zo,Rs,null),e(Je,Cf),e(Je,Ds),e(Ds,jf),p(o,Hn,h),p(o,q,h),T(Uo,q,null),e(q,xf),e(q,Bs),e(Bs,Jf),e(q,Wf),e(q,Po),e(Po,zf),e(Po,No),e(No,Zf),e(Po,Uf),e(q,Pf),e(q,Q),T(Ao,Q,null),e(Q,Nf),e(Q,We),e(We,Af),e(We,ba),e(ba,Rf),e(We,Df),e(We,Vs),e(Vs,Bf),e(We,Vf),e(Q,Gf),T(ft,Q,null),e(Q,Lf),T(ht,Q,null),p(o,Xn,h),p(o,ze,h),e(ze,pt),e(pt,Gs),T(Ro,Gs,null),e(ze,qf),e(ze,Ls),e(Ls,Hf),p(o,Yn,h),p(o,he,h),T(Do,he,null),e(he,Xf),e(he,Bo),e(Bo,Yf),e(Bo,Vo),e(Vo,Of),e(Bo,Qf),e(he,Kf),e(he,K),T(Go,K,null),e(K,eh),e(K,Ze),e(Ze,th),e(Ze,va),e(va,oh),e(Ze,rh),e(Ze,qs),e(qs,ah),e(Ze,sh),e(K,nh),T(gt,K,null),e(K,lh),T(ut,K,null),p(o,On,h),p(o,Ue,h),e(Ue,_t),e(_t,Hs),T(Lo,Hs,null),e(Ue,ih),e(Ue,Xs),e(Xs,dh),p(o,Qn,h),p(o,Pe,h),T(qo,Pe,null),e(Pe,ch),e(Pe,ya),T(Ho,ya,null),p(o,Kn,h),p(o,Ne,h),e(Ne,bt),e(bt,Ys),T(Xo,Ys,null),e(Ne,mh),e(Ne,Os),e(Os,fh),p(o,el,h),p(o,H,h),T(Yo,H,null),e(H,hh),e(H,Oo),e(Oo,ph),e(Oo,Ta),e(Ta,gh),e(Oo,uh),e(H,_h),e(H,Qo),e(Qo,bh),e(Qo,Ko),e(Ko,vh),e(Qo,yh),e(H,Th),e(H,ee),T(er,ee,null),e(ee,wh),e(ee,Ae),e(Ae,Sh),e(Ae,wa),e(wa,$h),e(Ae,Mh),e(Ae,Qs),e(Qs,Fh),e(Ae,Eh),e(ee,Ih),T(vt,ee,null),e(ee,kh),T(yt,ee,null),p(o,tl,h),p(o,Re,h),e(Re,Tt),e(Tt,Ks),T(tr,Ks,null),e(Re,Ch),e(Re,en),e(en,jh),p(o,ol,h),p(o,R,h),T(or,R,null),e(R,xh),e(R,tn),e(tn,Jh),e(R,Wh),e(R,rr),e(rr,zh),e(rr,Sa),e(Sa,Zh),e(rr,Uh),e(R,Ph),e(R,ar),e(ar,Nh),e(ar,sr),e(sr,Ah),e(ar,Rh),e(R,Dh),e(R,te),T(nr,te,null),e(te,Bh),e(te,De),e(De,Vh),e(De,$a),e($a,Gh),e(De,Lh),e(De,on),e(on,qh),e(De,Hh),e(te,Xh),T(wt,te,null),e(te,Yh),T(St,te,null),p(o,rl,h),p(o,Be,h),e(Be,$t),e($t,rn),T(lr,rn,null),e(Be,Oh),e(Be,an),e(an,Qh),p(o,al,h),p(o,X,h),T(ir,X,null),e(X,Kh),e(X,dr),e(dr,ep),e(dr,Ma),e(Ma,tp),e(dr,op),e(X,rp),e(X,cr),e(cr,ap),e(cr,mr),e(mr,sp),e(cr,np),e(X,lp),e(X,oe),T(fr,oe,null),e(oe,ip),e(oe,Ve),e(Ve,dp),e(Ve,Fa),e(Fa,cp),e(Ve,mp),e(Ve,sn),e(sn,fp),e(Ve,hp),e(oe,pp),T(Mt,oe,null),e(oe,gp),T(Ft,oe,null),sl=!0},p(o,[h]){const hr={};h&2&&(hr.$$scope={dirty:h,ctx:o}),tt.$set(hr);const nn={};h&2&&(nn.$$scope={dirty:h,ctx:o}),it.$set(nn);const ln={};h&2&&(ln.$$scope={dirty:h,ctx:o}),dt.$set(ln);const dn={};h&2&&(dn.$$scope={dirty:h,ctx:o}),ft.$set(dn);const pr={};h&2&&(pr.$$scope={dirty:h,ctx:o}),ht.$set(pr);const cn={};h&2&&(cn.$$scope={dirty:h,ctx:o}),gt.$set(cn);const mn={};h&2&&(mn.$$scope={dirty:h,ctx:o}),ut.$set(mn);const fn={};h&2&&(fn.$$scope={dirty:h,ctx:o}),vt.$set(fn);const gr={};h&2&&(gr.$$scope={dirty:h,ctx:o}),yt.$set(gr);const hn={};h&2&&(hn.$$scope={dirty:h,ctx:o}),wt.$set(hn);const pn={};h&2&&(pn.$$scope={dirty:h,ctx:o}),St.$set(pn);const gn={};h&2&&(gn.$$scope={dirty:h,ctx:o}),Mt.$set(gn);const un={};h&2&&(un.$$scope={dirty:h,ctx:o}),Ft.$set(un)},i(o){sl||(w(m.$$.fragment,o),w(Nt.$$.fragment,o),w(ao.$$.fragment,o),w(so.$$.fragment,o),w(go.$$.fragment,o),w(uo.$$.fragment,o),w(tt.$$.fragment,o),w(bo.$$.fragment,o),w(vo.$$.fragment,o),w(yo.$$.fragment,o),w(To.$$.fragment,o),w(So.$$.fragment,o),w($o.$$.fragment,o),w(Mo.$$.fragment,o),w(Fo.$$.fragment,o),w(Io.$$.fragment,o),w(ko.$$.fragment,o),w(xo.$$.fragment,o),w(it.$$.fragment,o),w(dt.$$.fragment,o),w(Jo.$$.fragment,o),w(Wo.$$.fragment,o),w(zo.$$.fragment,o),w(Zo.$$.fragment,o),w(Uo.$$.fragment,o),w(Ao.$$.fragment,o),w(ft.$$.fragment,o),w(ht.$$.fragment,o),w(Ro.$$.fragment,o),w(Do.$$.fragment,o),w(Go.$$.fragment,o),w(gt.$$.fragment,o),w(ut.$$.fragment,o),w(Lo.$$.fragment,o),w(qo.$$.fragment,o),w(Ho.$$.fragment,o),w(Xo.$$.fragment,o),w(Yo.$$.fragment,o),w(er.$$.fragment,o),w(vt.$$.fragment,o),w(yt.$$.fragment,o),w(tr.$$.fragment,o),w(or.$$.fragment,o),w(nr.$$.fragment,o),w(wt.$$.fragment,o),w(St.$$.fragment,o),w(lr.$$.fragment,o),w(ir.$$.fragment,o),w(fr.$$.fragment,o),w(Mt.$$.fragment,o),w(Ft.$$.fragment,o),sl=!0)},o(o){S(m.$$.fragment,o),S(Nt.$$.fragment,o),S(ao.$$.fragment,o),S(so.$$.fragment,o),S(go.$$.fragment,o),S(uo.$$.fragment,o),S(tt.$$.fragment,o),S(bo.$$.fragment,o),S(vo.$$.fragment,o),S(yo.$$.fragment,o),S(To.$$.fragment,o),S(So.$$.fragment,o),S($o.$$.fragment,o),S(Mo.$$.fragment,o),S(Fo.$$.fragment,o),S(Io.$$.fragment,o),S(ko.$$.fragment,o),S(xo.$$.fragment,o),S(it.$$.fragment,o),S(dt.$$.fragment,o),S(Jo.$$.fragment,o),S(Wo.$$.fragment,o),S(zo.$$.fragment,o),S(Zo.$$.fragment,o),S(Uo.$$.fragment,o),S(Ao.$$.fragment,o),S(ft.$$.fragment,o),S(ht.$$.fragment,o),S(Ro.$$.fragment,o),S(Do.$$.fragment,o),S(Go.$$.fragment,o),S(gt.$$.fragment,o),S(ut.$$.fragment,o),S(Lo.$$.fragment,o),S(qo.$$.fragment,o),S(Ho.$$.fragment,o),S(Xo.$$.fragment,o),S(Yo.$$.fragment,o),S(er.$$.fragment,o),S(vt.$$.fragment,o),S(yt.$$.fragment,o),S(tr.$$.fragment,o),S(or.$$.fragment,o),S(nr.$$.fragment,o),S(wt.$$.fragment,o),S(St.$$.fragment,o),S(lr.$$.fragment,o),S(ir.$$.fragment,o),S(fr.$$.fragment,o),S(Mt.$$.fragment,o),S(Ft.$$.fragment,o),sl=!1},d(o){t(f),o&&t(M),o&&t(_),$(m),o&&t(vn),o&&t(ve),$(Nt),o&&t(yn),o&&t(Le),o&&t(Tn),o&&t(yr),o&&t(wn),o&&t(Tr),o&&t(Sn),o&&t(qe),o&&t($n),o&&t(Dt),o&&t(Mn),o&&t(Y),o&&t(Fn),o&&t(wr),o&&t(En),o&&t(C),o&&t(In),o&&t(He),o&&t(kn),o&&t(Xe),o&&t(Cn),o&&t(we),$(ao),o&&t(jn),o&&t(ra),o&&t(xn),$(so,o),o&&t(Jn),o&&t(Oe),o&&t(Wn),o&&t(na),o&&t(zn),o&&t(D),o&&t(Zn),o&&t(ca),o&&t(Un),o&&t(Se),$(go),o&&t(Pn),o&&t(G),$(uo),$(tt),o&&t(Nn),o&&t(Fe),$(bo),o&&t(An),o&&t(me),$(vo),$(yo),$(To),o&&t(Rn),o&&t(Ie),$(So),o&&t(Dn),o&&t(L),$($o),$(Mo),$(Fo),o&&t(Bn),o&&t(ke),$(Io),o&&t(Vn),o&&t(fe),$(ko),$(xo),$(it),$(dt),o&&t(Gn),o&&t(je),$(Jo),o&&t(Ln),o&&t(xe),$(Wo),$(zo),o&&t(qn),o&&t(Je),$(Zo),o&&t(Hn),o&&t(q),$(Uo),$(Ao),$(ft),$(ht),o&&t(Xn),o&&t(ze),$(Ro),o&&t(Yn),o&&t(he),$(Do),$(Go),$(gt),$(ut),o&&t(On),o&&t(Ue),$(Lo),o&&t(Qn),o&&t(Pe),$(qo),$(Ho),o&&t(Kn),o&&t(Ne),$(Xo),o&&t(el),o&&t(H),$(Yo),$(er),$(vt),$(yt),o&&t(tl),o&&t(Re),$(tr),o&&t(ol),o&&t(R),$(or),$(nr),$(wt),$(St),o&&t(rl),o&&t(Be),$(lr),o&&t(al),o&&t(X),$(ir),$(fr),$(Mt),$(Ft)}}}const A_={local:"segformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.SegformerConfig",title:"SegformerConfig"},{local:"transformers.SegformerFeatureExtractor",title:"SegformerFeatureExtractor"},{local:"transformers.SegformerImageProcessor",title:"SegformerImageProcessor"},{local:"transformers.SegformerModel",title:"SegformerModel"},{local:"transformers.SegformerDecodeHead",title:"SegformerDecodeHead"},{local:"transformers.SegformerForImageClassification",title:"SegformerForImageClassification"},{local:"transformers.SegformerForSemanticSegmentation",title:"SegformerForSemanticSegmentation"},{local:"transformers.TFSegformerDecodeHead",title:"TFSegformerDecodeHead"},{local:"transformers.TFSegformerModel",title:"TFSegformerModel"},{local:"transformers.TFSegformerForImageClassification",title:"TFSegformerForImageClassification"},{local:"transformers.TFSegformerForSemanticSegmentation",title:"TFSegformerForSemanticSegmentation"}],title:"SegFormer"};function R_(F){return $_(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class X_ extends v_{constructor(f){super();y_(this,f,R_,N_,T_,{})}}export{X_ as default,A_ as metadata};
