import{S as ld,i as cd,s as md,e as s,k as c,w as F,t as r,M as pd,c as n,d as o,m,a as i,x as v,h as a,b as d,N as hd,G as e,g as f,y as w,q as x,o as M,B as y,v as fd,L as Gn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Lr}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Kn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as yt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Vn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ud(E){let p,k,u,g,b;return{c(){p=s("p"),k=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=s("a"),g=r("Github Issue"),b=r("."),this.h()},l(l){p=n(l,"P",{});var _=i(p);k=a(_,`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 O=i(u);g=a(O,"Github Issue"),O.forEach(o),b=a(_,"."),_.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(l,_){f(l,p,_),e(p,k),e(p,u),e(u,g),e(p,b)},d(l){l&&o(p)}}}function gd(E){let p,k,u,g,b;return g=new Kn({props:{code:`from transformers import MaskFormerConfig, MaskFormerModel

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

# Initializing a model 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 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=s("p"),k=r("Examples:"),u=c(),F(g.$$.fragment)},l(l){p=n(l,"P",{});var _=i(p);k=a(_,"Examples:"),_.forEach(o),u=m(l),v(g.$$.fragment,l)},m(l,_){f(l,p,_),e(p,k),f(l,u,_),w(g,l,_),b=!0},p:Gn,i(l){b||(x(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(u),y(g,l)}}}function _d(E){let p,k;return{c(){p=s("p"),k=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);k=a(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,k)},d(u){u&&o(p)}}}function kd(E){let p,k,u,g,b;return{c(){p=s("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),g=r("Module"),b=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(l){p=n(l,"P",{});var _=i(p);k=a(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(_,"CODE",{});var O=i(u);g=a(O,"Module"),O.forEach(o),b=a(_,`
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(l,_){f(l,p,_),e(p,k),e(p,u),e(u,g),e(p,b)},d(l){l&&o(p)}}}function bd(E){let p,k,u,g,b;return g=new Kn({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=s("p"),k=r("Example:"),u=c(),F(g.$$.fragment)},l(l){p=n(l,"P",{});var _=i(p);k=a(_,"Example:"),_.forEach(o),u=m(l),v(g.$$.fragment,l)},m(l,_){f(l,p,_),e(p,k),f(l,u,_),w(g,l,_),b=!0},p:Gn,i(l){b||(x(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(u),y(g,l)}}}function Fd(E){let p,k,u,g,b;return{c(){p=s("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),g=r("Module"),b=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(l){p=n(l,"P",{});var _=i(p);k=a(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(_,"CODE",{});var O=i(u);g=a(O,"Module"),O.forEach(o),b=a(_,`
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(l,_){f(l,p,_),e(p,k),e(p,u),e(u,g),e(p,b)},d(l){l&&o(p)}}}function vd(E){let p,k,u,g,b;return g=new Kn({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_segmentation(outputs)
output = feature_extractor.post_process_semantic_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_segmentation(outputs)
<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_panoptic_segmentation(outputs)`}}),{c(){p=s("p"),k=r("Examples:"),u=c(),F(g.$$.fragment)},l(l){p=n(l,"P",{});var _=i(p);k=a(_,"Examples:"),_.forEach(o),u=m(l),v(g.$$.fragment,l)},m(l,_){f(l,p,_),e(p,k),f(l,u,_),w(g,l,_),b=!0},p:Gn,i(l){b||(x(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(u),y(g,l)}}}function wd(E){let p,k,u,g,b,l,_,O,Ar,Ho,de,Ro,X,le,oo,Le,jr,ro,Nr,Bo,ce,Dr,Ae,qr,Hr,Wo,Tt,Rr,Uo,$t,ao,Br,Vo,Et,Wr,Go,A,C,Ur,It,Vr,Gr,so,Kr,Qr,Pt,Xr,Yr,no,Jr,Zr,ea,S,ta,io,oa,ra,lo,aa,sa,co,na,ia,je,da,la,ca,Ne,ma,Ot,pa,ha,fa,L,ua,zt,ga,_a,Ct,ka,ba,St,Fa,va,mo,wa,xa,Ko,me,Ma,De,ya,Ta,Qo,qe,Qn,Xo,U,$a,He,Ea,Ia,Re,Pa,Oa,Yo,Y,pe,po,Be,za,ho,Ca,Jo,J,We,Sa,Ue,La,Lt,Aa,ja,Zo,q,Ve,Na,Ge,Da,At,qa,Ha,Ra,Z,Ba,jt,Wa,Ua,Nt,Va,Ga,er,ee,he,fo,Ke,Ka,uo,Qa,tr,$,Qe,Xa,H,Ya,Dt,Ja,Za,Xe,es,ts,Ye,os,rs,as,te,ss,qt,ns,is,Ht,ds,ls,cs,Je,ms,Rt,ps,hs,fs,fe,us,ue,Ze,gs,et,_s,Bt,ks,bs,Fs,ge,tt,vs,ot,ws,Wt,xs,Ms,or,oe,_e,go,rt,ys,_o,Ts,rr,T,at,$s,ko,Es,Is,st,Ps,Ut,Os,zs,Cs,j,nt,Ss,bo,Ls,As,R,js,Fo,Ns,Ds,vo,qs,Hs,wo,Rs,Bs,Ws,ke,Us,V,it,Vs,dt,Gs,xo,Ks,Qs,Xs,B,Ys,Mo,Js,Zs,yo,en,tn,To,on,rn,an,be,lt,sn,ct,nn,$o,dn,ln,cn,Fe,mt,mn,pt,pn,Eo,hn,fn,un,ve,ht,gn,ft,_n,Io,kn,bn,ar,re,we,Po,ut,Fn,Oo,vn,sr,W,gt,wn,_t,xn,kt,Mn,yn,Tn,N,bt,$n,ae,En,Vt,In,Pn,zo,On,zn,Cn,xe,Sn,Me,nr,se,ye,Co,Ft,Ln,So,An,ir,ne,vt,jn,D,wt,Nn,ie,Dn,Gt,qn,Hn,Lo,Rn,Bn,Wn,Te,Un,$e,dr;return l=new yt({}),de=new Lr({props:{$$slots:{default:[ud]},$$scope:{ctx:E}}}),Le=new yt({}),Be=new yt({}),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_17548/src/transformers/models/maskformer/modeling_maskformer.py#L215"}}),Ve=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, height, width)</code> representing the proposed masks for each
query.`,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, 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:"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_17548/src/transformers/models/maskformer/modeling_maskformer.py#L258"}}),Ke=new yt({}),Qe=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_17548/src/transformers/models/maskformer/configuration_maskformer.py#L36"}}),fe=new Vn({props:{anchor:"transformers.MaskFormerConfig.example",$$slots:{default:[gd]},$$scope:{ctx:E}}}),Ze=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_17548/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_17548/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_17548/src/transformers/models/maskformer/configuration_maskformer.py#L172",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a></p>
`}}),tt=new P({props:{name:"to_dict",anchor:"transformers.MaskFormerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),rt=new yt({}),at=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.BILINEAR</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.NEAREST</code>, <code>PIL.Image.BOX</code>,
<code>PIL.Image.BILINEAR</code>, <code>PIL.Image.HAMMING</code>, <code>PIL.Image.BICUBIC</code> or <code>PIL.Image.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;
Value of the index (label) to be removed from the segmentation maps.`,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 reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is
used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). The
background label will be replaced by <code>ignore_index</code>.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L38"}}),nt=new P({props:{name:"__call__",anchor:"transformers.MaskFormerFeatureExtractor.__call__",parameters:[{name:"images",val:": typing.Union[PIL.Image.Image, numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"segmentation_maps",val:": typing.Union[PIL.Image.Image, numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[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.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;
Optionally, the corresponding semantic segmentation maps with the pixel-wise annotations.`,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>Dict[int, int]</code>, <em>optional</em>) &#x2014;
If passed, we treat <code>segmentation_maps</code> as an instance segmentation map where each pixel represents an
instance id. To convert it to a binary mask of shape (<code>batch, num_labels, height, width</code>) we need a
dictionary mapping instance ids to label ids to create a semantic segmentation map.`,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_17548/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_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L160",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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
<em>\u201Cpixel_mask\u201D</em> 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_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),ke=new Lr({props:{warning:!0,$$slots:{default:[_d]},$$scope:{ctx:E}}}),it=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[PIL.Image.Image, numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[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.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>Dict[int, int]</code>, <em>optional</em>) &#x2014;
If passed, we treat <code>segmentation_maps</code> as an instance segmentation map where each pixel represents an
instance id. To convert it to a binary mask of shape (<code>batch, num_labels, height, width</code>) we need a
dictionary mapping instance ids to label ids to create a semantic segmentation map.`,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_17548/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_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L344",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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
<em>\u201Cpixel_mask\u201D</em> 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_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),lt=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_17548/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_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L456",returnDescription:`
<p>A tensor of shape (<code>batch_size, num_labels, height, width</code>).</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),mt=new P({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:": MaskFormerForInstanceSegmentationOutput"},{name:"target_size",val:": typing.Tuple[int, int] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L527",returnDescription:`
<p>A tensor of shape <code>batch_size, height, width</code>.</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),ht=new P({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:": MaskFormerForInstanceSegmentationOutput"},{name:"object_mask_threshold",val:": float = 0.8"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = 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_17548/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.object_mask_threshold",description:`<strong>object_mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The object mask threshold.`,name:"object_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 use.`,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"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/maskformer/feature_extraction_maskformer.py#L545",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>.</li>
<li><strong>segments</strong> \u2014 a dictionary with the following keys<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 segment\u2019s label.</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.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),ut=new yt({}),gt=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_17548/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_17548/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_17548/src/transformers/models/maskformer/modeling_maskformer.py#L2337"}}),bt=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_17548/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_17548/src/transformers/models/maskformer/modeling_maskformer.py#L2347",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new Lr({props:{$$slots:{default:[kd]},$$scope:{ctx:E}}}),Me=new Vn({props:{anchor:"transformers.MaskFormerModel.forward.example",$$slots:{default:[bd]},$$scope:{ctx:E}}}),Ft=new yt({}),vt=new P({props:{name:"class transformers.MaskFormerForInstanceSegmentation",anchor:"transformers.MaskFormerForInstanceSegmentation",parameters:[{name:"config",val:": MaskFormerConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/maskformer/modeling_maskformer.py#L2417"}}),wt=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_17548/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_17548/src/transformers/models/maskformer/modeling_maskformer.py#L2498",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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, height, width)</code> representing the proposed masks for each
query.</li>
<li><strong>masks_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>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_17548/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new Lr({props:{$$slots:{default:[Fd]},$$scope:{ctx:E}}}),$e=new Vn({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example",$$slots:{default:[vd]},$$scope:{ctx:E}}}),{c(){p=s("meta"),k=c(),u=s("h1"),g=s("a"),b=s("span"),F(l.$$.fragment),_=c(),O=s("span"),Ar=r("MaskFormer"),Ho=c(),F(de.$$.fragment),Ro=c(),X=s("h2"),le=s("a"),oo=s("span"),F(Le.$$.fragment),jr=c(),ro=s("span"),Nr=r("Overview"),Bo=c(),ce=s("p"),Dr=r("The MaskFormer model was proposed in "),Ae=s("a"),qr=r("Per-Pixel Classification is Not All You Need for Semantic Segmentation"),Hr=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."),Wo=c(),Tt=s("p"),Rr=r("The abstract from the paper is the following:"),Uo=c(),$t=s("p"),ao=s("em"),Br=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."),Vo=c(),Et=s("p"),Wr=r("Tips:"),Go=c(),A=s("ul"),C=s("li"),Ur=r("MaskFormer\u2019s Transformer decoder is identical to the decoder of "),It=s("a"),Vr=r("DETR"),Gr=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 "),so=s("code"),Kr=r("use_auxilary_loss"),Qr=r(" of "),Pt=s("a"),Xr=r("MaskFormerConfig"),Yr=r(" to "),no=s("code"),Jr=r("True"),Zr=r(", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),ea=c(),S=s("li"),ta=r(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),io=s("code"),oa=r("get_num_masks"),ra=r(" function inside in the "),lo=s("code"),aa=r("MaskFormerLoss"),sa=r(" class of "),co=s("code"),na=r("modeling_maskformer.py"),ia=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=s("a"),da=r("here"),la=r("."),ca=c(),Ne=s("li"),ma=r("One can use "),Ot=s("a"),pa=r("MaskFormerFeatureExtractor"),ha=r(" to prepare images for the model and optional targets for the model."),fa=c(),L=s("li"),ua=r("To get the final segmentation, depending on the task, you can call "),zt=s("a"),ga=r("post_process_semantic_segmentation()"),_a=r(" or "),Ct=s("a"),ka=r("post_process_panoptic_segmentation()"),ba=r(". Both tasks can be solved using "),St=s("a"),Fa=r("MaskFormerForInstanceSegmentation"),va=r(" output, the latter needs an additional "),mo=s("code"),wa=r("is_thing_map"),xa=r(" to know which instances must be merged together.."),Ko=c(),me=s("p"),Ma=r("The figure below illustrates the architecture of MaskFormer. Taken from the "),De=s("a"),ya=r("original paper"),Ta=r("."),Qo=c(),qe=s("img"),Xo=c(),U=s("p"),$a=r("This model was contributed by "),He=s("a"),Ea=r("francesco"),Ia=r(". The original code can be found "),Re=s("a"),Pa=r("here"),Oa=r("."),Yo=c(),Y=s("h2"),pe=s("a"),po=s("span"),F(Be.$$.fragment),za=c(),ho=s("span"),Ca=r("MaskFormer specific outputs"),Jo=c(),J=s("div"),F(We.$$.fragment),Sa=c(),Ue=s("p"),La=r("Class for outputs of "),Lt=s("a"),Aa=r("MaskFormerModel"),ja=r(". This class returns all the needed hidden states to compute the logits."),Zo=c(),q=s("div"),F(Ve.$$.fragment),Na=c(),Ge=s("p"),Da=r("Class for outputs of "),At=s("a"),qa=r("MaskFormerForInstanceSegmentation"),Ha=r("."),Ra=c(),Z=s("p"),Ba=r("This output can be directly passed to "),jt=s("a"),Wa=r("post_process_segmentation()"),Ua=r(` or
`),Nt=s("a"),Va=r("post_process_panoptic_segmentation()"),Ga=r(" depending on the task. Please, see\n[`~MaskFormerFeatureExtractor] for details regarding usage."),er=c(),ee=s("h2"),he=s("a"),fo=s("span"),F(Ke.$$.fragment),Ka=c(),uo=s("span"),Qa=r("MaskFormerConfig"),tr=c(),$=s("div"),F(Qe.$$.fragment),Xa=c(),H=s("p"),Ya=r("This is the configuration class to store the configuration of a "),Dt=s("a"),Ja=r("MaskFormerModel"),Za=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
`),Xe=s("a"),es=r("facebook/maskformer-swin-base-ade"),ts=r(` architecture trained
on `),Ye=s("a"),os=r("ADE20k-150"),rs=r("."),as=c(),te=s("p"),ss=r("Configuration objects inherit from "),qt=s("a"),ns=r("PretrainedConfig"),is=r(` and can be used to control the model outputs. Read the
documentation from `),Ht=s("a"),ds=r("PretrainedConfig"),ls=r(" for more information."),cs=c(),Je=s("p"),ms=r("Currently, MaskFormer only supports the "),Rt=s("a"),ps=r("Swin Transformer"),hs=r(" as backbone."),fs=c(),F(fe.$$.fragment),us=c(),ue=s("div"),F(Ze.$$.fragment),gs=c(),et=s("p"),_s=r("Instantiate a "),Bt=s("a"),ks=r("MaskFormerConfig"),bs=r(` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),Fs=c(),ge=s("div"),F(tt.$$.fragment),vs=c(),ot=s("p"),ws=r("Serializes this instance to a Python dictionary. Override the default "),Wt=s("a"),xs=r("to_dict()"),Ms=r("."),or=c(),oe=s("h2"),_e=s("a"),go=s("span"),F(rt.$$.fragment),ys=c(),_o=s("span"),Ts=r("MaskFormerFeatureExtractor"),rr=c(),T=s("div"),F(at.$$.fragment),$s=c(),ko=s("p"),Es=r(`Constructs a MaskFormer feature extractor. The feature extractor can be used to prepare image(s) and optional
targets for the model.`),Is=c(),st=s("p"),Ps=r("This feature extractor inherits from "),Ut=s("a"),Os=r("FeatureExtractionMixin"),zs=r(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Cs=c(),j=s("div"),F(nt.$$.fragment),Ss=c(),bo=s("p"),Ls=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.`),As=c(),R=s("p"),js=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
`),Fo=s("code"),Ns=r("segmentation_maps = [[2,6,7,9]]"),Ds=r(", the output will contain "),vo=s("code"),qs=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Hs=r(" (four binary masks) and "),wo=s("code"),Rs=r("class_labels = [2,6,7,9]"),Bs=r(`, the labels for
each mask.`),Ws=c(),F(ke.$$.fragment),Us=c(),V=s("div"),F(it.$$.fragment),Vs=c(),dt=s("p"),Gs=r("Pad images up to the largest image in a batch and create a corresponding "),xo=s("code"),Ks=r("pixel_mask"),Qs=r("."),Xs=c(),B=s("p"),Ys=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=s("code"),Js=r("segmentation_maps = [[2,6,7,9]]"),Zs=r(", the output will contain "),yo=s("code"),en=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),tn=r(" (four binary masks) and "),To=s("code"),on=r("class_labels = [2,6,7,9]"),rn=r(`, the labels for
each mask.`),an=c(),be=s("div"),F(lt.$$.fragment),sn=c(),ct=s("p"),nn=r("Converts the output of "),$o=s("code"),dn=r("MaskFormerForInstanceSegmentationOutput"),ln=r(` into image segmentation predictions. Only
supports PyTorch.`),cn=c(),Fe=s("div"),F(mt.$$.fragment),mn=c(),pt=s("p"),pn=r("Converts the output of "),Eo=s("code"),hn=r("MaskFormerForInstanceSegmentationOutput"),fn=r(` into semantic segmentation predictions. Only
supports PyTorch.`),un=c(),ve=s("div"),F(ht.$$.fragment),gn=c(),ft=s("p"),_n=r("Converts the output of "),Io=s("code"),kn=r("MaskFormerForInstanceSegmentationOutput"),bn=r(` into image panoptic segmentation
predictions. Only supports PyTorch.`),ar=c(),re=s("h2"),we=s("a"),Po=s("span"),F(ut.$$.fragment),Fn=c(),Oo=s("span"),vn=r("MaskFormerModel"),sr=c(),W=s("div"),F(gt.$$.fragment),wn=c(),_t=s("p"),xn=r(`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),kt=s("a"),Mn=r("torch.nn.Module"),yn=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.`),Tn=c(),N=s("div"),F(bt.$$.fragment),$n=c(),ae=s("p"),En=r("The "),Vt=s("a"),In=r("MaskFormerModel"),Pn=r(" forward method, overrides the "),zo=s("code"),On=r("__call__"),zn=r(" special method."),Cn=c(),F(xe.$$.fragment),Sn=c(),F(Me.$$.fragment),nr=c(),se=s("h2"),ye=s("a"),Co=s("span"),F(Ft.$$.fragment),Ln=c(),So=s("span"),An=r("MaskFormerForInstanceSegmentation"),ir=c(),ne=s("div"),F(vt.$$.fragment),jn=c(),D=s("div"),F(wt.$$.fragment),Nn=c(),ie=s("p"),Dn=r("The "),Gt=s("a"),qn=r("MaskFormerForInstanceSegmentation"),Hn=r(" forward method, overrides the "),Lo=s("code"),Rn=r("__call__"),Bn=r(" special method."),Wn=c(),F(Te.$$.fragment),Un=c(),F($e.$$.fragment),this.h()},l(t){const h=pd('[data-svelte="svelte-1phssyn"]',document.head);p=n(h,"META",{name:!0,content:!0}),h.forEach(o),k=m(t),u=n(t,"H1",{class:!0});var xt=i(u);g=n(xt,"A",{id:!0,class:!0,href:!0});var Ao=i(g);b=n(Ao,"SPAN",{});var jo=i(b);v(l.$$.fragment,jo),jo.forEach(o),Ao.forEach(o),_=m(xt),O=n(xt,"SPAN",{});var No=i(O);Ar=a(No,"MaskFormer"),No.forEach(o),xt.forEach(o),Ho=m(t),v(de.$$.fragment,t),Ro=m(t),X=n(t,"H2",{class:!0});var Mt=i(X);le=n(Mt,"A",{id:!0,class:!0,href:!0});var Do=i(le);oo=n(Do,"SPAN",{});var qo=i(oo);v(Le.$$.fragment,qo),qo.forEach(o),Do.forEach(o),jr=m(Mt),ro=n(Mt,"SPAN",{});var Xn=i(ro);Nr=a(Xn,"Overview"),Xn.forEach(o),Mt.forEach(o),Bo=m(t),ce=n(t,"P",{});var lr=i(ce);Dr=a(lr,"The MaskFormer model was proposed in "),Ae=n(lr,"A",{href:!0,rel:!0});var Yn=i(Ae);qr=a(Yn,"Per-Pixel Classification is Not All You Need for Semantic Segmentation"),Yn.forEach(o),Hr=a(lr," by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),lr.forEach(o),Wo=m(t),Tt=n(t,"P",{});var Jn=i(Tt);Rr=a(Jn,"The abstract from the paper is the following:"),Jn.forEach(o),Uo=m(t),$t=n(t,"P",{});var Zn=i($t);ao=n(Zn,"EM",{});var ei=i(ao);Br=a(ei,"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."),ei.forEach(o),Zn.forEach(o),Vo=m(t),Et=n(t,"P",{});var ti=i(Et);Wr=a(ti,"Tips:"),ti.forEach(o),Go=m(t),A=n(t,"UL",{});var Ee=i(A);C=n(Ee,"LI",{});var G=i(C);Ur=a(G,"MaskFormer\u2019s Transformer decoder is identical to the decoder of "),It=n(G,"A",{href:!0});var oi=i(It);Vr=a(oi,"DETR"),oi.forEach(o),Gr=a(G,". 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 "),so=n(G,"CODE",{});var ri=i(so);Kr=a(ri,"use_auxilary_loss"),ri.forEach(o),Qr=a(G," of "),Pt=n(G,"A",{href:!0});var ai=i(Pt);Xr=a(ai,"MaskFormerConfig"),ai.forEach(o),Yr=a(G," to "),no=n(G,"CODE",{});var si=i(no);Jr=a(si,"True"),si.forEach(o),Zr=a(G,", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),G.forEach(o),ea=m(Ee),S=n(Ee,"LI",{});var K=i(S);ta=a(K,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),io=n(K,"CODE",{});var ni=i(io);oa=a(ni,"get_num_masks"),ni.forEach(o),ra=a(K," function inside in the "),lo=n(K,"CODE",{});var ii=i(lo);aa=a(ii,"MaskFormerLoss"),ii.forEach(o),sa=a(K," class of "),co=n(K,"CODE",{});var di=i(co);na=a(di,"modeling_maskformer.py"),di.forEach(o),ia=a(K,`. 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(K,"A",{href:!0,rel:!0});var li=i(je);da=a(li,"here"),li.forEach(o),la=a(K,"."),K.forEach(o),ca=m(Ee),Ne=n(Ee,"LI",{});var cr=i(Ne);ma=a(cr,"One can use "),Ot=n(cr,"A",{href:!0});var ci=i(Ot);pa=a(ci,"MaskFormerFeatureExtractor"),ci.forEach(o),ha=a(cr," to prepare images for the model and optional targets for the model."),cr.forEach(o),fa=m(Ee),L=n(Ee,"LI",{});var Q=i(L);ua=a(Q,"To get the final segmentation, depending on the task, you can call "),zt=n(Q,"A",{href:!0});var mi=i(zt);ga=a(mi,"post_process_semantic_segmentation()"),mi.forEach(o),_a=a(Q," or "),Ct=n(Q,"A",{href:!0});var pi=i(Ct);ka=a(pi,"post_process_panoptic_segmentation()"),pi.forEach(o),ba=a(Q,". Both tasks can be solved using "),St=n(Q,"A",{href:!0});var hi=i(St);Fa=a(hi,"MaskFormerForInstanceSegmentation"),hi.forEach(o),va=a(Q," output, the latter needs an additional "),mo=n(Q,"CODE",{});var fi=i(mo);wa=a(fi,"is_thing_map"),fi.forEach(o),xa=a(Q," to know which instances must be merged together.."),Q.forEach(o),Ee.forEach(o),Ko=m(t),me=n(t,"P",{});var mr=i(me);Ma=a(mr,"The figure below illustrates the architecture of MaskFormer. Taken from the "),De=n(mr,"A",{href:!0,rel:!0});var ui=i(De);ya=a(ui,"original paper"),ui.forEach(o),Ta=a(mr,"."),mr.forEach(o),Qo=m(t),qe=n(t,"IMG",{width:!0,src:!0}),Xo=m(t),U=n(t,"P",{});var Kt=i(U);$a=a(Kt,"This model was contributed by "),He=n(Kt,"A",{href:!0,rel:!0});var gi=i(He);Ea=a(gi,"francesco"),gi.forEach(o),Ia=a(Kt,". The original code can be found "),Re=n(Kt,"A",{href:!0,rel:!0});var _i=i(Re);Pa=a(_i,"here"),_i.forEach(o),Oa=a(Kt,"."),Kt.forEach(o),Yo=m(t),Y=n(t,"H2",{class:!0});var pr=i(Y);pe=n(pr,"A",{id:!0,class:!0,href:!0});var ki=i(pe);po=n(ki,"SPAN",{});var bi=i(po);v(Be.$$.fragment,bi),bi.forEach(o),ki.forEach(o),za=m(pr),ho=n(pr,"SPAN",{});var Fi=i(ho);Ca=a(Fi,"MaskFormer specific outputs"),Fi.forEach(o),pr.forEach(o),Jo=m(t),J=n(t,"DIV",{class:!0});var hr=i(J);v(We.$$.fragment,hr),Sa=m(hr),Ue=n(hr,"P",{});var fr=i(Ue);La=a(fr,"Class for outputs of "),Lt=n(fr,"A",{href:!0});var vi=i(Lt);Aa=a(vi,"MaskFormerModel"),vi.forEach(o),ja=a(fr,". This class returns all the needed hidden states to compute the logits."),fr.forEach(o),hr.forEach(o),Zo=m(t),q=n(t,"DIV",{class:!0});var Qt=i(q);v(Ve.$$.fragment,Qt),Na=m(Qt),Ge=n(Qt,"P",{});var ur=i(Ge);Da=a(ur,"Class for outputs of "),At=n(ur,"A",{href:!0});var wi=i(At);qa=a(wi,"MaskFormerForInstanceSegmentation"),wi.forEach(o),Ha=a(ur,"."),ur.forEach(o),Ra=m(Qt),Z=n(Qt,"P",{});var Xt=i(Z);Ba=a(Xt,"This output can be directly passed to "),jt=n(Xt,"A",{href:!0});var xi=i(jt);Wa=a(xi,"post_process_segmentation()"),xi.forEach(o),Ua=a(Xt,` or
`),Nt=n(Xt,"A",{href:!0});var Mi=i(Nt);Va=a(Mi,"post_process_panoptic_segmentation()"),Mi.forEach(o),Ga=a(Xt," depending on the task. Please, see\n[`~MaskFormerFeatureExtractor] for details regarding usage."),Xt.forEach(o),Qt.forEach(o),er=m(t),ee=n(t,"H2",{class:!0});var gr=i(ee);he=n(gr,"A",{id:!0,class:!0,href:!0});var yi=i(he);fo=n(yi,"SPAN",{});var Ti=i(fo);v(Ke.$$.fragment,Ti),Ti.forEach(o),yi.forEach(o),Ka=m(gr),uo=n(gr,"SPAN",{});var $i=i(uo);Qa=a($i,"MaskFormerConfig"),$i.forEach(o),gr.forEach(o),tr=m(t),$=n(t,"DIV",{class:!0});var z=i($);v(Qe.$$.fragment,z),Xa=m(z),H=n(z,"P",{});var Ie=i(H);Ya=a(Ie,"This is the configuration class to store the configuration of a "),Dt=n(Ie,"A",{href:!0});var Ei=i(Dt);Ja=a(Ei,"MaskFormerModel"),Ei.forEach(o),Za=a(Ie,`. 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
`),Xe=n(Ie,"A",{href:!0,rel:!0});var Ii=i(Xe);es=a(Ii,"facebook/maskformer-swin-base-ade"),Ii.forEach(o),ts=a(Ie,` architecture trained
on `),Ye=n(Ie,"A",{href:!0,rel:!0});var Pi=i(Ye);os=a(Pi,"ADE20k-150"),Pi.forEach(o),rs=a(Ie,"."),Ie.forEach(o),as=m(z),te=n(z,"P",{});var Yt=i(te);ss=a(Yt,"Configuration objects inherit from "),qt=n(Yt,"A",{href:!0});var Oi=i(qt);ns=a(Oi,"PretrainedConfig"),Oi.forEach(o),is=a(Yt,` and can be used to control the model outputs. Read the
documentation from `),Ht=n(Yt,"A",{href:!0});var zi=i(Ht);ds=a(zi,"PretrainedConfig"),zi.forEach(o),ls=a(Yt," for more information."),Yt.forEach(o),cs=m(z),Je=n(z,"P",{});var _r=i(Je);ms=a(_r,"Currently, MaskFormer only supports the "),Rt=n(_r,"A",{href:!0});var Ci=i(Rt);ps=a(Ci,"Swin Transformer"),Ci.forEach(o),hs=a(_r," as backbone."),_r.forEach(o),fs=m(z),v(fe.$$.fragment,z),us=m(z),ue=n(z,"DIV",{class:!0});var kr=i(ue);v(Ze.$$.fragment,kr),gs=m(kr),et=n(kr,"P",{});var br=i(et);_s=a(br,"Instantiate a "),Bt=n(br,"A",{href:!0});var Si=i(Bt);ks=a(Si,"MaskFormerConfig"),Si.forEach(o),bs=a(br,` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),br.forEach(o),kr.forEach(o),Fs=m(z),ge=n(z,"DIV",{class:!0});var Fr=i(ge);v(tt.$$.fragment,Fr),vs=m(Fr),ot=n(Fr,"P",{});var vr=i(ot);ws=a(vr,"Serializes this instance to a Python dictionary. Override the default "),Wt=n(vr,"A",{href:!0});var Li=i(Wt);xs=a(Li,"to_dict()"),Li.forEach(o),Ms=a(vr,"."),vr.forEach(o),Fr.forEach(o),z.forEach(o),or=m(t),oe=n(t,"H2",{class:!0});var wr=i(oe);_e=n(wr,"A",{id:!0,class:!0,href:!0});var Ai=i(_e);go=n(Ai,"SPAN",{});var ji=i(go);v(rt.$$.fragment,ji),ji.forEach(o),Ai.forEach(o),ys=m(wr),_o=n(wr,"SPAN",{});var Ni=i(_o);Ts=a(Ni,"MaskFormerFeatureExtractor"),Ni.forEach(o),wr.forEach(o),rr=m(t),T=n(t,"DIV",{class:!0});var I=i(T);v(at.$$.fragment,I),$s=m(I),ko=n(I,"P",{});var Di=i(ko);Es=a(Di,`Constructs a MaskFormer feature extractor. The feature extractor can be used to prepare image(s) and optional
targets for the model.`),Di.forEach(o),Is=m(I),st=n(I,"P",{});var xr=i(st);Ps=a(xr,"This feature extractor inherits from "),Ut=n(xr,"A",{href:!0});var qi=i(Ut);Os=a(qi,"FeatureExtractionMixin"),qi.forEach(o),zs=a(xr,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),xr.forEach(o),Cs=m(I),j=n(I,"DIV",{class:!0});var Pe=i(j);v(nt.$$.fragment,Pe),Ss=m(Pe),bo=n(Pe,"P",{});var Hi=i(bo);Ls=a(Hi,`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.`),Hi.forEach(o),As=m(Pe),R=n(Pe,"P",{});var Oe=i(R);js=a(Oe,`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
`),Fo=n(Oe,"CODE",{});var Ri=i(Fo);Ns=a(Ri,"segmentation_maps = [[2,6,7,9]]"),Ri.forEach(o),Ds=a(Oe,", the output will contain "),vo=n(Oe,"CODE",{});var Bi=i(vo);qs=a(Bi,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Bi.forEach(o),Hs=a(Oe," (four binary masks) and "),wo=n(Oe,"CODE",{});var Wi=i(wo);Rs=a(Wi,"class_labels = [2,6,7,9]"),Wi.forEach(o),Bs=a(Oe,`, the labels for
each mask.`),Oe.forEach(o),Ws=m(Pe),v(ke.$$.fragment,Pe),Pe.forEach(o),Us=m(I),V=n(I,"DIV",{class:!0});var Jt=i(V);v(it.$$.fragment,Jt),Vs=m(Jt),dt=n(Jt,"P",{});var Mr=i(dt);Gs=a(Mr,"Pad images up to the largest image in a batch and create a corresponding "),xo=n(Mr,"CODE",{});var Ui=i(xo);Ks=a(Ui,"pixel_mask"),Ui.forEach(o),Qs=a(Mr,"."),Mr.forEach(o),Xs=m(Jt),B=n(Jt,"P",{});var ze=i(B);Ys=a(ze,`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(ze,"CODE",{});var Vi=i(Mo);Js=a(Vi,"segmentation_maps = [[2,6,7,9]]"),Vi.forEach(o),Zs=a(ze,", the output will contain "),yo=n(ze,"CODE",{});var Gi=i(yo);en=a(Gi,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Gi.forEach(o),tn=a(ze," (four binary masks) and "),To=n(ze,"CODE",{});var Ki=i(To);on=a(Ki,"class_labels = [2,6,7,9]"),Ki.forEach(o),rn=a(ze,`, the labels for
each mask.`),ze.forEach(o),Jt.forEach(o),an=m(I),be=n(I,"DIV",{class:!0});var yr=i(be);v(lt.$$.fragment,yr),sn=m(yr),ct=n(yr,"P",{});var Tr=i(ct);nn=a(Tr,"Converts the output of "),$o=n(Tr,"CODE",{});var Qi=i($o);dn=a(Qi,"MaskFormerForInstanceSegmentationOutput"),Qi.forEach(o),ln=a(Tr,` into image segmentation predictions. Only
supports PyTorch.`),Tr.forEach(o),yr.forEach(o),cn=m(I),Fe=n(I,"DIV",{class:!0});var $r=i(Fe);v(mt.$$.fragment,$r),mn=m($r),pt=n($r,"P",{});var Er=i(pt);pn=a(Er,"Converts the output of "),Eo=n(Er,"CODE",{});var Xi=i(Eo);hn=a(Xi,"MaskFormerForInstanceSegmentationOutput"),Xi.forEach(o),fn=a(Er,` into semantic segmentation predictions. Only
supports PyTorch.`),Er.forEach(o),$r.forEach(o),un=m(I),ve=n(I,"DIV",{class:!0});var Ir=i(ve);v(ht.$$.fragment,Ir),gn=m(Ir),ft=n(Ir,"P",{});var Pr=i(ft);_n=a(Pr,"Converts the output of "),Io=n(Pr,"CODE",{});var Yi=i(Io);kn=a(Yi,"MaskFormerForInstanceSegmentationOutput"),Yi.forEach(o),bn=a(Pr,` into image panoptic segmentation
predictions. Only supports PyTorch.`),Pr.forEach(o),Ir.forEach(o),I.forEach(o),ar=m(t),re=n(t,"H2",{class:!0});var Or=i(re);we=n(Or,"A",{id:!0,class:!0,href:!0});var Ji=i(we);Po=n(Ji,"SPAN",{});var Zi=i(Po);v(ut.$$.fragment,Zi),Zi.forEach(o),Ji.forEach(o),Fn=m(Or),Oo=n(Or,"SPAN",{});var ed=i(Oo);vn=a(ed,"MaskFormerModel"),ed.forEach(o),Or.forEach(o),sr=m(t),W=n(t,"DIV",{class:!0});var Zt=i(W);v(gt.$$.fragment,Zt),wn=m(Zt),_t=n(Zt,"P",{});var zr=i(_t);xn=a(zr,`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),kt=n(zr,"A",{href:!0,rel:!0});var td=i(kt);Mn=a(td,"torch.nn.Module"),td.forEach(o),yn=a(zr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zr.forEach(o),Tn=m(Zt),N=n(Zt,"DIV",{class:!0});var Ce=i(N);v(bt.$$.fragment,Ce),$n=m(Ce),ae=n(Ce,"P",{});var eo=i(ae);En=a(eo,"The "),Vt=n(eo,"A",{href:!0});var od=i(Vt);In=a(od,"MaskFormerModel"),od.forEach(o),Pn=a(eo," forward method, overrides the "),zo=n(eo,"CODE",{});var rd=i(zo);On=a(rd,"__call__"),rd.forEach(o),zn=a(eo," special method."),eo.forEach(o),Cn=m(Ce),v(xe.$$.fragment,Ce),Sn=m(Ce),v(Me.$$.fragment,Ce),Ce.forEach(o),Zt.forEach(o),nr=m(t),se=n(t,"H2",{class:!0});var Cr=i(se);ye=n(Cr,"A",{id:!0,class:!0,href:!0});var ad=i(ye);Co=n(ad,"SPAN",{});var sd=i(Co);v(Ft.$$.fragment,sd),sd.forEach(o),ad.forEach(o),Ln=m(Cr),So=n(Cr,"SPAN",{});var nd=i(So);An=a(nd,"MaskFormerForInstanceSegmentation"),nd.forEach(o),Cr.forEach(o),ir=m(t),ne=n(t,"DIV",{class:!0});var Sr=i(ne);v(vt.$$.fragment,Sr),jn=m(Sr),D=n(Sr,"DIV",{class:!0});var Se=i(D);v(wt.$$.fragment,Se),Nn=m(Se),ie=n(Se,"P",{});var to=i(ie);Dn=a(to,"The "),Gt=n(to,"A",{href:!0});var id=i(Gt);qn=a(id,"MaskFormerForInstanceSegmentation"),id.forEach(o),Hn=a(to," forward method, overrides the "),Lo=n(to,"CODE",{});var dd=i(Lo);Rn=a(dd,"__call__"),dd.forEach(o),Bn=a(to," special method."),to.forEach(o),Wn=m(Se),v(Te.$$.fragment,Se),Un=m(Se),v($e.$$.fragment,Se),Se.forEach(o),Sr.forEach(o),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(xd)),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(le,"id","overview"),d(le,"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(le,"href","#overview"),d(X,"class","relative group"),d(Ae,"href","https://arxiv.org/abs/2107.06278"),d(Ae,"rel","nofollow"),d(It,"href","detr"),d(Pt,"href","/docs/transformers/pr_17548/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(Ot,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor"),d(zt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation"),d(Ct,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation"),d(St,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(De,"href","https://arxiv.org/abs/2107.06278"),d(De,"rel","nofollow"),d(qe,"width","600"),hd(qe.src,Qn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/maskformer_architecture.png")||d(qe,"src",Qn),d(He,"href","https://huggingface.co/francesco"),d(He,"rel","nofollow"),d(Re,"href","https://github.com/facebookresearch/MaskFormer"),d(Re,"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(Y,"class","relative group"),d(Lt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerModel"),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(At,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),d(jt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_segmentation"),d(Nt,"href","/docs/transformers/pr_17548/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(Dt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerModel"),d(Xe,"href","https://huggingface.co/facebook/maskformer-swin-base-ade"),d(Xe,"rel","nofollow"),d(Ye,"href","https://huggingface.co/datasets/scene_parse_150"),d(Ye,"rel","nofollow"),d(qt,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ht,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),d(Rt,"href","swin"),d(Bt,"href","/docs/transformers/pr_17548/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(Wt,"href","/docs/transformers/pr_17548/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(Ut,"href","/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin"),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(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(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(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(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(we,"id","transformers.MaskFormerModel"),d(we,"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(we,"href","#transformers.MaskFormerModel"),d(re,"class","relative group"),d(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(kt,"rel","nofollow"),d(Vt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerModel"),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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ye,"id","transformers.MaskFormerForInstanceSegmentation"),d(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ye,"href","#transformers.MaskFormerForInstanceSegmentation"),d(se,"class","relative group"),d(Gt,"href","/docs/transformers/pr_17548/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),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(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,k,h),f(t,u,h),e(u,g),e(g,b),w(l,b,null),e(u,_),e(u,O),e(O,Ar),f(t,Ho,h),w(de,t,h),f(t,Ro,h),f(t,X,h),e(X,le),e(le,oo),w(Le,oo,null),e(X,jr),e(X,ro),e(ro,Nr),f(t,Bo,h),f(t,ce,h),e(ce,Dr),e(ce,Ae),e(Ae,qr),e(ce,Hr),f(t,Wo,h),f(t,Tt,h),e(Tt,Rr),f(t,Uo,h),f(t,$t,h),e($t,ao),e(ao,Br),f(t,Vo,h),f(t,Et,h),e(Et,Wr),f(t,Go,h),f(t,A,h),e(A,C),e(C,Ur),e(C,It),e(It,Vr),e(C,Gr),e(C,so),e(so,Kr),e(C,Qr),e(C,Pt),e(Pt,Xr),e(C,Yr),e(C,no),e(no,Jr),e(C,Zr),e(A,ea),e(A,S),e(S,ta),e(S,io),e(io,oa),e(S,ra),e(S,lo),e(lo,aa),e(S,sa),e(S,co),e(co,na),e(S,ia),e(S,je),e(je,da),e(S,la),e(A,ca),e(A,Ne),e(Ne,ma),e(Ne,Ot),e(Ot,pa),e(Ne,ha),e(A,fa),e(A,L),e(L,ua),e(L,zt),e(zt,ga),e(L,_a),e(L,Ct),e(Ct,ka),e(L,ba),e(L,St),e(St,Fa),e(L,va),e(L,mo),e(mo,wa),e(L,xa),f(t,Ko,h),f(t,me,h),e(me,Ma),e(me,De),e(De,ya),e(me,Ta),f(t,Qo,h),f(t,qe,h),f(t,Xo,h),f(t,U,h),e(U,$a),e(U,He),e(He,Ea),e(U,Ia),e(U,Re),e(Re,Pa),e(U,Oa),f(t,Yo,h),f(t,Y,h),e(Y,pe),e(pe,po),w(Be,po,null),e(Y,za),e(Y,ho),e(ho,Ca),f(t,Jo,h),f(t,J,h),w(We,J,null),e(J,Sa),e(J,Ue),e(Ue,La),e(Ue,Lt),e(Lt,Aa),e(Ue,ja),f(t,Zo,h),f(t,q,h),w(Ve,q,null),e(q,Na),e(q,Ge),e(Ge,Da),e(Ge,At),e(At,qa),e(Ge,Ha),e(q,Ra),e(q,Z),e(Z,Ba),e(Z,jt),e(jt,Wa),e(Z,Ua),e(Z,Nt),e(Nt,Va),e(Z,Ga),f(t,er,h),f(t,ee,h),e(ee,he),e(he,fo),w(Ke,fo,null),e(ee,Ka),e(ee,uo),e(uo,Qa),f(t,tr,h),f(t,$,h),w(Qe,$,null),e($,Xa),e($,H),e(H,Ya),e(H,Dt),e(Dt,Ja),e(H,Za),e(H,Xe),e(Xe,es),e(H,ts),e(H,Ye),e(Ye,os),e(H,rs),e($,as),e($,te),e(te,ss),e(te,qt),e(qt,ns),e(te,is),e(te,Ht),e(Ht,ds),e(te,ls),e($,cs),e($,Je),e(Je,ms),e(Je,Rt),e(Rt,ps),e(Je,hs),e($,fs),w(fe,$,null),e($,us),e($,ue),w(Ze,ue,null),e(ue,gs),e(ue,et),e(et,_s),e(et,Bt),e(Bt,ks),e(et,bs),e($,Fs),e($,ge),w(tt,ge,null),e(ge,vs),e(ge,ot),e(ot,ws),e(ot,Wt),e(Wt,xs),e(ot,Ms),f(t,or,h),f(t,oe,h),e(oe,_e),e(_e,go),w(rt,go,null),e(oe,ys),e(oe,_o),e(_o,Ts),f(t,rr,h),f(t,T,h),w(at,T,null),e(T,$s),e(T,ko),e(ko,Es),e(T,Is),e(T,st),e(st,Ps),e(st,Ut),e(Ut,Os),e(st,zs),e(T,Cs),e(T,j),w(nt,j,null),e(j,Ss),e(j,bo),e(bo,Ls),e(j,As),e(j,R),e(R,js),e(R,Fo),e(Fo,Ns),e(R,Ds),e(R,vo),e(vo,qs),e(R,Hs),e(R,wo),e(wo,Rs),e(R,Bs),e(j,Ws),w(ke,j,null),e(T,Us),e(T,V),w(it,V,null),e(V,Vs),e(V,dt),e(dt,Gs),e(dt,xo),e(xo,Ks),e(dt,Qs),e(V,Xs),e(V,B),e(B,Ys),e(B,Mo),e(Mo,Js),e(B,Zs),e(B,yo),e(yo,en),e(B,tn),e(B,To),e(To,on),e(B,rn),e(T,an),e(T,be),w(lt,be,null),e(be,sn),e(be,ct),e(ct,nn),e(ct,$o),e($o,dn),e(ct,ln),e(T,cn),e(T,Fe),w(mt,Fe,null),e(Fe,mn),e(Fe,pt),e(pt,pn),e(pt,Eo),e(Eo,hn),e(pt,fn),e(T,un),e(T,ve),w(ht,ve,null),e(ve,gn),e(ve,ft),e(ft,_n),e(ft,Io),e(Io,kn),e(ft,bn),f(t,ar,h),f(t,re,h),e(re,we),e(we,Po),w(ut,Po,null),e(re,Fn),e(re,Oo),e(Oo,vn),f(t,sr,h),f(t,W,h),w(gt,W,null),e(W,wn),e(W,_t),e(_t,xn),e(_t,kt),e(kt,Mn),e(_t,yn),e(W,Tn),e(W,N),w(bt,N,null),e(N,$n),e(N,ae),e(ae,En),e(ae,Vt),e(Vt,In),e(ae,Pn),e(ae,zo),e(zo,On),e(ae,zn),e(N,Cn),w(xe,N,null),e(N,Sn),w(Me,N,null),f(t,nr,h),f(t,se,h),e(se,ye),e(ye,Co),w(Ft,Co,null),e(se,Ln),e(se,So),e(So,An),f(t,ir,h),f(t,ne,h),w(vt,ne,null),e(ne,jn),e(ne,D),w(wt,D,null),e(D,Nn),e(D,ie),e(ie,Dn),e(ie,Gt),e(Gt,qn),e(ie,Hn),e(ie,Lo),e(Lo,Rn),e(ie,Bn),e(D,Wn),w(Te,D,null),e(D,Un),w($e,D,null),dr=!0},p(t,[h]){const xt={};h&2&&(xt.$$scope={dirty:h,ctx:t}),de.$set(xt);const Ao={};h&2&&(Ao.$$scope={dirty:h,ctx:t}),fe.$set(Ao);const jo={};h&2&&(jo.$$scope={dirty:h,ctx:t}),ke.$set(jo);const No={};h&2&&(No.$$scope={dirty:h,ctx:t}),xe.$set(No);const Mt={};h&2&&(Mt.$$scope={dirty:h,ctx:t}),Me.$set(Mt);const Do={};h&2&&(Do.$$scope={dirty:h,ctx:t}),Te.$set(Do);const qo={};h&2&&(qo.$$scope={dirty:h,ctx:t}),$e.$set(qo)},i(t){dr||(x(l.$$.fragment,t),x(de.$$.fragment,t),x(Le.$$.fragment,t),x(Be.$$.fragment,t),x(We.$$.fragment,t),x(Ve.$$.fragment,t),x(Ke.$$.fragment,t),x(Qe.$$.fragment,t),x(fe.$$.fragment,t),x(Ze.$$.fragment,t),x(tt.$$.fragment,t),x(rt.$$.fragment,t),x(at.$$.fragment,t),x(nt.$$.fragment,t),x(ke.$$.fragment,t),x(it.$$.fragment,t),x(lt.$$.fragment,t),x(mt.$$.fragment,t),x(ht.$$.fragment,t),x(ut.$$.fragment,t),x(gt.$$.fragment,t),x(bt.$$.fragment,t),x(xe.$$.fragment,t),x(Me.$$.fragment,t),x(Ft.$$.fragment,t),x(vt.$$.fragment,t),x(wt.$$.fragment,t),x(Te.$$.fragment,t),x($e.$$.fragment,t),dr=!0)},o(t){M(l.$$.fragment,t),M(de.$$.fragment,t),M(Le.$$.fragment,t),M(Be.$$.fragment,t),M(We.$$.fragment,t),M(Ve.$$.fragment,t),M(Ke.$$.fragment,t),M(Qe.$$.fragment,t),M(fe.$$.fragment,t),M(Ze.$$.fragment,t),M(tt.$$.fragment,t),M(rt.$$.fragment,t),M(at.$$.fragment,t),M(nt.$$.fragment,t),M(ke.$$.fragment,t),M(it.$$.fragment,t),M(lt.$$.fragment,t),M(mt.$$.fragment,t),M(ht.$$.fragment,t),M(ut.$$.fragment,t),M(gt.$$.fragment,t),M(bt.$$.fragment,t),M(xe.$$.fragment,t),M(Me.$$.fragment,t),M(Ft.$$.fragment,t),M(vt.$$.fragment,t),M(wt.$$.fragment,t),M(Te.$$.fragment,t),M($e.$$.fragment,t),dr=!1},d(t){o(p),t&&o(k),t&&o(u),y(l),t&&o(Ho),y(de,t),t&&o(Ro),t&&o(X),y(Le),t&&o(Bo),t&&o(ce),t&&o(Wo),t&&o(Tt),t&&o(Uo),t&&o($t),t&&o(Vo),t&&o(Et),t&&o(Go),t&&o(A),t&&o(Ko),t&&o(me),t&&o(Qo),t&&o(qe),t&&o(Xo),t&&o(U),t&&o(Yo),t&&o(Y),y(Be),t&&o(Jo),t&&o(J),y(We),t&&o(Zo),t&&o(q),y(Ve),t&&o(er),t&&o(ee),y(Ke),t&&o(tr),t&&o($),y(Qe),y(fe),y(Ze),y(tt),t&&o(or),t&&o(oe),y(rt),t&&o(rr),t&&o(T),y(at),y(nt),y(ke),y(it),y(lt),y(mt),y(ht),t&&o(ar),t&&o(re),y(ut),t&&o(sr),t&&o(W),y(gt),y(bt),y(xe),y(Me),t&&o(nr),t&&o(se),y(Ft),t&&o(ir),t&&o(ne),y(vt),y(wt),y(Te),y($e)}}}const xd={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 Md(E){return fd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Od extends ld{constructor(p){super();cd(this,p,Md,wd,md,{})}}export{Od as default,xd as metadata};
