import{S as Md,i as Td,s as $d,e as a,k as l,w as k,t as r,M as Ed,c as n,d as o,m,a as i,x as b,h as s,b as d,N as Id,G as e,g as f,y as F,q as v,o as w,B as x,v as Pd,L as ii}from"../../chunks/vendor-hf-doc-builder.js";import{T as Hr}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as di}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as It}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ni}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zd(I){let p,y,u,g,M;return{c(){p=a("p"),y=r(`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),u=a("a"),g=r("Github Issue"),M=r("."),this.h()},l(c){p=n(c,"P",{});var _=i(p);y=s(_,`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),u=n(_,"A",{href:!0,rel:!0});var z=i(u);g=s(z,"Github Issue"),z.forEach(o),M=s(_,"."),_.forEach(o),this.h()},h(){d(u,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),d(u,"rel","nofollow")},m(c,_){f(c,p,_),e(p,y),e(p,u),e(u,g),e(p,M)},d(c){c&&o(p)}}}function Od(I){let p,y,u,g,M;return g=new di({props:{code:`from transformers import MaskFormerConfig, MaskFormerModel

# Initializing a MaskFormer facebook/maskformer-swin-base-ade configuration
configuration = MaskFormerConfig()

# Initializing a model (with random weights) from the facebook/maskformer-swin-base-ade style configuration
model = MaskFormerModel(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> MaskFormerConfig, MaskFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MaskFormer facebook/maskformer-swin-base-ade configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MaskFormerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/maskformer-swin-base-ade style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MaskFormerModel(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(){p=a("p"),y=r("Examples:"),u=l(),k(g.$$.fragment)},l(c){p=n(c,"P",{});var _=i(p);y=s(_,"Examples:"),_.forEach(o),u=m(c),b(g.$$.fragment,c)},m(c,_){f(c,p,_),e(p,y),f(c,u,_),F(g,c,_),M=!0},p:ii,i(c){M||(v(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(p),c&&o(u),x(g,c)}}}function Ld(I){let p,y;return{c(){p=a("p"),y=r(`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`)},l(u){p=n(u,"P",{});var g=i(p);y=s(g,`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`),g.forEach(o)},m(u,g){f(u,p,g),e(p,y)},d(u){u&&o(p)}}}function Cd(I){let p,y,u,g,M;return{c(){p=a("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),g=r("Module"),M=r(`
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(c){p=n(c,"P",{});var _=i(p);y=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(_,"CODE",{});var z=i(u);g=s(z,"Module"),z.forEach(o),M=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(c,_){f(c,p,_),e(p,y),e(p,u),e(u,g),e(p,M)},d(c){c&&o(p)}}}function Ad(I){let p,y,u,g,M;return g=new di({props:{code:`from transformers import MaskFormerFeatureExtractor, MaskFormerModel
import torch
from datasets import load_dataset

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

feature_extractor = MaskFormerFeatureExtractor.from_pretrained("facebook/maskformer-swin-base-ade")
model = MaskFormerModel.from_pretrained("facebook/maskformer-swin-base-ade")

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> MaskFormerFeatureExtractor, MaskFormerModel
<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 = MaskFormerFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-ade&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MaskFormerModel.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-ade&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)
`}}),{c(){p=a("p"),y=r("Example:"),u=l(),k(g.$$.fragment)},l(c){p=n(c,"P",{});var _=i(p);y=s(_,"Example:"),_.forEach(o),u=m(c),b(g.$$.fragment,c)},m(c,_){f(c,p,_),e(p,y),f(c,u,_),F(g,c,_),M=!0},p:ii,i(c){M||(v(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(p),c&&o(u),x(g,c)}}}function Sd(I){let p,y,u,g,M;return{c(){p=a("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),g=r("Module"),M=r(`
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(c){p=n(c,"P",{});var _=i(p);y=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(_,"CODE",{});var z=i(u);g=s(z,"Module"),z.forEach(o),M=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(c,_){f(c,p,_),e(p,y),e(p,u),e(u,g),e(p,M)},d(c){c&&o(p)}}}function Nd(I){let p,y,u,g,M;return g=new di({props:{code:`from transformers import MaskFormerFeatureExtractor, MaskFormerForInstanceSegmentation
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 = MaskFormerFeatureExtractor.from_pretrained("facebook/maskformer-swin-base-ade")
inputs = feature_extractor(images=image, return_tensors="pt")

model = MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-base-ade")
outputs = model(**inputs)
# model predicts class_queries_logits of shape \`(batch_size, num_queries)\`
# and masks_queries_logits of shape \`(batch_size, num_queries, height, width)\`
class_queries_logits = outputs.class_queries_logits
masks_queries_logits = outputs.masks_queries_logits

# you can pass them to feature_extractor for postprocessing
output = feature_extractor.post_process_semantic_segmentation(outputs)
output = feature_extractor.post_process_instance_segmentation(outputs)
output = feature_extractor.post_process_panoptic_segmentation(outputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerFeatureExtractor, MaskFormerForInstanceSegmentation
<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 = MaskFormerFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-ade&quot;</span>)
<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>model = MaskFormerForInstanceSegmentation.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-ade&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts class_queries_logits of shape \`(batch_size, num_queries)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># and masks_queries_logits of shape \`(batch_size, num_queries, height, width)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>class_queries_logits = outputs.class_queries_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>masks_queries_logits = outputs.masks_queries_logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># you can pass them to feature_extractor for postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output = feature_extractor.post_process_semantic_segmentation(outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = feature_extractor.post_process_instance_segmentation(outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = feature_extractor.post_process_panoptic_segmentation(outputs)`}}),{c(){p=a("p"),y=r("Examples:"),u=l(),k(g.$$.fragment)},l(c){p=n(c,"P",{});var _=i(p);y=s(_,"Examples:"),_.forEach(o),u=m(c),b(g.$$.fragment,c)},m(c,_){f(c,p,_),e(p,y),f(c,u,_),F(g,c,_),M=!0},p:ii,i(c){M||(v(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(p),c&&o(u),x(g,c)}}}function Dd(I){let p,y,u,g,M,c,_,z,Br,Wo,de,Go,Y,ce,io,Ne,Ur,co,Vr,Ko,le,Wr,De,Gr,Kr,Qo,Pt,Qr,Xo,zt,lo,Xr,Yo,Ot,Yr,Jo,S,L,Jr,Lt,Zr,es,mo,ts,os,Ct,rs,ss,po,as,ns,is,C,ds,ho,cs,ls,fo,ms,ps,uo,hs,fs,je,us,gs,_s,qe,ks,At,bs,Fs,vs,A,ws,St,xs,ys,Nt,Ms,Ts,Dt,$s,Es,go,Is,Ps,Zo,me,zs,Re,Os,Ls,er,He,ci,tr,W,Cs,Be,As,Ss,Ue,Ns,Ds,or,J,pe,_o,Ve,js,ko,qs,rr,Z,We,Rs,Ge,Hs,jt,Bs,Us,sr,q,Ke,Vs,Qe,Ws,qt,Gs,Ks,Qs,R,Xs,Rt,Ys,Js,Ht,Zs,ea,Bt,ta,oa,ar,ee,he,bo,Xe,ra,Fo,sa,nr,$,Ye,aa,H,na,Ut,ia,da,Je,ca,la,Ze,ma,pa,ha,te,fa,Vt,ua,ga,Wt,_a,ka,ba,et,Fa,Gt,va,wa,xa,fe,ya,ue,tt,Ma,ot,Ta,Kt,$a,Ea,Ia,ge,rt,Pa,st,za,Qt,Oa,La,ir,oe,_e,vo,at,Ca,wo,Aa,dr,T,nt,Sa,xo,Na,Da,it,ja,Xt,qa,Ra,Ha,N,dt,Ba,yo,Ua,Va,B,Wa,Mo,Ga,Ka,To,Qa,Xa,$o,Ya,Ja,Za,ke,en,G,ct,tn,lt,on,Eo,rn,sn,an,U,nn,Io,dn,cn,Po,ln,mn,zo,pn,hn,fn,be,mt,un,pt,gn,Oo,_n,kn,bn,Fe,ht,Fn,ft,vn,Yt,wn,xn,yn,ve,ut,Mn,gt,Tn,Lo,$n,En,In,we,_t,Pn,kt,zn,Co,On,Ln,cr,re,xe,Ao,bt,Cn,So,An,lr,V,Ft,Sn,vt,Nn,wt,Dn,jn,qn,D,xt,Rn,se,Hn,Jt,Bn,Un,No,Vn,Wn,Gn,ye,Kn,Me,mr,ae,Te,Do,yt,Qn,jo,Xn,pr,ne,Mt,Yn,j,Tt,Jn,ie,Zn,Zt,ei,ti,qo,oi,ri,si,$e,ai,Ee,hr;return c=new It({}),de=new Hr({props:{$$slots:{default:[zd]},$$scope:{ctx:I}}}),Ne=new It({}),Ve=new It({}),We=new P({props:{name:"class transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput",anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput",parameters:[{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"pixel_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"transformer_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the encoder model (backbone).`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.pixel_decoder_last_hidden_state",description:`<strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).`,name:"pixel_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.transformer_decoder_last_hidden_state",description:`<strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the transformer decoder model.`,name:"transformer_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 encoder
model at the output of each stage.`,name:"encoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.pixel_decoder_hidden_states",description:`<strong>pixel_decoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 pixel
decoder model at the output of each stage.`,name:"pixel_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.transformer_decoder_hidden_states",description:`<strong>transformer_decoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states (also called feature maps) of the
transformer decoder at the output of each stage.`,name:"transformer_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code>`,name:"hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights from Detr&#x2019;s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/modeling_maskformer.py#L215"}}),Ke=new P({props:{name:"class transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput",anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"class_queries_logits",val:": FloatTensor = None"},{name:"masks_queries_logits",val:": FloatTensor = None"},{name:"auxiliary_logits",val:": FloatTensor = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"pixel_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"transformer_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.loss",description:`<strong>loss</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
The computed loss, returned when labels are present.`,name:"loss"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.class_queries_logits",description:`<strong>class_queries_logits</strong> (<code>torch.FloatTensor</code>) &#x2014;
A tensor of shape <code>(batch_size, num_queries, num_labels + 1)</code> representing the proposed classes for each
query. Note the <code>+ 1</code> is needed because we incorporate the null class.`,name:"class_queries_logits"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.masks_queries_logits",description:`<strong>masks_queries_logits</strong> (<code>torch.FloatTensor</code>) &#x2014;
A tensor of shape <code>(batch_size, num_queries, height, width)</code> representing the proposed masks for each
query.`,name:"masks_queries_logits"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the encoder model (backbone).`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.pixel_decoder_last_hidden_state",description:`<strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).`,name:"pixel_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.transformer_decoder_last_hidden_state",description:`<strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the transformer decoder model.`,name:"transformer_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 encoder
model at the output of each stage.`,name:"encoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.pixel_decoder_hidden_states",description:`<strong>pixel_decoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 pixel
decoder model at the output of each stage.`,name:"pixel_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.transformer_decoder_hidden_states",description:`<strong>transformer_decoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the transformer decoder at the output
of each stage.`,name:"transformer_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code>.`,name:"hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights from Detr&#x2019;s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/modeling_maskformer.py#L258"}}),Xe=new It({}),Ye=new P({props:{name:"class transformers.MaskFormerConfig",anchor:"transformers.MaskFormerConfig",parameters:[{name:"fpn_feature_size",val:": int = 256"},{name:"mask_feature_size",val:": int = 256"},{name:"no_object_weight",val:": float = 0.1"},{name:"use_auxiliary_loss",val:": bool = False"},{name:"backbone_config",val:": typing.Optional[typing.Dict] = None"},{name:"decoder_config",val:": typing.Optional[typing.Dict] = None"},{name:"init_std",val:": float = 0.02"},{name:"init_xavier_std",val:": float = 1.0"},{name:"dice_weight",val:": float = 1.0"},{name:"cross_entropy_weight",val:": float = 1.0"},{name:"mask_weight",val:": float = 20.0"},{name:"output_auxiliary_logits",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerConfig.mask_feature_size",description:`<strong>mask_feature_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The masks&#x2019; features size, this value will also be used to specify the Feature Pyramid Network features&#x2019;
size.`,name:"mask_feature_size"},{anchor:"transformers.MaskFormerConfig.no_object_weight",description:`<strong>no_object_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Weight to apply to the null (no object) class.`,name:"no_object_weight"},{anchor:"transformers.MaskFormerConfig.use_auxiliary_loss(bool,",description:`<strong>use_auxiliary_loss(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code> <code>MaskFormerForInstanceSegmentationOutput</code> will contain the auxiliary losses computed using the
logits from each decoder&#x2019;s stage.`,name:"use_auxiliary_loss(bool,"},{anchor:"transformers.MaskFormerConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
The configuration passed to the backbone, if unset, the configuration corresponding to
<code>swin-base-patch4-window12-384</code> will be used.`,name:"backbone_config"},{anchor:"transformers.MaskFormerConfig.decoder_config",description:`<strong>decoder_config</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
The configuration passed to the transformer decoder model, if unset the base config for <code>detr-resnet-50</code>
will be used.`,name:"decoder_config"},{anchor:"transformers.MaskFormerConfig.init_std",description:`<strong>init_std</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:"init_std"},{anchor:"transformers.MaskFormerConfig.init_xavier_std",description:`<strong>init_xavier_std</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
The scaling factor used for the Xavier initialization gain in the HM Attention map module.`,name:"init_xavier_std"},{anchor:"transformers.MaskFormerConfig.dice_weight",description:`<strong>dice_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The weight for the dice loss.`,name:"dice_weight"},{anchor:"transformers.MaskFormerConfig.cross_entropy_weight",description:`<strong>cross_entropy_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The weight for the cross entropy loss.`,name:"cross_entropy_weight"},{anchor:"transformers.MaskFormerConfig.mask_weight",description:`<strong>mask_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 20.0) &#x2014;
The weight for the mask loss.`,name:"mask_weight"},{anchor:"transformers.MaskFormerConfig.output_auxiliary_logits",description:`<strong>output_auxiliary_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Should the model output its <code>auxiliary_logits</code> or not.`,name:"output_auxiliary_logits"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/configuration_maskformer.py#L36",raiseDescription:`
<ul>
<li><code>ValueError</code> \u2014
Raised if the backbone model type selected is not in <code>["swin"]</code> or the decoder model type selected is not
in <code>["detr"]</code></li>
</ul>
`,raiseType:`
<p><code>ValueError</code></p>
`}}),fe=new ni({props:{anchor:"transformers.MaskFormerConfig.example",$$slots:{default:[Od]},$$scope:{ctx:I}}}),tt=new P({props:{name:"from_backbone_and_decoder_configs",anchor:"transformers.MaskFormerConfig.from_backbone_and_decoder_configs",parameters:[{name:"backbone_config",val:": PretrainedConfig"},{name:"decoder_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerConfig.from_backbone_and_decoder_configs.backbone_config",description:`<strong>backbone_config</strong> (<a href="/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) &#x2014;
The backbone configuration.`,name:"backbone_config"},{anchor:"transformers.MaskFormerConfig.from_backbone_and_decoder_configs.decoder_config",description:`<strong>decoder_config</strong> (<a href="/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) &#x2014;
The transformer decoder configuration to use.`,name:"decoder_config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/configuration_maskformer.py#L172",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a></p>
`}}),rt=new P({props:{name:"to_dict",anchor:"transformers.MaskFormerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/configuration_maskformer.py#L194",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),at=new It({}),nt=new P({props:{name:"class transformers.MaskFormerFeatureExtractor",anchor:"transformers.MaskFormerFeatureExtractor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = 800"},{name:"max_size",val:" = 1333"},{name:"resample",val:" = <Resampling.BILINEAR: 2>"},{name:"size_divisibility",val:" = 32"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"ignore_index",val:" = None"},{name:"reduce_labels",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.MaskFormerFeatureExtractor.size",description:`<strong>size</strong> (<code>int</code>, <em>optional</em>, defaults to 800) &#x2014;
Resize the input to the given size. Only has an effect if <code>do_resize</code> is set to <code>True</code>. If size is a
sequence like <code>(width, height)</code>, output size will be matched to this. If size is an int, smaller edge of
the image will be matched to this number. i.e, if <code>height &gt; width</code>, then image will be rescaled to <code>(size * height / width, size)</code>.`,name:"size"},{anchor:"transformers.MaskFormerFeatureExtractor.max_size",description:`<strong>max_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1333) &#x2014;
The largest size an image dimension can have (otherwise it&#x2019;s capped). Only has an effect if <code>do_resize</code> is
set to <code>True</code>.`,name:"max_size"},{anchor:"transformers.MaskFormerFeatureExtractor.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.MaskFormerFeatureExtractor.size_divisibility",description:`<strong>size_divisibility</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Some backbones need images divisible by a certain number. If not passed, it defaults to the value used in
Swin Transformer.`,name:"size_divisibility"},{anchor:"transformers.MaskFormerFeatureExtractor.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.MaskFormerFeatureExtractor.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.MaskFormerFeatureExtractor.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.MaskFormerFeatureExtractor.ignore_index",description:`<strong>ignore_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels
denoted with 0 (background) will be replaced with <code>ignore_index</code>.`,name:"ignore_index"},{anchor:"transformers.MaskFormerFeatureExtractor.reduce_labels",description:`<strong>reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decrement 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 <code>ignore_index</code>.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L193"}}),dt=new P({props:{name:"__call__",anchor:"transformers.MaskFormerFeatureExtractor.__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:"pad_and_return_pixel_mask",val:": typing.Optional[bool] = True"},{name:"instance_id_to_semantic_id",val:": typing.Union[typing.List[typing.Dict[int, int]], typing.Dict[int, int], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.__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 a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.MaskFormerFeatureExtractor.__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;
The corresponding semantic segmentation maps with the pixel-wise class id annotations or instance
segmentation maps with pixel-wise instance id annotations. Assumed to be semantic segmentation maps if
no <code>instance_id_to_semantic_id map</code> is provided.`,name:"segmentation_maps"},{anchor:"transformers.MaskFormerFeatureExtractor.__call__.pad_and_return_pixel_mask",description:`<strong>pad_and_return_pixel_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to pad images up to the largest image in a batch and create a pixel mask.</p>
<p>If left to the default, will return a pixel mask that is:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>`,name:"pad_and_return_pixel_mask"},{anchor:"transformers.MaskFormerFeatureExtractor.__call__.instance_id_to_semantic_id",description:`<strong>instance_id_to_semantic_id</strong> (<code>List[Dict[int, int]]</code> or <code>Dict[int, int]</code>, <em>optional</em>) &#x2014;
A mapping between object instance ids and class ids. If passed, <code>segmentation_maps</code> is treated as an
instance segmentation map where each pixel represents an instance id. Can be provided as a single
dictionary with a global / dataset-level mapping or as a list of dictionaries (one per image), to map
instance ids in each image separately.`,name:"instance_id_to_semantic_id"},{anchor:"transformers.MaskFormerFeatureExtractor.__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>) &#x2014;
If set, will return tensors instead of NumPy arrays. If set to <code>&apos;pt&apos;</code>, return PyTorch <code>torch.Tensor</code>
objects.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L317",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.</li>
<li><strong>pixel_mask</strong> \u2014 Pixel mask to be fed to a model (when <code>pad_and_return_pixel_mask=True</code> or if
<code>pixel_mask</code> is in <code>self.model_input_names</code>).</li>
<li><strong>mask_labels</strong> \u2014 Optional list of mask labels of shape <code>(num_class_labels, height, width)</code> to be fed to
a model (when <code>annotations</code> are provided).</li>
<li><strong>class_labels</strong> \u2014 Optional list of class labels of shape <code>(num_class_labels)</code> to be fed to a model
(when <code>annotations</code> are provided). They identify the labels of <code>mask_labels</code>, e.g. the label of
<code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),ke=new Hr({props:{warning:!0,$$slots:{default:[Ld]},$$scope:{ctx:I}}}),ct=new P({props:{name:"encode_inputs",anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs",parameters:[{name:"pixel_values_list",val:": typing.List[ForwardRef('np.ndarray')]"},{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:"pad_and_return_pixel_mask",val:": bool = True"},{name:"instance_id_to_semantic_id",val:": typing.Union[typing.List[typing.Dict[int, int]], typing.Dict[int, int], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.pixel_values_list",description:`<strong>pixel_values_list</strong> (<code>List[torch.Tensor]</code>) &#x2014;
List of images (pixel values) to be padded. Each image should be a tensor of shape <code>(channels, height, width)</code>.`,name:"pixel_values_list"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.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;
The corresponding semantic segmentation maps with the pixel-wise annotations.`,name:"segmentation_maps"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.pad_and_return_pixel_mask",description:`<strong>pad_and_return_pixel_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to pad images up to the largest image in a batch and create a pixel mask.</p>
<p>If left to the default, will return a pixel mask that is:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>`,name:"pad_and_return_pixel_mask"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.instance_id_to_semantic_id",description:`<strong>instance_id_to_semantic_id</strong> (<code>List[Dict[int, int]]</code> or <code>Dict[int, int]</code>, <em>optional</em>) &#x2014;
A mapping between object instance ids and class ids. If passed, <code>segmentation_maps</code> is treated as an
instance segmentation map where each pixel represents an instance id. Can be provided as a single
dictionary with a global/dataset-level mapping or as a list of dictionaries (one per image), to map
instance ids in each image separately.`,name:"instance_id_to_semantic_id"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.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>) &#x2014;
If set, will return tensors instead of NumPy arrays. If set to <code>&apos;pt&apos;</code>, return PyTorch <code>torch.Tensor</code>
objects.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L509",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.</li>
<li><strong>pixel_mask</strong> \u2014 Pixel mask to be fed to a model (when <code>pad_and_return_pixel_mask=True</code> or if
<code>pixel_mask</code> is in <code>self.model_input_names</code>).</li>
<li><strong>mask_labels</strong> \u2014 Optional list of mask labels of shape <code>(labels, height, width)</code> to be fed to a model
(when <code>annotations</code> are provided).</li>
<li><strong>class_labels</strong> \u2014 Optional list of class labels of shape <code>(labels)</code> to be fed to a model (when
<code>annotations</code> are provided). They identify the labels of <code>mask_labels</code>, e.g. the label of
<code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),mt=new P({props:{name:"post_process_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_segmentation",parameters:[{name:"outputs",val:": MaskFormerForInstanceSegmentationOutput"},{name:"target_size",val:": typing.Tuple[int, int] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_segmentation.target_size",description:`<strong>target_size</strong> (<code>Tuple[int, int]</code>, <em>optional</em>) &#x2014;
If set, the <code>masks_queries_logits</code> will be resized to <code>target_size</code>.`,name:"target_size"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L629",returnDescription:`
<p>A tensor of shape (<code>batch_size, num_class_labels, height, width</code>).</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),ht=new P({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds 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/maskformer/feature_extraction_maskformer.py#L677",returnDescription:`
<p>A list 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><code>List[torch.Tensor]</code></p>
`}}),ut=new P({props:{name:"post_process_instance_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE)
format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L727",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to
<code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 An integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),_t=new P({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = None"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.label_ids_to_fuse",description:`<strong>label_ids_to_fuse</strong> (<code>Set[int]</code>, <em>optional</em>) &#x2014;
The labels in this state will have all their instances be fused together. For instance we could say
there can only be one sky in an image, but several persons, so the label ID for sky would be in that
set, but not the one for person.`,name:"label_ids_to_fuse"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction in batch. If left to None, predictions will not be
resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/feature_extraction_maskformer.py#L810",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code>, set
to <code>None</code> if no mask if found above <code>threshold</code>. If <code>target_sizes</code> is specified, segmentation is resized
to the corresponding <code>target_sizes</code> entry.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 an integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>was_fused</strong> \u2014 a boolean, <code>True</code> if <code>label_id</code> was in <code>label_ids_to_fuse</code>, <code>False</code> otherwise.
Multiple instances of the same class / label were fused and assigned a single <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),bt=new It({}),Ft=new P({props:{name:"class transformers.MaskFormerModel",anchor:"transformers.MaskFormerModel",parameters:[{name:"config",val:": MaskFormerConfig"}],parametersDescription:[{anchor:"transformers.MaskFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerConfig">MaskFormerConfig</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/maskformer/modeling_maskformer.py#L2348"}}),xt=new P({props:{name:"forward",anchor:"transformers.MaskFormerModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"pixel_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerModel.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. 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.MaskFormerModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.MaskFormerModel.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.MaskFormerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of Detr&#x2019;s decoder attention layers.`,name:"output_attentions"},{anchor:"transformers.MaskFormerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~MaskFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/modeling_maskformer.py#L2358",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput</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/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a>) and inputs.</p>
<ul>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the encoder model (backbone).</li>
<li><strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).</li>
<li><strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Last hidden states (final feature map) of the last stage of the transformer decoder model.</li>
<li><strong>encoder_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 + 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 encoder
model at the output of each stage.</li>
<li><strong>pixel_decoder_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 + 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 pixel
decoder model at the output of each stage.</li>
<li><strong>transformer_decoder_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 + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states (also called feature maps) of the
transformer decoder at the output of each stage.</li>
<li><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> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code></li>
<li><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>. Attentions weights from Detr\u2019s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new Hr({props:{$$slots:{default:[Cd]},$$scope:{ctx:I}}}),Me=new ni({props:{anchor:"transformers.MaskFormerModel.forward.example",$$slots:{default:[Ad]},$$scope:{ctx:I}}}),yt=new It({}),Mt=new P({props:{name:"class transformers.MaskFormerForInstanceSegmentation",anchor:"transformers.MaskFormerForInstanceSegmentation",parameters:[{name:"config",val:": MaskFormerConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/modeling_maskformer.py#L2428"}}),Tt=new P({props:{name:"forward",anchor:"transformers.MaskFormerForInstanceSegmentation.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"mask_labels",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"class_labels",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"pixel_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_auxiliary_logits",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerForInstanceSegmentation.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. 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.MaskFormerForInstanceSegmentation.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.MaskFormerForInstanceSegmentation.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.MaskFormerForInstanceSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of Detr&#x2019;s decoder attention layers.`,name:"output_attentions"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~MaskFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.mask_labels",description:`<strong>mask_labels</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
List of mask labels of shape <code>(num_labels, height, width)</code> to be fed to a model`,name:"mask_labels"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.class_labels",description:`<strong>class_labels</strong> (<code>List[torch.LongTensor]</code>, <em>optional</em>) &#x2014;
list of target class labels of shape <code>(num_labels, height, width)</code> to be fed to a model. They identify the
labels of <code>mask_labels</code>, e.g. the label of <code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.`,name:"class_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/maskformer/modeling_maskformer.py#L2509",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput</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/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.Tensor</code>, <em>optional</em>) \u2014 The computed loss, returned when labels are present.</li>
<li><strong>class_queries_logits</strong> (<code>torch.FloatTensor</code>) \u2014 A tensor of shape <code>(batch_size, num_queries, num_labels + 1)</code> representing the proposed classes for each
query. Note the <code>+ 1</code> is needed because we incorporate the null class.</li>
<li><strong>masks_queries_logits</strong> (<code>torch.FloatTensor</code>) \u2014 A tensor of shape <code>(batch_size, num_queries, height, width)</code> representing the proposed masks for each
query.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the encoder model (backbone).</li>
<li><strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).</li>
<li><strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Last hidden states (final feature map) of the last stage of the transformer decoder model.</li>
<li><strong>encoder_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 + 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 encoder
model at the output of each stage.</li>
<li><strong>pixel_decoder_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 + 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 pixel
decoder model at the output of each stage.</li>
<li><strong>transformer_decoder_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 + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the transformer decoder at the output
of each stage.</li>
<li><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> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code>.</li>
<li><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>. Attentions weights from Detr\u2019s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Hr({props:{$$slots:{default:[Sd]},$$scope:{ctx:I}}}),Ee=new ni({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example",$$slots:{default:[Nd]},$$scope:{ctx:I}}}),{c(){p=a("meta"),y=l(),u=a("h1"),g=a("a"),M=a("span"),k(c.$$.fragment),_=l(),z=a("span"),Br=r("MaskFormer"),Wo=l(),k(de.$$.fragment),Go=l(),Y=a("h2"),ce=a("a"),io=a("span"),k(Ne.$$.fragment),Ur=l(),co=a("span"),Vr=r("Overview"),Ko=l(),le=a("p"),Wr=r("The MaskFormer model was proposed in "),De=a("a"),Gr=r("Per-Pixel Classification is Not All You Need for Semantic Segmentation"),Kr=r(" by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),Qo=l(),Pt=a("p"),Qr=r("The abstract from the paper is the following:"),Xo=l(),zt=a("p"),lo=a("em"),Xr=r("Modern approaches typically formulate semantic segmentation as a per-pixel classification task, while instance-level segmentation is handled with an alternative mask classification. Our key insight: mask classification is sufficiently general to solve both semantic- and instance-level segmentation tasks in a unified manner using the exact same model, loss, and training procedure. Following this observation, we propose MaskFormer, a simple mask classification model which predicts a set of binary masks, each associated with a single global class label prediction. Overall, the proposed mask classification-based method simplifies the landscape of effective approaches to semantic and panoptic segmentation tasks and shows excellent empirical results. In particular, we observe that MaskFormer outperforms per-pixel classification baselines when the number of classes is large. Our mask classification-based method outperforms both current state-of-the-art semantic (55.6 mIoU on ADE20K) and panoptic segmentation (52.7 PQ on COCO) models."),Yo=l(),Ot=a("p"),Yr=r("Tips:"),Jo=l(),S=a("ul"),L=a("li"),Jr=r("MaskFormer\u2019s Transformer decoder is identical to the decoder of "),Lt=a("a"),Zr=r("DETR"),es=r(". During training, the authors of DETR did find it helpful to use auxiliary losses in the decoder, especially to help the model output the correct number of objects of each class. If you set the parameter "),mo=a("code"),ts=r("use_auxilary_loss"),os=r(" of "),Ct=a("a"),rs=r("MaskFormerConfig"),ss=r(" to "),po=a("code"),as=r("True"),ns=r(", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),is=l(),C=a("li"),ds=r(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),ho=a("code"),cs=r("get_num_masks"),ls=r(" function inside in the "),fo=a("code"),ms=r("MaskFormerLoss"),ps=r(" class of "),uo=a("code"),hs=r("modeling_maskformer.py"),fs=r(`. When training on multiple nodes, this should be
set to the average number of target masks across all nodes, as can be seen in the original implementation `),je=a("a"),us=r("here"),gs=r("."),_s=l(),qe=a("li"),ks=r("One can use "),At=a("a"),bs=r("MaskFormerFeatureExtractor"),Fs=r(" to prepare images for the model and optional targets for the model."),vs=l(),A=a("li"),ws=r("To get the final segmentation, depending on the task, you can call "),St=a("a"),xs=r("post_process_semantic_segmentation()"),ys=r(" or "),Nt=a("a"),Ms=r("post_process_panoptic_segmentation()"),Ts=r(". Both tasks can be solved using "),Dt=a("a"),$s=r("MaskFormerForInstanceSegmentation"),Es=r(" output, panoptic segmentation accepts an optional "),go=a("code"),Is=r("label_ids_to_fuse"),Ps=r(" argument to fuse instances of the target object/s (e.g. sky) together."),Zo=l(),me=a("p"),zs=r("The figure below illustrates the architecture of MaskFormer. Taken from the "),Re=a("a"),Os=r("original paper"),Ls=r("."),er=l(),He=a("img"),tr=l(),W=a("p"),Cs=r("This model was contributed by "),Be=a("a"),As=r("francesco"),Ss=r(". The original code can be found "),Ue=a("a"),Ns=r("here"),Ds=r("."),or=l(),J=a("h2"),pe=a("a"),_o=a("span"),k(Ve.$$.fragment),js=l(),ko=a("span"),qs=r("MaskFormer specific outputs"),rr=l(),Z=a("div"),k(We.$$.fragment),Rs=l(),Ge=a("p"),Hs=r("Class for outputs of "),jt=a("a"),Bs=r("MaskFormerModel"),Us=r(". This class returns all the needed hidden states to compute the logits."),sr=l(),q=a("div"),k(Ke.$$.fragment),Vs=l(),Qe=a("p"),Ws=r("Class for outputs of "),qt=a("a"),Gs=r("MaskFormerForInstanceSegmentation"),Ks=r("."),Qs=l(),R=a("p"),Xs=r("This output can be directly passed to "),Rt=a("a"),Ys=r("post_process_semantic_segmentation()"),Js=r(` or or
`),Ht=a("a"),Zs=r("post_process_instance_segmentation()"),ea=r(` or
`),Bt=a("a"),ta=r("post_process_panoptic_segmentation()"),oa=r(" depending on the task. Please, see\n[`~MaskFormerFeatureExtractor] for details regarding usage."),ar=l(),ee=a("h2"),he=a("a"),bo=a("span"),k(Xe.$$.fragment),ra=l(),Fo=a("span"),sa=r("MaskFormerConfig"),nr=l(),$=a("div"),k(Ye.$$.fragment),aa=l(),H=a("p"),na=r("This is the configuration class to store the configuration of a "),Ut=a("a"),ia=r("MaskFormerModel"),da=r(`. It is used to instantiate a
MaskFormer 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 MaskFormer
`),Je=a("a"),ca=r("facebook/maskformer-swin-base-ade"),la=r(` architecture trained
on `),Ze=a("a"),ma=r("ADE20k-150"),pa=r("."),ha=l(),te=a("p"),fa=r("Configuration objects inherit from "),Vt=a("a"),ua=r("PretrainedConfig"),ga=r(` and can be used to control the model outputs. Read the
documentation from `),Wt=a("a"),_a=r("PretrainedConfig"),ka=r(" for more information."),ba=l(),et=a("p"),Fa=r("Currently, MaskFormer only supports the "),Gt=a("a"),va=r("Swin Transformer"),wa=r(" as backbone."),xa=l(),k(fe.$$.fragment),ya=l(),ue=a("div"),k(tt.$$.fragment),Ma=l(),ot=a("p"),Ta=r("Instantiate a "),Kt=a("a"),$a=r("MaskFormerConfig"),Ea=r(` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),Ia=l(),ge=a("div"),k(rt.$$.fragment),Pa=l(),st=a("p"),za=r("Serializes this instance to a Python dictionary. Override the default "),Qt=a("a"),Oa=r("to_dict()"),La=r("."),ir=l(),oe=a("h2"),_e=a("a"),vo=a("span"),k(at.$$.fragment),Ca=l(),wo=a("span"),Aa=r("MaskFormerFeatureExtractor"),dr=l(),T=a("div"),k(nt.$$.fragment),Sa=l(),xo=a("p"),Na=r(`Constructs a MaskFormer feature extractor. The feature extractor can be used to prepare image(s) and optional
targets for the model.`),Da=l(),it=a("p"),ja=r("This feature extractor inherits from "),Xt=a("a"),qa=r("FeatureExtractionMixin"),Ra=r(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Ha=l(),N=a("div"),k(dt.$$.fragment),Ba=l(),yo=a("p"),Ua=r(`Main method to prepare for the model one or several image(s) and optional annotations. Images are by default
padded up to the largest image in a batch, and a pixel mask is created that indicates which pixels are
real/which are padding.`),Va=l(),B=a("p"),Wa=r(`MaskFormer addresses semantic segmentation with a mask classification paradigm, thus input segmentation maps
will be converted to lists of binary masks and their respective labels. Let\u2019s see an example, assuming
`),Mo=a("code"),Ga=r("segmentation_maps = [[2,6,7,9]]"),Ka=r(", the output will contain "),To=a("code"),Qa=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Xa=r(" (four binary masks) and "),$o=a("code"),Ya=r("class_labels = [2,6,7,9]"),Ja=r(`, the labels for
each mask.`),Za=l(),k(ke.$$.fragment),en=l(),G=a("div"),k(ct.$$.fragment),tn=l(),lt=a("p"),on=r("Pad images up to the largest image in a batch and create a corresponding "),Eo=a("code"),rn=r("pixel_mask"),sn=r("."),an=l(),U=a("p"),nn=r(`MaskFormer addresses semantic segmentation with a mask classification paradigm, thus input segmentation maps
will be converted to lists of binary masks and their respective labels. Let\u2019s see an example, assuming
`),Io=a("code"),dn=r("segmentation_maps = [[2,6,7,9]]"),cn=r(", the output will contain "),Po=a("code"),ln=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),mn=r(" (four binary masks) and "),zo=a("code"),pn=r("class_labels = [2,6,7,9]"),hn=r(`, the labels for
each mask.`),fn=l(),be=a("div"),k(mt.$$.fragment),un=l(),pt=a("p"),gn=r("Converts the output of "),Oo=a("code"),_n=r("MaskFormerForInstanceSegmentationOutput"),kn=r(` into image segmentation predictions. Only
supports PyTorch.`),bn=l(),Fe=a("div"),k(ht.$$.fragment),Fn=l(),ft=a("p"),vn=r("Converts the output of "),Yt=a("a"),wn=r("MaskFormerForInstanceSegmentation"),xn=r(` into semantic segmentation maps. Only supports
PyTorch.`),yn=l(),ve=a("div"),k(ut.$$.fragment),Mn=l(),gt=a("p"),Tn=r("Converts the output of "),Lo=a("code"),$n=r("MaskFormerForInstanceSegmentationOutput"),En=r(` into instance segmentation predictions. Only
supports PyTorch.`),In=l(),we=a("div"),k(_t.$$.fragment),Pn=l(),kt=a("p"),zn=r("Converts the output of "),Co=a("code"),On=r("MaskFormerForInstanceSegmentationOutput"),Ln=r(` into image panoptic segmentation
predictions. Only supports PyTorch.`),cr=l(),re=a("h2"),xe=a("a"),Ao=a("span"),k(bt.$$.fragment),Cn=l(),So=a("span"),An=r("MaskFormerModel"),lr=l(),V=a("div"),k(Ft.$$.fragment),Sn=l(),vt=a("p"),Nn=r(`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),wt=a("a"),Dn=r("torch.nn.Module"),jn=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qn=l(),D=a("div"),k(xt.$$.fragment),Rn=l(),se=a("p"),Hn=r("The "),Jt=a("a"),Bn=r("MaskFormerModel"),Un=r(" forward method, overrides the "),No=a("code"),Vn=r("__call__"),Wn=r(" special method."),Gn=l(),k(ye.$$.fragment),Kn=l(),k(Me.$$.fragment),mr=l(),ae=a("h2"),Te=a("a"),Do=a("span"),k(yt.$$.fragment),Qn=l(),jo=a("span"),Xn=r("MaskFormerForInstanceSegmentation"),pr=l(),ne=a("div"),k(Mt.$$.fragment),Yn=l(),j=a("div"),k(Tt.$$.fragment),Jn=l(),ie=a("p"),Zn=r("The "),Zt=a("a"),ei=r("MaskFormerForInstanceSegmentation"),ti=r(" forward method, overrides the "),qo=a("code"),oi=r("__call__"),ri=r(" special method."),si=l(),k($e.$$.fragment),ai=l(),k(Ee.$$.fragment),this.h()},l(t){const h=Ed('[data-svelte="svelte-1phssyn"]',document.head);p=n(h,"META",{name:!0,content:!0}),h.forEach(o),y=m(t),u=n(t,"H1",{class:!0});var $t=i(u);g=n($t,"A",{id:!0,class:!0,href:!0});var Ro=i(g);M=n(Ro,"SPAN",{});var Ho=i(M);b(c.$$.fragment,Ho),Ho.forEach(o),Ro.forEach(o),_=m($t),z=n($t,"SPAN",{});var Bo=i(z);Br=s(Bo,"MaskFormer"),Bo.forEach(o),$t.forEach(o),Wo=m(t),b(de.$$.fragment,t),Go=m(t),Y=n(t,"H2",{class:!0});var Et=i(Y);ce=n(Et,"A",{id:!0,class:!0,href:!0});var Uo=i(ce);io=n(Uo,"SPAN",{});var Vo=i(io);b(Ne.$$.fragment,Vo),Vo.forEach(o),Uo.forEach(o),Ur=m(Et),co=n(Et,"SPAN",{});var li=i(co);Vr=s(li,"Overview"),li.forEach(o),Et.forEach(o),Ko=m(t),le=n(t,"P",{});var fr=i(le);Wr=s(fr,"The MaskFormer model was proposed in "),De=n(fr,"A",{href:!0,rel:!0});var mi=i(De);Gr=s(mi,"Per-Pixel Classification is Not All You Need for Semantic Segmentation"),mi.forEach(o),Kr=s(fr," by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),fr.forEach(o),Qo=m(t),Pt=n(t,"P",{});var pi=i(Pt);Qr=s(pi,"The abstract from the paper is the following:"),pi.forEach(o),Xo=m(t),zt=n(t,"P",{});var hi=i(zt);lo=n(hi,"EM",{});var fi=i(lo);Xr=s(fi,"Modern approaches typically formulate semantic segmentation as a per-pixel classification task, while instance-level segmentation is handled with an alternative mask classification. Our key insight: mask classification is sufficiently general to solve both semantic- and instance-level segmentation tasks in a unified manner using the exact same model, loss, and training procedure. Following this observation, we propose MaskFormer, a simple mask classification model which predicts a set of binary masks, each associated with a single global class label prediction. Overall, the proposed mask classification-based method simplifies the landscape of effective approaches to semantic and panoptic segmentation tasks and shows excellent empirical results. In particular, we observe that MaskFormer outperforms per-pixel classification baselines when the number of classes is large. Our mask classification-based method outperforms both current state-of-the-art semantic (55.6 mIoU on ADE20K) and panoptic segmentation (52.7 PQ on COCO) models."),fi.forEach(o),hi.forEach(o),Yo=m(t),Ot=n(t,"P",{});var ui=i(Ot);Yr=s(ui,"Tips:"),ui.forEach(o),Jo=m(t),S=n(t,"UL",{});var Ie=i(S);L=n(Ie,"LI",{});var K=i(L);Jr=s(K,"MaskFormer\u2019s Transformer decoder is identical to the decoder of "),Lt=n(K,"A",{href:!0});var gi=i(Lt);Zr=s(gi,"DETR"),gi.forEach(o),es=s(K,". During training, the authors of DETR did find it helpful to use auxiliary losses in the decoder, especially to help the model output the correct number of objects of each class. If you set the parameter "),mo=n(K,"CODE",{});var _i=i(mo);ts=s(_i,"use_auxilary_loss"),_i.forEach(o),os=s(K," of "),Ct=n(K,"A",{href:!0});var ki=i(Ct);rs=s(ki,"MaskFormerConfig"),ki.forEach(o),ss=s(K," to "),po=n(K,"CODE",{});var bi=i(po);as=s(bi,"True"),bi.forEach(o),ns=s(K,", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),K.forEach(o),is=m(Ie),C=n(Ie,"LI",{});var Q=i(C);ds=s(Q,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),ho=n(Q,"CODE",{});var Fi=i(ho);cs=s(Fi,"get_num_masks"),Fi.forEach(o),ls=s(Q," function inside in the "),fo=n(Q,"CODE",{});var vi=i(fo);ms=s(vi,"MaskFormerLoss"),vi.forEach(o),ps=s(Q," class of "),uo=n(Q,"CODE",{});var wi=i(uo);hs=s(wi,"modeling_maskformer.py"),wi.forEach(o),fs=s(Q,`. When training on multiple nodes, this should be
set to the average number of target masks across all nodes, as can be seen in the original implementation `),je=n(Q,"A",{href:!0,rel:!0});var xi=i(je);us=s(xi,"here"),xi.forEach(o),gs=s(Q,"."),Q.forEach(o),_s=m(Ie),qe=n(Ie,"LI",{});var ur=i(qe);ks=s(ur,"One can use "),At=n(ur,"A",{href:!0});var yi=i(At);bs=s(yi,"MaskFormerFeatureExtractor"),yi.forEach(o),Fs=s(ur," to prepare images for the model and optional targets for the model."),ur.forEach(o),vs=m(Ie),A=n(Ie,"LI",{});var X=i(A);ws=s(X,"To get the final segmentation, depending on the task, you can call "),St=n(X,"A",{href:!0});var Mi=i(St);xs=s(Mi,"post_process_semantic_segmentation()"),Mi.forEach(o),ys=s(X," or "),Nt=n(X,"A",{href:!0});var Ti=i(Nt);Ms=s(Ti,"post_process_panoptic_segmentation()"),Ti.forEach(o),Ts=s(X,". Both tasks can be solved using "),Dt=n(X,"A",{href:!0});var $i=i(Dt);$s=s($i,"MaskFormerForInstanceSegmentation"),$i.forEach(o),Es=s(X," output, panoptic segmentation accepts an optional "),go=n(X,"CODE",{});var Ei=i(go);Is=s(Ei,"label_ids_to_fuse"),Ei.forEach(o),Ps=s(X," argument to fuse instances of the target object/s (e.g. sky) together."),X.forEach(o),Ie.forEach(o),Zo=m(t),me=n(t,"P",{});var gr=i(me);zs=s(gr,"The figure below illustrates the architecture of MaskFormer. Taken from the "),Re=n(gr,"A",{href:!0,rel:!0});var Ii=i(Re);Os=s(Ii,"original paper"),Ii.forEach(o),Ls=s(gr,"."),gr.forEach(o),er=m(t),He=n(t,"IMG",{width:!0,src:!0}),tr=m(t),W=n(t,"P",{});var eo=i(W);Cs=s(eo,"This model was contributed by "),Be=n(eo,"A",{href:!0,rel:!0});var Pi=i(Be);As=s(Pi,"francesco"),Pi.forEach(o),Ss=s(eo,". The original code can be found "),Ue=n(eo,"A",{href:!0,rel:!0});var zi=i(Ue);Ns=s(zi,"here"),zi.forEach(o),Ds=s(eo,"."),eo.forEach(o),or=m(t),J=n(t,"H2",{class:!0});var _r=i(J);pe=n(_r,"A",{id:!0,class:!0,href:!0});var Oi=i(pe);_o=n(Oi,"SPAN",{});var Li=i(_o);b(Ve.$$.fragment,Li),Li.forEach(o),Oi.forEach(o),js=m(_r),ko=n(_r,"SPAN",{});var Ci=i(ko);qs=s(Ci,"MaskFormer specific outputs"),Ci.forEach(o),_r.forEach(o),rr=m(t),Z=n(t,"DIV",{class:!0});var kr=i(Z);b(We.$$.fragment,kr),Rs=m(kr),Ge=n(kr,"P",{});var br=i(Ge);Hs=s(br,"Class for outputs of "),jt=n(br,"A",{href:!0});var Ai=i(jt);Bs=s(Ai,"MaskFormerModel"),Ai.forEach(o),Us=s(br,". This class returns all the needed hidden states to compute the logits."),br.forEach(o),kr.forEach(o),sr=m(t),q=n(t,"DIV",{class:!0});var to=i(q);b(Ke.$$.fragment,to),Vs=m(to),Qe=n(to,"P",{});var Fr=i(Qe);Ws=s(Fr,"Class for outputs of "),qt=n(Fr,"A",{href:!0});var Si=i(qt);Gs=s(Si,"MaskFormerForInstanceSegmentation"),Si.forEach(o),Ks=s(Fr,"."),Fr.forEach(o),Qs=m(to),R=n(to,"P",{});var Pe=i(R);Xs=s(Pe,"This output can be directly passed to "),Rt=n(Pe,"A",{href:!0});var Ni=i(Rt);Ys=s(Ni,"post_process_semantic_segmentation()"),Ni.forEach(o),Js=s(Pe,` or or
`),Ht=n(Pe,"A",{href:!0});var Di=i(Ht);Zs=s(Di,"post_process_instance_segmentation()"),Di.forEach(o),ea=s(Pe,` or
`),Bt=n(Pe,"A",{href:!0});var ji=i(Bt);ta=s(ji,"post_process_panoptic_segmentation()"),ji.forEach(o),oa=s(Pe," depending on the task. Please, see\n[`~MaskFormerFeatureExtractor] for details regarding usage."),Pe.forEach(o),to.forEach(o),ar=m(t),ee=n(t,"H2",{class:!0});var vr=i(ee);he=n(vr,"A",{id:!0,class:!0,href:!0});var qi=i(he);bo=n(qi,"SPAN",{});var Ri=i(bo);b(Xe.$$.fragment,Ri),Ri.forEach(o),qi.forEach(o),ra=m(vr),Fo=n(vr,"SPAN",{});var Hi=i(Fo);sa=s(Hi,"MaskFormerConfig"),Hi.forEach(o),vr.forEach(o),nr=m(t),$=n(t,"DIV",{class:!0});var O=i($);b(Ye.$$.fragment,O),aa=m(O),H=n(O,"P",{});var ze=i(H);na=s(ze,"This is the configuration class to store the configuration of a "),Ut=n(ze,"A",{href:!0});var Bi=i(Ut);ia=s(Bi,"MaskFormerModel"),Bi.forEach(o),da=s(ze,`. It is used to instantiate a
MaskFormer 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 MaskFormer
`),Je=n(ze,"A",{href:!0,rel:!0});var Ui=i(Je);ca=s(Ui,"facebook/maskformer-swin-base-ade"),Ui.forEach(o),la=s(ze,` architecture trained
on `),Ze=n(ze,"A",{href:!0,rel:!0});var Vi=i(Ze);ma=s(Vi,"ADE20k-150"),Vi.forEach(o),pa=s(ze,"."),ze.forEach(o),ha=m(O),te=n(O,"P",{});var oo=i(te);fa=s(oo,"Configuration objects inherit from "),Vt=n(oo,"A",{href:!0});var Wi=i(Vt);ua=s(Wi,"PretrainedConfig"),Wi.forEach(o),ga=s(oo,` and can be used to control the model outputs. Read the
documentation from `),Wt=n(oo,"A",{href:!0});var Gi=i(Wt);_a=s(Gi,"PretrainedConfig"),Gi.forEach(o),ka=s(oo," for more information."),oo.forEach(o),ba=m(O),et=n(O,"P",{});var wr=i(et);Fa=s(wr,"Currently, MaskFormer only supports the "),Gt=n(wr,"A",{href:!0});var Ki=i(Gt);va=s(Ki,"Swin Transformer"),Ki.forEach(o),wa=s(wr," as backbone."),wr.forEach(o),xa=m(O),b(fe.$$.fragment,O),ya=m(O),ue=n(O,"DIV",{class:!0});var xr=i(ue);b(tt.$$.fragment,xr),Ma=m(xr),ot=n(xr,"P",{});var yr=i(ot);Ta=s(yr,"Instantiate a "),Kt=n(yr,"A",{href:!0});var Qi=i(Kt);$a=s(Qi,"MaskFormerConfig"),Qi.forEach(o),Ea=s(yr,` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),yr.forEach(o),xr.forEach(o),Ia=m(O),ge=n(O,"DIV",{class:!0});var Mr=i(ge);b(rt.$$.fragment,Mr),Pa=m(Mr),st=n(Mr,"P",{});var Tr=i(st);za=s(Tr,"Serializes this instance to a Python dictionary. Override the default "),Qt=n(Tr,"A",{href:!0});var Xi=i(Qt);Oa=s(Xi,"to_dict()"),Xi.forEach(o),La=s(Tr,"."),Tr.forEach(o),Mr.forEach(o),O.forEach(o),ir=m(t),oe=n(t,"H2",{class:!0});var $r=i(oe);_e=n($r,"A",{id:!0,class:!0,href:!0});var Yi=i(_e);vo=n(Yi,"SPAN",{});var Ji=i(vo);b(at.$$.fragment,Ji),Ji.forEach(o),Yi.forEach(o),Ca=m($r),wo=n($r,"SPAN",{});var Zi=i(wo);Aa=s(Zi,"MaskFormerFeatureExtractor"),Zi.forEach(o),$r.forEach(o),dr=m(t),T=n(t,"DIV",{class:!0});var E=i(T);b(nt.$$.fragment,E),Sa=m(E),xo=n(E,"P",{});var ed=i(xo);Na=s(ed,`Constructs a MaskFormer feature extractor. The feature extractor can be used to prepare image(s) and optional
targets for the model.`),ed.forEach(o),Da=m(E),it=n(E,"P",{});var Er=i(it);ja=s(Er,"This feature extractor inherits from "),Xt=n(Er,"A",{href:!0});var td=i(Xt);qa=s(td,"FeatureExtractionMixin"),td.forEach(o),Ra=s(Er,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Er.forEach(o),Ha=m(E),N=n(E,"DIV",{class:!0});var Oe=i(N);b(dt.$$.fragment,Oe),Ba=m(Oe),yo=n(Oe,"P",{});var od=i(yo);Ua=s(od,`Main method to prepare for the model one or several image(s) and optional annotations. Images are by default
padded up to the largest image in a batch, and a pixel mask is created that indicates which pixels are
real/which are padding.`),od.forEach(o),Va=m(Oe),B=n(Oe,"P",{});var Le=i(B);Wa=s(Le,`MaskFormer addresses semantic segmentation with a mask classification paradigm, thus input segmentation maps
will be converted to lists of binary masks and their respective labels. Let\u2019s see an example, assuming
`),Mo=n(Le,"CODE",{});var rd=i(Mo);Ga=s(rd,"segmentation_maps = [[2,6,7,9]]"),rd.forEach(o),Ka=s(Le,", the output will contain "),To=n(Le,"CODE",{});var sd=i(To);Qa=s(sd,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),sd.forEach(o),Xa=s(Le," (four binary masks) and "),$o=n(Le,"CODE",{});var ad=i($o);Ya=s(ad,"class_labels = [2,6,7,9]"),ad.forEach(o),Ja=s(Le,`, the labels for
each mask.`),Le.forEach(o),Za=m(Oe),b(ke.$$.fragment,Oe),Oe.forEach(o),en=m(E),G=n(E,"DIV",{class:!0});var ro=i(G);b(ct.$$.fragment,ro),tn=m(ro),lt=n(ro,"P",{});var Ir=i(lt);on=s(Ir,"Pad images up to the largest image in a batch and create a corresponding "),Eo=n(Ir,"CODE",{});var nd=i(Eo);rn=s(nd,"pixel_mask"),nd.forEach(o),sn=s(Ir,"."),Ir.forEach(o),an=m(ro),U=n(ro,"P",{});var Ce=i(U);nn=s(Ce,`MaskFormer addresses semantic segmentation with a mask classification paradigm, thus input segmentation maps
will be converted to lists of binary masks and their respective labels. Let\u2019s see an example, assuming
`),Io=n(Ce,"CODE",{});var id=i(Io);dn=s(id,"segmentation_maps = [[2,6,7,9]]"),id.forEach(o),cn=s(Ce,", the output will contain "),Po=n(Ce,"CODE",{});var dd=i(Po);ln=s(dd,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),dd.forEach(o),mn=s(Ce," (four binary masks) and "),zo=n(Ce,"CODE",{});var cd=i(zo);pn=s(cd,"class_labels = [2,6,7,9]"),cd.forEach(o),hn=s(Ce,`, the labels for
each mask.`),Ce.forEach(o),ro.forEach(o),fn=m(E),be=n(E,"DIV",{class:!0});var Pr=i(be);b(mt.$$.fragment,Pr),un=m(Pr),pt=n(Pr,"P",{});var zr=i(pt);gn=s(zr,"Converts the output of "),Oo=n(zr,"CODE",{});var ld=i(Oo);_n=s(ld,"MaskFormerForInstanceSegmentationOutput"),ld.forEach(o),kn=s(zr,` into image segmentation predictions. Only
supports PyTorch.`),zr.forEach(o),Pr.forEach(o),bn=m(E),Fe=n(E,"DIV",{class:!0});var Or=i(Fe);b(ht.$$.fragment,Or),Fn=m(Or),ft=n(Or,"P",{});var Lr=i(ft);vn=s(Lr,"Converts the output of "),Yt=n(Lr,"A",{href:!0});var md=i(Yt);wn=s(md,"MaskFormerForInstanceSegmentation"),md.forEach(o),xn=s(Lr,` into semantic segmentation maps. Only supports
PyTorch.`),Lr.forEach(o),Or.forEach(o),yn=m(E),ve=n(E,"DIV",{class:!0});var Cr=i(ve);b(ut.$$.fragment,Cr),Mn=m(Cr),gt=n(Cr,"P",{});var Ar=i(gt);Tn=s(Ar,"Converts the output of "),Lo=n(Ar,"CODE",{});var pd=i(Lo);$n=s(pd,"MaskFormerForInstanceSegmentationOutput"),pd.forEach(o),En=s(Ar,` into instance segmentation predictions. Only
supports PyTorch.`),Ar.forEach(o),Cr.forEach(o),In=m(E),we=n(E,"DIV",{class:!0});var Sr=i(we);b(_t.$$.fragment,Sr),Pn=m(Sr),kt=n(Sr,"P",{});var Nr=i(kt);zn=s(Nr,"Converts the output of "),Co=n(Nr,"CODE",{});var hd=i(Co);On=s(hd,"MaskFormerForInstanceSegmentationOutput"),hd.forEach(o),Ln=s(Nr,` into image panoptic segmentation
predictions. Only supports PyTorch.`),Nr.forEach(o),Sr.forEach(o),E.forEach(o),cr=m(t),re=n(t,"H2",{class:!0});var Dr=i(re);xe=n(Dr,"A",{id:!0,class:!0,href:!0});var fd=i(xe);Ao=n(fd,"SPAN",{});var ud=i(Ao);b(bt.$$.fragment,ud),ud.forEach(o),fd.forEach(o),Cn=m(Dr),So=n(Dr,"SPAN",{});var gd=i(So);An=s(gd,"MaskFormerModel"),gd.forEach(o),Dr.forEach(o),lr=m(t),V=n(t,"DIV",{class:!0});var so=i(V);b(Ft.$$.fragment,so),Sn=m(so),vt=n(so,"P",{});var jr=i(vt);Nn=s(jr,`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),wt=n(jr,"A",{href:!0,rel:!0});var _d=i(wt);Dn=s(_d,"torch.nn.Module"),_d.forEach(o),jn=s(jr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jr.forEach(o),qn=m(so),D=n(so,"DIV",{class:!0});var Ae=i(D);b(xt.$$.fragment,Ae),Rn=m(Ae),se=n(Ae,"P",{});var ao=i(se);Hn=s(ao,"The "),Jt=n(ao,"A",{href:!0});var kd=i(Jt);Bn=s(kd,"MaskFormerModel"),kd.forEach(o),Un=s(ao," forward method, overrides the "),No=n(ao,"CODE",{});var bd=i(No);Vn=s(bd,"__call__"),bd.forEach(o),Wn=s(ao," special method."),ao.forEach(o),Gn=m(Ae),b(ye.$$.fragment,Ae),Kn=m(Ae),b(Me.$$.fragment,Ae),Ae.forEach(o),so.forEach(o),mr=m(t),ae=n(t,"H2",{class:!0});var qr=i(ae);Te=n(qr,"A",{id:!0,class:!0,href:!0});var Fd=i(Te);Do=n(Fd,"SPAN",{});var vd=i(Do);b(yt.$$.fragment,vd),vd.forEach(o),Fd.forEach(o),Qn=m(qr),jo=n(qr,"SPAN",{});var wd=i(jo);Xn=s(wd,"MaskFormerForInstanceSegmentation"),wd.forEach(o),qr.forEach(o),pr=m(t),ne=n(t,"DIV",{class:!0});var Rr=i(ne);b(Mt.$$.fragment,Rr),Yn=m(Rr),j=n(Rr,"DIV",{class:!0});var Se=i(j);b(Tt.$$.fragment,Se),Jn=m(Se),ie=n(Se,"P",{});var no=i(ie);Zn=s(no,"The "),Zt=n(no,"A",{href:!0});var xd=i(Zt);ei=s(xd,"MaskFormerForInstanceSegmentation"),xd.forEach(o),ti=s(no," forward method, overrides the "),qo=n(no,"CODE",{});var yd=i(qo);oi=s(yd,"__call__"),yd.forEach(o),ri=s(no," special method."),no.forEach(o),si=m(Se),b($e.$$.fragment,Se),ai=m(Se),b(Ee.$$.fragment,Se),Se.forEach(o),Rr.forEach(o),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(jd)),d(g,"id","maskformer"),d(g,"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"),d(g,"href","#maskformer"),d(u,"class","relative group"),d(ce,"id","overview"),d(ce,"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"),d(ce,"href","#overview"),d(Y,"class","relative group"),d(De,"href","https://arxiv.org/abs/2107.06278"),d(De,"rel","nofollow"),d(Lt,"href","detr"),d(Ct,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerConfig"),d(je,"href","https://github.com/facebookresearch/MaskFormer/blob/da3e60d85fdeedcb31476b5edd7d328826ce56cc/mask_former/modeling/criterion.py#L169"),d(je,"rel","nofollow"),d(At,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor"),d(St,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation"),d(Nt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation"),d(Dt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(Re,"href","https://arxiv.org/abs/2107.06278"),d(Re,"rel","nofollow"),d(He,"width","600"),Id(He.src,ci="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/maskformer_architecture.png")||d(He,"src",ci),d(Be,"href","https://huggingface.co/francesco"),d(Be,"rel","nofollow"),d(Ue,"href","https://github.com/facebookresearch/MaskFormer"),d(Ue,"rel","nofollow"),d(pe,"id","transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"),d(pe,"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"),d(pe,"href","#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"),d(J,"class","relative group"),d(jt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerModel"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(Rt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation"),d(Ht,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation"),d(Bt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(he,"id","transformers.MaskFormerConfig"),d(he,"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"),d(he,"href","#transformers.MaskFormerConfig"),d(ee,"class","relative group"),d(Ut,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerModel"),d(Je,"href","https://huggingface.co/facebook/maskformer-swin-base-ade"),d(Je,"rel","nofollow"),d(Ze,"href","https://huggingface.co/datasets/scene_parse_150"),d(Ze,"rel","nofollow"),d(Vt,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),d(Wt,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),d(Gt,"href","swin"),d(Kt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerConfig"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qt,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"id","transformers.MaskFormerFeatureExtractor"),d(_e,"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"),d(_e,"href","#transformers.MaskFormerFeatureExtractor"),d(oe,"class","relative group"),d(Xt,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Yt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xe,"id","transformers.MaskFormerModel"),d(xe,"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"),d(xe,"href","#transformers.MaskFormerModel"),d(re,"class","relative group"),d(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wt,"rel","nofollow"),d(Jt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerModel"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"id","transformers.MaskFormerForInstanceSegmentation"),d(Te,"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"),d(Te,"href","#transformers.MaskFormerForInstanceSegmentation"),d(ae,"class","relative group"),d(Zt,"href","/docs/transformers/pr_19907/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,p),f(t,y,h),f(t,u,h),e(u,g),e(g,M),F(c,M,null),e(u,_),e(u,z),e(z,Br),f(t,Wo,h),F(de,t,h),f(t,Go,h),f(t,Y,h),e(Y,ce),e(ce,io),F(Ne,io,null),e(Y,Ur),e(Y,co),e(co,Vr),f(t,Ko,h),f(t,le,h),e(le,Wr),e(le,De),e(De,Gr),e(le,Kr),f(t,Qo,h),f(t,Pt,h),e(Pt,Qr),f(t,Xo,h),f(t,zt,h),e(zt,lo),e(lo,Xr),f(t,Yo,h),f(t,Ot,h),e(Ot,Yr),f(t,Jo,h),f(t,S,h),e(S,L),e(L,Jr),e(L,Lt),e(Lt,Zr),e(L,es),e(L,mo),e(mo,ts),e(L,os),e(L,Ct),e(Ct,rs),e(L,ss),e(L,po),e(po,as),e(L,ns),e(S,is),e(S,C),e(C,ds),e(C,ho),e(ho,cs),e(C,ls),e(C,fo),e(fo,ms),e(C,ps),e(C,uo),e(uo,hs),e(C,fs),e(C,je),e(je,us),e(C,gs),e(S,_s),e(S,qe),e(qe,ks),e(qe,At),e(At,bs),e(qe,Fs),e(S,vs),e(S,A),e(A,ws),e(A,St),e(St,xs),e(A,ys),e(A,Nt),e(Nt,Ms),e(A,Ts),e(A,Dt),e(Dt,$s),e(A,Es),e(A,go),e(go,Is),e(A,Ps),f(t,Zo,h),f(t,me,h),e(me,zs),e(me,Re),e(Re,Os),e(me,Ls),f(t,er,h),f(t,He,h),f(t,tr,h),f(t,W,h),e(W,Cs),e(W,Be),e(Be,As),e(W,Ss),e(W,Ue),e(Ue,Ns),e(W,Ds),f(t,or,h),f(t,J,h),e(J,pe),e(pe,_o),F(Ve,_o,null),e(J,js),e(J,ko),e(ko,qs),f(t,rr,h),f(t,Z,h),F(We,Z,null),e(Z,Rs),e(Z,Ge),e(Ge,Hs),e(Ge,jt),e(jt,Bs),e(Ge,Us),f(t,sr,h),f(t,q,h),F(Ke,q,null),e(q,Vs),e(q,Qe),e(Qe,Ws),e(Qe,qt),e(qt,Gs),e(Qe,Ks),e(q,Qs),e(q,R),e(R,Xs),e(R,Rt),e(Rt,Ys),e(R,Js),e(R,Ht),e(Ht,Zs),e(R,ea),e(R,Bt),e(Bt,ta),e(R,oa),f(t,ar,h),f(t,ee,h),e(ee,he),e(he,bo),F(Xe,bo,null),e(ee,ra),e(ee,Fo),e(Fo,sa),f(t,nr,h),f(t,$,h),F(Ye,$,null),e($,aa),e($,H),e(H,na),e(H,Ut),e(Ut,ia),e(H,da),e(H,Je),e(Je,ca),e(H,la),e(H,Ze),e(Ze,ma),e(H,pa),e($,ha),e($,te),e(te,fa),e(te,Vt),e(Vt,ua),e(te,ga),e(te,Wt),e(Wt,_a),e(te,ka),e($,ba),e($,et),e(et,Fa),e(et,Gt),e(Gt,va),e(et,wa),e($,xa),F(fe,$,null),e($,ya),e($,ue),F(tt,ue,null),e(ue,Ma),e(ue,ot),e(ot,Ta),e(ot,Kt),e(Kt,$a),e(ot,Ea),e($,Ia),e($,ge),F(rt,ge,null),e(ge,Pa),e(ge,st),e(st,za),e(st,Qt),e(Qt,Oa),e(st,La),f(t,ir,h),f(t,oe,h),e(oe,_e),e(_e,vo),F(at,vo,null),e(oe,Ca),e(oe,wo),e(wo,Aa),f(t,dr,h),f(t,T,h),F(nt,T,null),e(T,Sa),e(T,xo),e(xo,Na),e(T,Da),e(T,it),e(it,ja),e(it,Xt),e(Xt,qa),e(it,Ra),e(T,Ha),e(T,N),F(dt,N,null),e(N,Ba),e(N,yo),e(yo,Ua),e(N,Va),e(N,B),e(B,Wa),e(B,Mo),e(Mo,Ga),e(B,Ka),e(B,To),e(To,Qa),e(B,Xa),e(B,$o),e($o,Ya),e(B,Ja),e(N,Za),F(ke,N,null),e(T,en),e(T,G),F(ct,G,null),e(G,tn),e(G,lt),e(lt,on),e(lt,Eo),e(Eo,rn),e(lt,sn),e(G,an),e(G,U),e(U,nn),e(U,Io),e(Io,dn),e(U,cn),e(U,Po),e(Po,ln),e(U,mn),e(U,zo),e(zo,pn),e(U,hn),e(T,fn),e(T,be),F(mt,be,null),e(be,un),e(be,pt),e(pt,gn),e(pt,Oo),e(Oo,_n),e(pt,kn),e(T,bn),e(T,Fe),F(ht,Fe,null),e(Fe,Fn),e(Fe,ft),e(ft,vn),e(ft,Yt),e(Yt,wn),e(ft,xn),e(T,yn),e(T,ve),F(ut,ve,null),e(ve,Mn),e(ve,gt),e(gt,Tn),e(gt,Lo),e(Lo,$n),e(gt,En),e(T,In),e(T,we),F(_t,we,null),e(we,Pn),e(we,kt),e(kt,zn),e(kt,Co),e(Co,On),e(kt,Ln),f(t,cr,h),f(t,re,h),e(re,xe),e(xe,Ao),F(bt,Ao,null),e(re,Cn),e(re,So),e(So,An),f(t,lr,h),f(t,V,h),F(Ft,V,null),e(V,Sn),e(V,vt),e(vt,Nn),e(vt,wt),e(wt,Dn),e(vt,jn),e(V,qn),e(V,D),F(xt,D,null),e(D,Rn),e(D,se),e(se,Hn),e(se,Jt),e(Jt,Bn),e(se,Un),e(se,No),e(No,Vn),e(se,Wn),e(D,Gn),F(ye,D,null),e(D,Kn),F(Me,D,null),f(t,mr,h),f(t,ae,h),e(ae,Te),e(Te,Do),F(yt,Do,null),e(ae,Qn),e(ae,jo),e(jo,Xn),f(t,pr,h),f(t,ne,h),F(Mt,ne,null),e(ne,Yn),e(ne,j),F(Tt,j,null),e(j,Jn),e(j,ie),e(ie,Zn),e(ie,Zt),e(Zt,ei),e(ie,ti),e(ie,qo),e(qo,oi),e(ie,ri),e(j,si),F($e,j,null),e(j,ai),F(Ee,j,null),hr=!0},p(t,[h]){const $t={};h&2&&($t.$$scope={dirty:h,ctx:t}),de.$set($t);const Ro={};h&2&&(Ro.$$scope={dirty:h,ctx:t}),fe.$set(Ro);const Ho={};h&2&&(Ho.$$scope={dirty:h,ctx:t}),ke.$set(Ho);const Bo={};h&2&&(Bo.$$scope={dirty:h,ctx:t}),ye.$set(Bo);const Et={};h&2&&(Et.$$scope={dirty:h,ctx:t}),Me.$set(Et);const Uo={};h&2&&(Uo.$$scope={dirty:h,ctx:t}),$e.$set(Uo);const Vo={};h&2&&(Vo.$$scope={dirty:h,ctx:t}),Ee.$set(Vo)},i(t){hr||(v(c.$$.fragment,t),v(de.$$.fragment,t),v(Ne.$$.fragment,t),v(Ve.$$.fragment,t),v(We.$$.fragment,t),v(Ke.$$.fragment,t),v(Xe.$$.fragment,t),v(Ye.$$.fragment,t),v(fe.$$.fragment,t),v(tt.$$.fragment,t),v(rt.$$.fragment,t),v(at.$$.fragment,t),v(nt.$$.fragment,t),v(dt.$$.fragment,t),v(ke.$$.fragment,t),v(ct.$$.fragment,t),v(mt.$$.fragment,t),v(ht.$$.fragment,t),v(ut.$$.fragment,t),v(_t.$$.fragment,t),v(bt.$$.fragment,t),v(Ft.$$.fragment,t),v(xt.$$.fragment,t),v(ye.$$.fragment,t),v(Me.$$.fragment,t),v(yt.$$.fragment,t),v(Mt.$$.fragment,t),v(Tt.$$.fragment,t),v($e.$$.fragment,t),v(Ee.$$.fragment,t),hr=!0)},o(t){w(c.$$.fragment,t),w(de.$$.fragment,t),w(Ne.$$.fragment,t),w(Ve.$$.fragment,t),w(We.$$.fragment,t),w(Ke.$$.fragment,t),w(Xe.$$.fragment,t),w(Ye.$$.fragment,t),w(fe.$$.fragment,t),w(tt.$$.fragment,t),w(rt.$$.fragment,t),w(at.$$.fragment,t),w(nt.$$.fragment,t),w(dt.$$.fragment,t),w(ke.$$.fragment,t),w(ct.$$.fragment,t),w(mt.$$.fragment,t),w(ht.$$.fragment,t),w(ut.$$.fragment,t),w(_t.$$.fragment,t),w(bt.$$.fragment,t),w(Ft.$$.fragment,t),w(xt.$$.fragment,t),w(ye.$$.fragment,t),w(Me.$$.fragment,t),w(yt.$$.fragment,t),w(Mt.$$.fragment,t),w(Tt.$$.fragment,t),w($e.$$.fragment,t),w(Ee.$$.fragment,t),hr=!1},d(t){o(p),t&&o(y),t&&o(u),x(c),t&&o(Wo),x(de,t),t&&o(Go),t&&o(Y),x(Ne),t&&o(Ko),t&&o(le),t&&o(Qo),t&&o(Pt),t&&o(Xo),t&&o(zt),t&&o(Yo),t&&o(Ot),t&&o(Jo),t&&o(S),t&&o(Zo),t&&o(me),t&&o(er),t&&o(He),t&&o(tr),t&&o(W),t&&o(or),t&&o(J),x(Ve),t&&o(rr),t&&o(Z),x(We),t&&o(sr),t&&o(q),x(Ke),t&&o(ar),t&&o(ee),x(Xe),t&&o(nr),t&&o($),x(Ye),x(fe),x(tt),x(rt),t&&o(ir),t&&o(oe),x(at),t&&o(dr),t&&o(T),x(nt),x(dt),x(ke),x(ct),x(mt),x(ht),x(ut),x(_t),t&&o(cr),t&&o(re),x(bt),t&&o(lr),t&&o(V),x(Ft),x(xt),x(ye),x(Me),t&&o(mr),t&&o(ae),x(yt),t&&o(pr),t&&o(ne),x(Mt),x(Tt),x($e),x(Ee)}}}const jd={local:"maskformer",sections:[{local:"overview",title:"Overview"},{local:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput",title:"MaskFormer specific outputs"},{local:"transformers.MaskFormerConfig",title:"MaskFormerConfig"},{local:"transformers.MaskFormerFeatureExtractor",title:"MaskFormerFeatureExtractor"},{local:"transformers.MaskFormerModel",title:"MaskFormerModel"},{local:"transformers.MaskFormerForInstanceSegmentation",title:"MaskFormerForInstanceSegmentation"}],title:"MaskFormer"};function qd(I){return Pd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gd extends Md{constructor(p){super();Td(this,p,qd,Dd,$d,{})}}export{Gd as default,jd as metadata};
