import{S as cd,i as dd,s as md,e as a,k as d,w as k,t as s,M as pd,c as n,d as t,m,a as i,x as b,h as r,b as l,N as hd,G as e,g,y as v,q as F,o as w,B as y,v as gd,L as Cr}from"../../chunks/vendor-hf-doc-builder.js";import{T as zl}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Dr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as he}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ar}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as fd}from"../../chunks/PipelineTag-hf-doc-builder.js";function ud(E){let h,T,_,f,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"),f=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(_);f=r(j,"Github Issue"),j.forEach(t),M=r(u,"."),u.forEach(t),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){g(c,h,u),e(h,T),e(h,_),e(_,f),e(h,M)},d(c){c&&t(h)}}}function _d(E){let h,T,_,f,M;return f=new Dr({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(f.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Examples:"),u.forEach(t),_=m(c),b(f.$$.fragment,c)},m(c,u){g(c,h,u),e(h,T),g(c,_,u),v(f,c,u),M=!0},p:Cr,i(c){M||(F(f.$$.fragment,c),M=!0)},o(c){w(f.$$.fragment,c),M=!1},d(c){c&&t(h),c&&t(_),y(f,c)}}}function kd(E){let h,T,_,f,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"),f=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(_);f=r(j,"Module"),j.forEach(t),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(t)},m(c,u){g(c,h,u),e(h,T),e(h,_),e(_,f),e(h,M)},d(c){c&&t(h)}}}function bd(E){let h,T,_,f,M;return f=new Dr({props:{code:`from transformers import MaskFormerImageProcessor, MaskFormerModel
from PIL import Image
import requests

# load MaskFormer fine-tuned on ADE20k semantic segmentation
image_processor = MaskFormerImageProcessor.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> MaskFormerImageProcessor, 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 = MaskFormerImageProcessor.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(f.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Examples:"),u.forEach(t),_=m(c),b(f.$$.fragment,c)},m(c,u){g(c,h,u),e(h,T),g(c,_,u),v(f,c,u),M=!0},p:Cr,i(c){M||(F(f.$$.fragment,c),M=!0)},o(c){w(f.$$.fragment,c),M=!1},d(c){c&&t(h),c&&t(_),y(f,c)}}}function vd(E){let h,T,_,f,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"),f=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(_);f=r(j,"Module"),j.forEach(t),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(t)},m(c,u){g(c,h,u),e(h,T),e(h,_),e(_,f),e(h,M)},d(c){c&&t(h)}}}function Fd(E){let h,T,_,f,M;return f=new Dr({props:{code:`from transformers import MaskFormerImageProcessor, MaskFormerForInstanceSegmentation
from PIL import Image
import requests

# load MaskFormer fine-tuned on ADE20k semantic segmentation
image_processor = MaskFormerImageProcessor.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> MaskFormerImageProcessor, 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 = MaskFormerImageProcessor.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(f.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Semantic segmentation example:"),u.forEach(t),_=m(c),b(f.$$.fragment,c)},m(c,u){g(c,h,u),e(h,T),g(c,_,u),v(f,c,u),M=!0},p:Cr,i(c){M||(F(f.$$.fragment,c),M=!0)},o(c){w(f.$$.fragment,c),M=!1},d(c){c&&t(h),c&&t(_),y(f,c)}}}function wd(E){let h,T,_,f,M;return f=new Dr({props:{code:`from transformers import MaskFormerImageProcessor, MaskFormerForInstanceSegmentation
from PIL import Image
import requests

# load MaskFormer fine-tuned on COCO panoptic segmentation
image_processor = MaskFormerImageProcessor.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> MaskFormerImageProcessor, 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 = MaskFormerImageProcessor.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(f.$$.fragment)},l(c){h=n(c,"P",{});var u=i(h);T=r(u,"Panoptic segmentation example:"),u.forEach(t),_=m(c),b(f.$$.fragment,c)},m(c,u){g(c,h,u),e(h,T),g(c,_,u),v(f,c,u),M=!0},p:Cr,i(c){M||(F(f.$$.fragment,c),M=!0)},o(c){w(f.$$.fragment,c),M=!1},d(c){c&&t(h),c&&t(_),y(f,c)}}}function yd(E){let h,T,_,f,M,c,u,j,Sr,Is,ge,$s,ee,fe,Lt,Ve,qr,jt,Rr,xs,ue,Ur,We,Br,Hr,Ps,Zo,Vr,Es,Jo,Nt,Wr,zs,et,Gr,Os,S,A,Kr,ot,Xr,Qr,At,Yr,Zr,tt,Jr,ea,Ct,oa,ta,sa,C,ra,Dt,aa,na,St,ia,la,qt,ca,da,Ge,ma,pa,ha,Ke,ga,st,fa,ua,_a,D,ka,rt,ba,va,at,Fa,wa,nt,ya,Ma,Rt,Ta,Ia,Ls,_e,$a,Xe,xa,Pa,js,Qe,Ol,Ns,K,Ea,Ye,za,Oa,Ze,La,ja,As,oe,ke,Ut,Je,Na,Bt,Aa,Cs,eo,Ds,it,oo,Ca,to,Da,Sa,Ss,te,be,Ht,so,qa,Vt,Ra,qs,se,ro,Ua,ao,Ba,lt,Ha,Va,Rs,U,no,Wa,io,Ga,ct,Ka,Xa,Qa,B,Ya,dt,Za,Ja,mt,en,on,pt,tn,sn,Us,re,ve,Wt,lo,rn,Gt,an,Bs,P,co,nn,H,ln,ht,cn,dn,mo,mn,pn,po,hn,gn,fn,ae,un,gt,_n,kn,ft,bn,vn,Fn,ho,wn,ut,yn,Mn,Tn,Fe,In,we,go,$n,fo,xn,_t,Pn,En,zn,ye,uo,On,_o,Ln,kt,jn,Nn,Hs,ne,Me,Kt,ko,An,Xt,Cn,Vs,I,bo,Dn,Qt,Sn,qn,vo,Rn,Yt,Un,Bn,Hn,bt,Fo,Vn,X,wo,Wn,yo,Gn,Zt,Kn,Xn,Qn,V,Yn,Jt,Zn,Jn,es,ei,oi,os,ti,si,ri,Te,Mo,ai,To,ni,vt,ii,li,ci,Ie,Io,di,$o,mi,ts,pi,hi,gi,$e,xo,fi,Po,ui,ss,_i,ki,Ws,ie,xe,rs,Eo,bi,as,vi,Gs,$,zo,Fi,ns,wi,yi,Oo,Mi,is,Ti,Ii,$i,Ft,Lo,xi,Q,jo,Pi,No,Ei,ls,zi,Oi,Li,W,ji,cs,Ni,Ai,ds,Ci,Di,ms,Si,qi,Ri,Pe,Ao,Ui,Co,Bi,wt,Hi,Vi,Wi,Ee,Do,Gi,So,Ki,ps,Xi,Qi,Yi,ze,qo,Zi,Ro,Ji,hs,el,ol,Ks,le,Oe,gs,Uo,tl,fs,sl,Xs,G,Bo,rl,Ho,al,Vo,nl,il,ll,q,Wo,cl,ce,dl,yt,ml,pl,us,hl,gl,fl,Le,ul,je,Qs,de,Ne,_s,Go,_l,ks,kl,Ys,me,Ko,bl,z,Xo,vl,pe,Fl,Mt,wl,yl,bs,Ml,Tl,Il,Ae,$l,vs,xl,Pl,Ce,El,De,Zs;return c=new he({}),ge=new zl({props:{$$slots:{default:[ud]},$$scope:{ctx:E}}}),Ve=new he({}),Je=new he({}),eo=new fd({props:{pipeline:"image-segmentation"}}),so=new he({}),ro=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.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L148"}}),no=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.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L191"}}),lo=new he({}),co=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.25.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 Ar({props:{anchor:"transformers.MaskFormerConfig.example",$$slots:{default:[_d]},$$scope:{ctx:E}}}),go=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.25.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.25.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.25.1/src/transformers/models/maskformer/configuration_maskformer.py#L172",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerConfig"
>MaskFormerConfig</a></p>
`}}),uo=new x({props:{name:"to_dict",anchor:"transformers.MaskFormerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/configuration_maskformer.py#L194",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),ko=new he({}),bo=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:"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.reduce_labels",description:`<strong>reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by <code>ignore_index</code>.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L335"}}),Fo=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:"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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L620"}}),wo=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L775",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),Mo=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L922",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>
`}}),Io=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"}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.25.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>) &#x2014;
Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE)
format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L972",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>
`}}),xo=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1055",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>
`}}),Eo=new he({}),zo=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:"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.reduce_labels",description:`<strong>reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by <code>ignore_index</code>.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L335"}}),Lo=new x({props:{name:"__call__",anchor:"transformers.MaskFormerImageProcessor.__call__",parameters:[{name:"images",val:""},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L532"}}),jo=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L775",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),Ao=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L922",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>
`}}),Do=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"}],parametersDescription:[{anchor:"transformers.MaskFormerImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.25.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>) &#x2014;
Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE)
format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L972",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>
`}}),qo=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.25.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.25.1/src/transformers/models/maskformer/image_processing_maskformer.py#L1055",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>
`}}),Uo=new he({}),Bo=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.25.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.25.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.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L1539"}}),Wo=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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.MaskFormerModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.MaskFormerModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MaskFormerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of Detr&#x2019;s decoder attention layers.`,name:"output_attentions"},{anchor:"transformers.MaskFormerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~MaskFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L1549",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.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>
`}}),Le=new zl({props:{$$slots:{default:[kd]},$$scope:{ctx:E}}}),je=new Ar({props:{anchor:"transformers.MaskFormerModel.forward.example",$$slots:{default:[bd]},$$scope:{ctx:E}}}),Go=new he({}),Ko=new x({props:{name:"class transformers.MaskFormerForInstanceSegmentation",anchor:"transformers.MaskFormerForInstanceSegmentation",parameters:[{name:"config",val:": MaskFormerConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L1636"}}),Xo=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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of Detr&#x2019;s decoder attention layers.`,name:"output_attentions"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~MaskFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.mask_labels",description:`<strong>mask_labels</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
List of mask labels of shape <code>(num_labels, height, width)</code> to be fed to a model`,name:"mask_labels"},{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.class_labels",description:`<strong>class_labels</strong> (<code>List[torch.LongTensor]</code>, <em>optional</em>) &#x2014;
list of target class labels of shape <code>(num_labels, height, width)</code> to be fed to a model. They identify the
labels of <code>mask_labels</code>, e.g. the label of <code>mask_labels[i][j]</code> if <code>class_labels[i][j]</code>.`,name:"class_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/maskformer/modeling_maskformer.py#L1717",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.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>
`}}),Ae=new zl({props:{$$slots:{default:[vd]},$$scope:{ctx:E}}}),Ce=new Ar({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example",$$slots:{default:[Fd]},$$scope:{ctx:E}}}),De=new Ar({props:{anchor:"transformers.MaskFormerForInstanceSegmentation.forward.example-2",$$slots:{default:[wd]},$$scope:{ctx:E}}}),{c(){h=a("meta"),T=d(),_=a("h1"),f=a("a"),M=a("span"),k(c.$$.fragment),u=d(),j=a("span"),Sr=s("MaskFormer"),Is=d(),k(ge.$$.fragment),$s=d(),ee=a("h2"),fe=a("a"),Lt=a("span"),k(Ve.$$.fragment),qr=d(),jt=a("span"),Rr=s("Overview"),xs=d(),ue=a("p"),Ur=s("The MaskFormer model was proposed in "),We=a("a"),Br=s("Per-Pixel Classification is Not All You Need for Semantic Segmentation"),Hr=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."),Ps=d(),Zo=a("p"),Vr=s("The abstract from the paper is the following:"),Es=d(),Jo=a("p"),Nt=a("em"),Wr=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."),zs=d(),et=a("p"),Gr=s("Tips:"),Os=d(),S=a("ul"),A=a("li"),Kr=s("MaskFormer\u2019s Transformer decoder is identical to the decoder of "),ot=a("a"),Xr=s("DETR"),Qr=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 "),At=a("code"),Yr=s("use_auxilary_loss"),Zr=s(" of "),tt=a("a"),Jr=s("MaskFormerConfig"),ea=s(" to "),Ct=a("code"),oa=s("True"),ta=s(", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),sa=d(),C=a("li"),ra=s(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Dt=a("code"),aa=s("get_num_masks"),na=s(" function inside in the "),St=a("code"),ia=s("MaskFormerLoss"),la=s(" class of "),qt=a("code"),ca=s("modeling_maskformer.py"),da=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"),ma=s("here"),pa=s("."),ha=d(),Ke=a("li"),ga=s("One can use "),st=a("a"),fa=s("MaskFormerImageProcessor"),ua=s(" to prepare images for the model and optional targets for the model."),_a=d(),D=a("li"),ka=s("To get the final segmentation, depending on the task, you can call "),rt=a("a"),ba=s("post_process_semantic_segmentation()"),va=s(" or "),at=a("a"),Fa=s("post_process_panoptic_segmentation()"),wa=s(". Both tasks can be solved using "),nt=a("a"),ya=s("MaskFormerForInstanceSegmentation"),Ma=s(" output, panoptic segmentation accepts an optional "),Rt=a("code"),Ta=s("label_ids_to_fuse"),Ia=s(" argument to fuse instances of the target object/s (e.g. sky) together."),Ls=d(),_e=a("p"),$a=s("The figure below illustrates the architecture of MaskFormer. Taken from the "),Xe=a("a"),xa=s("original paper"),Pa=s("."),js=d(),Qe=a("img"),Ns=d(),K=a("p"),Ea=s("This model was contributed by "),Ye=a("a"),za=s("francesco"),Oa=s(". The original code can be found "),Ze=a("a"),La=s("here"),ja=s("."),As=d(),oe=a("h2"),ke=a("a"),Ut=a("span"),k(Je.$$.fragment),Na=d(),Bt=a("span"),Aa=s("Resources"),Cs=d(),k(eo.$$.fragment),Ds=d(),it=a("ul"),oo=a("li"),Ca=s("All notebooks that illustrate inference as well as fine-tuning on custom data with MaskFormer can be found "),to=a("a"),Da=s("here"),Sa=s("."),Ss=d(),te=a("h2"),be=a("a"),Ht=a("span"),k(so.$$.fragment),qa=d(),Vt=a("span"),Ra=s("MaskFormer specific outputs"),qs=d(),se=a("div"),k(ro.$$.fragment),Ua=d(),ao=a("p"),Ba=s("Class for outputs of "),lt=a("a"),Ha=s("MaskFormerModel"),Va=s(". This class returns all the needed hidden states to compute the logits."),Rs=d(),U=a("div"),k(no.$$.fragment),Wa=d(),io=a("p"),Ga=s("Class for outputs of "),ct=a("a"),Ka=s("MaskFormerForInstanceSegmentation"),Xa=s("."),Qa=d(),B=a("p"),Ya=s("This output can be directly passed to "),dt=a("a"),Za=s("post_process_semantic_segmentation()"),Ja=s(` or or
`),mt=a("a"),en=s("post_process_instance_segmentation()"),on=s(` or
`),pt=a("a"),tn=s("post_process_panoptic_segmentation()"),sn=s(" depending on the task. Please, see\n[`~MaskFormerImageProcessor] for details regarding usage."),Us=d(),re=a("h2"),ve=a("a"),Wt=a("span"),k(lo.$$.fragment),rn=d(),Gt=a("span"),an=s("MaskFormerConfig"),Bs=d(),P=a("div"),k(co.$$.fragment),nn=d(),H=a("p"),ln=s("This is the configuration class to store the configuration of a "),ht=a("a"),cn=s("MaskFormerModel"),dn=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
`),mo=a("a"),mn=s("facebook/maskformer-swin-base-ade"),pn=s(` architecture trained
on `),po=a("a"),hn=s("ADE20k-150"),gn=s("."),fn=d(),ae=a("p"),un=s("Configuration objects inherit from "),gt=a("a"),_n=s("PretrainedConfig"),kn=s(` and can be used to control the model outputs. Read the
documentation from `),ft=a("a"),bn=s("PretrainedConfig"),vn=s(" for more information."),Fn=d(),ho=a("p"),wn=s("Currently, MaskFormer only supports the "),ut=a("a"),yn=s("Swin Transformer"),Mn=s(" as backbone."),Tn=d(),k(Fe.$$.fragment),In=d(),we=a("div"),k(go.$$.fragment),$n=d(),fo=a("p"),xn=s("Instantiate a "),_t=a("a"),Pn=s("MaskFormerConfig"),En=s(` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),zn=d(),ye=a("div"),k(uo.$$.fragment),On=d(),_o=a("p"),Ln=s("Serializes this instance to a Python dictionary. Override the default "),kt=a("a"),jn=s("to_dict()"),Nn=s("."),Hs=d(),ne=a("h2"),Me=a("a"),Kt=a("span"),k(ko.$$.fragment),An=d(),Xt=a("span"),Cn=s("MaskFormerImageProcessor"),Vs=d(),I=a("div"),k(bo.$$.fragment),Dn=d(),Qt=a("p"),Sn=s(`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),qn=d(),vo=a("p"),Rn=s("This image processor inherits from "),Yt=a("code"),Un=s("BaseImageProcessor"),Bn=s(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Hn=d(),bt=a("div"),k(Fo.$$.fragment),Vn=d(),X=a("div"),k(wo.$$.fragment),Wn=d(),yo=a("p"),Gn=s("Pad images up to the largest image in a batch and create a corresponding "),Zt=a("code"),Kn=s("pixel_mask"),Xn=s("."),Qn=d(),V=a("p"),Yn=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
`),Jt=a("code"),Zn=s("segmentation_maps = [[2,6,7,9]]"),Jn=s(", the output will contain "),es=a("code"),ei=s("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),oi=s(" (four binary masks) and "),os=a("code"),ti=s("class_labels = [2,6,7,9]"),si=s(`, the labels for
each mask.`),ri=d(),Te=a("div"),k(Mo.$$.fragment),ai=d(),To=a("p"),ni=s("Converts the output of "),vt=a("a"),ii=s("MaskFormerForInstanceSegmentation"),li=s(` into semantic segmentation maps. Only supports
PyTorch.`),ci=d(),Ie=a("div"),k(Io.$$.fragment),di=d(),$o=a("p"),mi=s("Converts the output of "),ts=a("code"),pi=s("MaskFormerForInstanceSegmentationOutput"),hi=s(` into instance segmentation predictions. Only
supports PyTorch.`),gi=d(),$e=a("div"),k(xo.$$.fragment),fi=d(),Po=a("p"),ui=s("Converts the output of "),ss=a("code"),_i=s("MaskFormerForInstanceSegmentationOutput"),ki=s(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Ws=d(),ie=a("h2"),xe=a("a"),rs=a("span"),k(Eo.$$.fragment),bi=d(),as=a("span"),vi=s("MaskFormerFeatureExtractor"),Gs=d(),$=a("div"),k(zo.$$.fragment),Fi=d(),ns=a("p"),wi=s(`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),yi=d(),Oo=a("p"),Mi=s("This image processor inherits from "),is=a("code"),Ti=s("BaseImageProcessor"),Ii=s(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),$i=d(),Ft=a("div"),k(Lo.$$.fragment),xi=d(),Q=a("div"),k(jo.$$.fragment),Pi=d(),No=a("p"),Ei=s("Pad images up to the largest image in a batch and create a corresponding "),ls=a("code"),zi=s("pixel_mask"),Oi=s("."),Li=d(),W=a("p"),ji=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
`),cs=a("code"),Ni=s("segmentation_maps = [[2,6,7,9]]"),Ai=s(", the output will contain "),ds=a("code"),Ci=s("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Di=s(" (four binary masks) and "),ms=a("code"),Si=s("class_labels = [2,6,7,9]"),qi=s(`, the labels for
each mask.`),Ri=d(),Pe=a("div"),k(Ao.$$.fragment),Ui=d(),Co=a("p"),Bi=s("Converts the output of "),wt=a("a"),Hi=s("MaskFormerForInstanceSegmentation"),Vi=s(` into semantic segmentation maps. Only supports
PyTorch.`),Wi=d(),Ee=a("div"),k(Do.$$.fragment),Gi=d(),So=a("p"),Ki=s("Converts the output of "),ps=a("code"),Xi=s("MaskFormerForInstanceSegmentationOutput"),Qi=s(` into instance segmentation predictions. Only
supports PyTorch.`),Yi=d(),ze=a("div"),k(qo.$$.fragment),Zi=d(),Ro=a("p"),Ji=s("Converts the output of "),hs=a("code"),el=s("MaskFormerForInstanceSegmentationOutput"),ol=s(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Ks=d(),le=a("h2"),Oe=a("a"),gs=a("span"),k(Uo.$$.fragment),tl=d(),fs=a("span"),sl=s("MaskFormerModel"),Xs=d(),G=a("div"),k(Bo.$$.fragment),rl=d(),Ho=a("p"),al=s(`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Vo=a("a"),nl=s("torch.nn.Module"),il=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.`),ll=d(),q=a("div"),k(Wo.$$.fragment),cl=d(),ce=a("p"),dl=s("The "),yt=a("a"),ml=s("MaskFormerModel"),pl=s(" forward method, overrides the "),us=a("code"),hl=s("__call__"),gl=s(" special method."),fl=d(),k(Le.$$.fragment),ul=d(),k(je.$$.fragment),Qs=d(),de=a("h2"),Ne=a("a"),_s=a("span"),k(Go.$$.fragment),_l=d(),ks=a("span"),kl=s("MaskFormerForInstanceSegmentation"),Ys=d(),me=a("div"),k(Ko.$$.fragment),bl=d(),z=a("div"),k(Xo.$$.fragment),vl=d(),pe=a("p"),Fl=s("The "),Mt=a("a"),wl=s("MaskFormerForInstanceSegmentation"),yl=s(" forward method, overrides the "),bs=a("code"),Ml=s("__call__"),Tl=s(" special method."),Il=d(),k(Ae.$$.fragment),$l=d(),vs=a("p"),xl=s("Examples:"),Pl=d(),k(Ce.$$.fragment),El=d(),k(De.$$.fragment),this.h()},l(o){const p=pd('[data-svelte="svelte-1phssyn"]',document.head);h=n(p,"META",{name:!0,content:!0}),p.forEach(t),T=m(o),_=n(o,"H1",{class:!0});var Qo=i(_);f=n(Qo,"A",{id:!0,class:!0,href:!0});var Fs=i(f);M=n(Fs,"SPAN",{});var ws=i(M);b(c.$$.fragment,ws),ws.forEach(t),Fs.forEach(t),u=m(Qo),j=n(Qo,"SPAN",{});var ys=i(j);Sr=r(ys,"MaskFormer"),ys.forEach(t),Qo.forEach(t),Is=m(o),b(ge.$$.fragment,o),$s=m(o),ee=n(o,"H2",{class:!0});var Yo=i(ee);fe=n(Yo,"A",{id:!0,class:!0,href:!0});var Ms=i(fe);Lt=n(Ms,"SPAN",{});var Ts=i(Lt);b(Ve.$$.fragment,Ts),Ts.forEach(t),Ms.forEach(t),qr=m(Yo),jt=n(Yo,"SPAN",{});var Ll=i(jt);Rr=r(Ll,"Overview"),Ll.forEach(t),Yo.forEach(t),xs=m(o),ue=n(o,"P",{});var Js=i(ue);Ur=r(Js,"The MaskFormer model was proposed in "),We=n(Js,"A",{href:!0,rel:!0});var jl=i(We);Br=r(jl,"Per-Pixel Classification is Not All You Need for Semantic Segmentation"),jl.forEach(t),Hr=r(Js," by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov. MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification."),Js.forEach(t),Ps=m(o),Zo=n(o,"P",{});var Nl=i(Zo);Vr=r(Nl,"The abstract from the paper is the following:"),Nl.forEach(t),Es=m(o),Jo=n(o,"P",{});var Al=i(Jo);Nt=n(Al,"EM",{});var Cl=i(Nt);Wr=r(Cl,"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."),Cl.forEach(t),Al.forEach(t),zs=m(o),et=n(o,"P",{});var Dl=i(et);Gr=r(Dl,"Tips:"),Dl.forEach(t),Os=m(o),S=n(o,"UL",{});var Se=i(S);A=n(Se,"LI",{});var Y=i(A);Kr=r(Y,"MaskFormer\u2019s Transformer decoder is identical to the decoder of "),ot=n(Y,"A",{href:!0});var Sl=i(ot);Xr=r(Sl,"DETR"),Sl.forEach(t),Qr=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 "),At=n(Y,"CODE",{});var ql=i(At);Yr=r(ql,"use_auxilary_loss"),ql.forEach(t),Zr=r(Y," of "),tt=n(Y,"A",{href:!0});var Rl=i(tt);Jr=r(Rl,"MaskFormerConfig"),Rl.forEach(t),ea=r(Y," to "),Ct=n(Y,"CODE",{});var Ul=i(Ct);oa=r(Ul,"True"),Ul.forEach(t),ta=r(Y,", then prediction feedforward neural networks and Hungarian losses are added after each decoder layer (with the FFNs sharing parameters)."),Y.forEach(t),sa=m(Se),C=n(Se,"LI",{});var Z=i(C);ra=r(Z,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Dt=n(Z,"CODE",{});var Bl=i(Dt);aa=r(Bl,"get_num_masks"),Bl.forEach(t),na=r(Z," function inside in the "),St=n(Z,"CODE",{});var Hl=i(St);ia=r(Hl,"MaskFormerLoss"),Hl.forEach(t),la=r(Z," class of "),qt=n(Z,"CODE",{});var Vl=i(qt);ca=r(Vl,"modeling_maskformer.py"),Vl.forEach(t),da=r(Z,`. 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(Z,"A",{href:!0,rel:!0});var Wl=i(Ge);ma=r(Wl,"here"),Wl.forEach(t),pa=r(Z,"."),Z.forEach(t),ha=m(Se),Ke=n(Se,"LI",{});var er=i(Ke);ga=r(er,"One can use "),st=n(er,"A",{href:!0});var Gl=i(st);fa=r(Gl,"MaskFormerImageProcessor"),Gl.forEach(t),ua=r(er," to prepare images for the model and optional targets for the model."),er.forEach(t),_a=m(Se),D=n(Se,"LI",{});var J=i(D);ka=r(J,"To get the final segmentation, depending on the task, you can call "),rt=n(J,"A",{href:!0});var Kl=i(rt);ba=r(Kl,"post_process_semantic_segmentation()"),Kl.forEach(t),va=r(J," or "),at=n(J,"A",{href:!0});var Xl=i(at);Fa=r(Xl,"post_process_panoptic_segmentation()"),Xl.forEach(t),wa=r(J,". Both tasks can be solved using "),nt=n(J,"A",{href:!0});var Ql=i(nt);ya=r(Ql,"MaskFormerForInstanceSegmentation"),Ql.forEach(t),Ma=r(J," output, panoptic segmentation accepts an optional "),Rt=n(J,"CODE",{});var Yl=i(Rt);Ta=r(Yl,"label_ids_to_fuse"),Yl.forEach(t),Ia=r(J," argument to fuse instances of the target object/s (e.g. sky) together."),J.forEach(t),Se.forEach(t),Ls=m(o),_e=n(o,"P",{});var or=i(_e);$a=r(or,"The figure below illustrates the architecture of MaskFormer. Taken from the "),Xe=n(or,"A",{href:!0,rel:!0});var Zl=i(Xe);xa=r(Zl,"original paper"),Zl.forEach(t),Pa=r(or,"."),or.forEach(t),js=m(o),Qe=n(o,"IMG",{width:!0,src:!0}),Ns=m(o),K=n(o,"P",{});var Tt=i(K);Ea=r(Tt,"This model was contributed by "),Ye=n(Tt,"A",{href:!0,rel:!0});var Jl=i(Ye);za=r(Jl,"francesco"),Jl.forEach(t),Oa=r(Tt,". The original code can be found "),Ze=n(Tt,"A",{href:!0,rel:!0});var ec=i(Ze);La=r(ec,"here"),ec.forEach(t),ja=r(Tt,"."),Tt.forEach(t),As=m(o),oe=n(o,"H2",{class:!0});var tr=i(oe);ke=n(tr,"A",{id:!0,class:!0,href:!0});var oc=i(ke);Ut=n(oc,"SPAN",{});var tc=i(Ut);b(Je.$$.fragment,tc),tc.forEach(t),oc.forEach(t),Na=m(tr),Bt=n(tr,"SPAN",{});var sc=i(Bt);Aa=r(sc,"Resources"),sc.forEach(t),tr.forEach(t),Cs=m(o),b(eo.$$.fragment,o),Ds=m(o),it=n(o,"UL",{});var rc=i(it);oo=n(rc,"LI",{});var sr=i(oo);Ca=r(sr,"All notebooks that illustrate inference as well as fine-tuning on custom data with MaskFormer can be found "),to=n(sr,"A",{href:!0,rel:!0});var ac=i(to);Da=r(ac,"here"),ac.forEach(t),Sa=r(sr,"."),sr.forEach(t),rc.forEach(t),Ss=m(o),te=n(o,"H2",{class:!0});var rr=i(te);be=n(rr,"A",{id:!0,class:!0,href:!0});var nc=i(be);Ht=n(nc,"SPAN",{});var ic=i(Ht);b(so.$$.fragment,ic),ic.forEach(t),nc.forEach(t),qa=m(rr),Vt=n(rr,"SPAN",{});var lc=i(Vt);Ra=r(lc,"MaskFormer specific outputs"),lc.forEach(t),rr.forEach(t),qs=m(o),se=n(o,"DIV",{class:!0});var ar=i(se);b(ro.$$.fragment,ar),Ua=m(ar),ao=n(ar,"P",{});var nr=i(ao);Ba=r(nr,"Class for outputs of "),lt=n(nr,"A",{href:!0});var cc=i(lt);Ha=r(cc,"MaskFormerModel"),cc.forEach(t),Va=r(nr,". This class returns all the needed hidden states to compute the logits."),nr.forEach(t),ar.forEach(t),Rs=m(o),U=n(o,"DIV",{class:!0});var It=i(U);b(no.$$.fragment,It),Wa=m(It),io=n(It,"P",{});var ir=i(io);Ga=r(ir,"Class for outputs of "),ct=n(ir,"A",{href:!0});var dc=i(ct);Ka=r(dc,"MaskFormerForInstanceSegmentation"),dc.forEach(t),Xa=r(ir,"."),ir.forEach(t),Qa=m(It),B=n(It,"P",{});var qe=i(B);Ya=r(qe,"This output can be directly passed to "),dt=n(qe,"A",{href:!0});var mc=i(dt);Za=r(mc,"post_process_semantic_segmentation()"),mc.forEach(t),Ja=r(qe,` or or
`),mt=n(qe,"A",{href:!0});var pc=i(mt);en=r(pc,"post_process_instance_segmentation()"),pc.forEach(t),on=r(qe,` or
`),pt=n(qe,"A",{href:!0});var hc=i(pt);tn=r(hc,"post_process_panoptic_segmentation()"),hc.forEach(t),sn=r(qe," depending on the task. Please, see\n[`~MaskFormerImageProcessor] for details regarding usage."),qe.forEach(t),It.forEach(t),Us=m(o),re=n(o,"H2",{class:!0});var lr=i(re);ve=n(lr,"A",{id:!0,class:!0,href:!0});var gc=i(ve);Wt=n(gc,"SPAN",{});var fc=i(Wt);b(lo.$$.fragment,fc),fc.forEach(t),gc.forEach(t),rn=m(lr),Gt=n(lr,"SPAN",{});var uc=i(Gt);an=r(uc,"MaskFormerConfig"),uc.forEach(t),lr.forEach(t),Bs=m(o),P=n(o,"DIV",{class:!0});var N=i(P);b(co.$$.fragment,N),nn=m(N),H=n(N,"P",{});var Re=i(H);ln=r(Re,"This is the configuration class to store the configuration of a "),ht=n(Re,"A",{href:!0});var _c=i(ht);cn=r(_c,"MaskFormerModel"),_c.forEach(t),dn=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
`),mo=n(Re,"A",{href:!0,rel:!0});var kc=i(mo);mn=r(kc,"facebook/maskformer-swin-base-ade"),kc.forEach(t),pn=r(Re,` architecture trained
on `),po=n(Re,"A",{href:!0,rel:!0});var bc=i(po);hn=r(bc,"ADE20k-150"),bc.forEach(t),gn=r(Re,"."),Re.forEach(t),fn=m(N),ae=n(N,"P",{});var $t=i(ae);un=r($t,"Configuration objects inherit from "),gt=n($t,"A",{href:!0});var vc=i(gt);_n=r(vc,"PretrainedConfig"),vc.forEach(t),kn=r($t,` and can be used to control the model outputs. Read the
documentation from `),ft=n($t,"A",{href:!0});var Fc=i(ft);bn=r(Fc,"PretrainedConfig"),Fc.forEach(t),vn=r($t," for more information."),$t.forEach(t),Fn=m(N),ho=n(N,"P",{});var cr=i(ho);wn=r(cr,"Currently, MaskFormer only supports the "),ut=n(cr,"A",{href:!0});var wc=i(ut);yn=r(wc,"Swin Transformer"),wc.forEach(t),Mn=r(cr," as backbone."),cr.forEach(t),Tn=m(N),b(Fe.$$.fragment,N),In=m(N),we=n(N,"DIV",{class:!0});var dr=i(we);b(go.$$.fragment,dr),$n=m(dr),fo=n(dr,"P",{});var mr=i(fo);xn=r(mr,"Instantiate a "),_t=n(mr,"A",{href:!0});var yc=i(_t);Pn=r(yc,"MaskFormerConfig"),yc.forEach(t),En=r(mr,` (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.`),mr.forEach(t),dr.forEach(t),zn=m(N),ye=n(N,"DIV",{class:!0});var pr=i(ye);b(uo.$$.fragment,pr),On=m(pr),_o=n(pr,"P",{});var hr=i(_o);Ln=r(hr,"Serializes this instance to a Python dictionary. Override the default "),kt=n(hr,"A",{href:!0});var Mc=i(kt);jn=r(Mc,"to_dict()"),Mc.forEach(t),Nn=r(hr,"."),hr.forEach(t),pr.forEach(t),N.forEach(t),Hs=m(o),ne=n(o,"H2",{class:!0});var gr=i(ne);Me=n(gr,"A",{id:!0,class:!0,href:!0});var Tc=i(Me);Kt=n(Tc,"SPAN",{});var Ic=i(Kt);b(ko.$$.fragment,Ic),Ic.forEach(t),Tc.forEach(t),An=m(gr),Xt=n(gr,"SPAN",{});var $c=i(Xt);Cn=r($c,"MaskFormerImageProcessor"),$c.forEach(t),gr.forEach(t),Vs=m(o),I=n(o,"DIV",{class:!0});var O=i(I);b(bo.$$.fragment,O),Dn=m(O),Qt=n(O,"P",{});var xc=i(Qt);Sn=r(xc,`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),xc.forEach(t),qn=m(O),vo=n(O,"P",{});var fr=i(vo);Rn=r(fr,"This image processor inherits from "),Yt=n(fr,"CODE",{});var Pc=i(Yt);Un=r(Pc,"BaseImageProcessor"),Pc.forEach(t),Bn=r(fr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),fr.forEach(t),Hn=m(O),bt=n(O,"DIV",{class:!0});var Ec=i(bt);b(Fo.$$.fragment,Ec),Ec.forEach(t),Vn=m(O),X=n(O,"DIV",{class:!0});var xt=i(X);b(wo.$$.fragment,xt),Wn=m(xt),yo=n(xt,"P",{});var ur=i(yo);Gn=r(ur,"Pad images up to the largest image in a batch and create a corresponding "),Zt=n(ur,"CODE",{});var zc=i(Zt);Kn=r(zc,"pixel_mask"),zc.forEach(t),Xn=r(ur,"."),ur.forEach(t),Qn=m(xt),V=n(xt,"P",{});var Ue=i(V);Yn=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
`),Jt=n(Ue,"CODE",{});var Oc=i(Jt);Zn=r(Oc,"segmentation_maps = [[2,6,7,9]]"),Oc.forEach(t),Jn=r(Ue,", the output will contain "),es=n(Ue,"CODE",{});var Lc=i(es);ei=r(Lc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Lc.forEach(t),oi=r(Ue," (four binary masks) and "),os=n(Ue,"CODE",{});var jc=i(os);ti=r(jc,"class_labels = [2,6,7,9]"),jc.forEach(t),si=r(Ue,`, the labels for
each mask.`),Ue.forEach(t),xt.forEach(t),ri=m(O),Te=n(O,"DIV",{class:!0});var _r=i(Te);b(Mo.$$.fragment,_r),ai=m(_r),To=n(_r,"P",{});var kr=i(To);ni=r(kr,"Converts the output of "),vt=n(kr,"A",{href:!0});var Nc=i(vt);ii=r(Nc,"MaskFormerForInstanceSegmentation"),Nc.forEach(t),li=r(kr,` into semantic segmentation maps. Only supports
PyTorch.`),kr.forEach(t),_r.forEach(t),ci=m(O),Ie=n(O,"DIV",{class:!0});var br=i(Ie);b(Io.$$.fragment,br),di=m(br),$o=n(br,"P",{});var vr=i($o);mi=r(vr,"Converts the output of "),ts=n(vr,"CODE",{});var Ac=i(ts);pi=r(Ac,"MaskFormerForInstanceSegmentationOutput"),Ac.forEach(t),hi=r(vr,` into instance segmentation predictions. Only
supports PyTorch.`),vr.forEach(t),br.forEach(t),gi=m(O),$e=n(O,"DIV",{class:!0});var Fr=i($e);b(xo.$$.fragment,Fr),fi=m(Fr),Po=n(Fr,"P",{});var wr=i(Po);ui=r(wr,"Converts the output of "),ss=n(wr,"CODE",{});var Cc=i(ss);_i=r(Cc,"MaskFormerForInstanceSegmentationOutput"),Cc.forEach(t),ki=r(wr,` into image panoptic segmentation
predictions. Only supports PyTorch.`),wr.forEach(t),Fr.forEach(t),O.forEach(t),Ws=m(o),ie=n(o,"H2",{class:!0});var yr=i(ie);xe=n(yr,"A",{id:!0,class:!0,href:!0});var Dc=i(xe);rs=n(Dc,"SPAN",{});var Sc=i(rs);b(Eo.$$.fragment,Sc),Sc.forEach(t),Dc.forEach(t),bi=m(yr),as=n(yr,"SPAN",{});var qc=i(as);vi=r(qc,"MaskFormerFeatureExtractor"),qc.forEach(t),yr.forEach(t),Gs=m(o),$=n(o,"DIV",{class:!0});var L=i($);b(zo.$$.fragment,L),Fi=m(L),ns=n(L,"P",{});var Rc=i(ns);wi=r(Rc,`Constructs a MaskFormer image processor. The image processor can be used to prepare image(s) and optional targets
for the model.`),Rc.forEach(t),yi=m(L),Oo=n(L,"P",{});var Mr=i(Oo);Mi=r(Mr,"This image processor inherits from "),is=n(Mr,"CODE",{});var Uc=i(is);Ti=r(Uc,"BaseImageProcessor"),Uc.forEach(t),Ii=r(Mr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Mr.forEach(t),$i=m(L),Ft=n(L,"DIV",{class:!0});var Bc=i(Ft);b(Lo.$$.fragment,Bc),Bc.forEach(t),xi=m(L),Q=n(L,"DIV",{class:!0});var Pt=i(Q);b(jo.$$.fragment,Pt),Pi=m(Pt),No=n(Pt,"P",{});var Tr=i(No);Ei=r(Tr,"Pad images up to the largest image in a batch and create a corresponding "),ls=n(Tr,"CODE",{});var Hc=i(ls);zi=r(Hc,"pixel_mask"),Hc.forEach(t),Oi=r(Tr,"."),Tr.forEach(t),Li=m(Pt),W=n(Pt,"P",{});var Be=i(W);ji=r(Be,`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
`),cs=n(Be,"CODE",{});var Vc=i(cs);Ni=r(Vc,"segmentation_maps = [[2,6,7,9]]"),Vc.forEach(t),Ai=r(Be,", the output will contain "),ds=n(Be,"CODE",{});var Wc=i(ds);Ci=r(Wc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Wc.forEach(t),Di=r(Be," (four binary masks) and "),ms=n(Be,"CODE",{});var Gc=i(ms);Si=r(Gc,"class_labels = [2,6,7,9]"),Gc.forEach(t),qi=r(Be,`, the labels for
each mask.`),Be.forEach(t),Pt.forEach(t),Ri=m(L),Pe=n(L,"DIV",{class:!0});var Ir=i(Pe);b(Ao.$$.fragment,Ir),Ui=m(Ir),Co=n(Ir,"P",{});var $r=i(Co);Bi=r($r,"Converts the output of "),wt=n($r,"A",{href:!0});var Kc=i(wt);Hi=r(Kc,"MaskFormerForInstanceSegmentation"),Kc.forEach(t),Vi=r($r,` into semantic segmentation maps. Only supports
PyTorch.`),$r.forEach(t),Ir.forEach(t),Wi=m(L),Ee=n(L,"DIV",{class:!0});var xr=i(Ee);b(Do.$$.fragment,xr),Gi=m(xr),So=n(xr,"P",{});var Pr=i(So);Ki=r(Pr,"Converts the output of "),ps=n(Pr,"CODE",{});var Xc=i(ps);Xi=r(Xc,"MaskFormerForInstanceSegmentationOutput"),Xc.forEach(t),Qi=r(Pr,` into instance segmentation predictions. Only
supports PyTorch.`),Pr.forEach(t),xr.forEach(t),Yi=m(L),ze=n(L,"DIV",{class:!0});var Er=i(ze);b(qo.$$.fragment,Er),Zi=m(Er),Ro=n(Er,"P",{});var zr=i(Ro);Ji=r(zr,"Converts the output of "),hs=n(zr,"CODE",{});var Qc=i(hs);el=r(Qc,"MaskFormerForInstanceSegmentationOutput"),Qc.forEach(t),ol=r(zr,` into image panoptic segmentation
predictions. Only supports PyTorch.`),zr.forEach(t),Er.forEach(t),L.forEach(t),Ks=m(o),le=n(o,"H2",{class:!0});var Or=i(le);Oe=n(Or,"A",{id:!0,class:!0,href:!0});var Yc=i(Oe);gs=n(Yc,"SPAN",{});var Zc=i(gs);b(Uo.$$.fragment,Zc),Zc.forEach(t),Yc.forEach(t),tl=m(Or),fs=n(Or,"SPAN",{});var Jc=i(fs);sl=r(Jc,"MaskFormerModel"),Jc.forEach(t),Or.forEach(t),Xs=m(o),G=n(o,"DIV",{class:!0});var Et=i(G);b(Bo.$$.fragment,Et),rl=m(Et),Ho=n(Et,"P",{});var Lr=i(Ho);al=r(Lr,`The bare MaskFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Vo=n(Lr,"A",{href:!0,rel:!0});var ed=i(Vo);nl=r(ed,"torch.nn.Module"),ed.forEach(t),il=r(Lr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Lr.forEach(t),ll=m(Et),q=n(Et,"DIV",{class:!0});var He=i(q);b(Wo.$$.fragment,He),cl=m(He),ce=n(He,"P",{});var zt=i(ce);dl=r(zt,"The "),yt=n(zt,"A",{href:!0});var od=i(yt);ml=r(od,"MaskFormerModel"),od.forEach(t),pl=r(zt," forward method, overrides the "),us=n(zt,"CODE",{});var td=i(us);hl=r(td,"__call__"),td.forEach(t),gl=r(zt," special method."),zt.forEach(t),fl=m(He),b(Le.$$.fragment,He),ul=m(He),b(je.$$.fragment,He),He.forEach(t),Et.forEach(t),Qs=m(o),de=n(o,"H2",{class:!0});var jr=i(de);Ne=n(jr,"A",{id:!0,class:!0,href:!0});var sd=i(Ne);_s=n(sd,"SPAN",{});var rd=i(_s);b(Go.$$.fragment,rd),rd.forEach(t),sd.forEach(t),_l=m(jr),ks=n(jr,"SPAN",{});var ad=i(ks);kl=r(ad,"MaskFormerForInstanceSegmentation"),ad.forEach(t),jr.forEach(t),Ys=m(o),me=n(o,"DIV",{class:!0});var Nr=i(me);b(Ko.$$.fragment,Nr),bl=m(Nr),z=n(Nr,"DIV",{class:!0});var R=i(z);b(Xo.$$.fragment,R),vl=m(R),pe=n(R,"P",{});var Ot=i(pe);Fl=r(Ot,"The "),Mt=n(Ot,"A",{href:!0});var nd=i(Mt);wl=r(nd,"MaskFormerForInstanceSegmentation"),nd.forEach(t),yl=r(Ot," forward method, overrides the "),bs=n(Ot,"CODE",{});var id=i(bs);Ml=r(id,"__call__"),id.forEach(t),Tl=r(Ot," special method."),Ot.forEach(t),Il=m(R),b(Ae.$$.fragment,R),$l=m(R),vs=n(R,"P",{});var ld=i(vs);xl=r(ld,"Examples:"),ld.forEach(t),Pl=m(R),b(Ce.$$.fragment,R),El=m(R),b(De.$$.fragment,R),R.forEach(t),Nr.forEach(t),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(Md)),l(f,"id","maskformer"),l(f,"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(f,"href","#maskformer"),l(_,"class","relative group"),l(fe,"id","overview"),l(fe,"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(fe,"href","#overview"),l(ee,"class","relative group"),l(We,"href","https://arxiv.org/abs/2107.06278"),l(We,"rel","nofollow"),l(ot,"href","detr"),l(tt,"href","/docs/transformers/v4.25.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(st,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor"),l(rt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor.post_process_semantic_segmentation"),l(at,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor.post_process_panoptic_segmentation"),l(nt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(Xe,"href","https://arxiv.org/abs/2107.06278"),l(Xe,"rel","nofollow"),l(Qe,"width","600"),hd(Qe.src,Ol="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/maskformer_architecture.png")||l(Qe,"src",Ol),l(Ye,"href","https://huggingface.co/francesco"),l(Ye,"rel","nofollow"),l(Ze,"href","https://github.com/facebookresearch/MaskFormer"),l(Ze,"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(oe,"class","relative group"),l(to,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/MaskFormer"),l(to,"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(te,"class","relative group"),l(lt,"href","/docs/transformers/v4.25.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(ct,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(dt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor.post_process_semantic_segmentation"),l(mt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor.post_process_instance_segmentation"),l(pt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerImageProcessor.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(ht,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerModel"),l(mo,"href","https://huggingface.co/facebook/maskformer-swin-base-ade"),l(mo,"rel","nofollow"),l(po,"href","https://huggingface.co/datasets/scene_parse_150"),l(po,"rel","nofollow"),l(gt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(ft,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(ut,"href","swin"),l(_t,"href","/docs/transformers/v4.25.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(kt,"href","/docs/transformers/v4.25.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(P,"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(bt,"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(vt,"href","/docs/transformers/v4.25.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(Ie,"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(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(xe,"id","transformers.MaskFormerImageProcessor"),l(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(xe,"href","#transformers.MaskFormerImageProcessor"),l(ie,"class","relative group"),l(Ft,"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(wt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),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(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(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($,"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(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Vo,"rel","nofollow"),l(yt,"href","/docs/transformers/v4.25.1/en/model_doc/maskformer#transformers.MaskFormerModel"),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(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(Ne,"id","transformers.MaskFormerForInstanceSegmentation"),l(Ne,"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(Ne,"href","#transformers.MaskFormerForInstanceSegmentation"),l(de,"class","relative group"),l(Mt,"href","/docs/transformers/v4.25.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(o,p){e(document.head,h),g(o,T,p),g(o,_,p),e(_,f),e(f,M),v(c,M,null),e(_,u),e(_,j),e(j,Sr),g(o,Is,p),v(ge,o,p),g(o,$s,p),g(o,ee,p),e(ee,fe),e(fe,Lt),v(Ve,Lt,null),e(ee,qr),e(ee,jt),e(jt,Rr),g(o,xs,p),g(o,ue,p),e(ue,Ur),e(ue,We),e(We,Br),e(ue,Hr),g(o,Ps,p),g(o,Zo,p),e(Zo,Vr),g(o,Es,p),g(o,Jo,p),e(Jo,Nt),e(Nt,Wr),g(o,zs,p),g(o,et,p),e(et,Gr),g(o,Os,p),g(o,S,p),e(S,A),e(A,Kr),e(A,ot),e(ot,Xr),e(A,Qr),e(A,At),e(At,Yr),e(A,Zr),e(A,tt),e(tt,Jr),e(A,ea),e(A,Ct),e(Ct,oa),e(A,ta),e(S,sa),e(S,C),e(C,ra),e(C,Dt),e(Dt,aa),e(C,na),e(C,St),e(St,ia),e(C,la),e(C,qt),e(qt,ca),e(C,da),e(C,Ge),e(Ge,ma),e(C,pa),e(S,ha),e(S,Ke),e(Ke,ga),e(Ke,st),e(st,fa),e(Ke,ua),e(S,_a),e(S,D),e(D,ka),e(D,rt),e(rt,ba),e(D,va),e(D,at),e(at,Fa),e(D,wa),e(D,nt),e(nt,ya),e(D,Ma),e(D,Rt),e(Rt,Ta),e(D,Ia),g(o,Ls,p),g(o,_e,p),e(_e,$a),e(_e,Xe),e(Xe,xa),e(_e,Pa),g(o,js,p),g(o,Qe,p),g(o,Ns,p),g(o,K,p),e(K,Ea),e(K,Ye),e(Ye,za),e(K,Oa),e(K,Ze),e(Ze,La),e(K,ja),g(o,As,p),g(o,oe,p),e(oe,ke),e(ke,Ut),v(Je,Ut,null),e(oe,Na),e(oe,Bt),e(Bt,Aa),g(o,Cs,p),v(eo,o,p),g(o,Ds,p),g(o,it,p),e(it,oo),e(oo,Ca),e(oo,to),e(to,Da),e(oo,Sa),g(o,Ss,p),g(o,te,p),e(te,be),e(be,Ht),v(so,Ht,null),e(te,qa),e(te,Vt),e(Vt,Ra),g(o,qs,p),g(o,se,p),v(ro,se,null),e(se,Ua),e(se,ao),e(ao,Ba),e(ao,lt),e(lt,Ha),e(ao,Va),g(o,Rs,p),g(o,U,p),v(no,U,null),e(U,Wa),e(U,io),e(io,Ga),e(io,ct),e(ct,Ka),e(io,Xa),e(U,Qa),e(U,B),e(B,Ya),e(B,dt),e(dt,Za),e(B,Ja),e(B,mt),e(mt,en),e(B,on),e(B,pt),e(pt,tn),e(B,sn),g(o,Us,p),g(o,re,p),e(re,ve),e(ve,Wt),v(lo,Wt,null),e(re,rn),e(re,Gt),e(Gt,an),g(o,Bs,p),g(o,P,p),v(co,P,null),e(P,nn),e(P,H),e(H,ln),e(H,ht),e(ht,cn),e(H,dn),e(H,mo),e(mo,mn),e(H,pn),e(H,po),e(po,hn),e(H,gn),e(P,fn),e(P,ae),e(ae,un),e(ae,gt),e(gt,_n),e(ae,kn),e(ae,ft),e(ft,bn),e(ae,vn),e(P,Fn),e(P,ho),e(ho,wn),e(ho,ut),e(ut,yn),e(ho,Mn),e(P,Tn),v(Fe,P,null),e(P,In),e(P,we),v(go,we,null),e(we,$n),e(we,fo),e(fo,xn),e(fo,_t),e(_t,Pn),e(fo,En),e(P,zn),e(P,ye),v(uo,ye,null),e(ye,On),e(ye,_o),e(_o,Ln),e(_o,kt),e(kt,jn),e(_o,Nn),g(o,Hs,p),g(o,ne,p),e(ne,Me),e(Me,Kt),v(ko,Kt,null),e(ne,An),e(ne,Xt),e(Xt,Cn),g(o,Vs,p),g(o,I,p),v(bo,I,null),e(I,Dn),e(I,Qt),e(Qt,Sn),e(I,qn),e(I,vo),e(vo,Rn),e(vo,Yt),e(Yt,Un),e(vo,Bn),e(I,Hn),e(I,bt),v(Fo,bt,null),e(I,Vn),e(I,X),v(wo,X,null),e(X,Wn),e(X,yo),e(yo,Gn),e(yo,Zt),e(Zt,Kn),e(yo,Xn),e(X,Qn),e(X,V),e(V,Yn),e(V,Jt),e(Jt,Zn),e(V,Jn),e(V,es),e(es,ei),e(V,oi),e(V,os),e(os,ti),e(V,si),e(I,ri),e(I,Te),v(Mo,Te,null),e(Te,ai),e(Te,To),e(To,ni),e(To,vt),e(vt,ii),e(To,li),e(I,ci),e(I,Ie),v(Io,Ie,null),e(Ie,di),e(Ie,$o),e($o,mi),e($o,ts),e(ts,pi),e($o,hi),e(I,gi),e(I,$e),v(xo,$e,null),e($e,fi),e($e,Po),e(Po,ui),e(Po,ss),e(ss,_i),e(Po,ki),g(o,Ws,p),g(o,ie,p),e(ie,xe),e(xe,rs),v(Eo,rs,null),e(ie,bi),e(ie,as),e(as,vi),g(o,Gs,p),g(o,$,p),v(zo,$,null),e($,Fi),e($,ns),e(ns,wi),e($,yi),e($,Oo),e(Oo,Mi),e(Oo,is),e(is,Ti),e(Oo,Ii),e($,$i),e($,Ft),v(Lo,Ft,null),e($,xi),e($,Q),v(jo,Q,null),e(Q,Pi),e(Q,No),e(No,Ei),e(No,ls),e(ls,zi),e(No,Oi),e(Q,Li),e(Q,W),e(W,ji),e(W,cs),e(cs,Ni),e(W,Ai),e(W,ds),e(ds,Ci),e(W,Di),e(W,ms),e(ms,Si),e(W,qi),e($,Ri),e($,Pe),v(Ao,Pe,null),e(Pe,Ui),e(Pe,Co),e(Co,Bi),e(Co,wt),e(wt,Hi),e(Co,Vi),e($,Wi),e($,Ee),v(Do,Ee,null),e(Ee,Gi),e(Ee,So),e(So,Ki),e(So,ps),e(ps,Xi),e(So,Qi),e($,Yi),e($,ze),v(qo,ze,null),e(ze,Zi),e(ze,Ro),e(Ro,Ji),e(Ro,hs),e(hs,el),e(Ro,ol),g(o,Ks,p),g(o,le,p),e(le,Oe),e(Oe,gs),v(Uo,gs,null),e(le,tl),e(le,fs),e(fs,sl),g(o,Xs,p),g(o,G,p),v(Bo,G,null),e(G,rl),e(G,Ho),e(Ho,al),e(Ho,Vo),e(Vo,nl),e(Ho,il),e(G,ll),e(G,q),v(Wo,q,null),e(q,cl),e(q,ce),e(ce,dl),e(ce,yt),e(yt,ml),e(ce,pl),e(ce,us),e(us,hl),e(ce,gl),e(q,fl),v(Le,q,null),e(q,ul),v(je,q,null),g(o,Qs,p),g(o,de,p),e(de,Ne),e(Ne,_s),v(Go,_s,null),e(de,_l),e(de,ks),e(ks,kl),g(o,Ys,p),g(o,me,p),v(Ko,me,null),e(me,bl),e(me,z),v(Xo,z,null),e(z,vl),e(z,pe),e(pe,Fl),e(pe,Mt),e(Mt,wl),e(pe,yl),e(pe,bs),e(bs,Ml),e(pe,Tl),e(z,Il),v(Ae,z,null),e(z,$l),e(z,vs),e(vs,xl),e(z,Pl),v(Ce,z,null),e(z,El),v(De,z,null),Zs=!0},p(o,[p]){const Qo={};p&2&&(Qo.$$scope={dirty:p,ctx:o}),ge.$set(Qo);const Fs={};p&2&&(Fs.$$scope={dirty:p,ctx:o}),Fe.$set(Fs);const ws={};p&2&&(ws.$$scope={dirty:p,ctx:o}),Le.$set(ws);const ys={};p&2&&(ys.$$scope={dirty:p,ctx:o}),je.$set(ys);const Yo={};p&2&&(Yo.$$scope={dirty:p,ctx:o}),Ae.$set(Yo);const Ms={};p&2&&(Ms.$$scope={dirty:p,ctx:o}),Ce.$set(Ms);const Ts={};p&2&&(Ts.$$scope={dirty:p,ctx:o}),De.$set(Ts)},i(o){Zs||(F(c.$$.fragment,o),F(ge.$$.fragment,o),F(Ve.$$.fragment,o),F(Je.$$.fragment,o),F(eo.$$.fragment,o),F(so.$$.fragment,o),F(ro.$$.fragment,o),F(no.$$.fragment,o),F(lo.$$.fragment,o),F(co.$$.fragment,o),F(Fe.$$.fragment,o),F(go.$$.fragment,o),F(uo.$$.fragment,o),F(ko.$$.fragment,o),F(bo.$$.fragment,o),F(Fo.$$.fragment,o),F(wo.$$.fragment,o),F(Mo.$$.fragment,o),F(Io.$$.fragment,o),F(xo.$$.fragment,o),F(Eo.$$.fragment,o),F(zo.$$.fragment,o),F(Lo.$$.fragment,o),F(jo.$$.fragment,o),F(Ao.$$.fragment,o),F(Do.$$.fragment,o),F(qo.$$.fragment,o),F(Uo.$$.fragment,o),F(Bo.$$.fragment,o),F(Wo.$$.fragment,o),F(Le.$$.fragment,o),F(je.$$.fragment,o),F(Go.$$.fragment,o),F(Ko.$$.fragment,o),F(Xo.$$.fragment,o),F(Ae.$$.fragment,o),F(Ce.$$.fragment,o),F(De.$$.fragment,o),Zs=!0)},o(o){w(c.$$.fragment,o),w(ge.$$.fragment,o),w(Ve.$$.fragment,o),w(Je.$$.fragment,o),w(eo.$$.fragment,o),w(so.$$.fragment,o),w(ro.$$.fragment,o),w(no.$$.fragment,o),w(lo.$$.fragment,o),w(co.$$.fragment,o),w(Fe.$$.fragment,o),w(go.$$.fragment,o),w(uo.$$.fragment,o),w(ko.$$.fragment,o),w(bo.$$.fragment,o),w(Fo.$$.fragment,o),w(wo.$$.fragment,o),w(Mo.$$.fragment,o),w(Io.$$.fragment,o),w(xo.$$.fragment,o),w(Eo.$$.fragment,o),w(zo.$$.fragment,o),w(Lo.$$.fragment,o),w(jo.$$.fragment,o),w(Ao.$$.fragment,o),w(Do.$$.fragment,o),w(qo.$$.fragment,o),w(Uo.$$.fragment,o),w(Bo.$$.fragment,o),w(Wo.$$.fragment,o),w(Le.$$.fragment,o),w(je.$$.fragment,o),w(Go.$$.fragment,o),w(Ko.$$.fragment,o),w(Xo.$$.fragment,o),w(Ae.$$.fragment,o),w(Ce.$$.fragment,o),w(De.$$.fragment,o),Zs=!1},d(o){t(h),o&&t(T),o&&t(_),y(c),o&&t(Is),y(ge,o),o&&t($s),o&&t(ee),y(Ve),o&&t(xs),o&&t(ue),o&&t(Ps),o&&t(Zo),o&&t(Es),o&&t(Jo),o&&t(zs),o&&t(et),o&&t(Os),o&&t(S),o&&t(Ls),o&&t(_e),o&&t(js),o&&t(Qe),o&&t(Ns),o&&t(K),o&&t(As),o&&t(oe),y(Je),o&&t(Cs),y(eo,o),o&&t(Ds),o&&t(it),o&&t(Ss),o&&t(te),y(so),o&&t(qs),o&&t(se),y(ro),o&&t(Rs),o&&t(U),y(no),o&&t(Us),o&&t(re),y(lo),o&&t(Bs),o&&t(P),y(co),y(Fe),y(go),y(uo),o&&t(Hs),o&&t(ne),y(ko),o&&t(Vs),o&&t(I),y(bo),y(Fo),y(wo),y(Mo),y(Io),y(xo),o&&t(Ws),o&&t(ie),y(Eo),o&&t(Gs),o&&t($),y(zo),y(Lo),y(jo),y(Ao),y(Do),y(qo),o&&t(Ks),o&&t(le),y(Uo),o&&t(Xs),o&&t(G),y(Bo),y(Wo),y(Le),y(je),o&&t(Qs),o&&t(de),y(Go),o&&t(Ys),o&&t(me),y(Ko),y(Xo),y(Ae),y(Ce),y(De)}}}const Md={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.MaskFormerImageProcessor",title:"MaskFormerFeatureExtractor"},{local:"transformers.MaskFormerModel",title:"MaskFormerModel"},{local:"transformers.MaskFormerForInstanceSegmentation",title:"MaskFormerForInstanceSegmentation"}],title:"MaskFormer"};function Td(E){return gd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ld extends cd{constructor(h){super();dd(this,h,Td,yd,md,{})}}export{Ld as default,Md as metadata};
