import{S as Yc,i as Jc,s as Zc,e as a,k as d,w as k,t as s,M as ed,c as n,d as o,m,a as i,x as b,h as r,b as l,N as td,G as e,g as f,y as v,q as F,o as w,B as y,v as od,L as jr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fl}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as he}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Or}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as sd}from"../../chunks/PipelineTag-hf-doc-builder.js";function rd(P){let h,T,_,g,M;return{c(){h=a("p"),T=s(`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),_=a("a"),g=s("Github Issue"),M=s("."),this.h()},l(c){h=n(c,"P",{});var u=i(h);T=r(u,`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 `),_=n(u,"A",{href:!0,rel:!0});var j=i(_);g=r(j,"Github Issue"),j.forEach(o),M=r(u,"."),u.forEach(o),this.h()},h(){l(_,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),l(_,"rel","nofollow")},m(c,u){f(c,h,u),e(h,T),e(h,_),e(_,g),e(h,M)},d(c){c&&o(h)}}}function ad(P){let h,T,_,g,M;return g=new Lr({props:{code:`from transformers import MaskFormerConfig, MaskFormerModel

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

# Initializing a model (with random weights) from the facebook/maskformer-swin-base-ade style configuration
model = MaskFormerModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/maskformer-swin-base-ade style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MaskFormerModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=a("p"),T=s("Examples:"),_=d(),k(g.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Examples:"),u.forEach(o),_=m(c),b(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,T),f(c,_,u),v(g,c,u),M=!0},p:jr,i(c){M||(F(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(h),c&&o(_),y(g,c)}}}function nd(P){let h,T,_,g,M;return{c(){h=a("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(u,"CODE",{});var j=i(_);g=r(j,"Module"),j.forEach(o),M=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(c,u){f(c,h,u),e(h,T),e(h,_),e(_,g),e(h,M)},d(c){c&&o(h)}}}function id(P){let h,T,_,g,M;return g=new Lr({props:{code:`from transformers import AutoImageProcessor, MaskFormerModel
from PIL import Image
import requests

# load MaskFormer fine-tuned on ADE20k semantic segmentation
image_processor = AutoImageProcessor.from_pretrained("facebook/maskformer-swin-base-ade")
model = MaskFormerModel.from_pretrained("facebook/maskformer-swin-base-ade")

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

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

# forward pass
outputs = model(**inputs)

# the decoder of MaskFormer outputs hidden states of shape (batch_size, num_queries, hidden_size)
transformer_decoder_last_hidden_state = outputs.transformer_decoder_last_hidden_state
list(transformer_decoder_last_hidden_state.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MaskFormerModel
<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><span class="hljs-comment"># load MaskFormer fine-tuned on ADE20k semantic segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.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>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the decoder of MaskFormer outputs hidden states of shape (batch_size, num_queries, hidden_size)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transformer_decoder_last_hidden_state = outputs.transformer_decoder_last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(transformer_decoder_last_hidden_state.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">100</span>, <span class="hljs-number">256</span>]`}}),{c(){h=a("p"),T=s("Examples:"),_=d(),k(g.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Examples:"),u.forEach(o),_=m(c),b(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,T),f(c,_,u),v(g,c,u),M=!0},p:jr,i(c){M||(F(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(h),c&&o(_),y(g,c)}}}function ld(P){let h,T,_,g,M;return{c(){h=a("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(u,"CODE",{});var j=i(_);g=r(j,"Module"),j.forEach(o),M=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(c,u){f(c,h,u),e(h,T),e(h,_),e(_,g),e(h,M)},d(c){c&&o(h)}}}function cd(P){let h,T,_,g,M;return g=new Lr({props:{code:`from transformers import AutoImageProcessor, MaskFormerForInstanceSegmentation
from PIL import Image
import requests

# load MaskFormer fine-tuned on ADE20k semantic segmentation
image_processor = AutoImageProcessor.from_pretrained("facebook/maskformer-swin-base-ade")
model = MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-base-ade")

url = (
    "https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg"
)
image = Image.open(requests.get(url, stream=True).raw)
inputs = image_processor(images=image, return_tensors="pt")

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 image_processor for postprocessing
predicted_semantic_map = image_processor.post_process_semantic_segmentation(
    outputs, target_sizes=[image.size[::-1]]
)[0]

# we refer to the demo notebooks for visualization (see "Resources" section in the MaskFormer docs)
list(predicted_semantic_map.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, 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><span class="hljs-comment"># load MaskFormer fine-tuned on ADE20k semantic segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-ade&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>url = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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 image_processor for postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_semantic_map = image_processor.post_process_semantic_segmentation(
<span class="hljs-meta">... </span>    outputs, target_sizes=[image.size[::-<span class="hljs-number">1</span>]]
<span class="hljs-meta">... </span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># we refer to the demo notebooks for visualization (see &quot;Resources&quot; section in the MaskFormer docs)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(predicted_semantic_map.shape)
[<span class="hljs-number">512</span>, <span class="hljs-number">683</span>]`}}),{c(){h=a("p"),T=s("Semantic segmentation example:"),_=d(),k(g.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Semantic segmentation example:"),u.forEach(o),_=m(c),b(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,T),f(c,_,u),v(g,c,u),M=!0},p:jr,i(c){M||(F(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(h),c&&o(_),y(g,c)}}}function dd(P){let h,T,_,g,M;return g=new Lr({props:{code:`from transformers import AutoImageProcessor, MaskFormerForInstanceSegmentation
from PIL import Image
import requests

# load MaskFormer fine-tuned on COCO panoptic segmentation
image_processor = AutoImageProcessor.from_pretrained("facebook/maskformer-swin-base-coco")
model = MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-base-coco")

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

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 image_processor for postprocessing
result = image_processor.post_process_panoptic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]

# we refer to the demo notebooks for visualization (see "Resources" section in the MaskFormer docs)
predicted_panoptic_map = result["segmentation"]
list(predicted_panoptic_map.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, 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><span class="hljs-comment"># load MaskFormer fine-tuned on COCO panoptic segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MaskFormerForInstanceSegmentation.from_pretrained(<span class="hljs-string">&quot;facebook/maskformer-swin-base-coco&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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 image_processor for postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>result = image_processor.post_process_panoptic_segmentation(outputs, target_sizes=[image.size[::-<span class="hljs-number">1</span>]])[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># we refer to the demo notebooks for visualization (see &quot;Resources&quot; section in the MaskFormer docs)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_panoptic_map = result[<span class="hljs-string">&quot;segmentation&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(predicted_panoptic_map.shape)
[<span class="hljs-number">480</span>, <span class="hljs-number">640</span>]`}}),{c(){h=a("p"),T=s("Panoptic segmentation example:"),_=d(),k(g.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Panoptic segmentation example:"),u.forEach(o),_=m(c),b(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,T),f(c,_,u),v(g,c,u),M=!0},p:jr,i(c){M||(F(g.$$.fragment,c),M=!0)},o(c){w(g.$$.fragment,c),M=!1},d(c){c&&o(h),c&&o(_),y(g,c)}}}function md(P){let h,T,_,g,M,c,u,j,Ar,ys,fe,Ms,ee,ge,Oo,Ve,Nr,jo,Cr,Ts,ue,Sr,We,Dr,qr,$s,Xt,Rr,xs,Yt,Lo,Ur,Is,Jt,Hr,Es,S,A,Br,Zt,Vr,Wr,Ao,Gr,Kr,eo,Qr,Xr,No,Yr,Jr,Zr,N,ea,Co,ta,oa,So,sa,ra,Do,aa,na,Ge,ia,la,ca,Ke,da,to,ma,pa,ha,C,fa,oo,ga,ua,so,_a,ka,ro,ba,va,qo,Fa,wa,Ps,_e,ya,Qe,Ma,Ta,zs,Xe,wl,Os,K,$a,Ye,xa,Ia,Je,Ea,Pa,js,te,ke,Ro,Ze,za,Uo,Oa,Ls,et,As,ao,tt,ja,ot,La,Aa,Ns,oe,be,Ho,st,Na,Bo,Ca,Cs,se,rt,Sa,at,Da,no,qa,Ra,Ss,U,nt,Ua,it,Ha,io,Ba,Va,Wa,H,Ga,lo,Ka,Qa,co,Xa,Ya,mo,Ja,Za,Ds,re,ve,Vo,lt,en,Wo,tn,qs,I,ct,on,B,sn,po,rn,an,dt,nn,ln,mt,cn,dn,mn,ae,pn,ho,hn,fn,fo,gn,un,_n,pt,kn,go,bn,vn,Fn,Fe,wn,we,ht,yn,ft,Mn,uo,Tn,$n,xn,ye,gt,In,ut,En,_o,Pn,zn,Rs,ne,Me,Go,_t,On,Ko,jn,Us,$,kt,Ln,Qo,An,Nn,bt,Cn,Xo,Sn,Dn,qn,ko,vt,Rn,Q,Ft,Un,wt,Hn,Yo,Bn,Vn,Wn,V,Gn,Jo,Kn,Qn,Zo,Xn,Yn,es,Jn,Zn,ei,Te,yt,ti,Mt,oi,bo,si,ri,ai,$e,Tt,ni,$t,ii,ts,li,ci,di,xe,xt,mi,It,pi,os,hi,fi,Hs,ie,Ie,ss,Et,gi,rs,ui,Bs,E,Pt,_i,vo,zt,ki,X,Ot,bi,jt,vi,as,Fi,wi,yi,W,Mi,ns,Ti,$i,is,xi,Ii,ls,Ei,Pi,zi,Ee,Lt,Oi,At,ji,Fo,Li,Ai,Ni,Pe,Nt,Ci,Ct,Si,cs,Di,qi,Ri,ze,St,Ui,Dt,Hi,ds,Bi,Vi,Vs,le,Oe,ms,qt,Wi,ps,Gi,Ws,G,Rt,Ki,Ut,Qi,Ht,Xi,Yi,Ji,D,Bt,Zi,ce,el,wo,tl,ol,hs,sl,rl,al,je,nl,Le,Gs,de,Ae,fs,Vt,il,gs,ll,Ks,me,Wt,cl,z,Gt,dl,pe,ml,yo,pl,hl,us,fl,gl,ul,Ne,_l,_s,kl,bl,Ce,vl,Se,Qs;return c=new he({}),fe=new Fl({props:{$$slots:{default:[rd]},$$scope:{ctx:P}}}),Ve=new he({}),Ze=new he({}),et=new sd({props:{pipeline:"image-segmentation"}}),st=new he({}),rt=new x({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/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L146"}}),nt=new x({props:{name:"class transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput",anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"class_queries_logits",val:": FloatTensor = None"},{name:"masks_queries_logits",val:": FloatTensor = None"},{name:"auxiliary_logits",val:": FloatTensor = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"pixel_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"transformer_decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.loss",description:`<strong>loss</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
The computed loss, returned when labels are present.`,name:"loss"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.class_queries_logits",description:`<strong>class_queries_logits</strong> (<code>torch.FloatTensor</code>) &#x2014;
A tensor of shape <code>(batch_size, num_queries, num_labels + 1)</code> representing the proposed classes for each
query. Note the <code>+ 1</code> is needed because we incorporate the null class.`,name:"class_queries_logits"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.masks_queries_logits",description:`<strong>masks_queries_logits</strong> (<code>torch.FloatTensor</code>) &#x2014;
A tensor of shape <code>(batch_size, num_queries, height, width)</code> representing the proposed masks for each
query.`,name:"masks_queries_logits"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the encoder model (backbone).`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.pixel_decoder_last_hidden_state",description:`<strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).`,name:"pixel_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.transformer_decoder_last_hidden_state",description:`<strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Last hidden states (final feature map) of the last stage of the transformer decoder model.`,name:"transformer_decoder_last_hidden_state"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called feature maps) of the encoder
model at the output of each stage.`,name:"encoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.pixel_decoder_hidden_states",description:`<strong>pixel_decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called feature maps) of the pixel
decoder model at the output of each stage.`,name:"pixel_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.transformer_decoder_hidden_states",description:`<strong>transformer_decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the transformer decoder at the output
of each stage.`,name:"transformer_decoder_hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.hidden_states",description:`<strong>hidden_states</strong> <code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code>.`,name:"hidden_states"},{anchor:"transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights from Detr&#x2019;s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L189"}}),lt=new he({}),ct=new x({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/v4.27.1/src/transformers/models/maskformer/configuration_maskformer.py#L36",raiseDescription:`
<ul>
<li><code>ValueError</code> \u2014
Raised if the backbone model type selected is not in <code>["swin"]</code> or the decoder model type selected is not
in <code>["detr"]</code></li>
</ul>
`,raiseType:`
<p><code>ValueError</code></p>
`}}),Fe=new Or({props:{anchor:"transformers.MaskFormerConfig.example",$$slots:{default:[ad]},$$scope:{ctx:P}}}),ht=new x({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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/maskformer/configuration_maskformer.py#L183",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a></p>
`}}),gt=new x({props:{name:"to_dict",anchor:"transformers.MaskFormerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/configuration_maskformer.py#L205",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),_t=new he({}),kt=new x({props:{name:"class transformers.MaskFormerImageProcessor",anchor:"transformers.MaskFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"size_divisor",val:": int = 32"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": float = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float]] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float]] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.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.MaskFormerImageProcessor.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.MaskFormerImageProcessor.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.MaskFormerImageProcessor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BILINEAR</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.MaskFormerImageProcessor.size_divisor",description:`<strong>size_divisor</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_divisor"},{anchor:"transformers.MaskFormerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input to a certain <code>scale</code>.`,name:"do_rescale"},{anchor:"transformers.MaskFormerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1/ 255) &#x2014;
Rescale the input by the given factor. Only has an effect if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.MaskFormerImageProcessor.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.MaskFormerImageProcessor.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.MaskFormerImageProcessor.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.MaskFormerImageProcessor.ignore_index",description:`<strong>ignore_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels
denoted with 0 (background) will be replaced with <code>ignore_index</code>.`,name:"ignore_index"},{anchor:"transformers.MaskFormerImageProcessor.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by <code>ignore_index</code>.`,name:"do_reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L337"}}),vt=new x({props:{name:"preprocess",anchor:"transformers.MaskFormerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')], NoneType] = None"},{name:"instance_id_to_semantic_id",val:": typing.Union[typing.Dict[int, int], NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"size_divisor",val:": typing.Optional[int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L652"}}),Ft=new x({props:{name:"encode_inputs",anchor:"transformers.MaskFormerImageProcessor.encode_inputs",parameters:[{name:"pixel_values_list",val:": typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]] = None"},{name:"instance_id_to_semantic_id",val:": typing.Union[typing.List[typing.Dict[int, int]], typing.Dict[int, int], NoneType] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"reduce_labels",val:": bool = False"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.encode_inputs.pixel_values_list",description:`<strong>pixel_values_list</strong> (<code>List[ImageInput]</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.MaskFormerImageProcessor.encode_inputs.segmentation_maps",description:`<strong>segmentation_maps</strong> (<code>ImageInput</code>, <em>optional</em>) &#x2014;
The corresponding semantic segmentation maps with the pixel-wise annotations.</p>
<p>(<code>bool</code>, <em>optional</em>, defaults to <code>True</code>):
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:"segmentation_maps"},{anchor:"transformers.MaskFormerImageProcessor.encode_inputs.instance_id_to_semantic_id",description:`<strong>instance_id_to_semantic_id</strong> (<code>List[Dict[int, int]]</code> or <code>Dict[int, int]</code>, <em>optional</em>) &#x2014;
A mapping between object instance ids and class ids. If passed, <code>segmentation_maps</code> is treated as an
instance segmentation map where each pixel represents an instance id. Can be provided as a single
dictionary with a global/dataset-level mapping or as a list of dictionaries (one per image), to map
instance ids in each image separately.`,name:"instance_id_to_semantic_id"},{anchor:"transformers.MaskFormerImageProcessor.encode_inputs.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.27.1/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/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L817",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/image_processor#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>=True</code> or if <code>pixel_mask</code> is in
<code>self.model_input_names</code>).</li>
<li><strong>mask_labels</strong> \u2014 Optional list of mask labels of shape <code>(labels, height, width)</code> to be fed to a model
(when <code>annotations</code> are provided).</li>
<li><strong>class_labels</strong> \u2014 Optional list of class labels of shape <code>(labels)</code> to be fed to a model (when
<code>annotations</code> are provided). They identify the labels of <code>mask_labels</code>, e.g. the label of
<code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),yt=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MaskFormerImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L963",returnDescription:`
<p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width)
corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each
<code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p><code>List[torch.Tensor]</code></p>
`}}),Tt=new x({props:{name:"post_process_instance_segmentation",anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"},{name:"return_binary_maps",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE) format.`,name:"return_coco_annotation"},{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.return_binary_maps",description:`<strong>return_binary_maps</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, segmentation maps are returned as a concatenated tensor of binary segmentation maps
(one per detected instance).`,name:"return_binary_maps"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1013",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to
<code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 An integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),xt=new x({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = None"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.label_ids_to_fuse",description:`<strong>label_ids_to_fuse</strong> (<code>Set[int]</code>, <em>optional</em>) &#x2014;
The labels in this state will have all their instances be fused together. For instance we could say
there can only be one sky in an image, but several persons, so the label ID for sky would be in that
set, but not the one for person.`,name:"label_ids_to_fuse"},{anchor:"transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction in batch. If left to None, predictions will not be
resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1126",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code>, set
to <code>None</code> if no mask if found above <code>threshold</code>. If <code>target_sizes</code> is specified, segmentation is resized
to the corresponding <code>target_sizes</code> entry.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 an integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>was_fused</strong> \u2014 a boolean, <code>True</code> if <code>label_id</code> was in <code>label_ids_to_fuse</code>, <code>False</code> otherwise.
Multiple instances of the same class / label were fused and assigned a single <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Et=new he({}),Pt=new x({props:{name:"class transformers.MaskFormerFeatureExtractor",anchor:"transformers.MaskFormerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/feature_extraction_maskformer.py#L26"}}),zt=new x({props:{name:"__call__",anchor:"transformers.MaskFormerFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L564"}}),Ot=new x({props:{name:"encode_inputs",anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs",parameters:[{name:"pixel_values_list",val:": typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]] = None"},{name:"instance_id_to_semantic_id",val:": typing.Union[typing.List[typing.Dict[int, int]], typing.Dict[int, int], NoneType] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"reduce_labels",val:": bool = False"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.pixel_values_list",description:`<strong>pixel_values_list</strong> (<code>List[ImageInput]</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>ImageInput</code>, <em>optional</em>) &#x2014;
The corresponding semantic segmentation maps with the pixel-wise annotations.</p>
<p>(<code>bool</code>, <em>optional</em>, defaults to <code>True</code>):
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:"segmentation_maps"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.instance_id_to_semantic_id",description:`<strong>instance_id_to_semantic_id</strong> (<code>List[Dict[int, int]]</code> or <code>Dict[int, int]</code>, <em>optional</em>) &#x2014;
A mapping between object instance ids and class ids. If passed, <code>segmentation_maps</code> is treated as an
instance segmentation map where each pixel represents an instance id. Can be provided as a single
dictionary with a global/dataset-level mapping or as a list of dictionaries (one per image), to map
instance ids in each image separately.`,name:"instance_id_to_semantic_id"},{anchor:"transformers.MaskFormerFeatureExtractor.encode_inputs.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.27.1/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/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L817",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/image_processor#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>=True</code> or if <code>pixel_mask</code> is in
<code>self.model_input_names</code>).</li>
<li><strong>mask_labels</strong> \u2014 Optional list of mask labels of shape <code>(labels, height, width)</code> to be fed to a model
(when <code>annotations</code> are provided).</li>
<li><strong>class_labels</strong> \u2014 Optional list of class labels of shape <code>(labels)</code> to be fed to a model (when
<code>annotations</code> are provided). They identify the labels of <code>mask_labels</code>, e.g. the label of
<code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),Lt=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L963",returnDescription:`
<p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width)
corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each
<code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p><code>List[torch.Tensor]</code></p>
`}}),Nt=new x({props:{name:"post_process_instance_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"},{name:"return_binary_maps",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE) format.`,name:"return_coco_annotation"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation.return_binary_maps",description:`<strong>return_binary_maps</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, segmentation maps are returned as a concatenated tensor of binary segmentation maps
(one per detected instance).`,name:"return_binary_maps"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1013",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to
<code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 An integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),St=new x({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = None"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"}],parametersDescription:[{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
The overlap mask area threshold to merge or discard small disconnected parts within each binary
instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.label_ids_to_fuse",description:`<strong>label_ids_to_fuse</strong> (<code>Set[int]</code>, <em>optional</em>) &#x2014;
The labels in this state will have all their instances be fused together. For instance we could say
there can only be one sky in an image, but several persons, so the label ID for sky would be in that
set, but not the one for person.`,name:"label_ids_to_fuse"},{anchor:"transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction in batch. If left to None, predictions will not be
resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1126",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code>, set
to <code>None</code> if no mask if found above <code>threshold</code>. If <code>target_sizes</code> is specified, segmentation is resized
to the corresponding <code>target_sizes</code> entry.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 an integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>was_fused</strong> \u2014 a boolean, <code>True</code> if <code>label_id</code> was in <code>label_ids_to_fuse</code>, <code>False</code> otherwise.
Multiple instances of the same class / label were fused and assigned a single <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),qt=new he({}),Rt=new x({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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L1537"}}),Bt=new x({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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.__call__">MaskFormerImageProcessor.<strong>call</strong>()</a> 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/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L1547",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new Fl({props:{$$slots:{default:[nd]},$$scope:{ctx:P}}}),Le=new Or({props:{anchor:"transformers.MaskFormerModel.forward.example",$$slots:{default:[id]},$$scope:{ctx:P}}}),Vt=new he({}),Wt=new x({props:{name:"class transformers.MaskFormerForInstanceSegmentation",anchor:"transformers.MaskFormerForInstanceSegmentation",parameters:[{name:"config",val:": MaskFormerConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L1634"}}),Gt=new x({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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.__call__">MaskFormerImageProcessor.<strong>call</strong>()</a> 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/v4.27.1/src/transformers/models/maskformer/modeling_maskformer.py#L1715",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.Tensor</code>, <em>optional</em>) \u2014 The computed loss, returned when labels are present.</li>
<li><strong>class_queries_logits</strong> (<code>torch.FloatTensor</code>) \u2014 A tensor of shape <code>(batch_size, num_queries, num_labels + 1)</code> representing the proposed classes for each
query. Note the <code>+ 1</code> is needed because we incorporate the null class.</li>
<li><strong>masks_queries_logits</strong> (<code>torch.FloatTensor</code>) \u2014 A tensor of shape <code>(batch_size, num_queries, height, width)</code> representing the proposed masks for each
query.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the encoder model (backbone).</li>
<li><strong>pixel_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Last hidden states (final feature map) of the last stage of the pixel decoder model (FPN).</li>
<li><strong>transformer_decoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Last hidden states (final feature map) of the last stage of the transformer decoder model.</li>
<li><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called feature maps) of the encoder
model at the output of each stage.</li>
<li><strong>pixel_decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called feature maps) of the pixel
decoder model at the output of each stage.</li>
<li><strong>transformer_decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the transformer decoder at the output
of each stage.</li>
<li><strong>hidden_states</strong> <code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> containing <code>encoder_hidden_states</code>, <code>pixel_decoder_hidden_states</code> and
<code>decoder_hidden_states</code>.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights from Detr\u2019s decoder after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput"
>transformers.models.maskformer.modeling_maskformer.MaskFormerForInstanceSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new Fl({props:{$$slots:{default:[ld]},$$scope:{ctx:P}}}),Ce=new Or({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example",$$slots:{default:[cd]},$$scope:{ctx:P}}}),Se=new Or({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example-2",$$slots:{default:[dd]},$$scope:{ctx:P}}}),{c(){h=a("meta"),T=d(),_=a("h1"),g=a("a"),M=a("span"),k(c.$$.fragment),u=d(),j=a("span"),Ar=s("MaskFormer"),ys=d(),k(fe.$$.fragment),Ms=d(),ee=a("h2"),ge=a("a"),Oo=a("span"),k(Ve.$$.fragment),Nr=d(),jo=a("span"),Cr=s("Overview"),Ts=d(),ue=a("p"),Sr=s("The MaskFormer model was proposed in "),We=a("a"),Dr=s("Per-Pixel Classification is Not All You Need for Semantic Segmentation"),qr=s(" by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),$s=d(),Xt=a("p"),Rr=s("The abstract from the paper is the following:"),xs=d(),Yt=a("p"),Lo=a("em"),Ur=s("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."),Is=d(),Jt=a("p"),Hr=s("Tips:"),Es=d(),S=a("ul"),A=a("li"),Br=s("MaskFormer\u2019s Transformer decoder is identical to the decoder of "),Zt=a("a"),Vr=s("DETR"),Wr=s(". 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 "),Ao=a("code"),Gr=s("use_auxilary_loss"),Kr=s(" of "),eo=a("a"),Qr=s("MaskFormerConfig"),Xr=s(" to "),No=a("code"),Yr=s("True"),Jr=s(", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),Zr=d(),N=a("li"),ea=s(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Co=a("code"),ta=s("get_num_masks"),oa=s(" function inside in the "),So=a("code"),sa=s("MaskFormerLoss"),ra=s(" class of "),Do=a("code"),aa=s("modeling_maskformer.py"),na=s(`. 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 `),Ge=a("a"),ia=s("here"),la=s("."),ca=d(),Ke=a("li"),da=s("One can use "),to=a("a"),ma=s("MaskFormerImageProcessor"),pa=s(" to prepare images for the model and optional targets for the model."),ha=d(),C=a("li"),fa=s("To get the final segmentation, depending on the task, you can call "),oo=a("a"),ga=s("post_process_semantic_segmentation()"),ua=s(" or "),so=a("a"),_a=s("post_process_panoptic_segmentation()"),ka=s(". Both tasks can be solved using "),ro=a("a"),ba=s("MaskFormerForInstanceSegmentation"),va=s(" output, panoptic segmentation accepts an optional "),qo=a("code"),Fa=s("label_ids_to_fuse"),wa=s(" argument to fuse instances of the target object/s (e.g. sky) together."),Ps=d(),_e=a("p"),ya=s("The figure below illustrates the architecture of MaskFormer. Taken from the "),Qe=a("a"),Ma=s("original paper"),Ta=s("."),zs=d(),Xe=a("img"),Os=d(),K=a("p"),$a=s("This model was contributed by "),Ye=a("a"),xa=s("francesco"),Ia=s(". The original code can be found "),Je=a("a"),Ea=s("here"),Pa=s("."),js=d(),te=a("h2"),ke=a("a"),Ro=a("span"),k(Ze.$$.fragment),za=d(),Uo=a("span"),Oa=s("Resources"),Ls=d(),k(et.$$.fragment),As=d(),ao=a("ul"),tt=a("li"),ja=s("All notebooks that illustrate inference as well as fine-tuning on custom data with MaskFormer can be found "),ot=a("a"),La=s("here"),Aa=s("."),Ns=d(),oe=a("h2"),be=a("a"),Ho=a("span"),k(st.$$.fragment),Na=d(),Bo=a("span"),Ca=s("MaskFormer specific outputs"),Cs=d(),se=a("div"),k(rt.$$.fragment),Sa=d(),at=a("p"),Da=s("Class for outputs of "),no=a("a"),qa=s("MaskFormerModel"),Ra=s(". This class returns all the needed hidden states to compute the logits."),Ss=d(),U=a("div"),k(nt.$$.fragment),Ua=d(),it=a("p"),Ha=s("Class for outputs of "),io=a("a"),Ba=s("MaskFormerForInstanceSegmentation"),Va=s("."),Wa=d(),H=a("p"),Ga=s("This output can be directly passed to "),lo=a("a"),Ka=s("post_process_semantic_segmentation()"),Qa=s(` or or
`),co=a("a"),Xa=s("post_process_instance_segmentation()"),Ya=s(` or
`),mo=a("a"),Ja=s("post_process_panoptic_segmentation()"),Za=s(" depending on the task. Please, see\n[`~MaskFormerImageProcessor] for details regarding usage."),Ds=d(),re=a("h2"),ve=a("a"),Vo=a("span"),k(lt.$$.fragment),en=d(),Wo=a("span"),tn=s("MaskFormerConfig"),qs=d(),I=a("div"),k(ct.$$.fragment),on=d(),B=a("p"),sn=s("This is the configuration class to store the configuration of a "),po=a("a"),rn=s("MaskFormerModel"),an=s(`. 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
`),dt=a("a"),nn=s("facebook/maskformer-swin-base-ade"),ln=s(` architecture trained
on `),mt=a("a"),cn=s("ADE20k-150"),dn=s("."),mn=d(),ae=a("p"),pn=s("Configuration objects inherit from "),ho=a("a"),hn=s("PretrainedConfig"),fn=s(` and can be used to control the model outputs. Read the
documentation from `),fo=a("a"),gn=s("PretrainedConfig"),un=s(" for more information."),_n=d(),pt=a("p"),kn=s("Currently, MaskFormer only supports the "),go=a("a"),bn=s("Swin Transformer"),vn=s(" as backbone."),Fn=d(),k(Fe.$$.fragment),wn=d(),we=a("div"),k(ht.$$.fragment),yn=d(),ft=a("p"),Mn=s("Instantiate a "),uo=a("a"),Tn=s("MaskFormerConfig"),$n=s(` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),xn=d(),ye=a("div"),k(gt.$$.fragment),In=d(),ut=a("p"),En=s("Serializes this instance to a Python dictionary. Override the default "),_o=a("a"),Pn=s("to_dict()"),zn=s("."),Rs=d(),ne=a("h2"),Me=a("a"),Go=a("span"),k(_t.$$.fragment),On=d(),Ko=a("span"),jn=s("MaskFormerImageProcessor"),Us=d(),$=a("div"),k(kt.$$.fragment),Ln=d(),Qo=a("p"),An=s(`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),Nn=d(),bt=a("p"),Cn=s("This image processor inherits from "),Xo=a("code"),Sn=s("BaseImageProcessor"),Dn=s(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),qn=d(),ko=a("div"),k(vt.$$.fragment),Rn=d(),Q=a("div"),k(Ft.$$.fragment),Un=d(),wt=a("p"),Hn=s("Pad images up to the largest image in a batch and create a corresponding "),Yo=a("code"),Bn=s("pixel_mask"),Vn=s("."),Wn=d(),V=a("p"),Gn=s(`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
`),Jo=a("code"),Kn=s("segmentation_maps = [[2,6,7,9]]"),Qn=s(", the output will contain "),Zo=a("code"),Xn=s("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Yn=s(" (four binary masks) and "),es=a("code"),Jn=s("class_labels = [2,6,7,9]"),Zn=s(`, the labels for
each mask.`),ei=d(),Te=a("div"),k(yt.$$.fragment),ti=d(),Mt=a("p"),oi=s("Converts the output of "),bo=a("a"),si=s("MaskFormerForInstanceSegmentation"),ri=s(` into semantic segmentation maps. Only supports
PyTorch.`),ai=d(),$e=a("div"),k(Tt.$$.fragment),ni=d(),$t=a("p"),ii=s("Converts the output of "),ts=a("code"),li=s("MaskFormerForInstanceSegmentationOutput"),ci=s(` into instance segmentation predictions. Only
supports PyTorch.`),di=d(),xe=a("div"),k(xt.$$.fragment),mi=d(),It=a("p"),pi=s("Converts the output of "),os=a("code"),hi=s("MaskFormerForInstanceSegmentationOutput"),fi=s(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Hs=d(),ie=a("h2"),Ie=a("a"),ss=a("span"),k(Et.$$.fragment),gi=d(),rs=a("span"),ui=s("MaskFormerFeatureExtractor"),Bs=d(),E=a("div"),k(Pt.$$.fragment),_i=d(),vo=a("div"),k(zt.$$.fragment),ki=d(),X=a("div"),k(Ot.$$.fragment),bi=d(),jt=a("p"),vi=s("Pad images up to the largest image in a batch and create a corresponding "),as=a("code"),Fi=s("pixel_mask"),wi=s("."),yi=d(),W=a("p"),Mi=s(`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
`),ns=a("code"),Ti=s("segmentation_maps = [[2,6,7,9]]"),$i=s(", the output will contain "),is=a("code"),xi=s("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Ii=s(" (four binary masks) and "),ls=a("code"),Ei=s("class_labels = [2,6,7,9]"),Pi=s(`, the labels for
each mask.`),zi=d(),Ee=a("div"),k(Lt.$$.fragment),Oi=d(),At=a("p"),ji=s("Converts the output of "),Fo=a("a"),Li=s("MaskFormerForInstanceSegmentation"),Ai=s(` into semantic segmentation maps. Only supports
PyTorch.`),Ni=d(),Pe=a("div"),k(Nt.$$.fragment),Ci=d(),Ct=a("p"),Si=s("Converts the output of "),cs=a("code"),Di=s("MaskFormerForInstanceSegmentationOutput"),qi=s(` into instance segmentation predictions. Only
supports PyTorch.`),Ri=d(),ze=a("div"),k(St.$$.fragment),Ui=d(),Dt=a("p"),Hi=s("Converts the output of "),ds=a("code"),Bi=s("MaskFormerForInstanceSegmentationOutput"),Vi=s(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Vs=d(),le=a("h2"),Oe=a("a"),ms=a("span"),k(qt.$$.fragment),Wi=d(),ps=a("span"),Gi=s("MaskFormerModel"),Ws=d(),G=a("div"),k(Rt.$$.fragment),Ki=d(),Ut=a("p"),Qi=s(`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ht=a("a"),Xi=s("torch.nn.Module"),Yi=s(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ji=d(),D=a("div"),k(Bt.$$.fragment),Zi=d(),ce=a("p"),el=s("The "),wo=a("a"),tl=s("MaskFormerModel"),ol=s(" forward method, overrides the "),hs=a("code"),sl=s("__call__"),rl=s(" special method."),al=d(),k(je.$$.fragment),nl=d(),k(Le.$$.fragment),Gs=d(),de=a("h2"),Ae=a("a"),fs=a("span"),k(Vt.$$.fragment),il=d(),gs=a("span"),ll=s("MaskFormerForInstanceSegmentation"),Ks=d(),me=a("div"),k(Wt.$$.fragment),cl=d(),z=a("div"),k(Gt.$$.fragment),dl=d(),pe=a("p"),ml=s("The "),yo=a("a"),pl=s("MaskFormerForInstanceSegmentation"),hl=s(" forward method, overrides the "),us=a("code"),fl=s("__call__"),gl=s(" special method."),ul=d(),k(Ne.$$.fragment),_l=d(),_s=a("p"),kl=s("Examples:"),bl=d(),k(Ce.$$.fragment),vl=d(),k(Se.$$.fragment),this.h()},l(t){const p=ed('[data-svelte="svelte-1phssyn"]',document.head);h=n(p,"META",{name:!0,content:!0}),p.forEach(o),T=m(t),_=n(t,"H1",{class:!0});var Kt=i(_);g=n(Kt,"A",{id:!0,class:!0,href:!0});var ks=i(g);M=n(ks,"SPAN",{});var bs=i(M);b(c.$$.fragment,bs),bs.forEach(o),ks.forEach(o),u=m(Kt),j=n(Kt,"SPAN",{});var vs=i(j);Ar=r(vs,"MaskFormer"),vs.forEach(o),Kt.forEach(o),ys=m(t),b(fe.$$.fragment,t),Ms=m(t),ee=n(t,"H2",{class:!0});var Qt=i(ee);ge=n(Qt,"A",{id:!0,class:!0,href:!0});var Fs=i(ge);Oo=n(Fs,"SPAN",{});var ws=i(Oo);b(Ve.$$.fragment,ws),ws.forEach(o),Fs.forEach(o),Nr=m(Qt),jo=n(Qt,"SPAN",{});var yl=i(jo);Cr=r(yl,"Overview"),yl.forEach(o),Qt.forEach(o),Ts=m(t),ue=n(t,"P",{});var Xs=i(ue);Sr=r(Xs,"The MaskFormer model was proposed in "),We=n(Xs,"A",{href:!0,rel:!0});var Ml=i(We);Dr=r(Ml,"Per-Pixel Classification is Not All You Need for Semantic Segmentation"),Ml.forEach(o),qr=r(Xs," by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),Xs.forEach(o),$s=m(t),Xt=n(t,"P",{});var Tl=i(Xt);Rr=r(Tl,"The abstract from the paper is the following:"),Tl.forEach(o),xs=m(t),Yt=n(t,"P",{});var $l=i(Yt);Lo=n($l,"EM",{});var xl=i(Lo);Ur=r(xl,"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."),xl.forEach(o),$l.forEach(o),Is=m(t),Jt=n(t,"P",{});var Il=i(Jt);Hr=r(Il,"Tips:"),Il.forEach(o),Es=m(t),S=n(t,"UL",{});var De=i(S);A=n(De,"LI",{});var Y=i(A);Br=r(Y,"MaskFormer\u2019s Transformer decoder is identical to the decoder of "),Zt=n(Y,"A",{href:!0});var El=i(Zt);Vr=r(El,"DETR"),El.forEach(o),Wr=r(Y,". 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 "),Ao=n(Y,"CODE",{});var Pl=i(Ao);Gr=r(Pl,"use_auxilary_loss"),Pl.forEach(o),Kr=r(Y," of "),eo=n(Y,"A",{href:!0});var zl=i(eo);Qr=r(zl,"MaskFormerConfig"),zl.forEach(o),Xr=r(Y," to "),No=n(Y,"CODE",{});var Ol=i(No);Yr=r(Ol,"True"),Ol.forEach(o),Jr=r(Y,", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),Y.forEach(o),Zr=m(De),N=n(De,"LI",{});var J=i(N);ea=r(J,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Co=n(J,"CODE",{});var jl=i(Co);ta=r(jl,"get_num_masks"),jl.forEach(o),oa=r(J," function inside in the "),So=n(J,"CODE",{});var Ll=i(So);sa=r(Ll,"MaskFormerLoss"),Ll.forEach(o),ra=r(J," class of "),Do=n(J,"CODE",{});var Al=i(Do);aa=r(Al,"modeling_maskformer.py"),Al.forEach(o),na=r(J,`. 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 `),Ge=n(J,"A",{href:!0,rel:!0});var Nl=i(Ge);ia=r(Nl,"here"),Nl.forEach(o),la=r(J,"."),J.forEach(o),ca=m(De),Ke=n(De,"LI",{});var Ys=i(Ke);da=r(Ys,"One can use "),to=n(Ys,"A",{href:!0});var Cl=i(to);ma=r(Cl,"MaskFormerImageProcessor"),Cl.forEach(o),pa=r(Ys," to prepare images for the model and optional targets for the model."),Ys.forEach(o),ha=m(De),C=n(De,"LI",{});var Z=i(C);fa=r(Z,"To get the final segmentation, depending on the task, you can call "),oo=n(Z,"A",{href:!0});var Sl=i(oo);ga=r(Sl,"post_process_semantic_segmentation()"),Sl.forEach(o),ua=r(Z," or "),so=n(Z,"A",{href:!0});var Dl=i(so);_a=r(Dl,"post_process_panoptic_segmentation()"),Dl.forEach(o),ka=r(Z,". Both tasks can be solved using "),ro=n(Z,"A",{href:!0});var ql=i(ro);ba=r(ql,"MaskFormerForInstanceSegmentation"),ql.forEach(o),va=r(Z," output, panoptic segmentation accepts an optional "),qo=n(Z,"CODE",{});var Rl=i(qo);Fa=r(Rl,"label_ids_to_fuse"),Rl.forEach(o),wa=r(Z," argument to fuse instances of the target object/s (e.g. sky) together."),Z.forEach(o),De.forEach(o),Ps=m(t),_e=n(t,"P",{});var Js=i(_e);ya=r(Js,"The figure below illustrates the architecture of MaskFormer. Taken from the "),Qe=n(Js,"A",{href:!0,rel:!0});var Ul=i(Qe);Ma=r(Ul,"original paper"),Ul.forEach(o),Ta=r(Js,"."),Js.forEach(o),zs=m(t),Xe=n(t,"IMG",{width:!0,src:!0}),Os=m(t),K=n(t,"P",{});var Mo=i(K);$a=r(Mo,"This model was contributed by "),Ye=n(Mo,"A",{href:!0,rel:!0});var Hl=i(Ye);xa=r(Hl,"francesco"),Hl.forEach(o),Ia=r(Mo,". The original code can be found "),Je=n(Mo,"A",{href:!0,rel:!0});var Bl=i(Je);Ea=r(Bl,"here"),Bl.forEach(o),Pa=r(Mo,"."),Mo.forEach(o),js=m(t),te=n(t,"H2",{class:!0});var Zs=i(te);ke=n(Zs,"A",{id:!0,class:!0,href:!0});var Vl=i(ke);Ro=n(Vl,"SPAN",{});var Wl=i(Ro);b(Ze.$$.fragment,Wl),Wl.forEach(o),Vl.forEach(o),za=m(Zs),Uo=n(Zs,"SPAN",{});var Gl=i(Uo);Oa=r(Gl,"Resources"),Gl.forEach(o),Zs.forEach(o),Ls=m(t),b(et.$$.fragment,t),As=m(t),ao=n(t,"UL",{});var Kl=i(ao);tt=n(Kl,"LI",{});var er=i(tt);ja=r(er,"All notebooks that illustrate inference as well as fine-tuning on custom data with MaskFormer can be found "),ot=n(er,"A",{href:!0,rel:!0});var Ql=i(ot);La=r(Ql,"here"),Ql.forEach(o),Aa=r(er,"."),er.forEach(o),Kl.forEach(o),Ns=m(t),oe=n(t,"H2",{class:!0});var tr=i(oe);be=n(tr,"A",{id:!0,class:!0,href:!0});var Xl=i(be);Ho=n(Xl,"SPAN",{});var Yl=i(Ho);b(st.$$.fragment,Yl),Yl.forEach(o),Xl.forEach(o),Na=m(tr),Bo=n(tr,"SPAN",{});var Jl=i(Bo);Ca=r(Jl,"MaskFormer specific outputs"),Jl.forEach(o),tr.forEach(o),Cs=m(t),se=n(t,"DIV",{class:!0});var or=i(se);b(rt.$$.fragment,or),Sa=m(or),at=n(or,"P",{});var sr=i(at);Da=r(sr,"Class for outputs of "),no=n(sr,"A",{href:!0});var Zl=i(no);qa=r(Zl,"MaskFormerModel"),Zl.forEach(o),Ra=r(sr,". This class returns all the needed hidden states to compute the logits."),sr.forEach(o),or.forEach(o),Ss=m(t),U=n(t,"DIV",{class:!0});var To=i(U);b(nt.$$.fragment,To),Ua=m(To),it=n(To,"P",{});var rr=i(it);Ha=r(rr,"Class for outputs of "),io=n(rr,"A",{href:!0});var ec=i(io);Ba=r(ec,"MaskFormerForInstanceSegmentation"),ec.forEach(o),Va=r(rr,"."),rr.forEach(o),Wa=m(To),H=n(To,"P",{});var qe=i(H);Ga=r(qe,"This output can be directly passed to "),lo=n(qe,"A",{href:!0});var tc=i(lo);Ka=r(tc,"post_process_semantic_segmentation()"),tc.forEach(o),Qa=r(qe,` or or
`),co=n(qe,"A",{href:!0});var oc=i(co);Xa=r(oc,"post_process_instance_segmentation()"),oc.forEach(o),Ya=r(qe,` or
`),mo=n(qe,"A",{href:!0});var sc=i(mo);Ja=r(sc,"post_process_panoptic_segmentation()"),sc.forEach(o),Za=r(qe," depending on the task. Please, see\n[`~MaskFormerImageProcessor] for details regarding usage."),qe.forEach(o),To.forEach(o),Ds=m(t),re=n(t,"H2",{class:!0});var ar=i(re);ve=n(ar,"A",{id:!0,class:!0,href:!0});var rc=i(ve);Vo=n(rc,"SPAN",{});var ac=i(Vo);b(lt.$$.fragment,ac),ac.forEach(o),rc.forEach(o),en=m(ar),Wo=n(ar,"SPAN",{});var nc=i(Wo);tn=r(nc,"MaskFormerConfig"),nc.forEach(o),ar.forEach(o),qs=m(t),I=n(t,"DIV",{class:!0});var L=i(I);b(ct.$$.fragment,L),on=m(L),B=n(L,"P",{});var Re=i(B);sn=r(Re,"This is the configuration class to store the configuration of a "),po=n(Re,"A",{href:!0});var ic=i(po);rn=r(ic,"MaskFormerModel"),ic.forEach(o),an=r(Re,`. 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
`),dt=n(Re,"A",{href:!0,rel:!0});var lc=i(dt);nn=r(lc,"facebook/maskformer-swin-base-ade"),lc.forEach(o),ln=r(Re,` architecture trained
on `),mt=n(Re,"A",{href:!0,rel:!0});var cc=i(mt);cn=r(cc,"ADE20k-150"),cc.forEach(o),dn=r(Re,"."),Re.forEach(o),mn=m(L),ae=n(L,"P",{});var $o=i(ae);pn=r($o,"Configuration objects inherit from "),ho=n($o,"A",{href:!0});var dc=i(ho);hn=r(dc,"PretrainedConfig"),dc.forEach(o),fn=r($o,` and can be used to control the model outputs. Read the
documentation from `),fo=n($o,"A",{href:!0});var mc=i(fo);gn=r(mc,"PretrainedConfig"),mc.forEach(o),un=r($o," for more information."),$o.forEach(o),_n=m(L),pt=n(L,"P",{});var nr=i(pt);kn=r(nr,"Currently, MaskFormer only supports the "),go=n(nr,"A",{href:!0});var pc=i(go);bn=r(pc,"Swin Transformer"),pc.forEach(o),vn=r(nr," as backbone."),nr.forEach(o),Fn=m(L),b(Fe.$$.fragment,L),wn=m(L),we=n(L,"DIV",{class:!0});var ir=i(we);b(ht.$$.fragment,ir),yn=m(ir),ft=n(ir,"P",{});var lr=i(ft);Mn=r(lr,"Instantiate a "),uo=n(lr,"A",{href:!0});var hc=i(uo);Tn=r(hc,"MaskFormerConfig"),hc.forEach(o),$n=r(lr,` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),lr.forEach(o),ir.forEach(o),xn=m(L),ye=n(L,"DIV",{class:!0});var cr=i(ye);b(gt.$$.fragment,cr),In=m(cr),ut=n(cr,"P",{});var dr=i(ut);En=r(dr,"Serializes this instance to a Python dictionary. Override the default "),_o=n(dr,"A",{href:!0});var fc=i(_o);Pn=r(fc,"to_dict()"),fc.forEach(o),zn=r(dr,"."),dr.forEach(o),cr.forEach(o),L.forEach(o),Rs=m(t),ne=n(t,"H2",{class:!0});var mr=i(ne);Me=n(mr,"A",{id:!0,class:!0,href:!0});var gc=i(Me);Go=n(gc,"SPAN",{});var uc=i(Go);b(_t.$$.fragment,uc),uc.forEach(o),gc.forEach(o),On=m(mr),Ko=n(mr,"SPAN",{});var _c=i(Ko);jn=r(_c,"MaskFormerImageProcessor"),_c.forEach(o),mr.forEach(o),Us=m(t),$=n(t,"DIV",{class:!0});var O=i($);b(kt.$$.fragment,O),Ln=m(O),Qo=n(O,"P",{});var kc=i(Qo);An=r(kc,`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),kc.forEach(o),Nn=m(O),bt=n(O,"P",{});var pr=i(bt);Cn=r(pr,"This image processor inherits from "),Xo=n(pr,"CODE",{});var bc=i(Xo);Sn=r(bc,"BaseImageProcessor"),bc.forEach(o),Dn=r(pr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),pr.forEach(o),qn=m(O),ko=n(O,"DIV",{class:!0});var vc=i(ko);b(vt.$$.fragment,vc),vc.forEach(o),Rn=m(O),Q=n(O,"DIV",{class:!0});var xo=i(Q);b(Ft.$$.fragment,xo),Un=m(xo),wt=n(xo,"P",{});var hr=i(wt);Hn=r(hr,"Pad images up to the largest image in a batch and create a corresponding "),Yo=n(hr,"CODE",{});var Fc=i(Yo);Bn=r(Fc,"pixel_mask"),Fc.forEach(o),Vn=r(hr,"."),hr.forEach(o),Wn=m(xo),V=n(xo,"P",{});var Ue=i(V);Gn=r(Ue,`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
`),Jo=n(Ue,"CODE",{});var wc=i(Jo);Kn=r(wc,"segmentation_maps = [[2,6,7,9]]"),wc.forEach(o),Qn=r(Ue,", the output will contain "),Zo=n(Ue,"CODE",{});var yc=i(Zo);Xn=r(yc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),yc.forEach(o),Yn=r(Ue," (four binary masks) and "),es=n(Ue,"CODE",{});var Mc=i(es);Jn=r(Mc,"class_labels = [2,6,7,9]"),Mc.forEach(o),Zn=r(Ue,`, the labels for
each mask.`),Ue.forEach(o),xo.forEach(o),ei=m(O),Te=n(O,"DIV",{class:!0});var fr=i(Te);b(yt.$$.fragment,fr),ti=m(fr),Mt=n(fr,"P",{});var gr=i(Mt);oi=r(gr,"Converts the output of "),bo=n(gr,"A",{href:!0});var Tc=i(bo);si=r(Tc,"MaskFormerForInstanceSegmentation"),Tc.forEach(o),ri=r(gr,` into semantic segmentation maps. Only supports
PyTorch.`),gr.forEach(o),fr.forEach(o),ai=m(O),$e=n(O,"DIV",{class:!0});var ur=i($e);b(Tt.$$.fragment,ur),ni=m(ur),$t=n(ur,"P",{});var _r=i($t);ii=r(_r,"Converts the output of "),ts=n(_r,"CODE",{});var $c=i(ts);li=r($c,"MaskFormerForInstanceSegmentationOutput"),$c.forEach(o),ci=r(_r,` into instance segmentation predictions. Only
supports PyTorch.`),_r.forEach(o),ur.forEach(o),di=m(O),xe=n(O,"DIV",{class:!0});var kr=i(xe);b(xt.$$.fragment,kr),mi=m(kr),It=n(kr,"P",{});var br=i(It);pi=r(br,"Converts the output of "),os=n(br,"CODE",{});var xc=i(os);hi=r(xc,"MaskFormerForInstanceSegmentationOutput"),xc.forEach(o),fi=r(br,` into image panoptic segmentation
predictions. Only supports PyTorch.`),br.forEach(o),kr.forEach(o),O.forEach(o),Hs=m(t),ie=n(t,"H2",{class:!0});var vr=i(ie);Ie=n(vr,"A",{id:!0,class:!0,href:!0});var Ic=i(Ie);ss=n(Ic,"SPAN",{});var Ec=i(ss);b(Et.$$.fragment,Ec),Ec.forEach(o),Ic.forEach(o),gi=m(vr),rs=n(vr,"SPAN",{});var Pc=i(rs);ui=r(Pc,"MaskFormerFeatureExtractor"),Pc.forEach(o),vr.forEach(o),Bs=m(t),E=n(t,"DIV",{class:!0});var q=i(E);b(Pt.$$.fragment,q),_i=m(q),vo=n(q,"DIV",{class:!0});var zc=i(vo);b(zt.$$.fragment,zc),zc.forEach(o),ki=m(q),X=n(q,"DIV",{class:!0});var Io=i(X);b(Ot.$$.fragment,Io),bi=m(Io),jt=n(Io,"P",{});var Fr=i(jt);vi=r(Fr,"Pad images up to the largest image in a batch and create a corresponding "),as=n(Fr,"CODE",{});var Oc=i(as);Fi=r(Oc,"pixel_mask"),Oc.forEach(o),wi=r(Fr,"."),Fr.forEach(o),yi=m(Io),W=n(Io,"P",{});var He=i(W);Mi=r(He,`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
`),ns=n(He,"CODE",{});var jc=i(ns);Ti=r(jc,"segmentation_maps = [[2,6,7,9]]"),jc.forEach(o),$i=r(He,", the output will contain "),is=n(He,"CODE",{});var Lc=i(is);xi=r(Lc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Lc.forEach(o),Ii=r(He," (four binary masks) and "),ls=n(He,"CODE",{});var Ac=i(ls);Ei=r(Ac,"class_labels = [2,6,7,9]"),Ac.forEach(o),Pi=r(He,`, the labels for
each mask.`),He.forEach(o),Io.forEach(o),zi=m(q),Ee=n(q,"DIV",{class:!0});var wr=i(Ee);b(Lt.$$.fragment,wr),Oi=m(wr),At=n(wr,"P",{});var yr=i(At);ji=r(yr,"Converts the output of "),Fo=n(yr,"A",{href:!0});var Nc=i(Fo);Li=r(Nc,"MaskFormerForInstanceSegmentation"),Nc.forEach(o),Ai=r(yr,` into semantic segmentation maps. Only supports
PyTorch.`),yr.forEach(o),wr.forEach(o),Ni=m(q),Pe=n(q,"DIV",{class:!0});var Mr=i(Pe);b(Nt.$$.fragment,Mr),Ci=m(Mr),Ct=n(Mr,"P",{});var Tr=i(Ct);Si=r(Tr,"Converts the output of "),cs=n(Tr,"CODE",{});var Cc=i(cs);Di=r(Cc,"MaskFormerForInstanceSegmentationOutput"),Cc.forEach(o),qi=r(Tr,` into instance segmentation predictions. Only
supports PyTorch.`),Tr.forEach(o),Mr.forEach(o),Ri=m(q),ze=n(q,"DIV",{class:!0});var $r=i(ze);b(St.$$.fragment,$r),Ui=m($r),Dt=n($r,"P",{});var xr=i(Dt);Hi=r(xr,"Converts the output of "),ds=n(xr,"CODE",{});var Sc=i(ds);Bi=r(Sc,"MaskFormerForInstanceSegmentationOutput"),Sc.forEach(o),Vi=r(xr,` into image panoptic segmentation
predictions. Only supports PyTorch.`),xr.forEach(o),$r.forEach(o),q.forEach(o),Vs=m(t),le=n(t,"H2",{class:!0});var Ir=i(le);Oe=n(Ir,"A",{id:!0,class:!0,href:!0});var Dc=i(Oe);ms=n(Dc,"SPAN",{});var qc=i(ms);b(qt.$$.fragment,qc),qc.forEach(o),Dc.forEach(o),Wi=m(Ir),ps=n(Ir,"SPAN",{});var Rc=i(ps);Gi=r(Rc,"MaskFormerModel"),Rc.forEach(o),Ir.forEach(o),Ws=m(t),G=n(t,"DIV",{class:!0});var Eo=i(G);b(Rt.$$.fragment,Eo),Ki=m(Eo),Ut=n(Eo,"P",{});var Er=i(Ut);Qi=r(Er,`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ht=n(Er,"A",{href:!0,rel:!0});var Uc=i(Ht);Xi=r(Uc,"torch.nn.Module"),Uc.forEach(o),Yi=r(Er,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Er.forEach(o),Ji=m(Eo),D=n(Eo,"DIV",{class:!0});var Be=i(D);b(Bt.$$.fragment,Be),Zi=m(Be),ce=n(Be,"P",{});var Po=i(ce);el=r(Po,"The "),wo=n(Po,"A",{href:!0});var Hc=i(wo);tl=r(Hc,"MaskFormerModel"),Hc.forEach(o),ol=r(Po," forward method, overrides the "),hs=n(Po,"CODE",{});var Bc=i(hs);sl=r(Bc,"__call__"),Bc.forEach(o),rl=r(Po," special method."),Po.forEach(o),al=m(Be),b(je.$$.fragment,Be),nl=m(Be),b(Le.$$.fragment,Be),Be.forEach(o),Eo.forEach(o),Gs=m(t),de=n(t,"H2",{class:!0});var Pr=i(de);Ae=n(Pr,"A",{id:!0,class:!0,href:!0});var Vc=i(Ae);fs=n(Vc,"SPAN",{});var Wc=i(fs);b(Vt.$$.fragment,Wc),Wc.forEach(o),Vc.forEach(o),il=m(Pr),gs=n(Pr,"SPAN",{});var Gc=i(gs);ll=r(Gc,"MaskFormerForInstanceSegmentation"),Gc.forEach(o),Pr.forEach(o),Ks=m(t),me=n(t,"DIV",{class:!0});var zr=i(me);b(Wt.$$.fragment,zr),cl=m(zr),z=n(zr,"DIV",{class:!0});var R=i(z);b(Gt.$$.fragment,R),dl=m(R),pe=n(R,"P",{});var zo=i(pe);ml=r(zo,"The "),yo=n(zo,"A",{href:!0});var Kc=i(yo);pl=r(Kc,"MaskFormerForInstanceSegmentation"),Kc.forEach(o),hl=r(zo," forward method, overrides the "),us=n(zo,"CODE",{});var Qc=i(us);fl=r(Qc,"__call__"),Qc.forEach(o),gl=r(zo," special method."),zo.forEach(o),ul=m(R),b(Ne.$$.fragment,R),_l=m(R),_s=n(R,"P",{});var Xc=i(_s);kl=r(Xc,"Examples:"),Xc.forEach(o),bl=m(R),b(Ce.$$.fragment,R),vl=m(R),b(Se.$$.fragment,R),R.forEach(o),zr.forEach(o),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(pd)),l(g,"id","maskformer"),l(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"),l(g,"href","#maskformer"),l(_,"class","relative group"),l(ge,"id","overview"),l(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ge,"href","#overview"),l(ee,"class","relative group"),l(We,"href","https://arxiv.org/abs/2107.06278"),l(We,"rel","nofollow"),l(Zt,"href","detr"),l(eo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerConfig"),l(Ge,"href","https://github.com/facebookresearch/MaskFormer/blob/da3e60d85fdeedcb31476b5edd7d328826ce56cc/mask_former/modeling/criterion.py#L169"),l(Ge,"rel","nofollow"),l(to,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor"),l(oo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation"),l(so,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation"),l(ro,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(Qe,"href","https://arxiv.org/abs/2107.06278"),l(Qe,"rel","nofollow"),l(Xe,"width","600"),td(Xe.src,wl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/maskformer_architecture.png")||l(Xe,"src",wl),l(Ye,"href","https://huggingface.co/francesco"),l(Ye,"rel","nofollow"),l(Je,"href","https://github.com/facebookresearch/MaskFormer"),l(Je,"rel","nofollow"),l(ke,"id","resources"),l(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ke,"href","#resources"),l(te,"class","relative group"),l(ot,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/MaskFormer"),l(ot,"rel","nofollow"),l(be,"id","transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"),l(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(be,"href","#transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput"),l(oe,"class","relative group"),l(no,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerModel"),l(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(io,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(lo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_semantic_segmentation"),l(co,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_instance_segmentation"),l(mo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerFeatureExtractor.post_process_panoptic_segmentation"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"id","transformers.MaskFormerConfig"),l(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ve,"href","#transformers.MaskFormerConfig"),l(re,"class","relative group"),l(po,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerModel"),l(dt,"href","https://huggingface.co/facebook/maskformer-swin-base-ade"),l(dt,"rel","nofollow"),l(mt,"href","https://huggingface.co/datasets/scene_parse_150"),l(mt,"rel","nofollow"),l(ho,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(fo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(go,"href","swin"),l(uo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerConfig"),l(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_o,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Me,"id","transformers.MaskFormerImageProcessor"),l(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Me,"href","#transformers.MaskFormerImageProcessor"),l(ne,"class","relative group"),l(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(bo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ie,"id","transformers.MaskFormerFeatureExtractor"),l(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ie,"href","#transformers.MaskFormerFeatureExtractor"),l(ie,"class","relative group"),l(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Fo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Oe,"id","transformers.MaskFormerModel"),l(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Oe,"href","#transformers.MaskFormerModel"),l(le,"class","relative group"),l(Ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ht,"rel","nofollow"),l(wo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerModel"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ae,"id","transformers.MaskFormerForInstanceSegmentation"),l(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ae,"href","#transformers.MaskFormerForInstanceSegmentation"),l(de,"class","relative group"),l(yo,"href","/docs/transformers/v4.27.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"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,p){e(document.head,h),f(t,T,p),f(t,_,p),e(_,g),e(g,M),v(c,M,null),e(_,u),e(_,j),e(j,Ar),f(t,ys,p),v(fe,t,p),f(t,Ms,p),f(t,ee,p),e(ee,ge),e(ge,Oo),v(Ve,Oo,null),e(ee,Nr),e(ee,jo),e(jo,Cr),f(t,Ts,p),f(t,ue,p),e(ue,Sr),e(ue,We),e(We,Dr),e(ue,qr),f(t,$s,p),f(t,Xt,p),e(Xt,Rr),f(t,xs,p),f(t,Yt,p),e(Yt,Lo),e(Lo,Ur),f(t,Is,p),f(t,Jt,p),e(Jt,Hr),f(t,Es,p),f(t,S,p),e(S,A),e(A,Br),e(A,Zt),e(Zt,Vr),e(A,Wr),e(A,Ao),e(Ao,Gr),e(A,Kr),e(A,eo),e(eo,Qr),e(A,Xr),e(A,No),e(No,Yr),e(A,Jr),e(S,Zr),e(S,N),e(N,ea),e(N,Co),e(Co,ta),e(N,oa),e(N,So),e(So,sa),e(N,ra),e(N,Do),e(Do,aa),e(N,na),e(N,Ge),e(Ge,ia),e(N,la),e(S,ca),e(S,Ke),e(Ke,da),e(Ke,to),e(to,ma),e(Ke,pa),e(S,ha),e(S,C),e(C,fa),e(C,oo),e(oo,ga),e(C,ua),e(C,so),e(so,_a),e(C,ka),e(C,ro),e(ro,ba),e(C,va),e(C,qo),e(qo,Fa),e(C,wa),f(t,Ps,p),f(t,_e,p),e(_e,ya),e(_e,Qe),e(Qe,Ma),e(_e,Ta),f(t,zs,p),f(t,Xe,p),f(t,Os,p),f(t,K,p),e(K,$a),e(K,Ye),e(Ye,xa),e(K,Ia),e(K,Je),e(Je,Ea),e(K,Pa),f(t,js,p),f(t,te,p),e(te,ke),e(ke,Ro),v(Ze,Ro,null),e(te,za),e(te,Uo),e(Uo,Oa),f(t,Ls,p),v(et,t,p),f(t,As,p),f(t,ao,p),e(ao,tt),e(tt,ja),e(tt,ot),e(ot,La),e(tt,Aa),f(t,Ns,p),f(t,oe,p),e(oe,be),e(be,Ho),v(st,Ho,null),e(oe,Na),e(oe,Bo),e(Bo,Ca),f(t,Cs,p),f(t,se,p),v(rt,se,null),e(se,Sa),e(se,at),e(at,Da),e(at,no),e(no,qa),e(at,Ra),f(t,Ss,p),f(t,U,p),v(nt,U,null),e(U,Ua),e(U,it),e(it,Ha),e(it,io),e(io,Ba),e(it,Va),e(U,Wa),e(U,H),e(H,Ga),e(H,lo),e(lo,Ka),e(H,Qa),e(H,co),e(co,Xa),e(H,Ya),e(H,mo),e(mo,Ja),e(H,Za),f(t,Ds,p),f(t,re,p),e(re,ve),e(ve,Vo),v(lt,Vo,null),e(re,en),e(re,Wo),e(Wo,tn),f(t,qs,p),f(t,I,p),v(ct,I,null),e(I,on),e(I,B),e(B,sn),e(B,po),e(po,rn),e(B,an),e(B,dt),e(dt,nn),e(B,ln),e(B,mt),e(mt,cn),e(B,dn),e(I,mn),e(I,ae),e(ae,pn),e(ae,ho),e(ho,hn),e(ae,fn),e(ae,fo),e(fo,gn),e(ae,un),e(I,_n),e(I,pt),e(pt,kn),e(pt,go),e(go,bn),e(pt,vn),e(I,Fn),v(Fe,I,null),e(I,wn),e(I,we),v(ht,we,null),e(we,yn),e(we,ft),e(ft,Mn),e(ft,uo),e(uo,Tn),e(ft,$n),e(I,xn),e(I,ye),v(gt,ye,null),e(ye,In),e(ye,ut),e(ut,En),e(ut,_o),e(_o,Pn),e(ut,zn),f(t,Rs,p),f(t,ne,p),e(ne,Me),e(Me,Go),v(_t,Go,null),e(ne,On),e(ne,Ko),e(Ko,jn),f(t,Us,p),f(t,$,p),v(kt,$,null),e($,Ln),e($,Qo),e(Qo,An),e($,Nn),e($,bt),e(bt,Cn),e(bt,Xo),e(Xo,Sn),e(bt,Dn),e($,qn),e($,ko),v(vt,ko,null),e($,Rn),e($,Q),v(Ft,Q,null),e(Q,Un),e(Q,wt),e(wt,Hn),e(wt,Yo),e(Yo,Bn),e(wt,Vn),e(Q,Wn),e(Q,V),e(V,Gn),e(V,Jo),e(Jo,Kn),e(V,Qn),e(V,Zo),e(Zo,Xn),e(V,Yn),e(V,es),e(es,Jn),e(V,Zn),e($,ei),e($,Te),v(yt,Te,null),e(Te,ti),e(Te,Mt),e(Mt,oi),e(Mt,bo),e(bo,si),e(Mt,ri),e($,ai),e($,$e),v(Tt,$e,null),e($e,ni),e($e,$t),e($t,ii),e($t,ts),e(ts,li),e($t,ci),e($,di),e($,xe),v(xt,xe,null),e(xe,mi),e(xe,It),e(It,pi),e(It,os),e(os,hi),e(It,fi),f(t,Hs,p),f(t,ie,p),e(ie,Ie),e(Ie,ss),v(Et,ss,null),e(ie,gi),e(ie,rs),e(rs,ui),f(t,Bs,p),f(t,E,p),v(Pt,E,null),e(E,_i),e(E,vo),v(zt,vo,null),e(E,ki),e(E,X),v(Ot,X,null),e(X,bi),e(X,jt),e(jt,vi),e(jt,as),e(as,Fi),e(jt,wi),e(X,yi),e(X,W),e(W,Mi),e(W,ns),e(ns,Ti),e(W,$i),e(W,is),e(is,xi),e(W,Ii),e(W,ls),e(ls,Ei),e(W,Pi),e(E,zi),e(E,Ee),v(Lt,Ee,null),e(Ee,Oi),e(Ee,At),e(At,ji),e(At,Fo),e(Fo,Li),e(At,Ai),e(E,Ni),e(E,Pe),v(Nt,Pe,null),e(Pe,Ci),e(Pe,Ct),e(Ct,Si),e(Ct,cs),e(cs,Di),e(Ct,qi),e(E,Ri),e(E,ze),v(St,ze,null),e(ze,Ui),e(ze,Dt),e(Dt,Hi),e(Dt,ds),e(ds,Bi),e(Dt,Vi),f(t,Vs,p),f(t,le,p),e(le,Oe),e(Oe,ms),v(qt,ms,null),e(le,Wi),e(le,ps),e(ps,Gi),f(t,Ws,p),f(t,G,p),v(Rt,G,null),e(G,Ki),e(G,Ut),e(Ut,Qi),e(Ut,Ht),e(Ht,Xi),e(Ut,Yi),e(G,Ji),e(G,D),v(Bt,D,null),e(D,Zi),e(D,ce),e(ce,el),e(ce,wo),e(wo,tl),e(ce,ol),e(ce,hs),e(hs,sl),e(ce,rl),e(D,al),v(je,D,null),e(D,nl),v(Le,D,null),f(t,Gs,p),f(t,de,p),e(de,Ae),e(Ae,fs),v(Vt,fs,null),e(de,il),e(de,gs),e(gs,ll),f(t,Ks,p),f(t,me,p),v(Wt,me,null),e(me,cl),e(me,z),v(Gt,z,null),e(z,dl),e(z,pe),e(pe,ml),e(pe,yo),e(yo,pl),e(pe,hl),e(pe,us),e(us,fl),e(pe,gl),e(z,ul),v(Ne,z,null),e(z,_l),e(z,_s),e(_s,kl),e(z,bl),v(Ce,z,null),e(z,vl),v(Se,z,null),Qs=!0},p(t,[p]){const Kt={};p&2&&(Kt.$$scope={dirty:p,ctx:t}),fe.$set(Kt);const ks={};p&2&&(ks.$$scope={dirty:p,ctx:t}),Fe.$set(ks);const bs={};p&2&&(bs.$$scope={dirty:p,ctx:t}),je.$set(bs);const vs={};p&2&&(vs.$$scope={dirty:p,ctx:t}),Le.$set(vs);const Qt={};p&2&&(Qt.$$scope={dirty:p,ctx:t}),Ne.$set(Qt);const Fs={};p&2&&(Fs.$$scope={dirty:p,ctx:t}),Ce.$set(Fs);const ws={};p&2&&(ws.$$scope={dirty:p,ctx:t}),Se.$set(ws)},i(t){Qs||(F(c.$$.fragment,t),F(fe.$$.fragment,t),F(Ve.$$.fragment,t),F(Ze.$$.fragment,t),F(et.$$.fragment,t),F(st.$$.fragment,t),F(rt.$$.fragment,t),F(nt.$$.fragment,t),F(lt.$$.fragment,t),F(ct.$$.fragment,t),F(Fe.$$.fragment,t),F(ht.$$.fragment,t),F(gt.$$.fragment,t),F(_t.$$.fragment,t),F(kt.$$.fragment,t),F(vt.$$.fragment,t),F(Ft.$$.fragment,t),F(yt.$$.fragment,t),F(Tt.$$.fragment,t),F(xt.$$.fragment,t),F(Et.$$.fragment,t),F(Pt.$$.fragment,t),F(zt.$$.fragment,t),F(Ot.$$.fragment,t),F(Lt.$$.fragment,t),F(Nt.$$.fragment,t),F(St.$$.fragment,t),F(qt.$$.fragment,t),F(Rt.$$.fragment,t),F(Bt.$$.fragment,t),F(je.$$.fragment,t),F(Le.$$.fragment,t),F(Vt.$$.fragment,t),F(Wt.$$.fragment,t),F(Gt.$$.fragment,t),F(Ne.$$.fragment,t),F(Ce.$$.fragment,t),F(Se.$$.fragment,t),Qs=!0)},o(t){w(c.$$.fragment,t),w(fe.$$.fragment,t),w(Ve.$$.fragment,t),w(Ze.$$.fragment,t),w(et.$$.fragment,t),w(st.$$.fragment,t),w(rt.$$.fragment,t),w(nt.$$.fragment,t),w(lt.$$.fragment,t),w(ct.$$.fragment,t),w(Fe.$$.fragment,t),w(ht.$$.fragment,t),w(gt.$$.fragment,t),w(_t.$$.fragment,t),w(kt.$$.fragment,t),w(vt.$$.fragment,t),w(Ft.$$.fragment,t),w(yt.$$.fragment,t),w(Tt.$$.fragment,t),w(xt.$$.fragment,t),w(Et.$$.fragment,t),w(Pt.$$.fragment,t),w(zt.$$.fragment,t),w(Ot.$$.fragment,t),w(Lt.$$.fragment,t),w(Nt.$$.fragment,t),w(St.$$.fragment,t),w(qt.$$.fragment,t),w(Rt.$$.fragment,t),w(Bt.$$.fragment,t),w(je.$$.fragment,t),w(Le.$$.fragment,t),w(Vt.$$.fragment,t),w(Wt.$$.fragment,t),w(Gt.$$.fragment,t),w(Ne.$$.fragment,t),w(Ce.$$.fragment,t),w(Se.$$.fragment,t),Qs=!1},d(t){o(h),t&&o(T),t&&o(_),y(c),t&&o(ys),y(fe,t),t&&o(Ms),t&&o(ee),y(Ve),t&&o(Ts),t&&o(ue),t&&o($s),t&&o(Xt),t&&o(xs),t&&o(Yt),t&&o(Is),t&&o(Jt),t&&o(Es),t&&o(S),t&&o(Ps),t&&o(_e),t&&o(zs),t&&o(Xe),t&&o(Os),t&&o(K),t&&o(js),t&&o(te),y(Ze),t&&o(Ls),y(et,t),t&&o(As),t&&o(ao),t&&o(Ns),t&&o(oe),y(st),t&&o(Cs),t&&o(se),y(rt),t&&o(Ss),t&&o(U),y(nt),t&&o(Ds),t&&o(re),y(lt),t&&o(qs),t&&o(I),y(ct),y(Fe),y(ht),y(gt),t&&o(Rs),t&&o(ne),y(_t),t&&o(Us),t&&o($),y(kt),y(vt),y(Ft),y(yt),y(Tt),y(xt),t&&o(Hs),t&&o(ie),y(Et),t&&o(Bs),t&&o(E),y(Pt),y(zt),y(Ot),y(Lt),y(Nt),y(St),t&&o(Vs),t&&o(le),y(qt),t&&o(Ws),t&&o(G),y(Rt),y(Bt),y(je),y(Le),t&&o(Gs),t&&o(de),y(Vt),t&&o(Ks),t&&o(me),y(Wt),y(Gt),y(Ne),y(Ce),y(Se)}}}const pd={local:"maskformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.models.maskformer.modeling_maskformer.MaskFormerModelOutput",title:"MaskFormer specific outputs"},{local:"transformers.MaskFormerConfig",title:"MaskFormerConfig"},{local:"transformers.MaskFormerImageProcessor",title:"MaskFormerImageProcessor"},{local:"transformers.MaskFormerFeatureExtractor",title:"MaskFormerFeatureExtractor"},{local:"transformers.MaskFormerModel",title:"MaskFormerModel"},{local:"transformers.MaskFormerForInstanceSegmentation",title:"MaskFormerForInstanceSegmentation"}],title:"MaskFormer"};function hd(P){return od(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fd extends Yc{constructor(h){super();Jc(this,h,hd,md,Zc,{})}}export{Fd as default,pd as metadata};
