import{S as rd,i as nd,s as sd,e as s,k as c,w as v,t as r,M as ad,c as a,d as t,m as d,a as i,x as b,h as n,b as l,N as od,G as e,g as h,y,q as w,o as F,B as T,v as id,L as _l}from"../../chunks/vendor-hf-doc-builder.js";import{T as td}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as vl}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ul}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ld(P){let f,k,_,g,O;return g=new vl({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9uZUZvcm1lckNvbmZpZyUyQyUyME9uZUZvcm1lck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME9uZUZvcm1lciUyMHNoaS1sYWJzJTJGb25lZm9ybWVyX2FkZTIwa19zd2luX3RpbnklMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME9uZUZvcm1lckNvbmZpZygpJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzaGktbGFicyUyRm9uZWZvcm1lcl9hZGUyMGtfc3dpbl90aW55JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBPbmVGb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OneFormerConfig, OneFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OneFormer shi-labs/oneformer_ade20k_swin_tiny configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OneFormerConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the shi-labs/oneformer_ade20k_swin_tiny style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OneFormerModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){f=s("p"),k=r("Examples:"),_=c(),v(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);k=n(u,"Examples:"),u.forEach(t),_=d(p),b(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,k),h(p,_,u),y(g,p,u),O=!0},p:_l,i(p){O||(w(g.$$.fragment,p),O=!0)},o(p){F(g.$$.fragment,p),O=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function cd(P){let f,k,_,g,O;return{c(){f=s("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),O=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){f=a(p,"P",{});var u=i(f);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var S=i(_);g=n(S,"Module"),S.forEach(t),O=n(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(p,u){h(p,f,u),e(f,k),e(f,_),e(_,g),e(f,O)},d(p){p&&t(f)}}}function dd(P){let f,k,_,g,O;return g=new vl({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBPbmVGb3JtZXJQcm9jZXNzb3IlMkMlMjBPbmVGb3JtZXJNb2RlbCUwQSUwQSUyMyUyMGRvd25sb2FkJTIwdGV4dGluZyUyMGltYWdlJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMGxvYWQlMjBwcm9jZXNzb3IlMjBmb3IlMjBwcmVwcm9jZXNzaW5nJTIwdGhlJTIwaW5wdXRzJTBBcHJvY2Vzc29yJTIwJTNEJTIwT25lRm9ybWVyUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzaGktbGFicyUyRm9uZWZvcm1lcl9hZGUyMGtfc3dpbl90aW55JTIyKSUwQW1vZGVsJTIwJTNEJTIwT25lRm9ybWVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnNoaS1sYWJzJTJGb25lZm9ybWVyX2FkZTIwa19zd2luX3RpbnklMjIpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlJTJDJTIwJTVCJTIyc2VtYW50aWMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbWFza19wcmVkaWN0aW9ucyUyMCUzRCUyMG91dHB1dHMudHJhbnNmb3JtZXJfZGVjb2Rlcl9tYXNrX3ByZWRpY3Rpb25zJTBBY2xhc3NfcHJlZGljdGlvbnMlMjAlM0QlMjBvdXRwdXRzLnRyYW5zZm9ybWVyX2RlY29kZXJfY2xhc3NfcHJlZGljdGlvbnMlMEElMEFmJTIyJUYwJTlGJTkxJTg5JTIwTWFzayUyMFByZWRpY3Rpb25zJTIwU2hhcGUlM0ElMjAlN0JsaXN0KG1hc2tfcHJlZGljdGlvbnMuc2hhcGUpJTdEJTJDJTIwQ2xhc3MlMjBQcmVkaWN0aW9ucyUyMFNoYXBlJTNBJTIwJTdCbGlzdChjbGFzc19wcmVkaWN0aW9ucy5zaGFwZSklN0QlMjI=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> 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-keyword">from</span> transformers <span class="hljs-keyword">import</span> OneFormerProcessor, OneFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># download texting image</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><span class="hljs-comment"># load processor for preprocessing the inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = OneFormerProcessor.from_pretrained(<span class="hljs-string">&quot;shi-labs/oneformer_ade20k_swin_tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OneFormerModel.from_pretrained(<span class="hljs-string">&quot;shi-labs/oneformer_ade20k_swin_tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, [<span class="hljs-string">&quot;semantic&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_predictions = outputs.transformer_decoder_mask_predictions
<span class="hljs-meta">&gt;&gt;&gt; </span>class_predictions = outputs.transformer_decoder_class_predictions

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-string">f&quot;\u{1F449} Mask Predictions Shape: <span class="hljs-subst">{<span class="hljs-built_in">list</span>(mask_predictions.shape)}</span>, Class Predictions Shape: <span class="hljs-subst">{<span class="hljs-built_in">list</span>(class_predictions.shape)}</span>&quot;</span>
<span class="hljs-string">&#x27;\u{1F449} Mask Predictions Shape: [1, 150, 128, 171], Class Predictions Shape: [1, 150, 151]&#x27;</span>`}}),{c(){f=s("p"),k=r("Example:"),_=c(),v(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);k=n(u,"Example:"),u.forEach(t),_=d(p),b(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,k),h(p,_,u),y(g,p,u),O=!0},p:_l,i(p){O||(w(g.$$.fragment,p),O=!0)},o(p){F(g.$$.fragment,p),O=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function md(P){let f,k,_,g,O;return{c(){f=s("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),O=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){f=a(p,"P",{});var u=i(f);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var S=i(_);g=n(S,"Module"),S.forEach(t),O=n(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(p,u){h(p,f,u),e(f,k),e(f,_),e(_,g),e(f,O)},d(p){p&&t(f)}}}function pd(P){let f,k,_,g,O;return g=new vl({props:{code:" ",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OneFormerProcessor, OneFormerForUniversalSegmentation
<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-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load OneFormer fine-tuned on ADE20k for universal segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = OneFormerProcessor.from_pretrained(<span class="hljs-string">&quot;shi-labs/oneformer_ade20k_swin_tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OneFormerForUniversalSegmentation.from_pretrained(<span class="hljs-string">&quot;shi-labs/oneformer_ade20k_swin_tiny&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><span class="hljs-comment"># Semantic Segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, [<span class="hljs-string">&quot;semantic&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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 processor for semantic postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_semantic_map = 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-string">f&quot;\u{1F449} Semantic Predictions Shape: <span class="hljs-subst">{<span class="hljs-built_in">list</span>(predicted_semantic_map.shape)}</span>&quot;</span>
<span class="hljs-string">&#x27;\u{1F449} Semantic Predictions Shape: [512, 683]&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Instance Segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, [<span class="hljs-string">&quot;instance&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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 processor for instance postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_instance_map = processor.post_process_instance_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-string">&quot;segmentation&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-string">f&quot;\u{1F449} Instance Predictions Shape: <span class="hljs-subst">{<span class="hljs-built_in">list</span>(predicted_instance_map.shape)}</span>&quot;</span>
<span class="hljs-string">&#x27;\u{1F449} Instance Predictions Shape: [512, 683]&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Panoptic Segmentation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, [<span class="hljs-string">&quot;panoptic&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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 processor for panoptic postprocessing</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_panoptic_map = processor.post_process_panoptic_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-string">&quot;segmentation&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-string">f&quot;\u{1F449} Panoptic Predictions Shape: <span class="hljs-subst">{<span class="hljs-built_in">list</span>(predicted_panoptic_map.shape)}</span>&quot;</span>
<span class="hljs-string">&#x27;\u{1F449} Panoptic Predictions Shape: [512, 683]&#x27;</span>`}}),{c(){f=s("p"),k=r("Universal segmentation example:"),_=c(),v(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);k=n(u,"Universal segmentation example:"),u.forEach(t),_=d(p),b(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,k),h(p,_,u),y(g,p,u),O=!0},p:_l,i(p){O||(w(g.$$.fragment,p),O=!0)},o(p){F(g.$$.fragment,p),O=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function hd(P){let f,k,_,g,O,p,u,S,In,wr,oe,ue,Nt,Ge,jn,Et,Un,Fr,_e,$n,Ve,Jn,zn,Tr,Ae,bl,Or,Ao,Nn,kr,Xo,Pt,En,Mr,Lo,Pn,xr,J,te,Cn,Ct,Wn,qn,Wt,Sn,Zn,Bn,qt,Rn,Gn,N,Vn,St,An,Xn,Zt,Ln,Dn,Bt,Hn,Yn,Xe,Qn,Kn,es,E,os,Do,ts,rs,Rt,ns,ss,Ho,as,is,Yo,ls,cs,ds,U,ms,Qo,ps,hs,Ko,fs,gs,et,us,_s,ot,vs,bs,Gt,ys,ws,Ir,ve,Fs,Le,Ts,Os,jr,De,yl,Ur,L,ks,He,Ms,xs,Ye,Is,js,$r,re,be,Vt,Qe,Us,At,$s,Jr,tt,Js,zr,rt,Ke,zs,eo,Ns,Es,Nr,nt,Ps,Er,ne,ye,Xt,oo,Cs,Lt,Ws,Pr,se,to,qs,ro,Ss,st,Zs,Bs,Cr,Z,no,Rs,so,Gs,Dt,Vs,As,Xs,B,Ls,at,Ds,Hs,it,Ys,Qs,lt,Ks,ea,Wr,ae,we,Ht,ao,oa,Yt,ta,qr,$,io,ra,R,na,ct,sa,aa,lo,ia,la,co,ca,da,ma,ie,pa,dt,ha,fa,mt,ga,ua,_a,Fe,va,Te,mo,ba,le,ya,pt,wa,Fa,Qt,Ta,Oa,Sr,ce,Oe,Kt,po,ka,er,Ma,Zr,M,ho,xa,or,Ia,ja,fo,Ua,tr,$a,Ja,za,ht,go,Na,D,uo,Ea,_o,Pa,rr,Ca,Wa,qa,G,Sa,nr,Za,Ba,sr,Ra,Ga,ar,Va,Aa,Xa,ke,vo,La,bo,Da,ft,Ha,Ya,Qa,Me,yo,Ka,wo,ei,ir,oi,ti,ri,xe,Fo,ni,To,si,lr,ai,ii,Br,de,Ie,cr,Oo,li,dr,ci,Rr,I,ko,di,V,mi,gt,pi,hi,ut,fi,gi,_t,ui,_i,vi,je,Mo,bi,xo,yi,vt,wi,Fi,Ti,Ue,Io,Oi,jo,ki,bt,Mi,xi,Ii,$e,Uo,ji,$o,Ui,yt,$i,Ji,zi,Je,Jo,Ni,zo,Ei,wt,Pi,Ci,Gr,me,ze,mr,No,Wi,pr,qi,Vr,A,Eo,Si,Po,Zi,Co,Bi,Ri,Gi,C,Wo,Vi,pe,Ai,Ft,Xi,Li,hr,Di,Hi,Yi,Ne,Qi,Ee,Ar,he,Pe,fr,qo,Ki,gr,el,Xr,X,So,ol,Zo,tl,Bo,rl,nl,sl,z,Ro,al,fe,il,Tt,ll,cl,ur,dl,ml,pl,Ce,hl,_r,fl,gl,We,Lr;return p=new ge({}),Ge=new ge({}),Qe=new ge({}),oo=new ge({}),to=new x({props:{name:"class transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput",anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput",parameters:[{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[torch.FloatTensor] = None"},{name:"transformer_decoder_object_queries",val:": FloatTensor = None"},{name:"transformer_decoder_contrastive_queries",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_mask_predictions",val:": FloatTensor = None"},{name:"transformer_decoder_class_predictions",val:": FloatTensor = None"},{name:"transformer_decoder_auxiliary_predictions",val:": typing.Union[typing.Tuple[typing.Dict[str, torch.FloatTensor]], NoneType] = None"},{name:"text_queries",val:": typing.Optional[torch.FloatTensor] = None"},{name:"task_token",val:": FloatTensor = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.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.oneformer.modeling_oneformer.OneFormerModelOutput.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.oneformer.modeling_oneformer.OneFormerModelOutput.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.oneformer.modeling_oneformer.OneFormerModelOutput.transformer_decoder_object_queries",description:`<strong>transformer_decoder_object_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Output object queries from the last layer in the transformer decoder.`,name:"transformer_decoder_object_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.transformer_decoder_contrastive_queries",description:`<strong>transformer_decoder_contrastive_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Contrastive queries from the transformer decoder.`,name:"transformer_decoder_contrastive_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.transformer_decoder_mask_predictions",description:`<strong>transformer_decoder_mask_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height, width)</code>) &#x2014;
Mask Predictions from the last layer in the transformer decoder.`,name:"transformer_decoder_mask_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.transformer_decoder_class_predictions",description:`<strong>transformer_decoder_class_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes+1)</code>) &#x2014;
Class Predictions from the last layer in the transformer decoder.`,name:"transformer_decoder_class_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.transformer_decoder_auxiliary_predictions",description:`<strong>transformer_decoder_auxiliary_predictions</strong> (Tuple of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Tuple of class and mask predictions from each layer of the transformer decoder.`,name:"transformer_decoder_auxiliary_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.text_queries",description:`<strong>text_queries</strong> (<code>torch.FloatTensor</code>, <em>optional</em> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Text queries derived from the input text list used for calculating contrastive loss during training.`,name:"text_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.task_token",description:`<strong>task_token</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_dim)</code>) &#x2014;
1D task token to condition the queries.`,name:"task_token"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(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>tuple(torch.FloatTensor)</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Self and Cross Attentions weights from transformer decoder.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L804"}}),no=new x({props:{name:"class transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput",anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput",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_predictions",val:": typing.List[typing.Dict[str, torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"pixel_decoder_hidden_states",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"transformer_decoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_object_queries",val:": FloatTensor = None"},{name:"transformer_decoder_contrastive_queries",val:": typing.Optional[torch.FloatTensor] = None"},{name:"transformer_decoder_mask_predictions",val:": FloatTensor = None"},{name:"transformer_decoder_class_predictions",val:": FloatTensor = None"},{name:"transformer_decoder_auxiliary_predictions",val:": typing.Union[typing.List[typing.Dict[str, torch.FloatTensor]], NoneType] = None"},{name:"text_queries",val:": typing.Optional[torch.FloatTensor] = None"},{name:"task_token",val:": FloatTensor = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.auxiliary_predictions",description:`<strong>auxiliary_predictions</strong> (List of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) &#x2014;
List of class and mask predictions from each layer of the transformer decoder.`,name:"auxiliary_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.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.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.transformer_decoder_object_queries",description:`<strong>transformer_decoder_object_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Output object queries from the last layer in the transformer decoder.`,name:"transformer_decoder_object_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.transformer_decoder_contrastive_queries",description:`<strong>transformer_decoder_contrastive_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Contrastive queries from the transformer decoder.`,name:"transformer_decoder_contrastive_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.transformer_decoder_mask_predictions",description:`<strong>transformer_decoder_mask_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height, width)</code>) &#x2014;
Mask Predictions from the last layer in the transformer decoder.`,name:"transformer_decoder_mask_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.transformer_decoder_class_predictions",description:`<strong>transformer_decoder_class_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes+1)</code>) &#x2014;
Class Predictions from the last layer in the transformer decoder.`,name:"transformer_decoder_class_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.transformer_decoder_auxiliary_predictions",description:`<strong>transformer_decoder_auxiliary_predictions</strong> (List of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) &#x2014;
List of class and mask predictions from each layer of the transformer decoder.`,name:"transformer_decoder_auxiliary_predictions"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.text_queries",description:`<strong>text_queries</strong> (<code>torch.FloatTensor</code>, <em>optional</em> of shape <code>(batch_size, num_queries, hidden_dim)</code>) &#x2014;
Text queries derived from the input text list used for calculating contrastive loss during training.`,name:"text_queries"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.task_token",description:`<strong>task_token</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_dim)</code>) &#x2014;
1D task token to condition the queries.`,name:"task_token"},{anchor:"transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(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>tuple(torch.FloatTensor)</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Self and Cross Attentions weights from transformer decoder.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L854"}}),ao=new ge({}),io=new x({props:{name:"class transformers.OneFormerConfig",anchor:"transformers.OneFormerConfig",parameters:[{name:"backbone_config",val:": typing.Optional[typing.Dict] = None"},{name:"ignore_value",val:": int = 255"},{name:"num_queries",val:": int = 150"},{name:"no_object_weight",val:": int = 0.1"},{name:"class_weight",val:": float = 2.0"},{name:"mask_weight",val:": float = 5.0"},{name:"dice_weight",val:": float = 5.0"},{name:"contrastive_weight",val:": float = 0.5"},{name:"contrastive_temperature",val:": float = 0.07"},{name:"train_num_points",val:": int = 12544"},{name:"oversample_ratio",val:": float = 3.0"},{name:"importance_sample_ratio",val:": float = 0.75"},{name:"init_std",val:": float = 0.02"},{name:"init_xavier_std",val:": float = 1.0"},{name:"layer_norm_eps",val:": float = 1e-05"},{name:"is_training",val:": bool = False"},{name:"use_auxiliary_loss",val:": bool = True"},{name:"output_auxiliary_logits",val:": bool = True"},{name:"strides",val:": typing.Optional[list] = [4, 8, 16, 32]"},{name:"task_seq_len",val:": int = 77"},{name:"text_encoder_width",val:": int = 256"},{name:"text_encoder_context_length",val:": int = 77"},{name:"text_encoder_num_layers",val:": int = 6"},{name:"text_encoder_vocab_size",val:": int = 49408"},{name:"text_encoder_proj_layers",val:": int = 2"},{name:"text_encoder_n_ctx",val:": int = 16"},{name:"conv_dim",val:": int = 256"},{name:"mask_dim",val:": int = 256"},{name:"hidden_dim",val:": int = 256"},{name:"encoder_feedforward_dim",val:": int = 1024"},{name:"norm",val:": str = 'GN'"},{name:"encoder_layers",val:": int = 6"},{name:"decoder_layers",val:": int = 10"},{name:"use_task_norm",val:": bool = True"},{name:"num_attention_heads",val:": int = 8"},{name:"dropout",val:": float = 0.1"},{name:"dim_feedforward",val:": int = 2048"},{name:"pre_norm",val:": bool = False"},{name:"enforce_input_proj",val:": bool = False"},{name:"query_dec_layers",val:": int = 2"},{name:"common_stride",val:": int = 4"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OneFormerConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code>, <em>optional</em>, defaults to <code>SwinConfig</code>) &#x2014;
The configuration of the backbone model.`,name:"backbone_config"},{anchor:"transformers.OneFormerConfig.ignore_value",description:`<strong>ignore_value</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
Values to be ignored in GT label while calculating loss.`,name:"ignore_value"},{anchor:"transformers.OneFormerConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 150) &#x2014;
Number of object queries.`,name:"num_queries"},{anchor:"transformers.OneFormerConfig.no_object_weight",description:`<strong>no_object_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Weight for no-object class predictions.`,name:"no_object_weight"},{anchor:"transformers.OneFormerConfig.class_weight",description:`<strong>class_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Weight for Classification CE loss.`,name:"class_weight"},{anchor:"transformers.OneFormerConfig.mask_weight",description:`<strong>mask_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#x2014;
Weight for binary CE loss.`,name:"mask_weight"},{anchor:"transformers.OneFormerConfig.dice_weight",description:`<strong>dice_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#x2014;
Weight for dice loss.`,name:"dice_weight"},{anchor:"transformers.OneFormerConfig.contrastive_weight",description:`<strong>contrastive_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Weight for contrastive loss.`,name:"contrastive_weight"},{anchor:"transformers.OneFormerConfig.contrastive_temperature",description:`<strong>contrastive_temperature</strong> (<code>float</code>, <em>optional</em>, defaults to 0.07) &#x2014;
Initial value for scaling the contrastive logits.`,name:"contrastive_temperature"},{anchor:"transformers.OneFormerConfig.train_num_points",description:`<strong>train_num_points</strong> (<code>int</code>, <em>optional</em>, defaults to 12544) &#x2014;
Number of points to sample while calculating losses on mask predictions.`,name:"train_num_points"},{anchor:"transformers.OneFormerConfig.oversample_ratio",description:`<strong>oversample_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 3.0) &#x2014;
Ratio to decide how many points to oversample.`,name:"oversample_ratio"},{anchor:"transformers.OneFormerConfig.importance_sample_ratio",description:`<strong>importance_sample_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.75) &#x2014;
Ratio of points that are sampled via importance sampling.`,name:"importance_sample_ratio"},{anchor:"transformers.OneFormerConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
Standard deviation for normal intialization.`,name:"init_std"},{anchor:"transformers.OneFormerConfig.init_xavier_std",description:`<strong>init_xavier_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
Standard deviation for xavier uniform initialization.`,name:"init_xavier_std"},{anchor:"transformers.OneFormerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
Epsilon for layer normalization.`,name:"layer_norm_eps"},{anchor:"transformers.OneFormerConfig.is_training",description:`<strong>is_training</strong> (<code>bool</code>, <em>optional</em>, defaults to False) &#x2014;
Whether to run in training or inference mode.`,name:"is_training"},{anchor:"transformers.OneFormerConfig.use_auxiliary_loss",description:`<strong>use_auxiliary_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
Whether to calculate loss using intermediate predictions from transformer decoder.`,name:"use_auxiliary_loss"},{anchor:"transformers.OneFormerConfig.output_auxiliary_logits",description:`<strong>output_auxiliary_logits</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
Whether to return intermediate predictions from transformer decoder.`,name:"output_auxiliary_logits"},{anchor:"transformers.OneFormerConfig.strides",description:`<strong>strides</strong> (<code>list</code>, <em>optional</em>, defaults to [4, 8, 16, 32]) &#x2014;
List containing the strides for feature maps in the encoder.`,name:"strides"},{anchor:"transformers.OneFormerConfig.task_seq_len",description:`<strong>task_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
Sequence length for tokenizing text list input.`,name:"task_seq_len"},{anchor:"transformers.OneFormerConfig.text_encoder_width",description:`<strong>text_encoder_width</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Hidden size for text encoder.`,name:"text_encoder_width"},{anchor:"transformers.OneFormerConfig.text_encoder_context_length",description:`<strong>text_encoder_context_length</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
Input sequence length for text encoder.`,name:"text_encoder_context_length"},{anchor:"transformers.OneFormerConfig.text_encoder_num_layers",description:`<strong>text_encoder_num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of layers for transformer in text encoder.`,name:"text_encoder_num_layers"},{anchor:"transformers.OneFormerConfig.text_encoder_vocab_size",description:`<strong>text_encoder_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size for tokenizer.`,name:"text_encoder_vocab_size"},{anchor:"transformers.OneFormerConfig.text_encoder_proj_layers",description:`<strong>text_encoder_proj_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of layers in MLP for project text queries.`,name:"text_encoder_proj_layers"},{anchor:"transformers.OneFormerConfig.text_encoder_n_ctx",description:`<strong>text_encoder_n_ctx</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of learnable text context queries.`,name:"text_encoder_n_ctx"},{anchor:"transformers.OneFormerConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Feature map dimension to map outputs from the backbone.`,name:"conv_dim"},{anchor:"transformers.OneFormerConfig.mask_dim",description:`<strong>mask_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimension for feature maps in pixel decoder.`,name:"mask_dim"},{anchor:"transformers.OneFormerConfig.hidden_dim",description:`<strong>hidden_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimension for hidden states in transformer decoder.`,name:"hidden_dim"},{anchor:"transformers.OneFormerConfig.encoder_feedforward_dim",description:`<strong>encoder_feedforward_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension for FFN layer in pixel decoder.`,name:"encoder_feedforward_dim"},{anchor:"transformers.OneFormerConfig.norm",description:`<strong>norm</strong> (<code>str</code>, <em>optional</em>, defaults to <code>GN</code>) &#x2014;
Type of normalization.`,name:"norm"},{anchor:"transformers.OneFormerConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of layers in pixel decoder.`,name:"encoder_layers"},{anchor:"transformers.OneFormerConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Number of layers in transformer decoder.`,name:"decoder_layers"},{anchor:"transformers.OneFormerConfig.use_task_norm",description:`<strong>use_task_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the task token.`,name:"use_task_norm"},{anchor:"transformers.OneFormerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads in transformer layers in the pixel and transformer decoders.`,name:"num_attention_heads"},{anchor:"transformers.OneFormerConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Dropout probability for pixel and transformer decoders.`,name:"dropout"},{anchor:"transformers.OneFormerConfig.dim_feedforward",description:`<strong>dim_feedforward</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension for FFN layer in transformer decoder.`,name:"dim_feedforward"},{anchor:"transformers.OneFormerConfig.pre_norm",description:`<strong>pre_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to normalize hidden states before attention layers in transformer decoder.`,name:"pre_norm"},{anchor:"transformers.OneFormerConfig.enforce_input_proj",description:`<strong>enforce_input_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to project hidden states in transformer decoder.`,name:"enforce_input_proj"},{anchor:"transformers.OneFormerConfig.query_dec_layers",description:`<strong>query_dec_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of layers in query transformer.`,name:"query_dec_layers"},{anchor:"transformers.OneFormerConfig.common_stride",description:`<strong>common_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Common stride used for features in pixel decoder.`,name:"common_stride"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/configuration_oneformer.py#L34"}}),Fe=new ul({props:{anchor:"transformers.OneFormerConfig.example",$$slots:{default:[ld]},$$scope:{ctx:P}}}),mo=new x({props:{name:"to_dict",anchor:"transformers.OneFormerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/configuration_oneformer.py#L254"}}),po=new ge({}),ho=new x({props:{name:"class transformers.OneFormerImageProcessor",anchor:"transformers.OneFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": float = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float]] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float]] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": bool = False"},{name:"repo_path",val:": str = 'shi-labs/oneformer_demo'"},{name:"class_info_file",val:": str = None"},{name:"num_text",val:": typing.Optional[int] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by <code>ignore_index</code>.`,name:"do_reduce_labels"},{anchor:"transformers.OneFormerImageProcessor.repo_path",description:`<strong>repo_path</strong> (<code>str</code>, defaults to <code>shi-labs/oneformer_demo</code>) &#x2014;
Dataset repository on huggingface hub containing the JSON file with class information for the dataset.`,name:"repo_path"},{anchor:"transformers.OneFormerImageProcessor.class_info_file",description:`<strong>class_info_file</strong> (<code>str</code>) &#x2014;
JSON file containing class information for the dataset. It is stored inside on the <code>repo_path</code> dataset
repository.`,name:"class_info_file"},{anchor:"transformers.OneFormerImageProcessor.num_text",description:`<strong>num_text</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of text entries in the text input list.`,name:"num_text"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L338"}}),go=new x({props:{name:"preprocess",anchor:"transformers.OneFormerImageProcessor.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:"task_inputs",val:": typing.Optional[typing.List[str]] = None"},{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:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"ignore_index",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L604"}}),uo=new x({props:{name:"encode_inputs",anchor:"transformers.OneFormerImageProcessor.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:"task_inputs",val:": typing.List[str]"},{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"}],parametersDescription:[{anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.encode_inputs.task_inputs",description:`<strong>task_inputs</strong> (<code>List[str]</code>) &#x2014;
List of task values.`,name:"task_inputs"},{anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.encode_inputs.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.31.0/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.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L875",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model.</li>
<li><strong>pixel_mask</strong> \u2014 Pixel mask to be fed to a model (when <code>=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>
<li><strong>text_inputs</strong> \u2014 Optional list of text string entries to be fed to a model (when <code>annotations</code> are
provided). They identify the binary masks present in the image.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),vo=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OneFormerImageProcessor.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.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L999",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>
`}}),yo=new x({props:{name:"post_process_instance_segmentation",anchor:"transformers.OneFormerImageProcessor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"task_type",val:": str = 'instance'"},{name:"is_demo",val:": bool = True"},{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.OneFormerImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<code>OneFormerForUniversalSegmentationOutput</code>) &#x2014;
The outputs from <code>OneFormerForUniversalSegmentationOutput</code>.`,name:"outputs"},{anchor:"transformers.OneFormerImageProcessor.post_process_instance_segmentation.task_type",description:`<strong>task_type</strong> (<code>str</code>, <em>optional)</em>, defaults to &#x201C;instance&#x201D;) &#x2014;
The post processing depends on the task token input. If the <code>task_type</code> is &#x201C;panoptic&#x201D;, we need to
ignore the stuff predictions.`,name:"task_type"},{anchor:"transformers.OneFormerImageProcessor.post_process_instance_segmentation.is_demo",description:`<strong>is_demo</strong> (<code>bool</code>, <em>optional)</em>, defaults to <code>True</code>) &#x2014;
Whether the model is in demo mode. If true, use threshold to predict final masks.`,name:"is_demo"},{anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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 in batch. If left to None, predictions will not be
resized.`,name:"target_sizes"},{anchor:"transformers.OneFormerImageProcessor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional)</em>, defaults to <code>False</code>) &#x2014;
Whether to return predictions in COCO format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L1049",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>
`}}),Fo=new x({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<code>MaskFormerForInstanceSegmentationOutput</code>) &#x2014;
The outputs from <a href="/docs/transformers/v4.31.0/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation">MaskFormerForInstanceSegmentation</a>.`,name:"outputs"},{anchor:"transformers.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.OneFormerImageProcessor.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.31.0/src/transformers/models/oneformer/image_processing_oneformer.py#L1168",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>
`}}),Oo=new ge({}),ko=new x({props:{name:"class transformers.OneFormerProcessor",anchor:"transformers.OneFormerProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"max_seq_length",val:": int = 77"},{name:"task_seq_length",val:": int = 77"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OneFormerProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor">OneFormerImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.OneFormerProcessor.tokenizer",description:`<strong>tokenizer</strong> ([<code>CLIPTokenizer</code>, <code>CLIPTokenizerFast</code>]) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.OneFormerProcessor.max_seq_len",description:`<strong>max_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 77)) &#x2014;
Sequence length for input text list.`,name:"max_seq_len"},{anchor:"transformers.OneFormerProcessor.task_seq_len",description:`<strong>task_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
Sequence length for input task token.`,name:"task_seq_len"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/processing_oneformer.py#L29"}}),Mo=new x({props:{name:"encode_inputs",anchor:"transformers.OneFormerProcessor.encode_inputs",parameters:[{name:"images",val:" = None"},{name:"task_inputs",val:" = None"},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/processing_oneformer.py#L145"}}),Io=new x({props:{name:"post_process_instance_segmentation",anchor:"transformers.OneFormerProcessor.post_process_instance_segmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/processing_oneformer.py#L192"}}),Uo=new x({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.OneFormerProcessor.post_process_panoptic_segmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/processing_oneformer.py#L199"}}),Jo=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.OneFormerProcessor.post_process_semantic_segmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/processing_oneformer.py#L185"}}),No=new ge({}),Eo=new x({props:{name:"class transformers.OneFormerModel",anchor:"transformers.OneFormerModel",parameters:[{name:"config",val:": OneFormerConfig"}],parametersDescription:[{anchor:"transformers.OneFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerConfig">OneFormerConfig</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.31.0/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.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L2905"}}),Wo=new x({props:{name:"forward",anchor:"transformers.OneFormerModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"task_inputs",val:": Tensor"},{name:"text_inputs",val:": typing.Optional[torch.Tensor] = None"},{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.OneFormerModel.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.31.0/en/model_doc/oneformer#transformers.OneFormerProcessor">OneFormerProcessor</a>. See
<code>OneFormerProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.OneFormerModel.forward.task_inputs",description:`<strong>task_inputs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Task inputs. Task inputs can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>OneFormerProcessor.__call__()</code>
for details.`,name:"task_inputs"},{anchor:"transformers.OneFormerModel.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.OneFormerModel.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.OneFormerModel.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.OneFormerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~OneFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L2922",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput</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.31.0/en/model_doc/oneformer#transformers.OneFormerConfig"
>OneFormerConfig</a>) and inputs.</p>
<ul>
<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>transformer_decoder_object_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Output object queries from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_contrastive_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Contrastive queries from the transformer decoder.</li>
<li><strong>transformer_decoder_mask_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height, width)</code>)
Mask Predictions from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_class_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes+1)</code>) \u2014 Class Predictions from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_auxiliary_predictions</strong> (Tuple of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) \u2014 Tuple of class and mask predictions from each layer of the transformer decoder.</li>
<li><strong>text_queries</strong> (<code>torch.FloatTensor</code>, <em>optional</em> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Text queries derived from the input text list used for calculating contrastive loss during training.</li>
<li><strong>task_token</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_dim)</code>)
1D task token to condition the queries.</li>
<li><strong>attentions</strong> (<code>tuple(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>tuple(torch.FloatTensor)</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Self and Cross Attentions weights from transformer decoder.</li>
</ul>
<p><code>OneFormerModelOutput</code></p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new td({props:{$$slots:{default:[cd]},$$scope:{ctx:P}}}),Ee=new ul({props:{anchor:"transformers.OneFormerModel.forward.example",$$slots:{default:[dd]},$$scope:{ctx:P}}}),qo=new ge({}),So=new x({props:{name:"class transformers.OneFormerForUniversalSegmentation",anchor:"transformers.OneFormerForUniversalSegmentation",parameters:[{name:"config",val:": OneFormerConfig"}],parametersDescription:[{anchor:"transformers.OneFormerForUniversalSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerConfig">OneFormerConfig</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.31.0/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.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L3034"}}),Ro=new x({props:{name:"forward",anchor:"transformers.OneFormerForUniversalSegmentation.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"task_inputs",val:": Tensor"},{name:"text_inputs",val:": typing.Optional[torch.Tensor] = None"},{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.OneFormerForUniversalSegmentation.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.31.0/en/model_doc/oneformer#transformers.OneFormerProcessor">OneFormerProcessor</a>. See
<code>OneFormerProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.OneFormerForUniversalSegmentation.forward.task_inputs",description:`<strong>task_inputs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Task inputs. Task inputs can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>OneFormerProcessor.__call__()</code>
for details.`,name:"task_inputs"},{anchor:"transformers.OneFormerForUniversalSegmentation.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.OneFormerForUniversalSegmentation.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.OneFormerForUniversalSegmentation.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.OneFormerForUniversalSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>~OneFormerModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OneFormerForUniversalSegmentation.forward.text_inputs",description:`<strong>text_inputs</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Tensor fof shape <code>(num_queries, sequence_length)</code> to be fed to a model`,name:"text_inputs"},{anchor:"transformers.OneFormerForUniversalSegmentation.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.OneFormerForUniversalSegmentation.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.31.0/src/transformers/models/oneformer/modeling_oneformer.py#L3101",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput</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.31.0/en/model_doc/oneformer#transformers.OneFormerConfig"
>OneFormerConfig</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>auxiliary_predictions</strong> (List of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) \u2014 List of class and mask predictions from each layer of the transformer decoder.</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>transformer_decoder_object_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Output object queries from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_contrastive_queries</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Contrastive queries from the transformer decoder.</li>
<li><strong>transformer_decoder_mask_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height, width)</code>)
Mask Predictions from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_class_predictions</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes+1)</code>) \u2014 Class Predictions from the last layer in the transformer decoder.</li>
<li><strong>transformer_decoder_auxiliary_predictions</strong> (List of Dict of <code>str, torch.FloatTensor</code>, <em>optional</em>) \u2014 List of class and mask predictions from each layer of the transformer decoder.</li>
<li><strong>text_queries</strong> (<code>torch.FloatTensor</code>, <em>optional</em> of shape <code>(batch_size, num_queries, hidden_dim)</code>)
Text queries derived from the input text list used for calculating contrastive loss during training.</li>
<li><strong>task_token</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_dim)</code>)
1D task token to condition the queries.</li>
<li><strong>attentions</strong> (<code>tuple(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>tuple(torch.FloatTensor)</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Self and Cross Attentions weights from transformer decoder.</li>
</ul>
<p><code>OneFormerUniversalSegmentationOutput</code></p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new td({props:{$$slots:{default:[md]},$$scope:{ctx:P}}}),We=new ul({props:{anchor:"transformers.OneFormerForUniversalSegmentation.forward.example",$$slots:{default:[pd]},$$scope:{ctx:P}}}),{c(){f=s("meta"),k=c(),_=s("h1"),g=s("a"),O=s("span"),v(p.$$.fragment),u=c(),S=s("span"),In=r("OneFormer"),wr=c(),oe=s("h2"),ue=s("a"),Nt=s("span"),v(Ge.$$.fragment),jn=c(),Et=s("span"),Un=r("Overview"),Fr=c(),_e=s("p"),$n=r("The OneFormer model was proposed in "),Ve=s("a"),Jn=r("OneFormer: One Transformer to Rule Universal Image Segmentation"),zn=r(" by Jitesh Jain, Jiachen Li, MangTik Chiu, Ali Hassani, Nikita Orlov, Humphrey Shi. OneFormer is a universal image segmentation framework that can be trained on a single panoptic dataset to perform semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference."),Tr=c(),Ae=s("img"),Or=c(),Ao=s("p"),Nn=r("The abstract from the paper is the following:"),kr=c(),Xo=s("p"),Pt=s("em"),En=r("Universal Image Segmentation is not a new concept. Past attempts to unify image segmentation in the last decades include scene parsing, panoptic segmentation, and, more recently, new panoptic architectures. However, such panoptic architectures do not truly unify image segmentation because they need to be trained individually on the semantic, instance, or panoptic segmentation to achieve the best performance. Ideally, a truly universal framework should be trained only once and achieve SOTA performance across all three image segmentation tasks. To that end, we propose OneFormer, a universal image segmentation framework that unifies segmentation with a multi-task train-once design. We first propose a task-conditioned joint training strategy that enables training on ground truths of each domain (semantic, instance, and panoptic segmentation) within a single multi-task training process. Secondly, we introduce a task token to condition our model on the task at hand, making our model task-dynamic to support multi-task training and inference. Thirdly, we propose using a query-text contrastive loss during training to establish better inter-task and inter-class distinctions. Notably, our single OneFormer model outperforms specialized Mask2Former models across all three segmentation tasks on ADE20k, CityScapes, and COCO, despite the latter being trained on each of the three tasks individually with three times the resources. With new ConvNeXt and DiNAT backbones, we observe even more performance improvement. We believe OneFormer is a significant step towards making image segmentation more universal and accessible."),Mr=c(),Lo=s("p"),Pn=r("Tips:"),xr=c(),J=s("ul"),te=s("li"),Cn=r("OneFormer requires two inputs during inference: "),Ct=s("em"),Wn=r("image"),qn=r(" and "),Wt=s("em"),Sn=r("task token"),Zn=r("."),Bn=c(),qt=s("li"),Rn=r("During training, OneFormer only uses panoptic annotations."),Gn=c(),N=s("li"),Vn=r(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),St=s("code"),An=r("get_num_masks"),Xn=r(" function inside in the "),Zt=s("code"),Ln=r("OneFormerLoss"),Dn=r(" class of "),Bt=s("code"),Hn=r("modeling_oneformer.py"),Yn=r(`. When training on multiple nodes, this should be
set to the average number of target masks across all nodes, as can be seen in the original implementation `),Xe=s("a"),Qn=r("here"),Kn=r("."),es=c(),E=s("li"),os=r("One can use "),Do=s("a"),ts=r("OneFormerProcessor"),rs=r(" to prepare input images and task inputs for the model and optional targets for the model. "),Rt=s("code"),ns=r("OneformerProcessor"),ss=r(" wraps "),Ho=s("a"),as=r("OneFormerImageProcessor"),is=r(" and "),Yo=s("a"),ls=r("CLIPTokenizer"),cs=r(" into a single instance to both prepare the images and encode the task inputs."),ds=c(),U=s("li"),ms=r("To get the final segmentation, depending on the task, you can call "),Qo=s("a"),ps=r("post_process_semantic_segmentation()"),hs=r(" or "),Ko=s("a"),fs=r("post_process_instance_segmentation()"),gs=r(" or "),et=s("a"),us=r("post_process_panoptic_segmentation()"),_s=r(". All three tasks can be solved using "),ot=s("a"),vs=r("OneFormerForUniversalSegmentation"),bs=r(" output, panoptic segmentation accepts an optional "),Gt=s("code"),ys=r("label_ids_to_fuse"),ws=r(" argument to fuse instances of the target object/s (e.g. sky) together."),Ir=c(),ve=s("p"),Fs=r("The figure below illustrates the architecture of OneFormer. Taken from the "),Le=s("a"),Ts=r("original paper"),Os=r("."),jr=c(),De=s("img"),Ur=c(),L=s("p"),ks=r("This model was contributed by "),He=s("a"),Ms=r("Jitesh Jain"),xs=r(". The original code can be found "),Ye=s("a"),Is=r("here"),js=r("."),$r=c(),re=s("h2"),be=s("a"),Vt=s("span"),v(Qe.$$.fragment),Us=c(),At=s("span"),$s=r("Resources"),Jr=c(),tt=s("p"),Js=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OneFormer."),zr=c(),rt=s("ul"),Ke=s("li"),zs=r("Demo notebooks regarding inference + fine-tuning on custom data can be found "),eo=s("a"),Ns=r("here"),Es=r("."),Nr=c(),nt=s("p"),Ps=r(`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Er=c(),ne=s("h2"),ye=s("a"),Xt=s("span"),v(oo.$$.fragment),Cs=c(),Lt=s("span"),Ws=r("OneFormer specific outputs"),Pr=c(),se=s("div"),v(to.$$.fragment),qs=c(),ro=s("p"),Ss=r("Class for outputs of "),st=s("a"),Zs=r("OneFormerModel"),Bs=r(". This class returns all the needed hidden states to compute the logits."),Cr=c(),Z=s("div"),v(no.$$.fragment),Rs=c(),so=s("p"),Gs=r("Class for outputs of "),Dt=s("code"),Vs=r("OneFormerForUniversalSegmentationOutput"),As=r("."),Xs=c(),B=s("p"),Ls=r("This output can be directly passed to "),at=s("a"),Ds=r("post_process_semantic_segmentation()"),Hs=r(` or
`),it=s("a"),Ys=r("post_process_instance_segmentation()"),Qs=r(` or
`),lt=s("a"),Ks=r("post_process_panoptic_segmentation()"),ea=r(" depending on the task. Please, see\n[`~OneFormerImageProcessor] for details regarding usage."),Wr=c(),ae=s("h2"),we=s("a"),Ht=s("span"),v(ao.$$.fragment),oa=c(),Yt=s("span"),ta=r("OneFormerConfig"),qr=c(),$=s("div"),v(io.$$.fragment),ra=c(),R=s("p"),na=r("This is the configuration class to store the configuration of a "),ct=s("a"),sa=r("OneFormerModel"),aa=r(`. It is used to instantiate a
OneFormer 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 OneFormer
`),lo=s("a"),ia=r("shi-labs/oneformer_ade20k_swin_tiny"),la=r(` architecture
trained on `),co=s("a"),ca=r("ADE20k-150"),da=r("."),ma=c(),ie=s("p"),pa=r("Configuration objects inherit from "),dt=s("a"),ha=r("PretrainedConfig"),fa=r(` and can be used to control the model outputs. Read the
documentation from `),mt=s("a"),ga=r("PretrainedConfig"),ua=r(" for more information."),_a=c(),v(Fe.$$.fragment),va=c(),Te=s("div"),v(mo.$$.fragment),ba=c(),le=s("p"),ya=r("Serializes this instance to a Python dictionary. Override the default "),pt=s("a"),wa=r("to_dict()"),Fa=r(`. Returns:
`),Qt=s("code"),Ta=r("Dict[str, any]"),Oa=r(": Dictionary of all the attributes that make up this configuration instance,"),Sr=c(),ce=s("h2"),Oe=s("a"),Kt=s("span"),v(po.$$.fragment),ka=c(),er=s("span"),Ma=r("OneFormerImageProcessor"),Zr=c(),M=s("div"),v(ho.$$.fragment),xa=c(),or=s("p"),Ia=r(`Constructs a OneFormer image processor. The image processor can be used to prepare image(s), task input(s) and
optional text inputs and targets for the model.`),ja=c(),fo=s("p"),Ua=r("This image processor inherits from "),tr=s("code"),$a=r("BaseImageProcessor"),Ja=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),za=c(),ht=s("div"),v(go.$$.fragment),Na=c(),D=s("div"),v(uo.$$.fragment),Ea=c(),_o=s("p"),Pa=r("Pad images up to the largest image in a batch and create a corresponding "),rr=s("code"),Ca=r("pixel_mask"),Wa=r("."),qa=c(),G=s("p"),Sa=r(`OneFormer 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
`),nr=s("code"),Za=r("segmentation_maps = [[2,6,7,9]]"),Ba=r(", the output will contain "),sr=s("code"),Ra=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Ga=r(" (four binary masks) and "),ar=s("code"),Va=r("class_labels = [2,6,7,9]"),Aa=r(`, the labels for
each mask.`),Xa=c(),ke=s("div"),v(vo.$$.fragment),La=c(),bo=s("p"),Da=r("Converts the output of "),ft=s("a"),Ha=r("MaskFormerForInstanceSegmentation"),Ya=r(` into semantic segmentation maps. Only supports
PyTorch.`),Qa=c(),Me=s("div"),v(yo.$$.fragment),Ka=c(),wo=s("p"),ei=r("Converts the output of "),ir=s("code"),oi=r("OneFormerForUniversalSegmentationOutput"),ti=r(` into image instance segmentation
predictions. Only supports PyTorch.`),ri=c(),xe=s("div"),v(Fo.$$.fragment),ni=c(),To=s("p"),si=r("Converts the output of "),lr=s("code"),ai=r("MaskFormerForInstanceSegmentationOutput"),ii=r(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Br=c(),de=s("h2"),Ie=s("a"),cr=s("span"),v(Oo.$$.fragment),li=c(),dr=s("span"),ci=r("OneFormerProcessor"),Rr=c(),I=s("div"),v(ko.$$.fragment),di=c(),V=s("p"),mi=r("Constructs an OneFormer processor which wraps "),gt=s("a"),pi=r("OneFormerImageProcessor"),hi=r(` and
`),ut=s("a"),fi=r("CLIPTokenizer"),gi=r("/"),_t=s("a"),ui=r("CLIPTokenizerFast"),_i=r(` into a single processor that inherits both the image processor and
tokenizer functionalities.`),vi=c(),je=s("div"),v(Mo.$$.fragment),bi=c(),xo=s("p"),yi=r("This method forwards all its arguments to "),vt=s("a"),wi=r("OneFormerImageProcessor.encode_inputs()"),Fi=r(` and then tokenizes the
task_inputs. Please refer to the docstring of this method for more information.`),Ti=c(),Ue=s("div"),v(Io.$$.fragment),Oi=c(),jo=s("p"),ki=r("This method forwards all its arguments to "),bt=s("a"),Mi=r("OneFormerImageProcessor.post_process_instance_segmentation()"),xi=r(`.
Please refer to the docstring of this method for more information.`),Ii=c(),$e=s("div"),v(Uo.$$.fragment),ji=c(),$o=s("p"),Ui=r("This method forwards all its arguments to "),yt=s("a"),$i=r("OneFormerImageProcessor.post_process_panoptic_segmentation()"),Ji=r(`.
Please refer to the docstring of this method for more information.`),zi=c(),Je=s("div"),v(Jo.$$.fragment),Ni=c(),zo=s("p"),Ei=r("This method forwards all its arguments to "),wt=s("a"),Pi=r("OneFormerImageProcessor.post_process_semantic_segmentation()"),Ci=r(`.
Please refer to the docstring of this method for more information.`),Gr=c(),me=s("h2"),ze=s("a"),mr=s("span"),v(No.$$.fragment),Wi=c(),pr=s("span"),qi=r("OneFormerModel"),Vr=c(),A=s("div"),v(Eo.$$.fragment),Si=c(),Po=s("p"),Zi=r(`The bare OneFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Co=s("a"),Bi=r("nn.Module"),Ri=r(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Gi=c(),C=s("div"),v(Wo.$$.fragment),Vi=c(),pe=s("p"),Ai=r("The "),Ft=s("a"),Xi=r("OneFormerModel"),Li=r(" forward method, overrides the "),hr=s("code"),Di=r("__call__"),Hi=r(" special method."),Yi=c(),v(Ne.$$.fragment),Qi=c(),v(Ee.$$.fragment),Ar=c(),he=s("h2"),Pe=s("a"),fr=s("span"),v(qo.$$.fragment),Ki=c(),gr=s("span"),el=r("OneFormerForUniversalSegmentation"),Xr=c(),X=s("div"),v(So.$$.fragment),ol=c(),Zo=s("p"),tl=r(`OneFormer Model for instance, semantic and panoptic image segmentation.
This model is a PyTorch `),Bo=s("a"),rl=r("nn.Module"),nl=r(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),sl=c(),z=s("div"),v(Ro.$$.fragment),al=c(),fe=s("p"),il=r("The "),Tt=s("a"),ll=r("OneFormerForUniversalSegmentation"),cl=r(" forward method, overrides the "),ur=s("code"),dl=r("__call__"),ml=r(" special method."),pl=c(),v(Ce.$$.fragment),hl=c(),_r=s("p"),fl=r("Example:"),gl=c(),v(We.$$.fragment),this.h()},l(o){const m=ad('[data-svelte="svelte-1phssyn"]',document.head);f=a(m,"META",{name:!0,content:!0}),m.forEach(t),k=d(o),_=a(o,"H1",{class:!0});var Go=i(_);g=a(Go,"A",{id:!0,class:!0,href:!0});var vr=i(g);O=a(vr,"SPAN",{});var br=i(O);b(p.$$.fragment,br),br.forEach(t),vr.forEach(t),u=d(Go),S=a(Go,"SPAN",{});var yr=i(S);In=n(yr,"OneFormer"),yr.forEach(t),Go.forEach(t),wr=d(o),oe=a(o,"H2",{class:!0});var Vo=i(oe);ue=a(Vo,"A",{id:!0,class:!0,href:!0});var wl=i(ue);Nt=a(wl,"SPAN",{});var Fl=i(Nt);b(Ge.$$.fragment,Fl),Fl.forEach(t),wl.forEach(t),jn=d(Vo),Et=a(Vo,"SPAN",{});var Tl=i(Et);Un=n(Tl,"Overview"),Tl.forEach(t),Vo.forEach(t),Fr=d(o),_e=a(o,"P",{});var Dr=i(_e);$n=n(Dr,"The OneFormer model was proposed in "),Ve=a(Dr,"A",{href:!0,rel:!0});var Ol=i(Ve);Jn=n(Ol,"OneFormer: One Transformer to Rule Universal Image Segmentation"),Ol.forEach(t),zn=n(Dr," by Jitesh Jain, Jiachen Li, MangTik Chiu, Ali Hassani, Nikita Orlov, Humphrey Shi. OneFormer is a universal image segmentation framework that can be trained on a single panoptic dataset to perform semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference."),Dr.forEach(t),Tr=d(o),Ae=a(o,"IMG",{width:!0,src:!0}),Or=d(o),Ao=a(o,"P",{});var kl=i(Ao);Nn=n(kl,"The abstract from the paper is the following:"),kl.forEach(t),kr=d(o),Xo=a(o,"P",{});var Ml=i(Xo);Pt=a(Ml,"EM",{});var xl=i(Pt);En=n(xl,"Universal Image Segmentation is not a new concept. Past attempts to unify image segmentation in the last decades include scene parsing, panoptic segmentation, and, more recently, new panoptic architectures. However, such panoptic architectures do not truly unify image segmentation because they need to be trained individually on the semantic, instance, or panoptic segmentation to achieve the best performance. Ideally, a truly universal framework should be trained only once and achieve SOTA performance across all three image segmentation tasks. To that end, we propose OneFormer, a universal image segmentation framework that unifies segmentation with a multi-task train-once design. We first propose a task-conditioned joint training strategy that enables training on ground truths of each domain (semantic, instance, and panoptic segmentation) within a single multi-task training process. Secondly, we introduce a task token to condition our model on the task at hand, making our model task-dynamic to support multi-task training and inference. Thirdly, we propose using a query-text contrastive loss during training to establish better inter-task and inter-class distinctions. Notably, our single OneFormer model outperforms specialized Mask2Former models across all three segmentation tasks on ADE20k, CityScapes, and COCO, despite the latter being trained on each of the three tasks individually with three times the resources. With new ConvNeXt and DiNAT backbones, we observe even more performance improvement. We believe OneFormer is a significant step towards making image segmentation more universal and accessible."),xl.forEach(t),Ml.forEach(t),Mr=d(o),Lo=a(o,"P",{});var Il=i(Lo);Pn=n(Il,"Tips:"),Il.forEach(t),xr=d(o),J=a(o,"UL",{});var H=i(J);te=a(H,"LI",{});var Ot=i(te);Cn=n(Ot,"OneFormer requires two inputs during inference: "),Ct=a(Ot,"EM",{});var jl=i(Ct);Wn=n(jl,"image"),jl.forEach(t),qn=n(Ot," and "),Wt=a(Ot,"EM",{});var Ul=i(Wt);Sn=n(Ul,"task token"),Ul.forEach(t),Zn=n(Ot,"."),Ot.forEach(t),Bn=d(H),qt=a(H,"LI",{});var $l=i(qt);Rn=n($l,"During training, OneFormer only uses panoptic annotations."),$l.forEach(t),Gn=d(H),N=a(H,"LI",{});var Y=i(N);Vn=n(Y,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),St=a(Y,"CODE",{});var Jl=i(St);An=n(Jl,"get_num_masks"),Jl.forEach(t),Xn=n(Y," function inside in the "),Zt=a(Y,"CODE",{});var zl=i(Zt);Ln=n(zl,"OneFormerLoss"),zl.forEach(t),Dn=n(Y," class of "),Bt=a(Y,"CODE",{});var Nl=i(Bt);Hn=n(Nl,"modeling_oneformer.py"),Nl.forEach(t),Yn=n(Y,`. 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 `),Xe=a(Y,"A",{href:!0,rel:!0});var El=i(Xe);Qn=n(El,"here"),El.forEach(t),Kn=n(Y,"."),Y.forEach(t),es=d(H),E=a(H,"LI",{});var Q=i(E);os=n(Q,"One can use "),Do=a(Q,"A",{href:!0});var Pl=i(Do);ts=n(Pl,"OneFormerProcessor"),Pl.forEach(t),rs=n(Q," to prepare input images and task inputs for the model and optional targets for the model. "),Rt=a(Q,"CODE",{});var Cl=i(Rt);ns=n(Cl,"OneformerProcessor"),Cl.forEach(t),ss=n(Q," wraps "),Ho=a(Q,"A",{href:!0});var Wl=i(Ho);as=n(Wl,"OneFormerImageProcessor"),Wl.forEach(t),is=n(Q," and "),Yo=a(Q,"A",{href:!0});var ql=i(Yo);ls=n(ql,"CLIPTokenizer"),ql.forEach(t),cs=n(Q," into a single instance to both prepare the images and encode the task inputs."),Q.forEach(t),ds=d(H),U=a(H,"LI",{});var W=i(U);ms=n(W,"To get the final segmentation, depending on the task, you can call "),Qo=a(W,"A",{href:!0});var Sl=i(Qo);ps=n(Sl,"post_process_semantic_segmentation()"),Sl.forEach(t),hs=n(W," or "),Ko=a(W,"A",{href:!0});var Zl=i(Ko);fs=n(Zl,"post_process_instance_segmentation()"),Zl.forEach(t),gs=n(W," or "),et=a(W,"A",{href:!0});var Bl=i(et);us=n(Bl,"post_process_panoptic_segmentation()"),Bl.forEach(t),_s=n(W,". All three tasks can be solved using "),ot=a(W,"A",{href:!0});var Rl=i(ot);vs=n(Rl,"OneFormerForUniversalSegmentation"),Rl.forEach(t),bs=n(W," output, panoptic segmentation accepts an optional "),Gt=a(W,"CODE",{});var Gl=i(Gt);ys=n(Gl,"label_ids_to_fuse"),Gl.forEach(t),ws=n(W," argument to fuse instances of the target object/s (e.g. sky) together."),W.forEach(t),H.forEach(t),Ir=d(o),ve=a(o,"P",{});var Hr=i(ve);Fs=n(Hr,"The figure below illustrates the architecture of OneFormer. Taken from the "),Le=a(Hr,"A",{href:!0,rel:!0});var Vl=i(Le);Ts=n(Vl,"original paper"),Vl.forEach(t),Os=n(Hr,"."),Hr.forEach(t),jr=d(o),De=a(o,"IMG",{width:!0,src:!0}),Ur=d(o),L=a(o,"P",{});var kt=i(L);ks=n(kt,"This model was contributed by "),He=a(kt,"A",{href:!0,rel:!0});var Al=i(He);Ms=n(Al,"Jitesh Jain"),Al.forEach(t),xs=n(kt,". The original code can be found "),Ye=a(kt,"A",{href:!0,rel:!0});var Xl=i(Ye);Is=n(Xl,"here"),Xl.forEach(t),js=n(kt,"."),kt.forEach(t),$r=d(o),re=a(o,"H2",{class:!0});var Yr=i(re);be=a(Yr,"A",{id:!0,class:!0,href:!0});var Ll=i(be);Vt=a(Ll,"SPAN",{});var Dl=i(Vt);b(Qe.$$.fragment,Dl),Dl.forEach(t),Ll.forEach(t),Us=d(Yr),At=a(Yr,"SPAN",{});var Hl=i(At);$s=n(Hl,"Resources"),Hl.forEach(t),Yr.forEach(t),Jr=d(o),tt=a(o,"P",{});var Yl=i(tt);Js=n(Yl,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OneFormer."),Yl.forEach(t),zr=d(o),rt=a(o,"UL",{});var Ql=i(rt);Ke=a(Ql,"LI",{});var Qr=i(Ke);zs=n(Qr,"Demo notebooks regarding inference + fine-tuning on custom data can be found "),eo=a(Qr,"A",{href:!0,rel:!0});var Kl=i(eo);Ns=n(Kl,"here"),Kl.forEach(t),Es=n(Qr,"."),Qr.forEach(t),Ql.forEach(t),Nr=d(o),nt=a(o,"P",{});var ec=i(nt);Ps=n(ec,`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),ec.forEach(t),Er=d(o),ne=a(o,"H2",{class:!0});var Kr=i(ne);ye=a(Kr,"A",{id:!0,class:!0,href:!0});var oc=i(ye);Xt=a(oc,"SPAN",{});var tc=i(Xt);b(oo.$$.fragment,tc),tc.forEach(t),oc.forEach(t),Cs=d(Kr),Lt=a(Kr,"SPAN",{});var rc=i(Lt);Ws=n(rc,"OneFormer specific outputs"),rc.forEach(t),Kr.forEach(t),Pr=d(o),se=a(o,"DIV",{class:!0});var en=i(se);b(to.$$.fragment,en),qs=d(en),ro=a(en,"P",{});var on=i(ro);Ss=n(on,"Class for outputs of "),st=a(on,"A",{href:!0});var nc=i(st);Zs=n(nc,"OneFormerModel"),nc.forEach(t),Bs=n(on,". This class returns all the needed hidden states to compute the logits."),on.forEach(t),en.forEach(t),Cr=d(o),Z=a(o,"DIV",{class:!0});var Mt=i(Z);b(no.$$.fragment,Mt),Rs=d(Mt),so=a(Mt,"P",{});var tn=i(so);Gs=n(tn,"Class for outputs of "),Dt=a(tn,"CODE",{});var sc=i(Dt);Vs=n(sc,"OneFormerForUniversalSegmentationOutput"),sc.forEach(t),As=n(tn,"."),tn.forEach(t),Xs=d(Mt),B=a(Mt,"P",{});var qe=i(B);Ls=n(qe,"This output can be directly passed to "),at=a(qe,"A",{href:!0});var ac=i(at);Ds=n(ac,"post_process_semantic_segmentation()"),ac.forEach(t),Hs=n(qe,` or
`),it=a(qe,"A",{href:!0});var ic=i(it);Ys=n(ic,"post_process_instance_segmentation()"),ic.forEach(t),Qs=n(qe,` or
`),lt=a(qe,"A",{href:!0});var lc=i(lt);Ks=n(lc,"post_process_panoptic_segmentation()"),lc.forEach(t),ea=n(qe," depending on the task. Please, see\n[`~OneFormerImageProcessor] for details regarding usage."),qe.forEach(t),Mt.forEach(t),Wr=d(o),ae=a(o,"H2",{class:!0});var rn=i(ae);we=a(rn,"A",{id:!0,class:!0,href:!0});var cc=i(we);Ht=a(cc,"SPAN",{});var dc=i(Ht);b(ao.$$.fragment,dc),dc.forEach(t),cc.forEach(t),oa=d(rn),Yt=a(rn,"SPAN",{});var mc=i(Yt);ta=n(mc,"OneFormerConfig"),mc.forEach(t),rn.forEach(t),qr=d(o),$=a(o,"DIV",{class:!0});var K=i($);b(io.$$.fragment,K),ra=d(K),R=a(K,"P",{});var Se=i(R);na=n(Se,"This is the configuration class to store the configuration of a "),ct=a(Se,"A",{href:!0});var pc=i(ct);sa=n(pc,"OneFormerModel"),pc.forEach(t),aa=n(Se,`. It is used to instantiate a
OneFormer 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 OneFormer
`),lo=a(Se,"A",{href:!0,rel:!0});var hc=i(lo);ia=n(hc,"shi-labs/oneformer_ade20k_swin_tiny"),hc.forEach(t),la=n(Se,` architecture
trained on `),co=a(Se,"A",{href:!0,rel:!0});var fc=i(co);ca=n(fc,"ADE20k-150"),fc.forEach(t),da=n(Se,"."),Se.forEach(t),ma=d(K),ie=a(K,"P",{});var xt=i(ie);pa=n(xt,"Configuration objects inherit from "),dt=a(xt,"A",{href:!0});var gc=i(dt);ha=n(gc,"PretrainedConfig"),gc.forEach(t),fa=n(xt,` and can be used to control the model outputs. Read the
documentation from `),mt=a(xt,"A",{href:!0});var uc=i(mt);ga=n(uc,"PretrainedConfig"),uc.forEach(t),ua=n(xt," for more information."),xt.forEach(t),_a=d(K),b(Fe.$$.fragment,K),va=d(K),Te=a(K,"DIV",{class:!0});var nn=i(Te);b(mo.$$.fragment,nn),ba=d(nn),le=a(nn,"P",{});var It=i(le);ya=n(It,"Serializes this instance to a Python dictionary. Override the default "),pt=a(It,"A",{href:!0});var _c=i(pt);wa=n(_c,"to_dict()"),_c.forEach(t),Fa=n(It,`. Returns:
`),Qt=a(It,"CODE",{});var vc=i(Qt);Ta=n(vc,"Dict[str, any]"),vc.forEach(t),Oa=n(It,": Dictionary of all the attributes that make up this configuration instance,"),It.forEach(t),nn.forEach(t),K.forEach(t),Sr=d(o),ce=a(o,"H2",{class:!0});var sn=i(ce);Oe=a(sn,"A",{id:!0,class:!0,href:!0});var bc=i(Oe);Kt=a(bc,"SPAN",{});var yc=i(Kt);b(po.$$.fragment,yc),yc.forEach(t),bc.forEach(t),ka=d(sn),er=a(sn,"SPAN",{});var wc=i(er);Ma=n(wc,"OneFormerImageProcessor"),wc.forEach(t),sn.forEach(t),Zr=d(o),M=a(o,"DIV",{class:!0});var j=i(M);b(ho.$$.fragment,j),xa=d(j),or=a(j,"P",{});var Fc=i(or);Ia=n(Fc,`Constructs a OneFormer image processor. The image processor can be used to prepare image(s), task input(s) and
optional text inputs and targets for the model.`),Fc.forEach(t),ja=d(j),fo=a(j,"P",{});var an=i(fo);Ua=n(an,"This image processor inherits from "),tr=a(an,"CODE",{});var Tc=i(tr);$a=n(Tc,"BaseImageProcessor"),Tc.forEach(t),Ja=n(an,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),an.forEach(t),za=d(j),ht=a(j,"DIV",{class:!0});var Oc=i(ht);b(go.$$.fragment,Oc),Oc.forEach(t),Na=d(j),D=a(j,"DIV",{class:!0});var jt=i(D);b(uo.$$.fragment,jt),Ea=d(jt),_o=a(jt,"P",{});var ln=i(_o);Pa=n(ln,"Pad images up to the largest image in a batch and create a corresponding "),rr=a(ln,"CODE",{});var kc=i(rr);Ca=n(kc,"pixel_mask"),kc.forEach(t),Wa=n(ln,"."),ln.forEach(t),qa=d(jt),G=a(jt,"P",{});var Ze=i(G);Sa=n(Ze,`OneFormer 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
`),nr=a(Ze,"CODE",{});var Mc=i(nr);Za=n(Mc,"segmentation_maps = [[2,6,7,9]]"),Mc.forEach(t),Ba=n(Ze,", the output will contain "),sr=a(Ze,"CODE",{});var xc=i(sr);Ra=n(xc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),xc.forEach(t),Ga=n(Ze," (four binary masks) and "),ar=a(Ze,"CODE",{});var Ic=i(ar);Va=n(Ic,"class_labels = [2,6,7,9]"),Ic.forEach(t),Aa=n(Ze,`, the labels for
each mask.`),Ze.forEach(t),jt.forEach(t),Xa=d(j),ke=a(j,"DIV",{class:!0});var cn=i(ke);b(vo.$$.fragment,cn),La=d(cn),bo=a(cn,"P",{});var dn=i(bo);Da=n(dn,"Converts the output of "),ft=a(dn,"A",{href:!0});var jc=i(ft);Ha=n(jc,"MaskFormerForInstanceSegmentation"),jc.forEach(t),Ya=n(dn,` into semantic segmentation maps. Only supports
PyTorch.`),dn.forEach(t),cn.forEach(t),Qa=d(j),Me=a(j,"DIV",{class:!0});var mn=i(Me);b(yo.$$.fragment,mn),Ka=d(mn),wo=a(mn,"P",{});var pn=i(wo);ei=n(pn,"Converts the output of "),ir=a(pn,"CODE",{});var Uc=i(ir);oi=n(Uc,"OneFormerForUniversalSegmentationOutput"),Uc.forEach(t),ti=n(pn,` into image instance segmentation
predictions. Only supports PyTorch.`),pn.forEach(t),mn.forEach(t),ri=d(j),xe=a(j,"DIV",{class:!0});var hn=i(xe);b(Fo.$$.fragment,hn),ni=d(hn),To=a(hn,"P",{});var fn=i(To);si=n(fn,"Converts the output of "),lr=a(fn,"CODE",{});var $c=i(lr);ai=n($c,"MaskFormerForInstanceSegmentationOutput"),$c.forEach(t),ii=n(fn,` into image panoptic segmentation
predictions. Only supports PyTorch.`),fn.forEach(t),hn.forEach(t),j.forEach(t),Br=d(o),de=a(o,"H2",{class:!0});var gn=i(de);Ie=a(gn,"A",{id:!0,class:!0,href:!0});var Jc=i(Ie);cr=a(Jc,"SPAN",{});var zc=i(cr);b(Oo.$$.fragment,zc),zc.forEach(t),Jc.forEach(t),li=d(gn),dr=a(gn,"SPAN",{});var Nc=i(dr);ci=n(Nc,"OneFormerProcessor"),Nc.forEach(t),gn.forEach(t),Rr=d(o),I=a(o,"DIV",{class:!0});var q=i(I);b(ko.$$.fragment,q),di=d(q),V=a(q,"P",{});var Be=i(V);mi=n(Be,"Constructs an OneFormer processor which wraps "),gt=a(Be,"A",{href:!0});var Ec=i(gt);pi=n(Ec,"OneFormerImageProcessor"),Ec.forEach(t),hi=n(Be,` and
`),ut=a(Be,"A",{href:!0});var Pc=i(ut);fi=n(Pc,"CLIPTokenizer"),Pc.forEach(t),gi=n(Be,"/"),_t=a(Be,"A",{href:!0});var Cc=i(_t);ui=n(Cc,"CLIPTokenizerFast"),Cc.forEach(t),_i=n(Be,` into a single processor that inherits both the image processor and
tokenizer functionalities.`),Be.forEach(t),vi=d(q),je=a(q,"DIV",{class:!0});var un=i(je);b(Mo.$$.fragment,un),bi=d(un),xo=a(un,"P",{});var _n=i(xo);yi=n(_n,"This method forwards all its arguments to "),vt=a(_n,"A",{href:!0});var Wc=i(vt);wi=n(Wc,"OneFormerImageProcessor.encode_inputs()"),Wc.forEach(t),Fi=n(_n,` and then tokenizes the
task_inputs. Please refer to the docstring of this method for more information.`),_n.forEach(t),un.forEach(t),Ti=d(q),Ue=a(q,"DIV",{class:!0});var vn=i(Ue);b(Io.$$.fragment,vn),Oi=d(vn),jo=a(vn,"P",{});var bn=i(jo);ki=n(bn,"This method forwards all its arguments to "),bt=a(bn,"A",{href:!0});var qc=i(bt);Mi=n(qc,"OneFormerImageProcessor.post_process_instance_segmentation()"),qc.forEach(t),xi=n(bn,`.
Please refer to the docstring of this method for more information.`),bn.forEach(t),vn.forEach(t),Ii=d(q),$e=a(q,"DIV",{class:!0});var yn=i($e);b(Uo.$$.fragment,yn),ji=d(yn),$o=a(yn,"P",{});var wn=i($o);Ui=n(wn,"This method forwards all its arguments to "),yt=a(wn,"A",{href:!0});var Sc=i(yt);$i=n(Sc,"OneFormerImageProcessor.post_process_panoptic_segmentation()"),Sc.forEach(t),Ji=n(wn,`.
Please refer to the docstring of this method for more information.`),wn.forEach(t),yn.forEach(t),zi=d(q),Je=a(q,"DIV",{class:!0});var Fn=i(Je);b(Jo.$$.fragment,Fn),Ni=d(Fn),zo=a(Fn,"P",{});var Tn=i(zo);Ei=n(Tn,"This method forwards all its arguments to "),wt=a(Tn,"A",{href:!0});var Zc=i(wt);Pi=n(Zc,"OneFormerImageProcessor.post_process_semantic_segmentation()"),Zc.forEach(t),Ci=n(Tn,`.
Please refer to the docstring of this method for more information.`),Tn.forEach(t),Fn.forEach(t),q.forEach(t),Gr=d(o),me=a(o,"H2",{class:!0});var On=i(me);ze=a(On,"A",{id:!0,class:!0,href:!0});var Bc=i(ze);mr=a(Bc,"SPAN",{});var Rc=i(mr);b(No.$$.fragment,Rc),Rc.forEach(t),Bc.forEach(t),Wi=d(On),pr=a(On,"SPAN",{});var Gc=i(pr);qi=n(Gc,"OneFormerModel"),Gc.forEach(t),On.forEach(t),Vr=d(o),A=a(o,"DIV",{class:!0});var Ut=i(A);b(Eo.$$.fragment,Ut),Si=d(Ut),Po=a(Ut,"P",{});var kn=i(Po);Zi=n(kn,`The bare OneFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Co=a(kn,"A",{href:!0,rel:!0});var Vc=i(Co);Bi=n(Vc,"nn.Module"),Vc.forEach(t),Ri=n(kn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),kn.forEach(t),Gi=d(Ut),C=a(Ut,"DIV",{class:!0});var Re=i(C);b(Wo.$$.fragment,Re),Vi=d(Re),pe=a(Re,"P",{});var $t=i(pe);Ai=n($t,"The "),Ft=a($t,"A",{href:!0});var Ac=i(Ft);Xi=n(Ac,"OneFormerModel"),Ac.forEach(t),Li=n($t," forward method, overrides the "),hr=a($t,"CODE",{});var Xc=i(hr);Di=n(Xc,"__call__"),Xc.forEach(t),Hi=n($t," special method."),$t.forEach(t),Yi=d(Re),b(Ne.$$.fragment,Re),Qi=d(Re),b(Ee.$$.fragment,Re),Re.forEach(t),Ut.forEach(t),Ar=d(o),he=a(o,"H2",{class:!0});var Mn=i(he);Pe=a(Mn,"A",{id:!0,class:!0,href:!0});var Lc=i(Pe);fr=a(Lc,"SPAN",{});var Dc=i(fr);b(qo.$$.fragment,Dc),Dc.forEach(t),Lc.forEach(t),Ki=d(Mn),gr=a(Mn,"SPAN",{});var Hc=i(gr);el=n(Hc,"OneFormerForUniversalSegmentation"),Hc.forEach(t),Mn.forEach(t),Xr=d(o),X=a(o,"DIV",{class:!0});var Jt=i(X);b(So.$$.fragment,Jt),ol=d(Jt),Zo=a(Jt,"P",{});var xn=i(Zo);tl=n(xn,`OneFormer Model for instance, semantic and panoptic image segmentation.
This model is a PyTorch `),Bo=a(xn,"A",{href:!0,rel:!0});var Yc=i(Bo);rl=n(Yc,"nn.Module"),Yc.forEach(t),nl=n(xn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),xn.forEach(t),sl=d(Jt),z=a(Jt,"DIV",{class:!0});var ee=i(z);b(Ro.$$.fragment,ee),al=d(ee),fe=a(ee,"P",{});var zt=i(fe);il=n(zt,"The "),Tt=a(zt,"A",{href:!0});var Qc=i(Tt);ll=n(Qc,"OneFormerForUniversalSegmentation"),Qc.forEach(t),cl=n(zt," forward method, overrides the "),ur=a(zt,"CODE",{});var Kc=i(ur);dl=n(Kc,"__call__"),Kc.forEach(t),ml=n(zt," special method."),zt.forEach(t),pl=d(ee),b(Ce.$$.fragment,ee),hl=d(ee),_r=a(ee,"P",{});var ed=i(_r);fl=n(ed,"Example:"),ed.forEach(t),gl=d(ee),b(We.$$.fragment,ee),ee.forEach(t),Jt.forEach(t),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(fd)),l(g,"id","oneformer"),l(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(g,"href","#oneformer"),l(_,"class","relative group"),l(ue,"id","overview"),l(ue,"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(ue,"href","#overview"),l(oe,"class","relative group"),l(Ve,"href","https://arxiv.org/abs/2211.06220"),l(Ve,"rel","nofollow"),l(Ae,"width","600"),od(Ae.src,bl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/oneformer_teaser.png")||l(Ae,"src",bl),l(Xe,"href","https://github.com/SHI-Labs/OneFormer/blob/33ebb56ed34f970a30ae103e786c0cb64c653d9a/oneformer/modeling/criterion.py#L287"),l(Xe,"rel","nofollow"),l(Do,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerProcessor"),l(Ho,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor"),l(Yo,"href","/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer"),l(Qo,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerProcessor.post_process_semantic_segmentation"),l(Ko,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),l(et,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_panoptic_segmentation"),l(ot,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerForUniversalSegmentation"),l(Le,"href","https://arxiv.org/abs/2211.06220"),l(Le,"rel","nofollow"),l(De,"width","600"),od(De.src,yl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/oneformer_architecture.png")||l(De,"src",yl),l(He,"href","https://huggingface.co/praeclarumjj3"),l(He,"rel","nofollow"),l(Ye,"href","https://github.com/SHI-Labs/OneFormer"),l(Ye,"rel","nofollow"),l(be,"id","resources"),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","#resources"),l(re,"class","relative group"),l(eo,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/OneFormer"),l(eo,"rel","nofollow"),l(ye,"id","transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"),l(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ye,"href","#transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"),l(ne,"class","relative group"),l(st,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerModel"),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(at,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_semantic_segmentation"),l(it,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),l(lt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_panoptic_segmentation"),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(we,"id","transformers.OneFormerConfig"),l(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(we,"href","#transformers.OneFormerConfig"),l(ae,"class","relative group"),l(ct,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerModel"),l(lo,"href","https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny"),l(lo,"rel","nofollow"),l(co,"href","https://huggingface.co/datasets/scene_parse_150"),l(co,"rel","nofollow"),l(dt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(mt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(pt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),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($,"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.OneFormerImageProcessor"),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.OneFormerImageProcessor"),l(ce,"class","relative group"),l(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ft,"href","/docs/transformers/v4.31.0/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ie,"id","transformers.OneFormerProcessor"),l(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ie,"href","#transformers.OneFormerProcessor"),l(de,"class","relative group"),l(gt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor"),l(ut,"href","/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer"),l(_t,"href","/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizerFast"),l(vt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.encode_inputs"),l(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(bt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),l(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(yt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_panoptic_segmentation"),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(wt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_semantic_segmentation"),l(Je,"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(ze,"id","transformers.OneFormerModel"),l(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ze,"href","#transformers.OneFormerModel"),l(me,"class","relative group"),l(Co,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Co,"rel","nofollow"),l(Ft,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerModel"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Pe,"id","transformers.OneFormerForUniversalSegmentation"),l(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Pe,"href","#transformers.OneFormerForUniversalSegmentation"),l(he,"class","relative group"),l(Bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Bo,"rel","nofollow"),l(Tt,"href","/docs/transformers/v4.31.0/en/model_doc/oneformer#transformers.OneFormerForUniversalSegmentation"),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(X,"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,m){e(document.head,f),h(o,k,m),h(o,_,m),e(_,g),e(g,O),y(p,O,null),e(_,u),e(_,S),e(S,In),h(o,wr,m),h(o,oe,m),e(oe,ue),e(ue,Nt),y(Ge,Nt,null),e(oe,jn),e(oe,Et),e(Et,Un),h(o,Fr,m),h(o,_e,m),e(_e,$n),e(_e,Ve),e(Ve,Jn),e(_e,zn),h(o,Tr,m),h(o,Ae,m),h(o,Or,m),h(o,Ao,m),e(Ao,Nn),h(o,kr,m),h(o,Xo,m),e(Xo,Pt),e(Pt,En),h(o,Mr,m),h(o,Lo,m),e(Lo,Pn),h(o,xr,m),h(o,J,m),e(J,te),e(te,Cn),e(te,Ct),e(Ct,Wn),e(te,qn),e(te,Wt),e(Wt,Sn),e(te,Zn),e(J,Bn),e(J,qt),e(qt,Rn),e(J,Gn),e(J,N),e(N,Vn),e(N,St),e(St,An),e(N,Xn),e(N,Zt),e(Zt,Ln),e(N,Dn),e(N,Bt),e(Bt,Hn),e(N,Yn),e(N,Xe),e(Xe,Qn),e(N,Kn),e(J,es),e(J,E),e(E,os),e(E,Do),e(Do,ts),e(E,rs),e(E,Rt),e(Rt,ns),e(E,ss),e(E,Ho),e(Ho,as),e(E,is),e(E,Yo),e(Yo,ls),e(E,cs),e(J,ds),e(J,U),e(U,ms),e(U,Qo),e(Qo,ps),e(U,hs),e(U,Ko),e(Ko,fs),e(U,gs),e(U,et),e(et,us),e(U,_s),e(U,ot),e(ot,vs),e(U,bs),e(U,Gt),e(Gt,ys),e(U,ws),h(o,Ir,m),h(o,ve,m),e(ve,Fs),e(ve,Le),e(Le,Ts),e(ve,Os),h(o,jr,m),h(o,De,m),h(o,Ur,m),h(o,L,m),e(L,ks),e(L,He),e(He,Ms),e(L,xs),e(L,Ye),e(Ye,Is),e(L,js),h(o,$r,m),h(o,re,m),e(re,be),e(be,Vt),y(Qe,Vt,null),e(re,Us),e(re,At),e(At,$s),h(o,Jr,m),h(o,tt,m),e(tt,Js),h(o,zr,m),h(o,rt,m),e(rt,Ke),e(Ke,zs),e(Ke,eo),e(eo,Ns),e(Ke,Es),h(o,Nr,m),h(o,nt,m),e(nt,Ps),h(o,Er,m),h(o,ne,m),e(ne,ye),e(ye,Xt),y(oo,Xt,null),e(ne,Cs),e(ne,Lt),e(Lt,Ws),h(o,Pr,m),h(o,se,m),y(to,se,null),e(se,qs),e(se,ro),e(ro,Ss),e(ro,st),e(st,Zs),e(ro,Bs),h(o,Cr,m),h(o,Z,m),y(no,Z,null),e(Z,Rs),e(Z,so),e(so,Gs),e(so,Dt),e(Dt,Vs),e(so,As),e(Z,Xs),e(Z,B),e(B,Ls),e(B,at),e(at,Ds),e(B,Hs),e(B,it),e(it,Ys),e(B,Qs),e(B,lt),e(lt,Ks),e(B,ea),h(o,Wr,m),h(o,ae,m),e(ae,we),e(we,Ht),y(ao,Ht,null),e(ae,oa),e(ae,Yt),e(Yt,ta),h(o,qr,m),h(o,$,m),y(io,$,null),e($,ra),e($,R),e(R,na),e(R,ct),e(ct,sa),e(R,aa),e(R,lo),e(lo,ia),e(R,la),e(R,co),e(co,ca),e(R,da),e($,ma),e($,ie),e(ie,pa),e(ie,dt),e(dt,ha),e(ie,fa),e(ie,mt),e(mt,ga),e(ie,ua),e($,_a),y(Fe,$,null),e($,va),e($,Te),y(mo,Te,null),e(Te,ba),e(Te,le),e(le,ya),e(le,pt),e(pt,wa),e(le,Fa),e(le,Qt),e(Qt,Ta),e(le,Oa),h(o,Sr,m),h(o,ce,m),e(ce,Oe),e(Oe,Kt),y(po,Kt,null),e(ce,ka),e(ce,er),e(er,Ma),h(o,Zr,m),h(o,M,m),y(ho,M,null),e(M,xa),e(M,or),e(or,Ia),e(M,ja),e(M,fo),e(fo,Ua),e(fo,tr),e(tr,$a),e(fo,Ja),e(M,za),e(M,ht),y(go,ht,null),e(M,Na),e(M,D),y(uo,D,null),e(D,Ea),e(D,_o),e(_o,Pa),e(_o,rr),e(rr,Ca),e(_o,Wa),e(D,qa),e(D,G),e(G,Sa),e(G,nr),e(nr,Za),e(G,Ba),e(G,sr),e(sr,Ra),e(G,Ga),e(G,ar),e(ar,Va),e(G,Aa),e(M,Xa),e(M,ke),y(vo,ke,null),e(ke,La),e(ke,bo),e(bo,Da),e(bo,ft),e(ft,Ha),e(bo,Ya),e(M,Qa),e(M,Me),y(yo,Me,null),e(Me,Ka),e(Me,wo),e(wo,ei),e(wo,ir),e(ir,oi),e(wo,ti),e(M,ri),e(M,xe),y(Fo,xe,null),e(xe,ni),e(xe,To),e(To,si),e(To,lr),e(lr,ai),e(To,ii),h(o,Br,m),h(o,de,m),e(de,Ie),e(Ie,cr),y(Oo,cr,null),e(de,li),e(de,dr),e(dr,ci),h(o,Rr,m),h(o,I,m),y(ko,I,null),e(I,di),e(I,V),e(V,mi),e(V,gt),e(gt,pi),e(V,hi),e(V,ut),e(ut,fi),e(V,gi),e(V,_t),e(_t,ui),e(V,_i),e(I,vi),e(I,je),y(Mo,je,null),e(je,bi),e(je,xo),e(xo,yi),e(xo,vt),e(vt,wi),e(xo,Fi),e(I,Ti),e(I,Ue),y(Io,Ue,null),e(Ue,Oi),e(Ue,jo),e(jo,ki),e(jo,bt),e(bt,Mi),e(jo,xi),e(I,Ii),e(I,$e),y(Uo,$e,null),e($e,ji),e($e,$o),e($o,Ui),e($o,yt),e(yt,$i),e($o,Ji),e(I,zi),e(I,Je),y(Jo,Je,null),e(Je,Ni),e(Je,zo),e(zo,Ei),e(zo,wt),e(wt,Pi),e(zo,Ci),h(o,Gr,m),h(o,me,m),e(me,ze),e(ze,mr),y(No,mr,null),e(me,Wi),e(me,pr),e(pr,qi),h(o,Vr,m),h(o,A,m),y(Eo,A,null),e(A,Si),e(A,Po),e(Po,Zi),e(Po,Co),e(Co,Bi),e(Po,Ri),e(A,Gi),e(A,C),y(Wo,C,null),e(C,Vi),e(C,pe),e(pe,Ai),e(pe,Ft),e(Ft,Xi),e(pe,Li),e(pe,hr),e(hr,Di),e(pe,Hi),e(C,Yi),y(Ne,C,null),e(C,Qi),y(Ee,C,null),h(o,Ar,m),h(o,he,m),e(he,Pe),e(Pe,fr),y(qo,fr,null),e(he,Ki),e(he,gr),e(gr,el),h(o,Xr,m),h(o,X,m),y(So,X,null),e(X,ol),e(X,Zo),e(Zo,tl),e(Zo,Bo),e(Bo,rl),e(Zo,nl),e(X,sl),e(X,z),y(Ro,z,null),e(z,al),e(z,fe),e(fe,il),e(fe,Tt),e(Tt,ll),e(fe,cl),e(fe,ur),e(ur,dl),e(fe,ml),e(z,pl),y(Ce,z,null),e(z,hl),e(z,_r),e(_r,fl),e(z,gl),y(We,z,null),Lr=!0},p(o,[m]){const Go={};m&2&&(Go.$$scope={dirty:m,ctx:o}),Fe.$set(Go);const vr={};m&2&&(vr.$$scope={dirty:m,ctx:o}),Ne.$set(vr);const br={};m&2&&(br.$$scope={dirty:m,ctx:o}),Ee.$set(br);const yr={};m&2&&(yr.$$scope={dirty:m,ctx:o}),Ce.$set(yr);const Vo={};m&2&&(Vo.$$scope={dirty:m,ctx:o}),We.$set(Vo)},i(o){Lr||(w(p.$$.fragment,o),w(Ge.$$.fragment,o),w(Qe.$$.fragment,o),w(oo.$$.fragment,o),w(to.$$.fragment,o),w(no.$$.fragment,o),w(ao.$$.fragment,o),w(io.$$.fragment,o),w(Fe.$$.fragment,o),w(mo.$$.fragment,o),w(po.$$.fragment,o),w(ho.$$.fragment,o),w(go.$$.fragment,o),w(uo.$$.fragment,o),w(vo.$$.fragment,o),w(yo.$$.fragment,o),w(Fo.$$.fragment,o),w(Oo.$$.fragment,o),w(ko.$$.fragment,o),w(Mo.$$.fragment,o),w(Io.$$.fragment,o),w(Uo.$$.fragment,o),w(Jo.$$.fragment,o),w(No.$$.fragment,o),w(Eo.$$.fragment,o),w(Wo.$$.fragment,o),w(Ne.$$.fragment,o),w(Ee.$$.fragment,o),w(qo.$$.fragment,o),w(So.$$.fragment,o),w(Ro.$$.fragment,o),w(Ce.$$.fragment,o),w(We.$$.fragment,o),Lr=!0)},o(o){F(p.$$.fragment,o),F(Ge.$$.fragment,o),F(Qe.$$.fragment,o),F(oo.$$.fragment,o),F(to.$$.fragment,o),F(no.$$.fragment,o),F(ao.$$.fragment,o),F(io.$$.fragment,o),F(Fe.$$.fragment,o),F(mo.$$.fragment,o),F(po.$$.fragment,o),F(ho.$$.fragment,o),F(go.$$.fragment,o),F(uo.$$.fragment,o),F(vo.$$.fragment,o),F(yo.$$.fragment,o),F(Fo.$$.fragment,o),F(Oo.$$.fragment,o),F(ko.$$.fragment,o),F(Mo.$$.fragment,o),F(Io.$$.fragment,o),F(Uo.$$.fragment,o),F(Jo.$$.fragment,o),F(No.$$.fragment,o),F(Eo.$$.fragment,o),F(Wo.$$.fragment,o),F(Ne.$$.fragment,o),F(Ee.$$.fragment,o),F(qo.$$.fragment,o),F(So.$$.fragment,o),F(Ro.$$.fragment,o),F(Ce.$$.fragment,o),F(We.$$.fragment,o),Lr=!1},d(o){t(f),o&&t(k),o&&t(_),T(p),o&&t(wr),o&&t(oe),T(Ge),o&&t(Fr),o&&t(_e),o&&t(Tr),o&&t(Ae),o&&t(Or),o&&t(Ao),o&&t(kr),o&&t(Xo),o&&t(Mr),o&&t(Lo),o&&t(xr),o&&t(J),o&&t(Ir),o&&t(ve),o&&t(jr),o&&t(De),o&&t(Ur),o&&t(L),o&&t($r),o&&t(re),T(Qe),o&&t(Jr),o&&t(tt),o&&t(zr),o&&t(rt),o&&t(Nr),o&&t(nt),o&&t(Er),o&&t(ne),T(oo),o&&t(Pr),o&&t(se),T(to),o&&t(Cr),o&&t(Z),T(no),o&&t(Wr),o&&t(ae),T(ao),o&&t(qr),o&&t($),T(io),T(Fe),T(mo),o&&t(Sr),o&&t(ce),T(po),o&&t(Zr),o&&t(M),T(ho),T(go),T(uo),T(vo),T(yo),T(Fo),o&&t(Br),o&&t(de),T(Oo),o&&t(Rr),o&&t(I),T(ko),T(Mo),T(Io),T(Uo),T(Jo),o&&t(Gr),o&&t(me),T(No),o&&t(Vr),o&&t(A),T(Eo),T(Wo),T(Ne),T(Ee),o&&t(Ar),o&&t(he),T(qo),o&&t(Xr),o&&t(X),T(So),T(Ro),T(Ce),T(We)}}}const fd={local:"oneformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput",title:"OneFormer specific outputs"},{local:"transformers.OneFormerConfig",title:"OneFormerConfig"},{local:"transformers.OneFormerImageProcessor",title:"OneFormerImageProcessor"},{local:"transformers.OneFormerProcessor",title:"OneFormerProcessor"},{local:"transformers.OneFormerModel",title:"OneFormerModel"},{local:"transformers.OneFormerForUniversalSegmentation",title:"OneFormerForUniversalSegmentation"}],title:"OneFormer"};function gd(P){return id(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fd extends rd{constructor(f){super();nd(this,f,gd,hd,sd,{})}}export{Fd as default,fd as metadata};
