import{S as Gg,i as Yg,s as Jg,e as o,k as c,w as S,t as n,M as Xg,c as a,d as t,m,a as s,x as w,h as i,b as l,N as Zg,G as e,g as _,y as $,q as T,o as F,B as y,v as Qg,L as Ur}from"../../chunks/vendor-hf-doc-builder.js";import{T as Wr}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Vr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as de}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Br}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ep(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerModel, SegformerConfig

# Initializing a SegFormer nvidia/segformer-b0-finetuned-ade-512-512 style configuration
configuration = SegformerConfig()

# Initializing a model from the nvidia/segformer-b0-finetuned-ade-512-512 style configuration
model = SegformerModel(configuration)

# Accessing the model configuration
configuration = model.config`,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=o("p"),v=n("Example:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Example:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function tp(E){let f,v;return{c(){f=o("p"),v=n(`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`)},l(u){f=a(u,"P",{});var p=s(f);v=i(p,`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`),p.forEach(t)},m(u,p){_(u,f,p),e(f,v)},d(u){u&&t(f)}}}function rp(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function op(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, SegformerModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/mit-b0")
model = SegformerModel.from_pretrained("nvidia/mit-b0")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Example:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Example:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function ap(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function sp(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, SegformerForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/mit-b0")
model = SegformerForImageClassification.from_pretrained("nvidia/mit-b0")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Example:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Example:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function np(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function ip(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, SegformerForSemanticSegmentation
from PIL import Image
import requests

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits  # shape (batch_size, num_labels, height/4, width/4)
list(logits.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Examples:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Examples:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function lp(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function dp(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, TFSegformerModel
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/mit-b0")
model = TFSegformerModel.from_pretrained("nvidia/mit-b0")

inputs = feature_extractor(image, return_tensors="tf")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Example:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Example:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function cp(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function mp(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, TFSegformerForImageClassification
import tensorflow as tf
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/mit-b0")
model = TFSegformerForImageClassification.from_pretrained("nvidia/mit-b0")

inputs = feature_extractor(image, return_tensors="tf")
logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Example:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Example:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function fp(E){let f,v,u,p,b;return{c(){f=o("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),p=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(d){f=a(d,"P",{});var g=s(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(g,"CODE",{});var x=s(u);p=i(x,"Module"),x.forEach(t),b=i(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(d,g){_(d,f,g),e(f,v),e(f,u),e(u,p),e(f,b)},d(d){d&&t(f)}}}function hp(E){let f,v,u,p,b;return p=new Vr({props:{code:`from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
model = TFSegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")

inputs = feature_extractor(images=image, return_tensors="tf")
outputs = model(**inputs, training=False)
# logits are of shape (batch_size, num_labels, height/4, width/4)
logits = outputs.logits
list(logits.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegformerFeatureExtractor, 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>feature_extractor = SegformerFeatureExtractor.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 = feature_extractor(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=o("p"),v=n("Examples:"),u=c(),S(p.$$.fragment)},l(d){f=a(d,"P",{});var g=s(f);v=i(g,"Examples:"),g.forEach(t),u=m(d),w(p.$$.fragment,d)},m(d,g){_(d,f,g),e(f,v),_(d,u,g),$(p,d,g),b=!0},p:Ur,i(d){b||(T(p.$$.fragment,d),b=!0)},o(d){F(p.$$.fragment,d),b=!1},d(d){d&&t(f),d&&t(u),y(p,d)}}}function gp(E){let f,v,u,p,b,d,g,x,Pn,Fs,ue,Oe,na,Et,Dn,ia,An,ys,Ne,zn,xt,qn,Ln,Es,Kr,On,xs,Gr,la,Nn,ks,He,Hn,kt,Rn,Wn,Ms,Mt,uf,Is,G,Bn,It,Un,Vn,jt,Kn,Gn,Ct,Yn,Jn,js,Yr,Xn,Cs,M,W,Zn,Jr,Qn,ei,Xr,ti,ri,Zr,oi,ai,Pt,si,ni,ii,_e,li,Dt,di,ci,At,mi,fi,hi,zt,gi,qt,pi,ui,_i,Lt,bi,Ot,vi,Si,wi,Nt,$i,da,Ti,Fi,yi,be,Ei,Qr,xi,ki,Ht,Mi,Ii,ji,k,Ci,eo,Pi,Di,ca,Ai,zi,ma,qi,Li,fa,Oi,Ni,ha,Hi,Ri,ga,Wi,Bi,to,Ui,Vi,pa,Ki,Gi,ua,Yi,Ji,Xi,Rt,Zi,Wt,Qi,el,Ps,Re,_a,P,ro,ba,tl,rl,va,Sa,ol,al,wa,$a,sl,nl,oo,Ta,il,ll,ao,Fa,dl,cl,so,ya,ml,fl,D,A,no,hl,gl,Ea,pl,ul,xa,_l,bl,io,vl,Sl,lo,wl,$l,co,Tl,Fl,z,mo,yl,El,ka,xl,kl,Ma,Ml,Il,fo,jl,Cl,ho,Pl,Dl,go,Al,zl,q,po,ql,Ll,Ia,Ol,Nl,ja,Hl,Rl,uo,Wl,Bl,_o,Ul,Vl,bo,Kl,Gl,L,vo,Yl,Jl,Ca,Xl,Zl,Pa,Ql,ed,So,td,rd,wo,od,ad,$o,sd,nd,O,To,id,ld,Da,dd,cd,Aa,md,fd,Fo,hd,gd,yo,pd,ud,Eo,_d,bd,N,xo,vd,Sd,za,wd,$d,qa,Td,Fd,ko,yd,Ed,Mo,xd,kd,Io,Md,Ds,We,Id,Bt,jd,Cd,As,ve,Be,La,Ut,Pd,Oa,Dd,zs,B,Vt,Ad,Se,zd,jo,qd,Ld,Kt,Od,Nd,Hd,we,Rd,Co,Wd,Bd,Po,Ud,Vd,Kd,Ue,qs,$e,Ve,Na,Gt,Gd,Ha,Yd,Ls,H,Yt,Jd,Ra,Xd,Zd,Jt,Qd,Do,ec,tc,rc,fe,Xt,oc,Wa,ac,sc,Ke,nc,Ge,Zt,ic,Qt,lc,Ao,dc,cc,Os,Te,Ye,Ba,er,mc,Ua,fc,Ns,ce,tr,hc,rr,gc,or,pc,uc,_c,Y,ar,bc,Fe,vc,zo,Sc,wc,Va,$c,Tc,Fc,Je,yc,Xe,Hs,ye,Ze,Ka,sr,Ec,Ga,xc,Rs,Ee,nr,kc,qo,ir,Ws,xe,Qe,Ya,lr,Mc,Ja,Ic,Bs,U,dr,jc,Xa,Cc,Pc,cr,Dc,mr,Ac,zc,qc,J,fr,Lc,ke,Oc,Lo,Nc,Hc,Za,Rc,Wc,Bc,et,Uc,tt,Us,Me,rt,Qa,hr,Vc,es,Kc,Vs,me,gr,Gc,pr,Yc,ur,Jc,Xc,Zc,X,_r,Qc,Ie,em,Oo,tm,rm,ts,om,am,sm,ot,nm,at,Ks,je,st,rs,br,im,os,lm,Gs,Ce,vr,dm,No,Sr,Ys,Pe,nt,as,wr,cm,ss,mm,Js,V,$r,fm,Tr,hm,Ho,gm,pm,um,Fr,_m,yr,bm,vm,Sm,Z,Er,wm,De,$m,Ro,Tm,Fm,ns,ym,Em,xm,it,km,lt,Xs,Ae,dt,is,xr,Mm,ls,Im,Zs,R,kr,jm,ds,Cm,Pm,Mr,Dm,Wo,Am,zm,qm,Ir,Lm,jr,Om,Nm,Hm,Q,Cr,Rm,ze,Wm,Bo,Bm,Um,cs,Vm,Km,Gm,ct,Ym,mt,Qs,qe,ft,ms,Pr,Jm,fs,Xm,en,K,Dr,Zm,Ar,Qm,Uo,ef,tf,rf,zr,of,qr,af,sf,nf,ee,Lr,lf,Le,df,Vo,cf,mf,hs,ff,hf,gf,ht,pf,gt,tn;return d=new de({}),Et=new de({}),Ut=new de({}),Vt=new j({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:"is_encoder_decoder",val:" = False"},{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/vr_19907/src/transformers/models/segformer/configuration_segformer.py#L38"}}),Ue=new Br({props:{anchor:"transformers.SegformerConfig.example",$$slots:{default:[ep]},$$scope:{ctx:E}}}),Gt=new de({}),Yt=new j({props:{name:"class transformers.SegformerFeatureExtractor",anchor:"transformers.SegformerFeatureExtractor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = 512"},{name:"resample",val:" = <Resampling.BILINEAR: 2>"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"reduce_labels",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegformerFeatureExtractor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input based on a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.SegformerFeatureExtractor.size",description:`<strong>size</strong> (<code>int</code> or <code>Tuple(int)</code>, <em>optional</em>, defaults to 512) &#x2014;
Resize the input to the given size. If a tuple is provided, it should be (width, height). If only an
integer is provided, then the input will be resized to (size, size). Only has an effect if <code>do_resize</code> is
set to <code>True</code>.`,name:"size"},{anchor:"transformers.SegformerFeatureExtractor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BILINEAR</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.SegformerFeatureExtractor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input with mean and standard deviation.`,name:"do_normalize"},{anchor:"transformers.SegformerFeatureExtractor.image_mean",description:`<strong>image_mean</strong> (<code>int</code>, <em>optional</em>, defaults to <code>[0.485, 0.456, 0.406]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images. Defaults to the ImageNet mean.`,name:"image_mean"},{anchor:"transformers.SegformerFeatureExtractor.image_std",description:`<strong>image_std</strong> (<code>int</code>, <em>optional</em>, defaults to <code>[0.229, 0.224, 0.225]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images. Defaults to the
ImageNet std.`,name:"image_std"},{anchor:"transformers.SegformerFeatureExtractor.reduce_labels",description:`<strong>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.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/feature_extraction_segformer.py#L41"}}),Xt=new j({props:{name:"__call__",anchor:"transformers.SegformerFeatureExtractor.__call__",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')]] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegformerFeatureExtractor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is
the number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.SegformerFeatureExtractor.__call__.segmentation_maps",description:`<strong>segmentation_maps</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Optionally, the corresponding semantic segmentation maps with the pixel-wise annotations.`,name:"segmentation_maps"},{anchor:"transformers.SegformerFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_19907/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>, defaults to <code>&apos;np&apos;</code>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/feature_extraction_segformer.py#L95",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model, of shape (batch_size, num_channels, height,
width).</li>
<li><strong>labels</strong> \u2014 Optional labels to be fed to a model (when <code>segmentation_maps</code> are provided)</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),Ke=new Wr({props:{warning:!0,$$slots:{default:[tp]},$$scope:{ctx:E}}}),Zt=new j({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/pr_19907/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 left to
None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/feature_extraction_segformer.py#L221",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>
`}}),er=new de({}),tr=new j({props:{name:"class transformers.SegformerModel",anchor:"transformers.SegformerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L511"}}),ar=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor">SegformerFeatureExtractor</a>. See <a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SegformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L530",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new Wr({props:{$$slots:{default:[rp]},$$scope:{ctx:E}}}),Xe=new Br({props:{anchor:"transformers.SegformerModel.forward.example",$$slots:{default:[op]},$$scope:{ctx:E}}}),sr=new de({}),nr=new j({props:{name:"class transformers.SegformerDecodeHead",anchor:"transformers.SegformerDecodeHead",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L684"}}),ir=new j({props:{name:"forward",anchor:"transformers.SegformerDecodeHead.forward",parameters:[{name:"encoder_hidden_states",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L709"}}),lr=new de({}),dr=new j({props:{name:"class transformers.SegformerForImageClassification",anchor:"transformers.SegformerForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L577"}}),fr=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor">SegformerFeatureExtractor</a>. See <a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SegformerForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegformerForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L590",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/pr_19907/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>
`}}),et=new Wr({props:{$$slots:{default:[ap]},$$scope:{ctx:E}}}),tt=new Br({props:{anchor:"transformers.SegformerForImageClassification.forward.example",$$slots:{default:[sp]},$$scope:{ctx:E}}}),hr=new de({}),gr=new j({props:{name:"class transformers.SegformerForSemanticSegmentation",anchor:"transformers.SegformerForSemanticSegmentation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SegformerForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L746"}}),_r=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor">SegformerFeatureExtractor</a>. See <a href="/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor.__call__">SegformerFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegformerForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_segformer.py#L755",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ot=new Wr({props:{$$slots:{default:[np]},$$scope:{ctx:E}}}),at=new Br({props:{anchor:"transformers.SegformerForSemanticSegmentation.forward.example",$$slots:{default:[ip]},$$scope:{ctx:E}}}),br=new de({}),vr=new j({props:{name:"class transformers.TFSegformerDecodeHead",anchor:"transformers.TFSegformerDecodeHead",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L730"}}),Sr=new j({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/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L752"}}),wr=new de({}),$r=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L598"}}),Er=new j({props:{name:"call",anchor:"transformers.TFSegformerModel.call",parameters:[{name:"pixel_values",val:": Tensor"},{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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFSegformerModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L606",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),it=new Wr({props:{$$slots:{default:[lp]},$$scope:{ctx:E}}}),lt=new Br({props:{anchor:"transformers.TFSegformerModel.call.example",$$slots:{default:[dp]},$$scope:{ctx:E}}}),xr=new de({}),kr=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L649"}}),Cr=new j({props:{name:"call",anchor:"transformers.TFSegformerForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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.TFSegformerForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerForImageClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L659",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ct=new Wr({props:{$$slots:{default:[cp]},$$scope:{ctx:E}}}),mt=new Br({props:{anchor:"transformers.TFSegformerForImageClassification.call.example",$$slots:{default:[mp]},$$scope:{ctx:E}}}),Pr=new de({}),Dr=new j({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/pr_19907/en/model_doc/segformer#transformers.SegformerConfig">SegformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L790"}}),Lr=new j({props:{name:"call",anchor:"transformers.TFSegformerForSemanticSegmentation.call",parameters:[{name:"pixel_values",val:": Tensor"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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.TFSegformerForSemanticSegmentation.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFSegformerForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a (per-pixel) classification loss is computed
(Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/segformer/modeling_tf_segformer.py#L816",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/pr_19907/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>
`}}),ht=new Wr({props:{$$slots:{default:[fp]},$$scope:{ctx:E}}}),gt=new Br({props:{anchor:"transformers.TFSegformerForSemanticSegmentation.call.example",$$slots:{default:[hp]},$$scope:{ctx:E}}}),{c(){f=o("meta"),v=c(),u=o("h1"),p=o("a"),b=o("span"),S(d.$$.fragment),g=c(),x=o("span"),Pn=n("SegFormer"),Fs=c(),ue=o("h2"),Oe=o("a"),na=o("span"),S(Et.$$.fragment),Dn=c(),ia=o("span"),An=n("Overview"),ys=c(),Ne=o("p"),zn=n("The SegFormer model was proposed in "),xt=o("a"),qn=n("SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers"),Ln=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.`),Es=c(),Kr=o("p"),On=n("The abstract from the paper is the following:"),xs=c(),Gr=o("p"),la=o("em"),Nn=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.`),ks=c(),He=o("p"),Hn=n("The figure below illustrates the architecture of SegFormer. Taken from the "),kt=o("a"),Rn=n("original paper"),Wn=n("."),Ms=c(),Mt=o("img"),Is=c(),G=o("p"),Bn=n("This model was contributed by "),It=o("a"),Un=n("nielsr"),Vn=n(`. The TensorFlow version
of the model was contributed by `),jt=o("a"),Kn=n("sayakpaul"),Gn=n(". The original code can be found "),Ct=o("a"),Yn=n("here"),Jn=n("."),js=c(),Yr=o("p"),Xn=n("Tips:"),Cs=c(),M=o("ul"),W=o("li"),Zn=n(`SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
`),Jr=o("a"),Qn=n("SegformerModel"),ei=n(` is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). `),Xr=o("a"),ti=n("SegformerForSemanticSegmentation"),ri=n(` adds the all-MLP decoder head on
top to perform semantic segmentation of images. In addition, there\u2019s
`),Zr=o("a"),oi=n("SegformerForImageClassification"),ai=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 `),Pt=o("a"),si=n("hub"),ni=n("."),ii=c(),_e=o("li"),li=n("The quickest way to get started with SegFormer is by checking the "),Dt=o("a"),di=n("example notebooks"),ci=n(` (which showcase both inference and
fine-tuning on custom data). One can also check out the `),At=o("a"),mi=n("blog post"),fi=n(" introducing SegFormer and illustrating how it can be fine-tuned on custom data."),hi=c(),zt=o("li"),gi=n("TensorFlow users should refer to "),qt=o("a"),pi=n("this repository"),ui=n(" that shows off-the-shelf inference and fine-tuning."),_i=c(),Lt=o("li"),bi=n("One can also check out "),Ot=o("a"),vi=n("this interactive demo on Hugging Face Spaces"),Si=n(`
to try out a SegFormer model on custom images.`),wi=c(),Nt=o("li"),$i=n("SegFormer works on any input size, as it pads the input to be divisible by "),da=o("code"),Ti=n("config.patch_sizes"),Fi=n("."),yi=c(),be=o("li"),Ei=n("One can use "),Qr=o("a"),xi=n("SegformerFeatureExtractor"),ki=n(` to prepare images and corresponding segmentation maps
for the model. Note that this feature extractor 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 `),Ht=o("a"),Mi=n("here"),Ii=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.`),ji=c(),k=o("li"),Ci=n("One additional thing to keep in mind is that one can initialize "),eo=o("a"),Pi=n("SegformerFeatureExtractor"),Di=n(` with
`),ca=o("code"),Ai=n("reduce_labels"),zi=n(" set to "),ma=o("code"),qi=n("True"),Li=n(" or "),fa=o("code"),Oi=n("False"),Ni=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, `),ha=o("code"),Hi=n("reduce_labels"),Ri=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 `),ga=o("em"),Wi=n("ignore_index"),Bi=n(` of the loss function
used by `),to=o("a"),Ui=n("SegformerForSemanticSegmentation"),Vi=n(`). However, other datasets use the 0 index as
background class and include this class as part of all labels. In that case, `),pa=o("code"),Ki=n("reduce_labels"),Gi=n(` should be set to
`),ua=o("code"),Yi=n("False"),Ji=n(", as loss should also be computed for the background class."),Xi=c(),Rt=o("li"),Zi=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 `),Wt=o("a"),Qi=n("original paper"),el=n(")."),Ps=c(),Re=o("table"),_a=o("thead"),P=o("tr"),ro=o("th"),ba=o("strong"),tl=n("Model variant"),rl=c(),va=o("th"),Sa=o("strong"),ol=n("Depths"),al=c(),wa=o("th"),$a=o("strong"),sl=n("Hidden sizes"),nl=c(),oo=o("th"),Ta=o("strong"),il=n("Decoder hidden size"),ll=c(),ao=o("th"),Fa=o("strong"),dl=n("Params (M)"),cl=c(),so=o("th"),ya=o("strong"),ml=n("ImageNet-1k Top 1"),fl=c(),D=o("tbody"),A=o("tr"),no=o("td"),hl=n("MiT-b0"),gl=c(),Ea=o("td"),pl=n("[2, 2, 2, 2]"),ul=c(),xa=o("td"),_l=n("[32, 64, 160, 256]"),bl=c(),io=o("td"),vl=n("256"),Sl=c(),lo=o("td"),wl=n("3.7"),$l=c(),co=o("td"),Tl=n("70.5"),Fl=c(),z=o("tr"),mo=o("td"),yl=n("MiT-b1"),El=c(),ka=o("td"),xl=n("[2, 2, 2, 2]"),kl=c(),Ma=o("td"),Ml=n("[64, 128, 320, 512]"),Il=c(),fo=o("td"),jl=n("256"),Cl=c(),ho=o("td"),Pl=n("14.0"),Dl=c(),go=o("td"),Al=n("78.7"),zl=c(),q=o("tr"),po=o("td"),ql=n("MiT-b2"),Ll=c(),Ia=o("td"),Ol=n("[3, 4, 6, 3]"),Nl=c(),ja=o("td"),Hl=n("[64, 128, 320, 512]"),Rl=c(),uo=o("td"),Wl=n("768"),Bl=c(),_o=o("td"),Ul=n("25.4"),Vl=c(),bo=o("td"),Kl=n("81.6"),Gl=c(),L=o("tr"),vo=o("td"),Yl=n("MiT-b3"),Jl=c(),Ca=o("td"),Xl=n("[3, 4, 18, 3]"),Zl=c(),Pa=o("td"),Ql=n("[64, 128, 320, 512]"),ed=c(),So=o("td"),td=n("768"),rd=c(),wo=o("td"),od=n("45.2"),ad=c(),$o=o("td"),sd=n("83.1"),nd=c(),O=o("tr"),To=o("td"),id=n("MiT-b4"),ld=c(),Da=o("td"),dd=n("[3, 8, 27, 3]"),cd=c(),Aa=o("td"),md=n("[64, 128, 320, 512]"),fd=c(),Fo=o("td"),hd=n("768"),gd=c(),yo=o("td"),pd=n("62.6"),ud=c(),Eo=o("td"),_d=n("83.6"),bd=c(),N=o("tr"),xo=o("td"),vd=n("MiT-b5"),Sd=c(),za=o("td"),wd=n("[3, 6, 40, 3]"),$d=c(),qa=o("td"),Td=n("[64, 128, 320, 512]"),Fd=c(),ko=o("td"),yd=n("768"),Ed=c(),Mo=o("td"),xd=n("82.0"),kd=c(),Io=o("td"),Md=n("83.8"),Ds=c(),We=o("p"),Id=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 `),Bt=o("a"),jd=n("paper"),Cd=n("."),As=c(),ve=o("h2"),Be=o("a"),La=o("span"),S(Ut.$$.fragment),Pd=c(),Oa=o("span"),Dd=n("SegformerConfig"),zs=c(),B=o("div"),S(Vt.$$.fragment),Ad=c(),Se=o("p"),zd=n("This is the configuration class to store the configuration of a "),jo=o("a"),qd=n("SegformerModel"),Ld=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
`),Kt=o("a"),Od=n("nvidia/segformer-b0-finetuned-ade-512-512"),Nd=n(`
architecture.`),Hd=c(),we=o("p"),Rd=n("Configuration objects inherit from "),Co=o("a"),Wd=n("PretrainedConfig"),Bd=n(` and can be used to control the model outputs. Read the
documentation from `),Po=o("a"),Ud=n("PretrainedConfig"),Vd=n(" for more information."),Kd=c(),S(Ue.$$.fragment),qs=c(),$e=o("h2"),Ve=o("a"),Na=o("span"),S(Gt.$$.fragment),Gd=c(),Ha=o("span"),Yd=n("SegformerFeatureExtractor"),Ls=c(),H=o("div"),S(Yt.$$.fragment),Jd=c(),Ra=o("p"),Xd=n("Constructs a SegFormer feature extractor."),Zd=c(),Jt=o("p"),Qd=n("This feature extractor inherits from "),Do=o("a"),ec=n("FeatureExtractionMixin"),tc=n(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),rc=c(),fe=o("div"),S(Xt.$$.fragment),oc=c(),Wa=o("p"),ac=n("Main method to prepare for the model one or several image(s) and optional corresponding segmentation maps."),sc=c(),S(Ke.$$.fragment),nc=c(),Ge=o("div"),S(Zt.$$.fragment),ic=c(),Qt=o("p"),lc=n("Converts the output of "),Ao=o("a"),dc=n("SegformerForSemanticSegmentation"),cc=n(` into semantic segmentation maps. Only supports
PyTorch.`),Os=c(),Te=o("h2"),Ye=o("a"),Ba=o("span"),S(er.$$.fragment),mc=c(),Ua=o("span"),fc=n("SegformerModel"),Ns=c(),ce=o("div"),S(tr.$$.fragment),hc=c(),rr=o("p"),gc=n(`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),or=o("a"),pc=n("torch.nn.Module"),uc=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.`),_c=c(),Y=o("div"),S(ar.$$.fragment),bc=c(),Fe=o("p"),vc=n("The "),zo=o("a"),Sc=n("SegformerModel"),wc=n(" forward method, overrides the "),Va=o("code"),$c=n("__call__"),Tc=n(" special method."),Fc=c(),S(Je.$$.fragment),yc=c(),S(Xe.$$.fragment),Hs=c(),ye=o("h2"),Ze=o("a"),Ka=o("span"),S(sr.$$.fragment),Ec=c(),Ga=o("span"),xc=n("SegformerDecodeHead"),Rs=c(),Ee=o("div"),S(nr.$$.fragment),kc=c(),qo=o("div"),S(ir.$$.fragment),Ws=c(),xe=o("h2"),Qe=o("a"),Ya=o("span"),S(lr.$$.fragment),Mc=c(),Ja=o("span"),Ic=n("SegformerForImageClassification"),Bs=c(),U=o("div"),S(dr.$$.fragment),jc=c(),Xa=o("p"),Cc=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.`),Pc=c(),cr=o("p"),Dc=n("This model is a PyTorch "),mr=o("a"),Ac=n("torch.nn.Module"),zc=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.`),qc=c(),J=o("div"),S(fr.$$.fragment),Lc=c(),ke=o("p"),Oc=n("The "),Lo=o("a"),Nc=n("SegformerForImageClassification"),Hc=n(" forward method, overrides the "),Za=o("code"),Rc=n("__call__"),Wc=n(" special method."),Bc=c(),S(et.$$.fragment),Uc=c(),S(tt.$$.fragment),Us=c(),Me=o("h2"),rt=o("a"),Qa=o("span"),S(hr.$$.fragment),Vc=c(),es=o("span"),Kc=n("SegformerForSemanticSegmentation"),Vs=c(),me=o("div"),S(gr.$$.fragment),Gc=c(),pr=o("p"),Yc=n(`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model is a PyTorch `),ur=o("a"),Jc=n("torch.nn.Module"),Xc=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.`),Zc=c(),X=o("div"),S(_r.$$.fragment),Qc=c(),Ie=o("p"),em=n("The "),Oo=o("a"),tm=n("SegformerForSemanticSegmentation"),rm=n(" forward method, overrides the "),ts=o("code"),om=n("__call__"),am=n(" special method."),sm=c(),S(ot.$$.fragment),nm=c(),S(at.$$.fragment),Ks=c(),je=o("h2"),st=o("a"),rs=o("span"),S(br.$$.fragment),im=c(),os=o("span"),lm=n("TFSegformerDecodeHead"),Gs=c(),Ce=o("div"),S(vr.$$.fragment),dm=c(),No=o("div"),S(Sr.$$.fragment),Ys=c(),Pe=o("h2"),nt=o("a"),as=o("span"),S(wr.$$.fragment),cm=c(),ss=o("span"),mm=n("TFSegformerModel"),Js=c(),V=o("div"),S($r.$$.fragment),fm=c(),Tr=o("p"),hm=n(`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model inherits from `),Ho=o("a"),gm=n("TFPreTrainedModel"),pm=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.)`),um=c(),Fr=o("p"),_m=n("This model is also a "),yr=o("a"),bm=n("tf.keras.Model"),vm=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.`),Sm=c(),Z=o("div"),S(Er.$$.fragment),wm=c(),De=o("p"),$m=n("The "),Ro=o("a"),Tm=n("TFSegformerModel"),Fm=n(" forward method, overrides the "),ns=o("code"),ym=n("__call__"),Em=n(" special method."),xm=c(),S(it.$$.fragment),km=c(),S(lt.$$.fragment),Xs=c(),Ae=o("h2"),dt=o("a"),is=o("span"),S(xr.$$.fragment),Mm=c(),ls=o("span"),Im=n("TFSegformerForImageClassification"),Zs=c(),R=o("div"),S(kr.$$.fragment),jm=c(),ds=o("p"),Cm=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.`),Pm=c(),Mr=o("p"),Dm=n("This model inherits from "),Wo=o("a"),Am=n("TFPreTrainedModel"),zm=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.)`),qm=c(),Ir=o("p"),Lm=n("This model is also a "),jr=o("a"),Om=n("tf.keras.Model"),Nm=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.`),Hm=c(),Q=o("div"),S(Cr.$$.fragment),Rm=c(),ze=o("p"),Wm=n("The "),Bo=o("a"),Bm=n("TFSegformerForImageClassification"),Um=n(" forward method, overrides the "),cs=o("code"),Vm=n("__call__"),Km=n(" special method."),Gm=c(),S(ct.$$.fragment),Ym=c(),S(mt.$$.fragment),Qs=c(),qe=o("h2"),ft=o("a"),ms=o("span"),S(Pr.$$.fragment),Jm=c(),fs=o("span"),Xm=n("TFSegformerForSemanticSegmentation"),en=c(),K=o("div"),S(Dr.$$.fragment),Zm=c(),Ar=o("p"),Qm=n(`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model inherits from `),Uo=o("a"),ef=n("TFPreTrainedModel"),tf=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.)`),rf=c(),zr=o("p"),of=n("This model is also a "),qr=o("a"),af=n("tf.keras.Model"),sf=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.`),nf=c(),ee=o("div"),S(Lr.$$.fragment),lf=c(),Le=o("p"),df=n("The "),Vo=o("a"),cf=n("TFSegformerForSemanticSegmentation"),mf=n(" forward method, overrides the "),hs=o("code"),ff=n("__call__"),hf=n(" special method."),gf=c(),S(ht.$$.fragment),pf=c(),S(gt.$$.fragment),this.h()},l(r){const h=Xg('[data-svelte="svelte-1phssyn"]',document.head);f=a(h,"META",{name:!0,content:!0}),h.forEach(t),v=m(r),u=a(r,"H1",{class:!0});var Or=s(u);p=a(Or,"A",{id:!0,class:!0,href:!0});var gs=s(p);b=a(gs,"SPAN",{});var ps=s(b);w(d.$$.fragment,ps),ps.forEach(t),gs.forEach(t),g=m(Or),x=a(Or,"SPAN",{});var us=s(x);Pn=i(us,"SegFormer"),us.forEach(t),Or.forEach(t),Fs=m(r),ue=a(r,"H2",{class:!0});var Nr=s(ue);Oe=a(Nr,"A",{id:!0,class:!0,href:!0});var _s=s(Oe);na=a(_s,"SPAN",{});var bs=s(na);w(Et.$$.fragment,bs),bs.forEach(t),_s.forEach(t),Dn=m(Nr),ia=a(Nr,"SPAN",{});var vs=s(ia);An=i(vs,"Overview"),vs.forEach(t),Nr.forEach(t),ys=m(r),Ne=a(r,"P",{});var Hr=s(Ne);zn=i(Hr,"The SegFormer model was proposed in "),xt=a(Hr,"A",{href:!0,rel:!0});var Ss=s(xt);qn=i(Ss,"SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers"),Ss.forEach(t),Ln=i(Hr,` 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.`),Hr.forEach(t),Es=m(r),Kr=a(r,"P",{});var ws=s(Kr);On=i(ws,"The abstract from the paper is the following:"),ws.forEach(t),xs=m(r),Gr=a(r,"P",{});var $s=s(Gr);la=a($s,"EM",{});var Ts=s(la);Nn=i(Ts,`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.`),Ts.forEach(t),$s.forEach(t),ks=m(r),He=a(r,"P",{});var Rr=s(He);Hn=i(Rr,"The figure below illustrates the architecture of SegFormer. Taken from the "),kt=a(Rr,"A",{href:!0,rel:!0});var _f=s(kt);Rn=i(_f,"original paper"),_f.forEach(t),Wn=i(Rr,"."),Rr.forEach(t),Ms=m(r),Mt=a(r,"IMG",{width:!0,src:!0}),Is=m(r),G=a(r,"P",{});var pt=s(G);Bn=i(pt,"This model was contributed by "),It=a(pt,"A",{href:!0,rel:!0});var bf=s(It);Un=i(bf,"nielsr"),bf.forEach(t),Vn=i(pt,`. The TensorFlow version
of the model was contributed by `),jt=a(pt,"A",{href:!0,rel:!0});var vf=s(jt);Kn=i(vf,"sayakpaul"),vf.forEach(t),Gn=i(pt,". The original code can be found "),Ct=a(pt,"A",{href:!0,rel:!0});var Sf=s(Ct);Yn=i(Sf,"here"),Sf.forEach(t),Jn=i(pt,"."),pt.forEach(t),js=m(r),Yr=a(r,"P",{});var wf=s(Yr);Xn=i(wf,"Tips:"),wf.forEach(t),Cs=m(r),M=a(r,"UL",{});var C=s(M);W=a(C,"LI",{});var he=s(W);Zn=i(he,`SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
`),Jr=a(he,"A",{href:!0});var $f=s(Jr);Qn=i($f,"SegformerModel"),$f.forEach(t),ei=i(he,` is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). `),Xr=a(he,"A",{href:!0});var Tf=s(Xr);ti=i(Tf,"SegformerForSemanticSegmentation"),Tf.forEach(t),ri=i(he,` adds the all-MLP decoder head on
top to perform semantic segmentation of images. In addition, there\u2019s
`),Zr=a(he,"A",{href:!0});var Ff=s(Zr);oi=i(Ff,"SegformerForImageClassification"),Ff.forEach(t),ai=i(he,` 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 `),Pt=a(he,"A",{href:!0,rel:!0});var yf=s(Pt);si=i(yf,"hub"),yf.forEach(t),ni=i(he,"."),he.forEach(t),ii=m(C),_e=a(C,"LI",{});var Ko=s(_e);li=i(Ko,"The quickest way to get started with SegFormer is by checking the "),Dt=a(Ko,"A",{href:!0,rel:!0});var Ef=s(Dt);di=i(Ef,"example notebooks"),Ef.forEach(t),ci=i(Ko,` (which showcase both inference and
fine-tuning on custom data). One can also check out the `),At=a(Ko,"A",{href:!0,rel:!0});var xf=s(At);mi=i(xf,"blog post"),xf.forEach(t),fi=i(Ko," introducing SegFormer and illustrating how it can be fine-tuned on custom data."),Ko.forEach(t),hi=m(C),zt=a(C,"LI",{});var rn=s(zt);gi=i(rn,"TensorFlow users should refer to "),qt=a(rn,"A",{href:!0,rel:!0});var kf=s(qt);pi=i(kf,"this repository"),kf.forEach(t),ui=i(rn," that shows off-the-shelf inference and fine-tuning."),rn.forEach(t),_i=m(C),Lt=a(C,"LI",{});var on=s(Lt);bi=i(on,"One can also check out "),Ot=a(on,"A",{href:!0,rel:!0});var Mf=s(Ot);vi=i(Mf,"this interactive demo on Hugging Face Spaces"),Mf.forEach(t),Si=i(on,`
to try out a SegFormer model on custom images.`),on.forEach(t),wi=m(C),Nt=a(C,"LI",{});var an=s(Nt);$i=i(an,"SegFormer works on any input size, as it pads the input to be divisible by "),da=a(an,"CODE",{});var If=s(da);Ti=i(If,"config.patch_sizes"),If.forEach(t),Fi=i(an,"."),an.forEach(t),yi=m(C),be=a(C,"LI",{});var Go=s(be);Ei=i(Go,"One can use "),Qr=a(Go,"A",{href:!0});var jf=s(Qr);xi=i(jf,"SegformerFeatureExtractor"),jf.forEach(t),ki=i(Go,` to prepare images and corresponding segmentation maps
for the model. Note that this feature extractor 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 `),Ht=a(Go,"A",{href:!0,rel:!0});var Cf=s(Ht);Mi=i(Cf,"here"),Cf.forEach(t),Ii=i(Go,`. 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.`),Go.forEach(t),ji=m(C),k=a(C,"LI",{});var I=s(k);Ci=i(I,"One additional thing to keep in mind is that one can initialize "),eo=a(I,"A",{href:!0});var Pf=s(eo);Pi=i(Pf,"SegformerFeatureExtractor"),Pf.forEach(t),Di=i(I,` with
`),ca=a(I,"CODE",{});var Df=s(ca);Ai=i(Df,"reduce_labels"),Df.forEach(t),zi=i(I," set to "),ma=a(I,"CODE",{});var Af=s(ma);qi=i(Af,"True"),Af.forEach(t),Li=i(I," or "),fa=a(I,"CODE",{});var zf=s(fa);Oi=i(zf,"False"),zf.forEach(t),Ni=i(I,`. 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, `),ha=a(I,"CODE",{});var qf=s(ha);Hi=i(qf,"reduce_labels"),qf.forEach(t),Ri=i(I,` 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 `),ga=a(I,"EM",{});var Lf=s(ga);Wi=i(Lf,"ignore_index"),Lf.forEach(t),Bi=i(I,` of the loss function
used by `),to=a(I,"A",{href:!0});var Of=s(to);Ui=i(Of,"SegformerForSemanticSegmentation"),Of.forEach(t),Vi=i(I,`). However, other datasets use the 0 index as
background class and include this class as part of all labels. In that case, `),pa=a(I,"CODE",{});var Nf=s(pa);Ki=i(Nf,"reduce_labels"),Nf.forEach(t),Gi=i(I,` should be set to
`),ua=a(I,"CODE",{});var Hf=s(ua);Yi=i(Hf,"False"),Hf.forEach(t),Ji=i(I,", as loss should also be computed for the background class."),I.forEach(t),Xi=m(C),Rt=a(C,"LI",{});var sn=s(Rt);Zi=i(sn,`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 `),Wt=a(sn,"A",{href:!0,rel:!0});var Rf=s(Wt);Qi=i(Rf,"original paper"),Rf.forEach(t),el=i(sn,")."),sn.forEach(t),C.forEach(t),Ps=m(r),Re=a(r,"TABLE",{});var nn=s(Re);_a=a(nn,"THEAD",{});var Wf=s(_a);P=a(Wf,"TR",{});var te=s(P);ro=a(te,"TH",{align:!0});var Bf=s(ro);ba=a(Bf,"STRONG",{});var Uf=s(ba);tl=i(Uf,"Model variant"),Uf.forEach(t),Bf.forEach(t),rl=m(te),va=a(te,"TH",{});var Vf=s(va);Sa=a(Vf,"STRONG",{});var Kf=s(Sa);ol=i(Kf,"Depths"),Kf.forEach(t),Vf.forEach(t),al=m(te),wa=a(te,"TH",{});var Gf=s(wa);$a=a(Gf,"STRONG",{});var Yf=s($a);sl=i(Yf,"Hidden sizes"),Yf.forEach(t),Gf.forEach(t),nl=m(te),oo=a(te,"TH",{align:!0});var Jf=s(oo);Ta=a(Jf,"STRONG",{});var Xf=s(Ta);il=i(Xf,"Decoder hidden size"),Xf.forEach(t),Jf.forEach(t),ll=m(te),ao=a(te,"TH",{align:!0});var Zf=s(ao);Fa=a(Zf,"STRONG",{});var Qf=s(Fa);dl=i(Qf,"Params (M)"),Qf.forEach(t),Zf.forEach(t),cl=m(te),so=a(te,"TH",{align:!0});var eh=s(so);ya=a(eh,"STRONG",{});var th=s(ya);ml=i(th,"ImageNet-1k Top 1"),th.forEach(t),eh.forEach(t),te.forEach(t),Wf.forEach(t),fl=m(nn),D=a(nn,"TBODY",{});var re=s(D);A=a(re,"TR",{});var oe=s(A);no=a(oe,"TD",{align:!0});var rh=s(no);hl=i(rh,"MiT-b0"),rh.forEach(t),gl=m(oe),Ea=a(oe,"TD",{});var oh=s(Ea);pl=i(oh,"[2, 2, 2, 2]"),oh.forEach(t),ul=m(oe),xa=a(oe,"TD",{});var ah=s(xa);_l=i(ah,"[32, 64, 160, 256]"),ah.forEach(t),bl=m(oe),io=a(oe,"TD",{align:!0});var sh=s(io);vl=i(sh,"256"),sh.forEach(t),Sl=m(oe),lo=a(oe,"TD",{align:!0});var nh=s(lo);wl=i(nh,"3.7"),nh.forEach(t),$l=m(oe),co=a(oe,"TD",{align:!0});var ih=s(co);Tl=i(ih,"70.5"),ih.forEach(t),oe.forEach(t),Fl=m(re),z=a(re,"TR",{});var ae=s(z);mo=a(ae,"TD",{align:!0});var lh=s(mo);yl=i(lh,"MiT-b1"),lh.forEach(t),El=m(ae),ka=a(ae,"TD",{});var dh=s(ka);xl=i(dh,"[2, 2, 2, 2]"),dh.forEach(t),kl=m(ae),Ma=a(ae,"TD",{});var ch=s(Ma);Ml=i(ch,"[64, 128, 320, 512]"),ch.forEach(t),Il=m(ae),fo=a(ae,"TD",{align:!0});var mh=s(fo);jl=i(mh,"256"),mh.forEach(t),Cl=m(ae),ho=a(ae,"TD",{align:!0});var fh=s(ho);Pl=i(fh,"14.0"),fh.forEach(t),Dl=m(ae),go=a(ae,"TD",{align:!0});var hh=s(go);Al=i(hh,"78.7"),hh.forEach(t),ae.forEach(t),zl=m(re),q=a(re,"TR",{});var se=s(q);po=a(se,"TD",{align:!0});var gh=s(po);ql=i(gh,"MiT-b2"),gh.forEach(t),Ll=m(se),Ia=a(se,"TD",{});var ph=s(Ia);Ol=i(ph,"[3, 4, 6, 3]"),ph.forEach(t),Nl=m(se),ja=a(se,"TD",{});var uh=s(ja);Hl=i(uh,"[64, 128, 320, 512]"),uh.forEach(t),Rl=m(se),uo=a(se,"TD",{align:!0});var _h=s(uo);Wl=i(_h,"768"),_h.forEach(t),Bl=m(se),_o=a(se,"TD",{align:!0});var bh=s(_o);Ul=i(bh,"25.4"),bh.forEach(t),Vl=m(se),bo=a(se,"TD",{align:!0});var vh=s(bo);Kl=i(vh,"81.6"),vh.forEach(t),se.forEach(t),Gl=m(re),L=a(re,"TR",{});var ne=s(L);vo=a(ne,"TD",{align:!0});var Sh=s(vo);Yl=i(Sh,"MiT-b3"),Sh.forEach(t),Jl=m(ne),Ca=a(ne,"TD",{});var wh=s(Ca);Xl=i(wh,"[3, 4, 18, 3]"),wh.forEach(t),Zl=m(ne),Pa=a(ne,"TD",{});var $h=s(Pa);Ql=i($h,"[64, 128, 320, 512]"),$h.forEach(t),ed=m(ne),So=a(ne,"TD",{align:!0});var Th=s(So);td=i(Th,"768"),Th.forEach(t),rd=m(ne),wo=a(ne,"TD",{align:!0});var Fh=s(wo);od=i(Fh,"45.2"),Fh.forEach(t),ad=m(ne),$o=a(ne,"TD",{align:!0});var yh=s($o);sd=i(yh,"83.1"),yh.forEach(t),ne.forEach(t),nd=m(re),O=a(re,"TR",{});var ie=s(O);To=a(ie,"TD",{align:!0});var Eh=s(To);id=i(Eh,"MiT-b4"),Eh.forEach(t),ld=m(ie),Da=a(ie,"TD",{});var xh=s(Da);dd=i(xh,"[3, 8, 27, 3]"),xh.forEach(t),cd=m(ie),Aa=a(ie,"TD",{});var kh=s(Aa);md=i(kh,"[64, 128, 320, 512]"),kh.forEach(t),fd=m(ie),Fo=a(ie,"TD",{align:!0});var Mh=s(Fo);hd=i(Mh,"768"),Mh.forEach(t),gd=m(ie),yo=a(ie,"TD",{align:!0});var Ih=s(yo);pd=i(Ih,"62.6"),Ih.forEach(t),ud=m(ie),Eo=a(ie,"TD",{align:!0});var jh=s(Eo);_d=i(jh,"83.6"),jh.forEach(t),ie.forEach(t),bd=m(re),N=a(re,"TR",{});var le=s(N);xo=a(le,"TD",{align:!0});var Ch=s(xo);vd=i(Ch,"MiT-b5"),Ch.forEach(t),Sd=m(le),za=a(le,"TD",{});var Ph=s(za);wd=i(Ph,"[3, 6, 40, 3]"),Ph.forEach(t),$d=m(le),qa=a(le,"TD",{});var Dh=s(qa);Td=i(Dh,"[64, 128, 320, 512]"),Dh.forEach(t),Fd=m(le),ko=a(le,"TD",{align:!0});var Ah=s(ko);yd=i(Ah,"768"),Ah.forEach(t),Ed=m(le),Mo=a(le,"TD",{align:!0});var zh=s(Mo);xd=i(zh,"82.0"),zh.forEach(t),kd=m(le),Io=a(le,"TD",{align:!0});var qh=s(Io);Md=i(qh,"83.8"),qh.forEach(t),le.forEach(t),re.forEach(t),nn.forEach(t),Ds=m(r),We=a(r,"P",{});var ln=s(We);Id=i(ln,`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 `),Bt=a(ln,"A",{href:!0,rel:!0});var Lh=s(Bt);jd=i(Lh,"paper"),Lh.forEach(t),Cd=i(ln,"."),ln.forEach(t),As=m(r),ve=a(r,"H2",{class:!0});var dn=s(ve);Be=a(dn,"A",{id:!0,class:!0,href:!0});var Oh=s(Be);La=a(Oh,"SPAN",{});var Nh=s(La);w(Ut.$$.fragment,Nh),Nh.forEach(t),Oh.forEach(t),Pd=m(dn),Oa=a(dn,"SPAN",{});var Hh=s(Oa);Dd=i(Hh,"SegformerConfig"),Hh.forEach(t),dn.forEach(t),zs=m(r),B=a(r,"DIV",{class:!0});var ut=s(B);w(Vt.$$.fragment,ut),Ad=m(ut),Se=a(ut,"P",{});var Yo=s(Se);zd=i(Yo,"This is the configuration class to store the configuration of a "),jo=a(Yo,"A",{href:!0});var Rh=s(jo);qd=i(Rh,"SegformerModel"),Rh.forEach(t),Ld=i(Yo,`. 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
`),Kt=a(Yo,"A",{href:!0,rel:!0});var Wh=s(Kt);Od=i(Wh,"nvidia/segformer-b0-finetuned-ade-512-512"),Wh.forEach(t),Nd=i(Yo,`
architecture.`),Yo.forEach(t),Hd=m(ut),we=a(ut,"P",{});var Jo=s(we);Rd=i(Jo,"Configuration objects inherit from "),Co=a(Jo,"A",{href:!0});var Bh=s(Co);Wd=i(Bh,"PretrainedConfig"),Bh.forEach(t),Bd=i(Jo,` and can be used to control the model outputs. Read the
documentation from `),Po=a(Jo,"A",{href:!0});var Uh=s(Po);Ud=i(Uh,"PretrainedConfig"),Uh.forEach(t),Vd=i(Jo," for more information."),Jo.forEach(t),Kd=m(ut),w(Ue.$$.fragment,ut),ut.forEach(t),qs=m(r),$e=a(r,"H2",{class:!0});var cn=s($e);Ve=a(cn,"A",{id:!0,class:!0,href:!0});var Vh=s(Ve);Na=a(Vh,"SPAN",{});var Kh=s(Na);w(Gt.$$.fragment,Kh),Kh.forEach(t),Vh.forEach(t),Gd=m(cn),Ha=a(cn,"SPAN",{});var Gh=s(Ha);Yd=i(Gh,"SegformerFeatureExtractor"),Gh.forEach(t),cn.forEach(t),Ls=m(r),H=a(r,"DIV",{class:!0});var ge=s(H);w(Yt.$$.fragment,ge),Jd=m(ge),Ra=a(ge,"P",{});var Yh=s(Ra);Xd=i(Yh,"Constructs a SegFormer feature extractor."),Yh.forEach(t),Zd=m(ge),Jt=a(ge,"P",{});var mn=s(Jt);Qd=i(mn,"This feature extractor inherits from "),Do=a(mn,"A",{href:!0});var Jh=s(Do);ec=i(Jh,"FeatureExtractionMixin"),Jh.forEach(t),tc=i(mn,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),mn.forEach(t),rc=m(ge),fe=a(ge,"DIV",{class:!0});var Xo=s(fe);w(Xt.$$.fragment,Xo),oc=m(Xo),Wa=a(Xo,"P",{});var Xh=s(Wa);ac=i(Xh,"Main method to prepare for the model one or several image(s) and optional corresponding segmentation maps."),Xh.forEach(t),sc=m(Xo),w(Ke.$$.fragment,Xo),Xo.forEach(t),nc=m(ge),Ge=a(ge,"DIV",{class:!0});var fn=s(Ge);w(Zt.$$.fragment,fn),ic=m(fn),Qt=a(fn,"P",{});var hn=s(Qt);lc=i(hn,"Converts the output of "),Ao=a(hn,"A",{href:!0});var Zh=s(Ao);dc=i(Zh,"SegformerForSemanticSegmentation"),Zh.forEach(t),cc=i(hn,` into semantic segmentation maps. Only supports
PyTorch.`),hn.forEach(t),fn.forEach(t),ge.forEach(t),Os=m(r),Te=a(r,"H2",{class:!0});var gn=s(Te);Ye=a(gn,"A",{id:!0,class:!0,href:!0});var Qh=s(Ye);Ba=a(Qh,"SPAN",{});var eg=s(Ba);w(er.$$.fragment,eg),eg.forEach(t),Qh.forEach(t),mc=m(gn),Ua=a(gn,"SPAN",{});var tg=s(Ua);fc=i(tg,"SegformerModel"),tg.forEach(t),gn.forEach(t),Ns=m(r),ce=a(r,"DIV",{class:!0});var Zo=s(ce);w(tr.$$.fragment,Zo),hc=m(Zo),rr=a(Zo,"P",{});var pn=s(rr);gc=i(pn,`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),or=a(pn,"A",{href:!0,rel:!0});var rg=s(or);pc=i(rg,"torch.nn.Module"),rg.forEach(t),uc=i(pn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pn.forEach(t),_c=m(Zo),Y=a(Zo,"DIV",{class:!0});var _t=s(Y);w(ar.$$.fragment,_t),bc=m(_t),Fe=a(_t,"P",{});var Qo=s(Fe);vc=i(Qo,"The "),zo=a(Qo,"A",{href:!0});var og=s(zo);Sc=i(og,"SegformerModel"),og.forEach(t),wc=i(Qo," forward method, overrides the "),Va=a(Qo,"CODE",{});var ag=s(Va);$c=i(ag,"__call__"),ag.forEach(t),Tc=i(Qo," special method."),Qo.forEach(t),Fc=m(_t),w(Je.$$.fragment,_t),yc=m(_t),w(Xe.$$.fragment,_t),_t.forEach(t),Zo.forEach(t),Hs=m(r),ye=a(r,"H2",{class:!0});var un=s(ye);Ze=a(un,"A",{id:!0,class:!0,href:!0});var sg=s(Ze);Ka=a(sg,"SPAN",{});var ng=s(Ka);w(sr.$$.fragment,ng),ng.forEach(t),sg.forEach(t),Ec=m(un),Ga=a(un,"SPAN",{});var ig=s(Ga);xc=i(ig,"SegformerDecodeHead"),ig.forEach(t),un.forEach(t),Rs=m(r),Ee=a(r,"DIV",{class:!0});var _n=s(Ee);w(nr.$$.fragment,_n),kc=m(_n),qo=a(_n,"DIV",{class:!0});var lg=s(qo);w(ir.$$.fragment,lg),lg.forEach(t),_n.forEach(t),Ws=m(r),xe=a(r,"H2",{class:!0});var bn=s(xe);Qe=a(bn,"A",{id:!0,class:!0,href:!0});var dg=s(Qe);Ya=a(dg,"SPAN",{});var cg=s(Ya);w(lr.$$.fragment,cg),cg.forEach(t),dg.forEach(t),Mc=m(bn),Ja=a(bn,"SPAN",{});var mg=s(Ja);Ic=i(mg,"SegformerForImageClassification"),mg.forEach(t),bn.forEach(t),Bs=m(r),U=a(r,"DIV",{class:!0});var bt=s(U);w(dr.$$.fragment,bt),jc=m(bt),Xa=a(bt,"P",{});var fg=s(Xa);Cc=i(fg,`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),fg.forEach(t),Pc=m(bt),cr=a(bt,"P",{});var vn=s(cr);Dc=i(vn,"This model is a PyTorch "),mr=a(vn,"A",{href:!0,rel:!0});var hg=s(mr);Ac=i(hg,"torch.nn.Module"),hg.forEach(t),zc=i(vn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vn.forEach(t),qc=m(bt),J=a(bt,"DIV",{class:!0});var vt=s(J);w(fr.$$.fragment,vt),Lc=m(vt),ke=a(vt,"P",{});var ea=s(ke);Oc=i(ea,"The "),Lo=a(ea,"A",{href:!0});var gg=s(Lo);Nc=i(gg,"SegformerForImageClassification"),gg.forEach(t),Hc=i(ea," forward method, overrides the "),Za=a(ea,"CODE",{});var pg=s(Za);Rc=i(pg,"__call__"),pg.forEach(t),Wc=i(ea," special method."),ea.forEach(t),Bc=m(vt),w(et.$$.fragment,vt),Uc=m(vt),w(tt.$$.fragment,vt),vt.forEach(t),bt.forEach(t),Us=m(r),Me=a(r,"H2",{class:!0});var Sn=s(Me);rt=a(Sn,"A",{id:!0,class:!0,href:!0});var ug=s(rt);Qa=a(ug,"SPAN",{});var _g=s(Qa);w(hr.$$.fragment,_g),_g.forEach(t),ug.forEach(t),Vc=m(Sn),es=a(Sn,"SPAN",{});var bg=s(es);Kc=i(bg,"SegformerForSemanticSegmentation"),bg.forEach(t),Sn.forEach(t),Vs=m(r),me=a(r,"DIV",{class:!0});var ta=s(me);w(gr.$$.fragment,ta),Gc=m(ta),pr=a(ta,"P",{});var wn=s(pr);Yc=i(wn,`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model is a PyTorch `),ur=a(wn,"A",{href:!0,rel:!0});var vg=s(ur);Jc=i(vg,"torch.nn.Module"),vg.forEach(t),Xc=i(wn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wn.forEach(t),Zc=m(ta),X=a(ta,"DIV",{class:!0});var St=s(X);w(_r.$$.fragment,St),Qc=m(St),Ie=a(St,"P",{});var ra=s(Ie);em=i(ra,"The "),Oo=a(ra,"A",{href:!0});var Sg=s(Oo);tm=i(Sg,"SegformerForSemanticSegmentation"),Sg.forEach(t),rm=i(ra," forward method, overrides the "),ts=a(ra,"CODE",{});var wg=s(ts);om=i(wg,"__call__"),wg.forEach(t),am=i(ra," special method."),ra.forEach(t),sm=m(St),w(ot.$$.fragment,St),nm=m(St),w(at.$$.fragment,St),St.forEach(t),ta.forEach(t),Ks=m(r),je=a(r,"H2",{class:!0});var $n=s(je);st=a($n,"A",{id:!0,class:!0,href:!0});var $g=s(st);rs=a($g,"SPAN",{});var Tg=s(rs);w(br.$$.fragment,Tg),Tg.forEach(t),$g.forEach(t),im=m($n),os=a($n,"SPAN",{});var Fg=s(os);lm=i(Fg,"TFSegformerDecodeHead"),Fg.forEach(t),$n.forEach(t),Gs=m(r),Ce=a(r,"DIV",{class:!0});var Tn=s(Ce);w(vr.$$.fragment,Tn),dm=m(Tn),No=a(Tn,"DIV",{class:!0});var yg=s(No);w(Sr.$$.fragment,yg),yg.forEach(t),Tn.forEach(t),Ys=m(r),Pe=a(r,"H2",{class:!0});var Fn=s(Pe);nt=a(Fn,"A",{id:!0,class:!0,href:!0});var Eg=s(nt);as=a(Eg,"SPAN",{});var xg=s(as);w(wr.$$.fragment,xg),xg.forEach(t),Eg.forEach(t),cm=m(Fn),ss=a(Fn,"SPAN",{});var kg=s(ss);mm=i(kg,"TFSegformerModel"),kg.forEach(t),Fn.forEach(t),Js=m(r),V=a(r,"DIV",{class:!0});var wt=s(V);w($r.$$.fragment,wt),fm=m(wt),Tr=a(wt,"P",{});var yn=s(Tr);hm=i(yn,`The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model inherits from `),Ho=a(yn,"A",{href:!0});var Mg=s(Ho);gm=i(Mg,"TFPreTrainedModel"),Mg.forEach(t),pm=i(yn,`. 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.)`),yn.forEach(t),um=m(wt),Fr=a(wt,"P",{});var En=s(Fr);_m=i(En,"This model is also a "),yr=a(En,"A",{href:!0,rel:!0});var Ig=s(yr);bm=i(Ig,"tf.keras.Model"),Ig.forEach(t),vm=i(En,` 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.`),En.forEach(t),Sm=m(wt),Z=a(wt,"DIV",{class:!0});var $t=s(Z);w(Er.$$.fragment,$t),wm=m($t),De=a($t,"P",{});var oa=s(De);$m=i(oa,"The "),Ro=a(oa,"A",{href:!0});var jg=s(Ro);Tm=i(jg,"TFSegformerModel"),jg.forEach(t),Fm=i(oa," forward method, overrides the "),ns=a(oa,"CODE",{});var Cg=s(ns);ym=i(Cg,"__call__"),Cg.forEach(t),Em=i(oa," special method."),oa.forEach(t),xm=m($t),w(it.$$.fragment,$t),km=m($t),w(lt.$$.fragment,$t),$t.forEach(t),wt.forEach(t),Xs=m(r),Ae=a(r,"H2",{class:!0});var xn=s(Ae);dt=a(xn,"A",{id:!0,class:!0,href:!0});var Pg=s(dt);is=a(Pg,"SPAN",{});var Dg=s(is);w(xr.$$.fragment,Dg),Dg.forEach(t),Pg.forEach(t),Mm=m(xn),ls=a(xn,"SPAN",{});var Ag=s(ls);Im=i(Ag,"TFSegformerForImageClassification"),Ag.forEach(t),xn.forEach(t),Zs=m(r),R=a(r,"DIV",{class:!0});var pe=s(R);w(kr.$$.fragment,pe),jm=m(pe),ds=a(pe,"P",{});var zg=s(ds);Cm=i(zg,`SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden
states) e.g. for ImageNet.`),zg.forEach(t),Pm=m(pe),Mr=a(pe,"P",{});var kn=s(Mr);Dm=i(kn,"This model inherits from "),Wo=a(kn,"A",{href:!0});var qg=s(Wo);Am=i(qg,"TFPreTrainedModel"),qg.forEach(t),zm=i(kn,`. 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.)`),kn.forEach(t),qm=m(pe),Ir=a(pe,"P",{});var Mn=s(Ir);Lm=i(Mn,"This model is also a "),jr=a(Mn,"A",{href:!0,rel:!0});var Lg=s(jr);Om=i(Lg,"tf.keras.Model"),Lg.forEach(t),Nm=i(Mn,` 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.`),Mn.forEach(t),Hm=m(pe),Q=a(pe,"DIV",{class:!0});var Tt=s(Q);w(Cr.$$.fragment,Tt),Rm=m(Tt),ze=a(Tt,"P",{});var aa=s(ze);Wm=i(aa,"The "),Bo=a(aa,"A",{href:!0});var Og=s(Bo);Bm=i(Og,"TFSegformerForImageClassification"),Og.forEach(t),Um=i(aa," forward method, overrides the "),cs=a(aa,"CODE",{});var Ng=s(cs);Vm=i(Ng,"__call__"),Ng.forEach(t),Km=i(aa," special method."),aa.forEach(t),Gm=m(Tt),w(ct.$$.fragment,Tt),Ym=m(Tt),w(mt.$$.fragment,Tt),Tt.forEach(t),pe.forEach(t),Qs=m(r),qe=a(r,"H2",{class:!0});var In=s(qe);ft=a(In,"A",{id:!0,class:!0,href:!0});var Hg=s(ft);ms=a(Hg,"SPAN",{});var Rg=s(ms);w(Pr.$$.fragment,Rg),Rg.forEach(t),Hg.forEach(t),Jm=m(In),fs=a(In,"SPAN",{});var Wg=s(fs);Xm=i(Wg,"TFSegformerForSemanticSegmentation"),Wg.forEach(t),In.forEach(t),en=m(r),K=a(r,"DIV",{class:!0});var Ft=s(K);w(Dr.$$.fragment,Ft),Zm=m(Ft),Ar=a(Ft,"P",{});var jn=s(Ar);Qm=i(jn,`SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.
This model inherits from `),Uo=a(jn,"A",{href:!0});var Bg=s(Uo);ef=i(Bg,"TFPreTrainedModel"),Bg.forEach(t),tf=i(jn,`. 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.)`),jn.forEach(t),rf=m(Ft),zr=a(Ft,"P",{});var Cn=s(zr);of=i(Cn,"This model is also a "),qr=a(Cn,"A",{href:!0,rel:!0});var Ug=s(qr);af=i(Ug,"tf.keras.Model"),Ug.forEach(t),sf=i(Cn,` 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.`),Cn.forEach(t),nf=m(Ft),ee=a(Ft,"DIV",{class:!0});var yt=s(ee);w(Lr.$$.fragment,yt),lf=m(yt),Le=a(yt,"P",{});var sa=s(Le);df=i(sa,"The "),Vo=a(sa,"A",{href:!0});var Vg=s(Vo);cf=i(Vg,"TFSegformerForSemanticSegmentation"),Vg.forEach(t),mf=i(sa," forward method, overrides the "),hs=a(sa,"CODE",{});var Kg=s(hs);ff=i(Kg,"__call__"),Kg.forEach(t),hf=i(sa," special method."),sa.forEach(t),gf=m(yt),w(ht.$$.fragment,yt),pf=m(yt),w(gt.$$.fragment,yt),yt.forEach(t),Ft.forEach(t),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(pp)),l(p,"id","segformer"),l(p,"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"),l(p,"href","#segformer"),l(u,"class","relative group"),l(Oe,"id","overview"),l(Oe,"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"),l(Oe,"href","#overview"),l(ue,"class","relative group"),l(xt,"href","https://arxiv.org/abs/2105.15203"),l(xt,"rel","nofollow"),l(kt,"href","https://arxiv.org/abs/2105.15203"),l(kt,"rel","nofollow"),l(Mt,"width","600"),Zg(Mt.src,uf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/segformer_architecture.png")||l(Mt,"src",uf),l(It,"href","https://huggingface.co/nielsr"),l(It,"rel","nofollow"),l(jt,"href","https://huggingface.co/sayakpaul"),l(jt,"rel","nofollow"),l(Ct,"href","https://github.com/NVlabs/SegFormer"),l(Ct,"rel","nofollow"),l(Jr,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerModel"),l(Xr,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),l(Zr,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForImageClassification"),l(Pt,"href","https://huggingface.co/models?other=segformer"),l(Pt,"rel","nofollow"),l(Dt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/SegFormer"),l(Dt,"rel","nofollow"),l(At,"href","https://huggingface.co/blog/fine-tune-segformer"),l(At,"rel","nofollow"),l(qt,"href","https://github.com/deep-diver/segformer-tf-transformers"),l(qt,"rel","nofollow"),l(Ot,"href","https://huggingface.co/spaces/chansung/segformer-tf-transformers"),l(Ot,"rel","nofollow"),l(Qr,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor"),l(Ht,"href","https://github.com/NVlabs/SegFormer/blob/master/local_configs/_base_/datasets/ade20k_repeat.py"),l(Ht,"rel","nofollow"),l(eo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerFeatureExtractor"),l(to,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),l(Wt,"href","https://arxiv.org/abs/2105.15203"),l(Wt,"rel","nofollow"),l(ro,"align","center"),l(oo,"align","center"),l(ao,"align","center"),l(so,"align","center"),l(no,"align","center"),l(io,"align","center"),l(lo,"align","center"),l(co,"align","center"),l(mo,"align","center"),l(fo,"align","center"),l(ho,"align","center"),l(go,"align","center"),l(po,"align","center"),l(uo,"align","center"),l(_o,"align","center"),l(bo,"align","center"),l(vo,"align","center"),l(So,"align","center"),l(wo,"align","center"),l($o,"align","center"),l(To,"align","center"),l(Fo,"align","center"),l(yo,"align","center"),l(Eo,"align","center"),l(xo,"align","center"),l(ko,"align","center"),l(Mo,"align","center"),l(Io,"align","center"),l(Bt,"href","https://arxiv.org/abs/2105.15203"),l(Bt,"rel","nofollow"),l(Be,"id","transformers.SegformerConfig"),l(Be,"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"),l(Be,"href","#transformers.SegformerConfig"),l(ve,"class","relative group"),l(jo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerModel"),l(Kt,"href","https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512"),l(Kt,"rel","nofollow"),l(Co,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),l(Po,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ve,"id","transformers.SegformerFeatureExtractor"),l(Ve,"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"),l(Ve,"href","#transformers.SegformerFeatureExtractor"),l($e,"class","relative group"),l(Do,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin"),l(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ao,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),l(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ye,"id","transformers.SegformerModel"),l(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"),l(Ye,"href","#transformers.SegformerModel"),l(Te,"class","relative group"),l(or,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(or,"rel","nofollow"),l(zo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerModel"),l(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ze,"id","transformers.SegformerDecodeHead"),l(Ze,"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"),l(Ze,"href","#transformers.SegformerDecodeHead"),l(ye,"class","relative group"),l(qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qe,"id","transformers.SegformerForImageClassification"),l(Qe,"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"),l(Qe,"href","#transformers.SegformerForImageClassification"),l(xe,"class","relative group"),l(mr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(mr,"rel","nofollow"),l(Lo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForImageClassification"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rt,"id","transformers.SegformerForSemanticSegmentation"),l(rt,"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"),l(rt,"href","#transformers.SegformerForSemanticSegmentation"),l(Me,"class","relative group"),l(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ur,"rel","nofollow"),l(Oo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),l(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(st,"id","transformers.TFSegformerDecodeHead"),l(st,"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"),l(st,"href","#transformers.TFSegformerDecodeHead"),l(je,"class","relative group"),l(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(nt,"id","transformers.TFSegformerModel"),l(nt,"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"),l(nt,"href","#transformers.TFSegformerModel"),l(Pe,"class","relative group"),l(Ho,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),l(yr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(yr,"rel","nofollow"),l(Ro,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.TFSegformerModel"),l(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(dt,"id","transformers.TFSegformerForImageClassification"),l(dt,"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"),l(dt,"href","#transformers.TFSegformerForImageClassification"),l(Ae,"class","relative group"),l(Wo,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),l(jr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(jr,"rel","nofollow"),l(Bo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.TFSegformerForImageClassification"),l(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ft,"id","transformers.TFSegformerForSemanticSegmentation"),l(ft,"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"),l(ft,"href","#transformers.TFSegformerForSemanticSegmentation"),l(qe,"class","relative group"),l(Uo,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),l(qr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(qr,"rel","nofollow"),l(Vo,"href","/docs/transformers/pr_19907/en/model_doc/segformer#transformers.TFSegformerForSemanticSegmentation"),l(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(r,h){e(document.head,f),_(r,v,h),_(r,u,h),e(u,p),e(p,b),$(d,b,null),e(u,g),e(u,x),e(x,Pn),_(r,Fs,h),_(r,ue,h),e(ue,Oe),e(Oe,na),$(Et,na,null),e(ue,Dn),e(ue,ia),e(ia,An),_(r,ys,h),_(r,Ne,h),e(Ne,zn),e(Ne,xt),e(xt,qn),e(Ne,Ln),_(r,Es,h),_(r,Kr,h),e(Kr,On),_(r,xs,h),_(r,Gr,h),e(Gr,la),e(la,Nn),_(r,ks,h),_(r,He,h),e(He,Hn),e(He,kt),e(kt,Rn),e(He,Wn),_(r,Ms,h),_(r,Mt,h),_(r,Is,h),_(r,G,h),e(G,Bn),e(G,It),e(It,Un),e(G,Vn),e(G,jt),e(jt,Kn),e(G,Gn),e(G,Ct),e(Ct,Yn),e(G,Jn),_(r,js,h),_(r,Yr,h),e(Yr,Xn),_(r,Cs,h),_(r,M,h),e(M,W),e(W,Zn),e(W,Jr),e(Jr,Qn),e(W,ei),e(W,Xr),e(Xr,ti),e(W,ri),e(W,Zr),e(Zr,oi),e(W,ai),e(W,Pt),e(Pt,si),e(W,ni),e(M,ii),e(M,_e),e(_e,li),e(_e,Dt),e(Dt,di),e(_e,ci),e(_e,At),e(At,mi),e(_e,fi),e(M,hi),e(M,zt),e(zt,gi),e(zt,qt),e(qt,pi),e(zt,ui),e(M,_i),e(M,Lt),e(Lt,bi),e(Lt,Ot),e(Ot,vi),e(Lt,Si),e(M,wi),e(M,Nt),e(Nt,$i),e(Nt,da),e(da,Ti),e(Nt,Fi),e(M,yi),e(M,be),e(be,Ei),e(be,Qr),e(Qr,xi),e(be,ki),e(be,Ht),e(Ht,Mi),e(be,Ii),e(M,ji),e(M,k),e(k,Ci),e(k,eo),e(eo,Pi),e(k,Di),e(k,ca),e(ca,Ai),e(k,zi),e(k,ma),e(ma,qi),e(k,Li),e(k,fa),e(fa,Oi),e(k,Ni),e(k,ha),e(ha,Hi),e(k,Ri),e(k,ga),e(ga,Wi),e(k,Bi),e(k,to),e(to,Ui),e(k,Vi),e(k,pa),e(pa,Ki),e(k,Gi),e(k,ua),e(ua,Yi),e(k,Ji),e(M,Xi),e(M,Rt),e(Rt,Zi),e(Rt,Wt),e(Wt,Qi),e(Rt,el),_(r,Ps,h),_(r,Re,h),e(Re,_a),e(_a,P),e(P,ro),e(ro,ba),e(ba,tl),e(P,rl),e(P,va),e(va,Sa),e(Sa,ol),e(P,al),e(P,wa),e(wa,$a),e($a,sl),e(P,nl),e(P,oo),e(oo,Ta),e(Ta,il),e(P,ll),e(P,ao),e(ao,Fa),e(Fa,dl),e(P,cl),e(P,so),e(so,ya),e(ya,ml),e(Re,fl),e(Re,D),e(D,A),e(A,no),e(no,hl),e(A,gl),e(A,Ea),e(Ea,pl),e(A,ul),e(A,xa),e(xa,_l),e(A,bl),e(A,io),e(io,vl),e(A,Sl),e(A,lo),e(lo,wl),e(A,$l),e(A,co),e(co,Tl),e(D,Fl),e(D,z),e(z,mo),e(mo,yl),e(z,El),e(z,ka),e(ka,xl),e(z,kl),e(z,Ma),e(Ma,Ml),e(z,Il),e(z,fo),e(fo,jl),e(z,Cl),e(z,ho),e(ho,Pl),e(z,Dl),e(z,go),e(go,Al),e(D,zl),e(D,q),e(q,po),e(po,ql),e(q,Ll),e(q,Ia),e(Ia,Ol),e(q,Nl),e(q,ja),e(ja,Hl),e(q,Rl),e(q,uo),e(uo,Wl),e(q,Bl),e(q,_o),e(_o,Ul),e(q,Vl),e(q,bo),e(bo,Kl),e(D,Gl),e(D,L),e(L,vo),e(vo,Yl),e(L,Jl),e(L,Ca),e(Ca,Xl),e(L,Zl),e(L,Pa),e(Pa,Ql),e(L,ed),e(L,So),e(So,td),e(L,rd),e(L,wo),e(wo,od),e(L,ad),e(L,$o),e($o,sd),e(D,nd),e(D,O),e(O,To),e(To,id),e(O,ld),e(O,Da),e(Da,dd),e(O,cd),e(O,Aa),e(Aa,md),e(O,fd),e(O,Fo),e(Fo,hd),e(O,gd),e(O,yo),e(yo,pd),e(O,ud),e(O,Eo),e(Eo,_d),e(D,bd),e(D,N),e(N,xo),e(xo,vd),e(N,Sd),e(N,za),e(za,wd),e(N,$d),e(N,qa),e(qa,Td),e(N,Fd),e(N,ko),e(ko,yd),e(N,Ed),e(N,Mo),e(Mo,xd),e(N,kd),e(N,Io),e(Io,Md),_(r,Ds,h),_(r,We,h),e(We,Id),e(We,Bt),e(Bt,jd),e(We,Cd),_(r,As,h),_(r,ve,h),e(ve,Be),e(Be,La),$(Ut,La,null),e(ve,Pd),e(ve,Oa),e(Oa,Dd),_(r,zs,h),_(r,B,h),$(Vt,B,null),e(B,Ad),e(B,Se),e(Se,zd),e(Se,jo),e(jo,qd),e(Se,Ld),e(Se,Kt),e(Kt,Od),e(Se,Nd),e(B,Hd),e(B,we),e(we,Rd),e(we,Co),e(Co,Wd),e(we,Bd),e(we,Po),e(Po,Ud),e(we,Vd),e(B,Kd),$(Ue,B,null),_(r,qs,h),_(r,$e,h),e($e,Ve),e(Ve,Na),$(Gt,Na,null),e($e,Gd),e($e,Ha),e(Ha,Yd),_(r,Ls,h),_(r,H,h),$(Yt,H,null),e(H,Jd),e(H,Ra),e(Ra,Xd),e(H,Zd),e(H,Jt),e(Jt,Qd),e(Jt,Do),e(Do,ec),e(Jt,tc),e(H,rc),e(H,fe),$(Xt,fe,null),e(fe,oc),e(fe,Wa),e(Wa,ac),e(fe,sc),$(Ke,fe,null),e(H,nc),e(H,Ge),$(Zt,Ge,null),e(Ge,ic),e(Ge,Qt),e(Qt,lc),e(Qt,Ao),e(Ao,dc),e(Qt,cc),_(r,Os,h),_(r,Te,h),e(Te,Ye),e(Ye,Ba),$(er,Ba,null),e(Te,mc),e(Te,Ua),e(Ua,fc),_(r,Ns,h),_(r,ce,h),$(tr,ce,null),e(ce,hc),e(ce,rr),e(rr,gc),e(rr,or),e(or,pc),e(rr,uc),e(ce,_c),e(ce,Y),$(ar,Y,null),e(Y,bc),e(Y,Fe),e(Fe,vc),e(Fe,zo),e(zo,Sc),e(Fe,wc),e(Fe,Va),e(Va,$c),e(Fe,Tc),e(Y,Fc),$(Je,Y,null),e(Y,yc),$(Xe,Y,null),_(r,Hs,h),_(r,ye,h),e(ye,Ze),e(Ze,Ka),$(sr,Ka,null),e(ye,Ec),e(ye,Ga),e(Ga,xc),_(r,Rs,h),_(r,Ee,h),$(nr,Ee,null),e(Ee,kc),e(Ee,qo),$(ir,qo,null),_(r,Ws,h),_(r,xe,h),e(xe,Qe),e(Qe,Ya),$(lr,Ya,null),e(xe,Mc),e(xe,Ja),e(Ja,Ic),_(r,Bs,h),_(r,U,h),$(dr,U,null),e(U,jc),e(U,Xa),e(Xa,Cc),e(U,Pc),e(U,cr),e(cr,Dc),e(cr,mr),e(mr,Ac),e(cr,zc),e(U,qc),e(U,J),$(fr,J,null),e(J,Lc),e(J,ke),e(ke,Oc),e(ke,Lo),e(Lo,Nc),e(ke,Hc),e(ke,Za),e(Za,Rc),e(ke,Wc),e(J,Bc),$(et,J,null),e(J,Uc),$(tt,J,null),_(r,Us,h),_(r,Me,h),e(Me,rt),e(rt,Qa),$(hr,Qa,null),e(Me,Vc),e(Me,es),e(es,Kc),_(r,Vs,h),_(r,me,h),$(gr,me,null),e(me,Gc),e(me,pr),e(pr,Yc),e(pr,ur),e(ur,Jc),e(pr,Xc),e(me,Zc),e(me,X),$(_r,X,null),e(X,Qc),e(X,Ie),e(Ie,em),e(Ie,Oo),e(Oo,tm),e(Ie,rm),e(Ie,ts),e(ts,om),e(Ie,am),e(X,sm),$(ot,X,null),e(X,nm),$(at,X,null),_(r,Ks,h),_(r,je,h),e(je,st),e(st,rs),$(br,rs,null),e(je,im),e(je,os),e(os,lm),_(r,Gs,h),_(r,Ce,h),$(vr,Ce,null),e(Ce,dm),e(Ce,No),$(Sr,No,null),_(r,Ys,h),_(r,Pe,h),e(Pe,nt),e(nt,as),$(wr,as,null),e(Pe,cm),e(Pe,ss),e(ss,mm),_(r,Js,h),_(r,V,h),$($r,V,null),e(V,fm),e(V,Tr),e(Tr,hm),e(Tr,Ho),e(Ho,gm),e(Tr,pm),e(V,um),e(V,Fr),e(Fr,_m),e(Fr,yr),e(yr,bm),e(Fr,vm),e(V,Sm),e(V,Z),$(Er,Z,null),e(Z,wm),e(Z,De),e(De,$m),e(De,Ro),e(Ro,Tm),e(De,Fm),e(De,ns),e(ns,ym),e(De,Em),e(Z,xm),$(it,Z,null),e(Z,km),$(lt,Z,null),_(r,Xs,h),_(r,Ae,h),e(Ae,dt),e(dt,is),$(xr,is,null),e(Ae,Mm),e(Ae,ls),e(ls,Im),_(r,Zs,h),_(r,R,h),$(kr,R,null),e(R,jm),e(R,ds),e(ds,Cm),e(R,Pm),e(R,Mr),e(Mr,Dm),e(Mr,Wo),e(Wo,Am),e(Mr,zm),e(R,qm),e(R,Ir),e(Ir,Lm),e(Ir,jr),e(jr,Om),e(Ir,Nm),e(R,Hm),e(R,Q),$(Cr,Q,null),e(Q,Rm),e(Q,ze),e(ze,Wm),e(ze,Bo),e(Bo,Bm),e(ze,Um),e(ze,cs),e(cs,Vm),e(ze,Km),e(Q,Gm),$(ct,Q,null),e(Q,Ym),$(mt,Q,null),_(r,Qs,h),_(r,qe,h),e(qe,ft),e(ft,ms),$(Pr,ms,null),e(qe,Jm),e(qe,fs),e(fs,Xm),_(r,en,h),_(r,K,h),$(Dr,K,null),e(K,Zm),e(K,Ar),e(Ar,Qm),e(Ar,Uo),e(Uo,ef),e(Ar,tf),e(K,rf),e(K,zr),e(zr,of),e(zr,qr),e(qr,af),e(zr,sf),e(K,nf),e(K,ee),$(Lr,ee,null),e(ee,lf),e(ee,Le),e(Le,df),e(Le,Vo),e(Vo,cf),e(Le,mf),e(Le,hs),e(hs,ff),e(Le,hf),e(ee,gf),$(ht,ee,null),e(ee,pf),$(gt,ee,null),tn=!0},p(r,[h]){const Or={};h&2&&(Or.$$scope={dirty:h,ctx:r}),Ue.$set(Or);const gs={};h&2&&(gs.$$scope={dirty:h,ctx:r}),Ke.$set(gs);const ps={};h&2&&(ps.$$scope={dirty:h,ctx:r}),Je.$set(ps);const us={};h&2&&(us.$$scope={dirty:h,ctx:r}),Xe.$set(us);const Nr={};h&2&&(Nr.$$scope={dirty:h,ctx:r}),et.$set(Nr);const _s={};h&2&&(_s.$$scope={dirty:h,ctx:r}),tt.$set(_s);const bs={};h&2&&(bs.$$scope={dirty:h,ctx:r}),ot.$set(bs);const vs={};h&2&&(vs.$$scope={dirty:h,ctx:r}),at.$set(vs);const Hr={};h&2&&(Hr.$$scope={dirty:h,ctx:r}),it.$set(Hr);const Ss={};h&2&&(Ss.$$scope={dirty:h,ctx:r}),lt.$set(Ss);const ws={};h&2&&(ws.$$scope={dirty:h,ctx:r}),ct.$set(ws);const $s={};h&2&&($s.$$scope={dirty:h,ctx:r}),mt.$set($s);const Ts={};h&2&&(Ts.$$scope={dirty:h,ctx:r}),ht.$set(Ts);const Rr={};h&2&&(Rr.$$scope={dirty:h,ctx:r}),gt.$set(Rr)},i(r){tn||(T(d.$$.fragment,r),T(Et.$$.fragment,r),T(Ut.$$.fragment,r),T(Vt.$$.fragment,r),T(Ue.$$.fragment,r),T(Gt.$$.fragment,r),T(Yt.$$.fragment,r),T(Xt.$$.fragment,r),T(Ke.$$.fragment,r),T(Zt.$$.fragment,r),T(er.$$.fragment,r),T(tr.$$.fragment,r),T(ar.$$.fragment,r),T(Je.$$.fragment,r),T(Xe.$$.fragment,r),T(sr.$$.fragment,r),T(nr.$$.fragment,r),T(ir.$$.fragment,r),T(lr.$$.fragment,r),T(dr.$$.fragment,r),T(fr.$$.fragment,r),T(et.$$.fragment,r),T(tt.$$.fragment,r),T(hr.$$.fragment,r),T(gr.$$.fragment,r),T(_r.$$.fragment,r),T(ot.$$.fragment,r),T(at.$$.fragment,r),T(br.$$.fragment,r),T(vr.$$.fragment,r),T(Sr.$$.fragment,r),T(wr.$$.fragment,r),T($r.$$.fragment,r),T(Er.$$.fragment,r),T(it.$$.fragment,r),T(lt.$$.fragment,r),T(xr.$$.fragment,r),T(kr.$$.fragment,r),T(Cr.$$.fragment,r),T(ct.$$.fragment,r),T(mt.$$.fragment,r),T(Pr.$$.fragment,r),T(Dr.$$.fragment,r),T(Lr.$$.fragment,r),T(ht.$$.fragment,r),T(gt.$$.fragment,r),tn=!0)},o(r){F(d.$$.fragment,r),F(Et.$$.fragment,r),F(Ut.$$.fragment,r),F(Vt.$$.fragment,r),F(Ue.$$.fragment,r),F(Gt.$$.fragment,r),F(Yt.$$.fragment,r),F(Xt.$$.fragment,r),F(Ke.$$.fragment,r),F(Zt.$$.fragment,r),F(er.$$.fragment,r),F(tr.$$.fragment,r),F(ar.$$.fragment,r),F(Je.$$.fragment,r),F(Xe.$$.fragment,r),F(sr.$$.fragment,r),F(nr.$$.fragment,r),F(ir.$$.fragment,r),F(lr.$$.fragment,r),F(dr.$$.fragment,r),F(fr.$$.fragment,r),F(et.$$.fragment,r),F(tt.$$.fragment,r),F(hr.$$.fragment,r),F(gr.$$.fragment,r),F(_r.$$.fragment,r),F(ot.$$.fragment,r),F(at.$$.fragment,r),F(br.$$.fragment,r),F(vr.$$.fragment,r),F(Sr.$$.fragment,r),F(wr.$$.fragment,r),F($r.$$.fragment,r),F(Er.$$.fragment,r),F(it.$$.fragment,r),F(lt.$$.fragment,r),F(xr.$$.fragment,r),F(kr.$$.fragment,r),F(Cr.$$.fragment,r),F(ct.$$.fragment,r),F(mt.$$.fragment,r),F(Pr.$$.fragment,r),F(Dr.$$.fragment,r),F(Lr.$$.fragment,r),F(ht.$$.fragment,r),F(gt.$$.fragment,r),tn=!1},d(r){t(f),r&&t(v),r&&t(u),y(d),r&&t(Fs),r&&t(ue),y(Et),r&&t(ys),r&&t(Ne),r&&t(Es),r&&t(Kr),r&&t(xs),r&&t(Gr),r&&t(ks),r&&t(He),r&&t(Ms),r&&t(Mt),r&&t(Is),r&&t(G),r&&t(js),r&&t(Yr),r&&t(Cs),r&&t(M),r&&t(Ps),r&&t(Re),r&&t(Ds),r&&t(We),r&&t(As),r&&t(ve),y(Ut),r&&t(zs),r&&t(B),y(Vt),y(Ue),r&&t(qs),r&&t($e),y(Gt),r&&t(Ls),r&&t(H),y(Yt),y(Xt),y(Ke),y(Zt),r&&t(Os),r&&t(Te),y(er),r&&t(Ns),r&&t(ce),y(tr),y(ar),y(Je),y(Xe),r&&t(Hs),r&&t(ye),y(sr),r&&t(Rs),r&&t(Ee),y(nr),y(ir),r&&t(Ws),r&&t(xe),y(lr),r&&t(Bs),r&&t(U),y(dr),y(fr),y(et),y(tt),r&&t(Us),r&&t(Me),y(hr),r&&t(Vs),r&&t(me),y(gr),y(_r),y(ot),y(at),r&&t(Ks),r&&t(je),y(br),r&&t(Gs),r&&t(Ce),y(vr),y(Sr),r&&t(Ys),r&&t(Pe),y(wr),r&&t(Js),r&&t(V),y($r),y(Er),y(it),y(lt),r&&t(Xs),r&&t(Ae),y(xr),r&&t(Zs),r&&t(R),y(kr),y(Cr),y(ct),y(mt),r&&t(Qs),r&&t(qe),y(Pr),r&&t(en),r&&t(K),y(Dr),y(Lr),y(ht),y(gt)}}}const pp={local:"segformer",sections:[{local:"overview",title:"Overview"},{local:"transformers.SegformerConfig",title:"SegformerConfig"},{local:"transformers.SegformerFeatureExtractor",title:"SegformerFeatureExtractor"},{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 up(E){return Qg(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tp extends Gg{constructor(f){super();Yg(this,f,up,gp,Jg,{})}}export{Tp as default,pp as metadata};
