import{S as Zc,i as Bc,s as Rc,e as s,k as c,w as b,t as r,M as Gc,c as a,d as t,m as d,a as i,x as y,h as n,b as l,N as qc,G as e,g as h,y as v,q as w,o as F,B as T,v as Vc,L as rl}from"../../chunks/vendor-hf-doc-builder.js";import{T as Sc}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as nl}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as he}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as tl}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ac(P){let f,O,_,g,k;return g=new nl({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"),O=r("Examples:"),_=c(),b(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);O=n(u,"Examples:"),u.forEach(t),_=d(p),y(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,O),h(p,_,u),v(g,p,u),k=!0},p:rl,i(p){k||(w(g.$$.fragment,p),k=!0)},o(p){F(g.$$.fragment,p),k=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function Xc(P){let f,O,_,g,k;return{c(){f=s("p"),O=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),k=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);O=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),k=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,O),e(f,_),e(_,g),e(f,k)},d(p){p&&t(f)}}}function Lc(P){let f,O,_,g,k;return g=new nl({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"),O=r("Example:"),_=c(),b(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);O=n(u,"Example:"),u.forEach(t),_=d(p),y(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,O),h(p,_,u),v(g,p,u),k=!0},p:rl,i(p){k||(w(g.$$.fragment,p),k=!0)},o(p){F(g.$$.fragment,p),k=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function Dc(P){let f,O,_,g,k;return{c(){f=s("p"),O=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),k=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);O=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),k=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,O),e(f,_),e(_,g),e(f,k)},d(p){p&&t(f)}}}function Hc(P){let f,O,_,g,k;return g=new nl({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"),O=r("Universal segmentation example:"),_=c(),b(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);O=n(u,"Universal segmentation example:"),u.forEach(t),_=d(p),y(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,O),h(p,_,u),v(g,p,u),k=!0},p:rl,i(p){k||(w(g.$$.fragment,p),k=!0)},o(p){F(g.$$.fragment,p),k=!1},d(p){p&&t(f),p&&t(_),T(g,p)}}}function Yc(P){let f,O,_,g,k,p,u,S,wn,gr,ee,fe,jt,Be,Fn,Ut,Tn,ur,ge,kn,Re,On,Mn,_r,Ge,sl,br,Ro,xn,yr,Go,$t,In,vr,Vo,jn,wr,$,oe,Un,Jt,$n,Jn,zt,zn,Nn,En,Nt,Pn,Cn,z,Wn,Et,qn,Sn,Pt,Zn,Bn,Ct,Rn,Gn,Ve,Vn,An,Xn,N,Ln,Ao,Dn,Hn,Wt,Yn,Qn,Xo,Kn,es,Lo,os,ts,rs,U,ns,Do,ss,as,Ho,is,ls,Yo,cs,ds,Qo,ms,ps,qt,hs,fs,Fr,ue,gs,Ae,us,_s,Tr,Xe,al,kr,L,bs,Le,ys,vs,De,ws,Fs,Or,te,_e,St,He,Ts,Zt,ks,Mr,Ko,Os,xr,et,Ye,Ms,Qe,xs,Is,Ir,ot,js,jr,re,be,Bt,Ke,Us,Rt,$s,Ur,ne,eo,Js,oo,zs,tt,Ns,Es,$r,Z,to,Ps,ro,Cs,Gt,Ws,qs,Ss,B,Zs,rt,Bs,Rs,nt,Gs,Vs,st,As,Xs,Jr,se,ye,Vt,no,Ls,At,Ds,zr,E,so,Hs,R,Ys,at,Qs,Ks,ao,ea,oa,io,ta,ra,na,ae,sa,it,aa,ia,lt,la,ca,da,ve,Nr,ie,we,Xt,lo,ma,Lt,pa,Er,M,co,ha,Dt,fa,ga,mo,ua,Ht,_a,ba,ya,ct,po,va,D,ho,wa,fo,Fa,Yt,Ta,ka,Oa,G,Ma,Qt,xa,Ia,Kt,ja,Ua,er,$a,Ja,za,Fe,go,Na,uo,Ea,dt,Pa,Ca,Wa,Te,_o,qa,bo,Sa,or,Za,Ba,Ra,ke,yo,Ga,vo,Va,tr,Aa,Xa,Pr,le,Oe,rr,wo,La,nr,Da,Cr,I,Fo,Ha,V,Ya,mt,Qa,Ka,pt,ei,oi,ht,ti,ri,ni,Me,To,si,ko,ai,ft,ii,li,ci,xe,Oo,di,Mo,mi,gt,pi,hi,fi,Ie,xo,gi,Io,ui,ut,_i,bi,yi,je,jo,vi,Uo,wi,_t,Fi,Ti,Wr,ce,Ue,sr,$o,ki,ar,Oi,qr,A,Jo,Mi,zo,xi,No,Ii,ji,Ui,C,Eo,$i,de,Ji,bt,zi,Ni,ir,Ei,Pi,Ci,$e,Wi,Je,Sr,me,ze,lr,Po,qi,cr,Si,Zr,X,Co,Zi,Wo,Bi,qo,Ri,Gi,Vi,J,So,Ai,pe,Xi,yt,Li,Di,dr,Hi,Yi,Qi,Ne,Ki,mr,el,ol,Ee,Br;return p=new he({}),Be=new he({}),He=new he({}),Ke=new he({}),eo=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/main/src/transformers/models/oneformer/modeling_oneformer.py#L804"}}),to=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/main/src/transformers/models/oneformer/modeling_oneformer.py#L854"}}),no=new he({}),so=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/main/src/transformers/models/oneformer/configuration_oneformer.py#L33"}}),ve=new tl({props:{anchor:"transformers.OneFormerConfig.example",$$slots:{default:[Ac]},$$scope:{ctx:P}}}),lo=new he({}),co=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/main/src/transformers/models/oneformer/image_processing_oneformer.py#L347"}}),po=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[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/oneformer/image_processing_oneformer.py#L630"}}),ho=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[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, 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/main/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"},{anchor:"transformers.OneFormerImageProcessor.encode_inputs.input_data_format",description:`<strong>input_data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the input image. If not provided, it will be inferred from the input
image.`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/oneformer/image_processing_oneformer.py#L928",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),go=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/main/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/main/src/transformers/models/oneformer/image_processing_oneformer.py#L1063",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>
`}}),_o=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/main/src/transformers/models/oneformer/image_processing_oneformer.py#L1113",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>
`}}),yo=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/main/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/main/src/transformers/models/oneformer/image_processing_oneformer.py#L1232",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>
`}}),wo=new he({}),Fo=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/main/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/main/src/transformers/models/oneformer/processing_oneformer.py#L29"}}),To=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/main/src/transformers/models/oneformer/processing_oneformer.py#L145"}}),Oo=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/main/src/transformers/models/oneformer/processing_oneformer.py#L192"}}),xo=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/main/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/main/src/transformers/models/oneformer/processing_oneformer.py#L185"}}),$o=new he({}),Jo=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/main/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/main/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/main/src/transformers/models/oneformer/modeling_oneformer.py#L2902"}}),Eo=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/main/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/main/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/main/src/transformers/models/oneformer/modeling_oneformer.py#L2919",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Sc({props:{$$slots:{default:[Xc]},$$scope:{ctx:P}}}),Je=new tl({props:{anchor:"transformers.OneFormerModel.forward.example",$$slots:{default:[Lc]},$$scope:{ctx:P}}}),Po=new he({}),Co=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/main/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/main/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/main/src/transformers/models/oneformer/modeling_oneformer.py#L3031"}}),So=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/main/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/main/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/main/src/transformers/models/oneformer/modeling_oneformer.py#L3098",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/oneformer#transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput"
>transformers.models.oneformer.modeling_oneformer.OneFormerForUniversalSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new Sc({props:{$$slots:{default:[Dc]},$$scope:{ctx:P}}}),Ee=new tl({props:{anchor:"transformers.OneFormerForUniversalSegmentation.forward.example",$$slots:{default:[Hc]},$$scope:{ctx:P}}}),{c(){f=s("meta"),O=c(),_=s("h1"),g=s("a"),k=s("span"),b(p.$$.fragment),u=c(),S=s("span"),wn=r("OneFormer"),gr=c(),ee=s("h2"),fe=s("a"),jt=s("span"),b(Be.$$.fragment),Fn=c(),Ut=s("span"),Tn=r("Overview"),ur=c(),ge=s("p"),kn=r("The OneFormer model was proposed in "),Re=s("a"),On=r("OneFormer: One Transformer to Rule Universal Image Segmentation"),Mn=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."),_r=c(),Ge=s("img"),br=c(),Ro=s("p"),xn=r("The abstract from the paper is the following:"),yr=c(),Go=s("p"),$t=s("em"),In=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."),vr=c(),Vo=s("p"),jn=r("Tips:"),wr=c(),$=s("ul"),oe=s("li"),Un=r("OneFormer requires two inputs during inference: "),Jt=s("em"),$n=r("image"),Jn=r(" and "),zt=s("em"),zn=r("task token"),Nn=r("."),En=c(),Nt=s("li"),Pn=r("During training, OneFormer only uses panoptic annotations."),Cn=c(),z=s("li"),Wn=r(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Et=s("code"),qn=r("get_num_masks"),Sn=r(" function inside in the "),Pt=s("code"),Zn=r("OneFormerLoss"),Bn=r(" class of "),Ct=s("code"),Rn=r("modeling_oneformer.py"),Gn=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 `),Ve=s("a"),Vn=r("here"),An=r("."),Xn=c(),N=s("li"),Ln=r("One can use "),Ao=s("a"),Dn=r("OneFormerProcessor"),Hn=r(" to prepare input images and task inputs for the model and optional targets for the model. "),Wt=s("code"),Yn=r("OneformerProcessor"),Qn=r(" wraps "),Xo=s("a"),Kn=r("OneFormerImageProcessor"),es=r(" and "),Lo=s("a"),os=r("CLIPTokenizer"),ts=r(" into a single instance to both prepare the images and encode the task inputs."),rs=c(),U=s("li"),ns=r("To get the final segmentation, depending on the task, you can call "),Do=s("a"),ss=r("post_process_semantic_segmentation()"),as=r(" or "),Ho=s("a"),is=r("post_process_instance_segmentation()"),ls=r(" or "),Yo=s("a"),cs=r("post_process_panoptic_segmentation()"),ds=r(". All three tasks can be solved using "),Qo=s("a"),ms=r("OneFormerForUniversalSegmentation"),ps=r(" output, panoptic segmentation accepts an optional "),qt=s("code"),hs=r("label_ids_to_fuse"),fs=r(" argument to fuse instances of the target object/s (e.g. sky) together."),Fr=c(),ue=s("p"),gs=r("The figure below illustrates the architecture of OneFormer. Taken from the "),Ae=s("a"),us=r("original paper"),_s=r("."),Tr=c(),Xe=s("img"),kr=c(),L=s("p"),bs=r("This model was contributed by "),Le=s("a"),ys=r("Jitesh Jain"),vs=r(". The original code can be found "),De=s("a"),ws=r("here"),Fs=r("."),Or=c(),te=s("h2"),_e=s("a"),St=s("span"),b(He.$$.fragment),Ts=c(),Zt=s("span"),ks=r("Resources"),Mr=c(),Ko=s("p"),Os=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OneFormer."),xr=c(),et=s("ul"),Ye=s("li"),Ms=r("Demo notebooks regarding inference + fine-tuning on custom data can be found "),Qe=s("a"),xs=r("here"),Is=r("."),Ir=c(),ot=s("p"),js=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.`),jr=c(),re=s("h2"),be=s("a"),Bt=s("span"),b(Ke.$$.fragment),Us=c(),Rt=s("span"),$s=r("OneFormer specific outputs"),Ur=c(),ne=s("div"),b(eo.$$.fragment),Js=c(),oo=s("p"),zs=r("Class for outputs of "),tt=s("a"),Ns=r("OneFormerModel"),Es=r(". This class returns all the needed hidden states to compute the logits."),$r=c(),Z=s("div"),b(to.$$.fragment),Ps=c(),ro=s("p"),Cs=r("Class for outputs of "),Gt=s("code"),Ws=r("OneFormerForUniversalSegmentationOutput"),qs=r("."),Ss=c(),B=s("p"),Zs=r("This output can be directly passed to "),rt=s("a"),Bs=r("post_process_semantic_segmentation()"),Rs=r(` or
`),nt=s("a"),Gs=r("post_process_instance_segmentation()"),Vs=r(` or
`),st=s("a"),As=r("post_process_panoptic_segmentation()"),Xs=r(" depending on the task. Please, see\n[`~OneFormerImageProcessor] for details regarding usage."),Jr=c(),se=s("h2"),ye=s("a"),Vt=s("span"),b(no.$$.fragment),Ls=c(),At=s("span"),Ds=r("OneFormerConfig"),zr=c(),E=s("div"),b(so.$$.fragment),Hs=c(),R=s("p"),Ys=r("This is the configuration class to store the configuration of a "),at=s("a"),Qs=r("OneFormerModel"),Ks=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
`),ao=s("a"),ea=r("shi-labs/oneformer_ade20k_swin_tiny"),oa=r(` architecture
trained on `),io=s("a"),ta=r("ADE20k-150"),ra=r("."),na=c(),ae=s("p"),sa=r("Configuration objects inherit from "),it=s("a"),aa=r("PretrainedConfig"),ia=r(` and can be used to control the model outputs. Read the
documentation from `),lt=s("a"),la=r("PretrainedConfig"),ca=r(" for more information."),da=c(),b(ve.$$.fragment),Nr=c(),ie=s("h2"),we=s("a"),Xt=s("span"),b(lo.$$.fragment),ma=c(),Lt=s("span"),pa=r("OneFormerImageProcessor"),Er=c(),M=s("div"),b(co.$$.fragment),ha=c(),Dt=s("p"),fa=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.`),ga=c(),mo=s("p"),ua=r("This image processor inherits from "),Ht=s("code"),_a=r("BaseImageProcessor"),ba=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ya=c(),ct=s("div"),b(po.$$.fragment),va=c(),D=s("div"),b(ho.$$.fragment),wa=c(),fo=s("p"),Fa=r("Pad images up to the largest image in a batch and create a corresponding "),Yt=s("code"),Ta=r("pixel_mask"),ka=r("."),Oa=c(),G=s("p"),Ma=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
`),Qt=s("code"),xa=r("segmentation_maps = [[2,6,7,9]]"),Ia=r(", the output will contain "),Kt=s("code"),ja=r("mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),Ua=r(" (four binary masks) and "),er=s("code"),$a=r("class_labels = [2,6,7,9]"),Ja=r(`, the labels for
each mask.`),za=c(),Fe=s("div"),b(go.$$.fragment),Na=c(),uo=s("p"),Ea=r("Converts the output of "),dt=s("a"),Pa=r("MaskFormerForInstanceSegmentation"),Ca=r(` into semantic segmentation maps. Only supports
PyTorch.`),Wa=c(),Te=s("div"),b(_o.$$.fragment),qa=c(),bo=s("p"),Sa=r("Converts the output of "),or=s("code"),Za=r("OneFormerForUniversalSegmentationOutput"),Ba=r(` into image instance segmentation
predictions. Only supports PyTorch.`),Ra=c(),ke=s("div"),b(yo.$$.fragment),Ga=c(),vo=s("p"),Va=r("Converts the output of "),tr=s("code"),Aa=r("MaskFormerForInstanceSegmentationOutput"),Xa=r(` into image panoptic segmentation
predictions. Only supports PyTorch.`),Pr=c(),le=s("h2"),Oe=s("a"),rr=s("span"),b(wo.$$.fragment),La=c(),nr=s("span"),Da=r("OneFormerProcessor"),Cr=c(),I=s("div"),b(Fo.$$.fragment),Ha=c(),V=s("p"),Ya=r("Constructs an OneFormer processor which wraps "),mt=s("a"),Qa=r("OneFormerImageProcessor"),Ka=r(` and
`),pt=s("a"),ei=r("CLIPTokenizer"),oi=r("/"),ht=s("a"),ti=r("CLIPTokenizerFast"),ri=r(` into a single processor that inherits both the image processor and
tokenizer functionalities.`),ni=c(),Me=s("div"),b(To.$$.fragment),si=c(),ko=s("p"),ai=r("This method forwards all its arguments to "),ft=s("a"),ii=r("OneFormerImageProcessor.encode_inputs()"),li=r(` and then tokenizes the
task_inputs. Please refer to the docstring of this method for more information.`),ci=c(),xe=s("div"),b(Oo.$$.fragment),di=c(),Mo=s("p"),mi=r("This method forwards all its arguments to "),gt=s("a"),pi=r("OneFormerImageProcessor.post_process_instance_segmentation()"),hi=r(`.
Please refer to the docstring of this method for more information.`),fi=c(),Ie=s("div"),b(xo.$$.fragment),gi=c(),Io=s("p"),ui=r("This method forwards all its arguments to "),ut=s("a"),_i=r("OneFormerImageProcessor.post_process_panoptic_segmentation()"),bi=r(`.
Please refer to the docstring of this method for more information.`),yi=c(),je=s("div"),b(jo.$$.fragment),vi=c(),Uo=s("p"),wi=r("This method forwards all its arguments to "),_t=s("a"),Fi=r("OneFormerImageProcessor.post_process_semantic_segmentation()"),Ti=r(`.
Please refer to the docstring of this method for more information.`),Wr=c(),ce=s("h2"),Ue=s("a"),sr=s("span"),b($o.$$.fragment),ki=c(),ar=s("span"),Oi=r("OneFormerModel"),qr=c(),A=s("div"),b(Jo.$$.fragment),Mi=c(),zo=s("p"),xi=r(`The bare OneFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=s("a"),Ii=r("nn.Module"),ji=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.`),Ui=c(),C=s("div"),b(Eo.$$.fragment),$i=c(),de=s("p"),Ji=r("The "),bt=s("a"),zi=r("OneFormerModel"),Ni=r(" forward method, overrides the "),ir=s("code"),Ei=r("__call__"),Pi=r(" special method."),Ci=c(),b($e.$$.fragment),Wi=c(),b(Je.$$.fragment),Sr=c(),me=s("h2"),ze=s("a"),lr=s("span"),b(Po.$$.fragment),qi=c(),cr=s("span"),Si=r("OneFormerForUniversalSegmentation"),Zr=c(),X=s("div"),b(Co.$$.fragment),Zi=c(),Wo=s("p"),Bi=r(`OneFormer Model for instance, semantic and panoptic image segmentation.
This model is a PyTorch `),qo=s("a"),Ri=r("nn.Module"),Gi=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.`),Vi=c(),J=s("div"),b(So.$$.fragment),Ai=c(),pe=s("p"),Xi=r("The "),yt=s("a"),Li=r("OneFormerForUniversalSegmentation"),Di=r(" forward method, overrides the "),dr=s("code"),Hi=r("__call__"),Yi=r(" special method."),Qi=c(),b(Ne.$$.fragment),Ki=c(),mr=s("p"),el=r("Example:"),ol=c(),b(Ee.$$.fragment),this.h()},l(o){const m=Gc('[data-svelte="svelte-1phssyn"]',document.head);f=a(m,"META",{name:!0,content:!0}),m.forEach(t),O=d(o),_=a(o,"H1",{class:!0});var Zo=i(_);g=a(Zo,"A",{id:!0,class:!0,href:!0});var pr=i(g);k=a(pr,"SPAN",{});var hr=i(k);y(p.$$.fragment,hr),hr.forEach(t),pr.forEach(t),u=d(Zo),S=a(Zo,"SPAN",{});var fr=i(S);wn=n(fr,"OneFormer"),fr.forEach(t),Zo.forEach(t),gr=d(o),ee=a(o,"H2",{class:!0});var Bo=i(ee);fe=a(Bo,"A",{id:!0,class:!0,href:!0});var il=i(fe);jt=a(il,"SPAN",{});var ll=i(jt);y(Be.$$.fragment,ll),ll.forEach(t),il.forEach(t),Fn=d(Bo),Ut=a(Bo,"SPAN",{});var cl=i(Ut);Tn=n(cl,"Overview"),cl.forEach(t),Bo.forEach(t),ur=d(o),ge=a(o,"P",{});var Rr=i(ge);kn=n(Rr,"The OneFormer model was proposed in "),Re=a(Rr,"A",{href:!0,rel:!0});var dl=i(Re);On=n(dl,"OneFormer: One Transformer to Rule Universal Image Segmentation"),dl.forEach(t),Mn=n(Rr," 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."),Rr.forEach(t),_r=d(o),Ge=a(o,"IMG",{width:!0,src:!0}),br=d(o),Ro=a(o,"P",{});var ml=i(Ro);xn=n(ml,"The abstract from the paper is the following:"),ml.forEach(t),yr=d(o),Go=a(o,"P",{});var pl=i(Go);$t=a(pl,"EM",{});var hl=i($t);In=n(hl,"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."),hl.forEach(t),pl.forEach(t),vr=d(o),Vo=a(o,"P",{});var fl=i(Vo);jn=n(fl,"Tips:"),fl.forEach(t),wr=d(o),$=a(o,"UL",{});var H=i($);oe=a(H,"LI",{});var vt=i(oe);Un=n(vt,"OneFormer requires two inputs during inference: "),Jt=a(vt,"EM",{});var gl=i(Jt);$n=n(gl,"image"),gl.forEach(t),Jn=n(vt," and "),zt=a(vt,"EM",{});var ul=i(zt);zn=n(ul,"task token"),ul.forEach(t),Nn=n(vt,"."),vt.forEach(t),En=d(H),Nt=a(H,"LI",{});var _l=i(Nt);Pn=n(_l,"During training, OneFormer only uses panoptic annotations."),_l.forEach(t),Cn=d(H),z=a(H,"LI",{});var Y=i(z);Wn=n(Y,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Et=a(Y,"CODE",{});var bl=i(Et);qn=n(bl,"get_num_masks"),bl.forEach(t),Sn=n(Y," function inside in the "),Pt=a(Y,"CODE",{});var yl=i(Pt);Zn=n(yl,"OneFormerLoss"),yl.forEach(t),Bn=n(Y," class of "),Ct=a(Y,"CODE",{});var vl=i(Ct);Rn=n(vl,"modeling_oneformer.py"),vl.forEach(t),Gn=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 `),Ve=a(Y,"A",{href:!0,rel:!0});var wl=i(Ve);Vn=n(wl,"here"),wl.forEach(t),An=n(Y,"."),Y.forEach(t),Xn=d(H),N=a(H,"LI",{});var Q=i(N);Ln=n(Q,"One can use "),Ao=a(Q,"A",{href:!0});var Fl=i(Ao);Dn=n(Fl,"OneFormerProcessor"),Fl.forEach(t),Hn=n(Q," to prepare input images and task inputs for the model and optional targets for the model. "),Wt=a(Q,"CODE",{});var Tl=i(Wt);Yn=n(Tl,"OneformerProcessor"),Tl.forEach(t),Qn=n(Q," wraps "),Xo=a(Q,"A",{href:!0});var kl=i(Xo);Kn=n(kl,"OneFormerImageProcessor"),kl.forEach(t),es=n(Q," and "),Lo=a(Q,"A",{href:!0});var Ol=i(Lo);os=n(Ol,"CLIPTokenizer"),Ol.forEach(t),ts=n(Q," into a single instance to both prepare the images and encode the task inputs."),Q.forEach(t),rs=d(H),U=a(H,"LI",{});var W=i(U);ns=n(W,"To get the final segmentation, depending on the task, you can call "),Do=a(W,"A",{href:!0});var Ml=i(Do);ss=n(Ml,"post_process_semantic_segmentation()"),Ml.forEach(t),as=n(W," or "),Ho=a(W,"A",{href:!0});var xl=i(Ho);is=n(xl,"post_process_instance_segmentation()"),xl.forEach(t),ls=n(W," or "),Yo=a(W,"A",{href:!0});var Il=i(Yo);cs=n(Il,"post_process_panoptic_segmentation()"),Il.forEach(t),ds=n(W,". All three tasks can be solved using "),Qo=a(W,"A",{href:!0});var jl=i(Qo);ms=n(jl,"OneFormerForUniversalSegmentation"),jl.forEach(t),ps=n(W," output, panoptic segmentation accepts an optional "),qt=a(W,"CODE",{});var Ul=i(qt);hs=n(Ul,"label_ids_to_fuse"),Ul.forEach(t),fs=n(W," argument to fuse instances of the target object/s (e.g. sky) together."),W.forEach(t),H.forEach(t),Fr=d(o),ue=a(o,"P",{});var Gr=i(ue);gs=n(Gr,"The figure below illustrates the architecture of OneFormer. Taken from the "),Ae=a(Gr,"A",{href:!0,rel:!0});var $l=i(Ae);us=n($l,"original paper"),$l.forEach(t),_s=n(Gr,"."),Gr.forEach(t),Tr=d(o),Xe=a(o,"IMG",{width:!0,src:!0}),kr=d(o),L=a(o,"P",{});var wt=i(L);bs=n(wt,"This model was contributed by "),Le=a(wt,"A",{href:!0,rel:!0});var Jl=i(Le);ys=n(Jl,"Jitesh Jain"),Jl.forEach(t),vs=n(wt,". The original code can be found "),De=a(wt,"A",{href:!0,rel:!0});var zl=i(De);ws=n(zl,"here"),zl.forEach(t),Fs=n(wt,"."),wt.forEach(t),Or=d(o),te=a(o,"H2",{class:!0});var Vr=i(te);_e=a(Vr,"A",{id:!0,class:!0,href:!0});var Nl=i(_e);St=a(Nl,"SPAN",{});var El=i(St);y(He.$$.fragment,El),El.forEach(t),Nl.forEach(t),Ts=d(Vr),Zt=a(Vr,"SPAN",{});var Pl=i(Zt);ks=n(Pl,"Resources"),Pl.forEach(t),Vr.forEach(t),Mr=d(o),Ko=a(o,"P",{});var Cl=i(Ko);Os=n(Cl,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OneFormer."),Cl.forEach(t),xr=d(o),et=a(o,"UL",{});var Wl=i(et);Ye=a(Wl,"LI",{});var Ar=i(Ye);Ms=n(Ar,"Demo notebooks regarding inference + fine-tuning on custom data can be found "),Qe=a(Ar,"A",{href:!0,rel:!0});var ql=i(Qe);xs=n(ql,"here"),ql.forEach(t),Is=n(Ar,"."),Ar.forEach(t),Wl.forEach(t),Ir=d(o),ot=a(o,"P",{});var Sl=i(ot);js=n(Sl,`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.`),Sl.forEach(t),jr=d(o),re=a(o,"H2",{class:!0});var Xr=i(re);be=a(Xr,"A",{id:!0,class:!0,href:!0});var Zl=i(be);Bt=a(Zl,"SPAN",{});var Bl=i(Bt);y(Ke.$$.fragment,Bl),Bl.forEach(t),Zl.forEach(t),Us=d(Xr),Rt=a(Xr,"SPAN",{});var Rl=i(Rt);$s=n(Rl,"OneFormer specific outputs"),Rl.forEach(t),Xr.forEach(t),Ur=d(o),ne=a(o,"DIV",{class:!0});var Lr=i(ne);y(eo.$$.fragment,Lr),Js=d(Lr),oo=a(Lr,"P",{});var Dr=i(oo);zs=n(Dr,"Class for outputs of "),tt=a(Dr,"A",{href:!0});var Gl=i(tt);Ns=n(Gl,"OneFormerModel"),Gl.forEach(t),Es=n(Dr,". This class returns all the needed hidden states to compute the logits."),Dr.forEach(t),Lr.forEach(t),$r=d(o),Z=a(o,"DIV",{class:!0});var Ft=i(Z);y(to.$$.fragment,Ft),Ps=d(Ft),ro=a(Ft,"P",{});var Hr=i(ro);Cs=n(Hr,"Class for outputs of "),Gt=a(Hr,"CODE",{});var Vl=i(Gt);Ws=n(Vl,"OneFormerForUniversalSegmentationOutput"),Vl.forEach(t),qs=n(Hr,"."),Hr.forEach(t),Ss=d(Ft),B=a(Ft,"P",{});var Pe=i(B);Zs=n(Pe,"This output can be directly passed to "),rt=a(Pe,"A",{href:!0});var Al=i(rt);Bs=n(Al,"post_process_semantic_segmentation()"),Al.forEach(t),Rs=n(Pe,` or
`),nt=a(Pe,"A",{href:!0});var Xl=i(nt);Gs=n(Xl,"post_process_instance_segmentation()"),Xl.forEach(t),Vs=n(Pe,` or
`),st=a(Pe,"A",{href:!0});var Ll=i(st);As=n(Ll,"post_process_panoptic_segmentation()"),Ll.forEach(t),Xs=n(Pe," depending on the task. Please, see\n[`~OneFormerImageProcessor] for details regarding usage."),Pe.forEach(t),Ft.forEach(t),Jr=d(o),se=a(o,"H2",{class:!0});var Yr=i(se);ye=a(Yr,"A",{id:!0,class:!0,href:!0});var Dl=i(ye);Vt=a(Dl,"SPAN",{});var Hl=i(Vt);y(no.$$.fragment,Hl),Hl.forEach(t),Dl.forEach(t),Ls=d(Yr),At=a(Yr,"SPAN",{});var Yl=i(At);Ds=n(Yl,"OneFormerConfig"),Yl.forEach(t),Yr.forEach(t),zr=d(o),E=a(o,"DIV",{class:!0});var Ce=i(E);y(so.$$.fragment,Ce),Hs=d(Ce),R=a(Ce,"P",{});var We=i(R);Ys=n(We,"This is the configuration class to store the configuration of a "),at=a(We,"A",{href:!0});var Ql=i(at);Qs=n(Ql,"OneFormerModel"),Ql.forEach(t),Ks=n(We,`. 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
`),ao=a(We,"A",{href:!0,rel:!0});var Kl=i(ao);ea=n(Kl,"shi-labs/oneformer_ade20k_swin_tiny"),Kl.forEach(t),oa=n(We,` architecture
trained on `),io=a(We,"A",{href:!0,rel:!0});var ec=i(io);ta=n(ec,"ADE20k-150"),ec.forEach(t),ra=n(We,"."),We.forEach(t),na=d(Ce),ae=a(Ce,"P",{});var Tt=i(ae);sa=n(Tt,"Configuration objects inherit from "),it=a(Tt,"A",{href:!0});var oc=i(it);aa=n(oc,"PretrainedConfig"),oc.forEach(t),ia=n(Tt,` and can be used to control the model outputs. Read the
documentation from `),lt=a(Tt,"A",{href:!0});var tc=i(lt);la=n(tc,"PretrainedConfig"),tc.forEach(t),ca=n(Tt," for more information."),Tt.forEach(t),da=d(Ce),y(ve.$$.fragment,Ce),Ce.forEach(t),Nr=d(o),ie=a(o,"H2",{class:!0});var Qr=i(ie);we=a(Qr,"A",{id:!0,class:!0,href:!0});var rc=i(we);Xt=a(rc,"SPAN",{});var nc=i(Xt);y(lo.$$.fragment,nc),nc.forEach(t),rc.forEach(t),ma=d(Qr),Lt=a(Qr,"SPAN",{});var sc=i(Lt);pa=n(sc,"OneFormerImageProcessor"),sc.forEach(t),Qr.forEach(t),Er=d(o),M=a(o,"DIV",{class:!0});var j=i(M);y(co.$$.fragment,j),ha=d(j),Dt=a(j,"P",{});var ac=i(Dt);fa=n(ac,`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.`),ac.forEach(t),ga=d(j),mo=a(j,"P",{});var Kr=i(mo);ua=n(Kr,"This image processor inherits from "),Ht=a(Kr,"CODE",{});var ic=i(Ht);_a=n(ic,"BaseImageProcessor"),ic.forEach(t),ba=n(Kr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Kr.forEach(t),ya=d(j),ct=a(j,"DIV",{class:!0});var lc=i(ct);y(po.$$.fragment,lc),lc.forEach(t),va=d(j),D=a(j,"DIV",{class:!0});var kt=i(D);y(ho.$$.fragment,kt),wa=d(kt),fo=a(kt,"P",{});var en=i(fo);Fa=n(en,"Pad images up to the largest image in a batch and create a corresponding "),Yt=a(en,"CODE",{});var cc=i(Yt);Ta=n(cc,"pixel_mask"),cc.forEach(t),ka=n(en,"."),en.forEach(t),Oa=d(kt),G=a(kt,"P",{});var qe=i(G);Ma=n(qe,`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
`),Qt=a(qe,"CODE",{});var dc=i(Qt);xa=n(dc,"segmentation_maps = [[2,6,7,9]]"),dc.forEach(t),Ia=n(qe,", the output will contain "),Kt=a(qe,"CODE",{});var mc=i(Kt);ja=n(mc,"mask_labels = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"),mc.forEach(t),Ua=n(qe," (four binary masks) and "),er=a(qe,"CODE",{});var pc=i(er);$a=n(pc,"class_labels = [2,6,7,9]"),pc.forEach(t),Ja=n(qe,`, the labels for
each mask.`),qe.forEach(t),kt.forEach(t),za=d(j),Fe=a(j,"DIV",{class:!0});var on=i(Fe);y(go.$$.fragment,on),Na=d(on),uo=a(on,"P",{});var tn=i(uo);Ea=n(tn,"Converts the output of "),dt=a(tn,"A",{href:!0});var hc=i(dt);Pa=n(hc,"MaskFormerForInstanceSegmentation"),hc.forEach(t),Ca=n(tn,` into semantic segmentation maps. Only supports
PyTorch.`),tn.forEach(t),on.forEach(t),Wa=d(j),Te=a(j,"DIV",{class:!0});var rn=i(Te);y(_o.$$.fragment,rn),qa=d(rn),bo=a(rn,"P",{});var nn=i(bo);Sa=n(nn,"Converts the output of "),or=a(nn,"CODE",{});var fc=i(or);Za=n(fc,"OneFormerForUniversalSegmentationOutput"),fc.forEach(t),Ba=n(nn,` into image instance segmentation
predictions. Only supports PyTorch.`),nn.forEach(t),rn.forEach(t),Ra=d(j),ke=a(j,"DIV",{class:!0});var sn=i(ke);y(yo.$$.fragment,sn),Ga=d(sn),vo=a(sn,"P",{});var an=i(vo);Va=n(an,"Converts the output of "),tr=a(an,"CODE",{});var gc=i(tr);Aa=n(gc,"MaskFormerForInstanceSegmentationOutput"),gc.forEach(t),Xa=n(an,` into image panoptic segmentation
predictions. Only supports PyTorch.`),an.forEach(t),sn.forEach(t),j.forEach(t),Pr=d(o),le=a(o,"H2",{class:!0});var ln=i(le);Oe=a(ln,"A",{id:!0,class:!0,href:!0});var uc=i(Oe);rr=a(uc,"SPAN",{});var _c=i(rr);y(wo.$$.fragment,_c),_c.forEach(t),uc.forEach(t),La=d(ln),nr=a(ln,"SPAN",{});var bc=i(nr);Da=n(bc,"OneFormerProcessor"),bc.forEach(t),ln.forEach(t),Cr=d(o),I=a(o,"DIV",{class:!0});var q=i(I);y(Fo.$$.fragment,q),Ha=d(q),V=a(q,"P",{});var Se=i(V);Ya=n(Se,"Constructs an OneFormer processor which wraps "),mt=a(Se,"A",{href:!0});var yc=i(mt);Qa=n(yc,"OneFormerImageProcessor"),yc.forEach(t),Ka=n(Se,` and
`),pt=a(Se,"A",{href:!0});var vc=i(pt);ei=n(vc,"CLIPTokenizer"),vc.forEach(t),oi=n(Se,"/"),ht=a(Se,"A",{href:!0});var wc=i(ht);ti=n(wc,"CLIPTokenizerFast"),wc.forEach(t),ri=n(Se,` into a single processor that inherits both the image processor and
tokenizer functionalities.`),Se.forEach(t),ni=d(q),Me=a(q,"DIV",{class:!0});var cn=i(Me);y(To.$$.fragment,cn),si=d(cn),ko=a(cn,"P",{});var dn=i(ko);ai=n(dn,"This method forwards all its arguments to "),ft=a(dn,"A",{href:!0});var Fc=i(ft);ii=n(Fc,"OneFormerImageProcessor.encode_inputs()"),Fc.forEach(t),li=n(dn,` and then tokenizes the
task_inputs. Please refer to the docstring of this method for more information.`),dn.forEach(t),cn.forEach(t),ci=d(q),xe=a(q,"DIV",{class:!0});var mn=i(xe);y(Oo.$$.fragment,mn),di=d(mn),Mo=a(mn,"P",{});var pn=i(Mo);mi=n(pn,"This method forwards all its arguments to "),gt=a(pn,"A",{href:!0});var Tc=i(gt);pi=n(Tc,"OneFormerImageProcessor.post_process_instance_segmentation()"),Tc.forEach(t),hi=n(pn,`.
Please refer to the docstring of this method for more information.`),pn.forEach(t),mn.forEach(t),fi=d(q),Ie=a(q,"DIV",{class:!0});var hn=i(Ie);y(xo.$$.fragment,hn),gi=d(hn),Io=a(hn,"P",{});var fn=i(Io);ui=n(fn,"This method forwards all its arguments to "),ut=a(fn,"A",{href:!0});var kc=i(ut);_i=n(kc,"OneFormerImageProcessor.post_process_panoptic_segmentation()"),kc.forEach(t),bi=n(fn,`.
Please refer to the docstring of this method for more information.`),fn.forEach(t),hn.forEach(t),yi=d(q),je=a(q,"DIV",{class:!0});var gn=i(je);y(jo.$$.fragment,gn),vi=d(gn),Uo=a(gn,"P",{});var un=i(Uo);wi=n(un,"This method forwards all its arguments to "),_t=a(un,"A",{href:!0});var Oc=i(_t);Fi=n(Oc,"OneFormerImageProcessor.post_process_semantic_segmentation()"),Oc.forEach(t),Ti=n(un,`.
Please refer to the docstring of this method for more information.`),un.forEach(t),gn.forEach(t),q.forEach(t),Wr=d(o),ce=a(o,"H2",{class:!0});var _n=i(ce);Ue=a(_n,"A",{id:!0,class:!0,href:!0});var Mc=i(Ue);sr=a(Mc,"SPAN",{});var xc=i(sr);y($o.$$.fragment,xc),xc.forEach(t),Mc.forEach(t),ki=d(_n),ar=a(_n,"SPAN",{});var Ic=i(ar);Oi=n(Ic,"OneFormerModel"),Ic.forEach(t),_n.forEach(t),qr=d(o),A=a(o,"DIV",{class:!0});var Ot=i(A);y(Jo.$$.fragment,Ot),Mi=d(Ot),zo=a(Ot,"P",{});var bn=i(zo);xi=n(bn,`The bare OneFormer Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=a(bn,"A",{href:!0,rel:!0});var jc=i(No);Ii=n(jc,"nn.Module"),jc.forEach(t),ji=n(bn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),bn.forEach(t),Ui=d(Ot),C=a(Ot,"DIV",{class:!0});var Ze=i(C);y(Eo.$$.fragment,Ze),$i=d(Ze),de=a(Ze,"P",{});var Mt=i(de);Ji=n(Mt,"The "),bt=a(Mt,"A",{href:!0});var Uc=i(bt);zi=n(Uc,"OneFormerModel"),Uc.forEach(t),Ni=n(Mt," forward method, overrides the "),ir=a(Mt,"CODE",{});var $c=i(ir);Ei=n($c,"__call__"),$c.forEach(t),Pi=n(Mt," special method."),Mt.forEach(t),Ci=d(Ze),y($e.$$.fragment,Ze),Wi=d(Ze),y(Je.$$.fragment,Ze),Ze.forEach(t),Ot.forEach(t),Sr=d(o),me=a(o,"H2",{class:!0});var yn=i(me);ze=a(yn,"A",{id:!0,class:!0,href:!0});var Jc=i(ze);lr=a(Jc,"SPAN",{});var zc=i(lr);y(Po.$$.fragment,zc),zc.forEach(t),Jc.forEach(t),qi=d(yn),cr=a(yn,"SPAN",{});var Nc=i(cr);Si=n(Nc,"OneFormerForUniversalSegmentation"),Nc.forEach(t),yn.forEach(t),Zr=d(o),X=a(o,"DIV",{class:!0});var xt=i(X);y(Co.$$.fragment,xt),Zi=d(xt),Wo=a(xt,"P",{});var vn=i(Wo);Bi=n(vn,`OneFormer Model for instance, semantic and panoptic image segmentation.
This model is a PyTorch `),qo=a(vn,"A",{href:!0,rel:!0});var Ec=i(qo);Ri=n(Ec,"nn.Module"),Ec.forEach(t),Gi=n(vn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),vn.forEach(t),Vi=d(xt),J=a(xt,"DIV",{class:!0});var K=i(J);y(So.$$.fragment,K),Ai=d(K),pe=a(K,"P",{});var It=i(pe);Xi=n(It,"The "),yt=a(It,"A",{href:!0});var Pc=i(yt);Li=n(Pc,"OneFormerForUniversalSegmentation"),Pc.forEach(t),Di=n(It," forward method, overrides the "),dr=a(It,"CODE",{});var Cc=i(dr);Hi=n(Cc,"__call__"),Cc.forEach(t),Yi=n(It," special method."),It.forEach(t),Qi=d(K),y(Ne.$$.fragment,K),Ki=d(K),mr=a(K,"P",{});var Wc=i(mr);el=n(Wc,"Example:"),Wc.forEach(t),ol=d(K),y(Ee.$$.fragment,K),K.forEach(t),xt.forEach(t),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(Qc)),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(fe,"id","overview"),l(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(fe,"href","#overview"),l(ee,"class","relative group"),l(Re,"href","https://arxiv.org/abs/2211.06220"),l(Re,"rel","nofollow"),l(Ge,"width","600"),qc(Ge.src,sl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/oneformer_teaser.png")||l(Ge,"src",sl),l(Ve,"href","https://github.com/SHI-Labs/OneFormer/blob/33ebb56ed34f970a30ae103e786c0cb64c653d9a/oneformer/modeling/criterion.py#L287"),l(Ve,"rel","nofollow"),l(Ao,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerProcessor"),l(Xo,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor"),l(Lo,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),l(Do,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerProcessor.post_process_semantic_segmentation"),l(Ho,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),l(Yo,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_panoptic_segmentation"),l(Qo,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerForUniversalSegmentation"),l(Ae,"href","https://arxiv.org/abs/2211.06220"),l(Ae,"rel","nofollow"),l(Xe,"width","600"),qc(Xe.src,al="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/oneformer_architecture.png")||l(Xe,"src",al),l(Le,"href","https://huggingface.co/praeclarumjj3"),l(Le,"rel","nofollow"),l(De,"href","https://github.com/SHI-Labs/OneFormer"),l(De,"rel","nofollow"),l(_e,"id","resources"),l(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(_e,"href","#resources"),l(te,"class","relative group"),l(Qe,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/OneFormer"),l(Qe,"rel","nofollow"),l(be,"id","transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"),l(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(be,"href","#transformers.models.oneformer.modeling_oneformer.OneFormerModelOutput"),l(re,"class","relative group"),l(tt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerModel"),l(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_semantic_segmentation"),l(nt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),l(st,"href","/docs/transformers/main/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(ye,"id","transformers.OneFormerConfig"),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.OneFormerConfig"),l(se,"class","relative group"),l(at,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerModel"),l(ao,"href","https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny"),l(ao,"rel","nofollow"),l(io,"href","https://huggingface.co/datasets/scene_parse_150"),l(io,"rel","nofollow"),l(it,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(lt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(we,"id","transformers.OneFormerImageProcessor"),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.OneFormerImageProcessor"),l(ie,"class","relative group"),l(ct,"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(dt,"href","/docs/transformers/main/en/model_doc/maskformer#transformers.MaskFormerForInstanceSegmentation"),l(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(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(Oe,"id","transformers.OneFormerProcessor"),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.OneFormerProcessor"),l(le,"class","relative group"),l(mt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor"),l(pt,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),l(ht,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast"),l(ft,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.encode_inputs"),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(gt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_instance_segmentation"),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(ut,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerImageProcessor.post_process_panoptic_segmentation"),l(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_t,"href","/docs/transformers/main/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(Ue,"id","transformers.OneFormerModel"),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","#transformers.OneFormerModel"),l(ce,"class","relative group"),l(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(No,"rel","nofollow"),l(bt,"href","/docs/transformers/main/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(ze,"id","transformers.OneFormerForUniversalSegmentation"),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.OneFormerForUniversalSegmentation"),l(me,"class","relative group"),l(qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(qo,"rel","nofollow"),l(yt,"href","/docs/transformers/main/en/model_doc/oneformer#transformers.OneFormerForUniversalSegmentation"),l(J,"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,O,m),h(o,_,m),e(_,g),e(g,k),v(p,k,null),e(_,u),e(_,S),e(S,wn),h(o,gr,m),h(o,ee,m),e(ee,fe),e(fe,jt),v(Be,jt,null),e(ee,Fn),e(ee,Ut),e(Ut,Tn),h(o,ur,m),h(o,ge,m),e(ge,kn),e(ge,Re),e(Re,On),e(ge,Mn),h(o,_r,m),h(o,Ge,m),h(o,br,m),h(o,Ro,m),e(Ro,xn),h(o,yr,m),h(o,Go,m),e(Go,$t),e($t,In),h(o,vr,m),h(o,Vo,m),e(Vo,jn),h(o,wr,m),h(o,$,m),e($,oe),e(oe,Un),e(oe,Jt),e(Jt,$n),e(oe,Jn),e(oe,zt),e(zt,zn),e(oe,Nn),e($,En),e($,Nt),e(Nt,Pn),e($,Cn),e($,z),e(z,Wn),e(z,Et),e(Et,qn),e(z,Sn),e(z,Pt),e(Pt,Zn),e(z,Bn),e(z,Ct),e(Ct,Rn),e(z,Gn),e(z,Ve),e(Ve,Vn),e(z,An),e($,Xn),e($,N),e(N,Ln),e(N,Ao),e(Ao,Dn),e(N,Hn),e(N,Wt),e(Wt,Yn),e(N,Qn),e(N,Xo),e(Xo,Kn),e(N,es),e(N,Lo),e(Lo,os),e(N,ts),e($,rs),e($,U),e(U,ns),e(U,Do),e(Do,ss),e(U,as),e(U,Ho),e(Ho,is),e(U,ls),e(U,Yo),e(Yo,cs),e(U,ds),e(U,Qo),e(Qo,ms),e(U,ps),e(U,qt),e(qt,hs),e(U,fs),h(o,Fr,m),h(o,ue,m),e(ue,gs),e(ue,Ae),e(Ae,us),e(ue,_s),h(o,Tr,m),h(o,Xe,m),h(o,kr,m),h(o,L,m),e(L,bs),e(L,Le),e(Le,ys),e(L,vs),e(L,De),e(De,ws),e(L,Fs),h(o,Or,m),h(o,te,m),e(te,_e),e(_e,St),v(He,St,null),e(te,Ts),e(te,Zt),e(Zt,ks),h(o,Mr,m),h(o,Ko,m),e(Ko,Os),h(o,xr,m),h(o,et,m),e(et,Ye),e(Ye,Ms),e(Ye,Qe),e(Qe,xs),e(Ye,Is),h(o,Ir,m),h(o,ot,m),e(ot,js),h(o,jr,m),h(o,re,m),e(re,be),e(be,Bt),v(Ke,Bt,null),e(re,Us),e(re,Rt),e(Rt,$s),h(o,Ur,m),h(o,ne,m),v(eo,ne,null),e(ne,Js),e(ne,oo),e(oo,zs),e(oo,tt),e(tt,Ns),e(oo,Es),h(o,$r,m),h(o,Z,m),v(to,Z,null),e(Z,Ps),e(Z,ro),e(ro,Cs),e(ro,Gt),e(Gt,Ws),e(ro,qs),e(Z,Ss),e(Z,B),e(B,Zs),e(B,rt),e(rt,Bs),e(B,Rs),e(B,nt),e(nt,Gs),e(B,Vs),e(B,st),e(st,As),e(B,Xs),h(o,Jr,m),h(o,se,m),e(se,ye),e(ye,Vt),v(no,Vt,null),e(se,Ls),e(se,At),e(At,Ds),h(o,zr,m),h(o,E,m),v(so,E,null),e(E,Hs),e(E,R),e(R,Ys),e(R,at),e(at,Qs),e(R,Ks),e(R,ao),e(ao,ea),e(R,oa),e(R,io),e(io,ta),e(R,ra),e(E,na),e(E,ae),e(ae,sa),e(ae,it),e(it,aa),e(ae,ia),e(ae,lt),e(lt,la),e(ae,ca),e(E,da),v(ve,E,null),h(o,Nr,m),h(o,ie,m),e(ie,we),e(we,Xt),v(lo,Xt,null),e(ie,ma),e(ie,Lt),e(Lt,pa),h(o,Er,m),h(o,M,m),v(co,M,null),e(M,ha),e(M,Dt),e(Dt,fa),e(M,ga),e(M,mo),e(mo,ua),e(mo,Ht),e(Ht,_a),e(mo,ba),e(M,ya),e(M,ct),v(po,ct,null),e(M,va),e(M,D),v(ho,D,null),e(D,wa),e(D,fo),e(fo,Fa),e(fo,Yt),e(Yt,Ta),e(fo,ka),e(D,Oa),e(D,G),e(G,Ma),e(G,Qt),e(Qt,xa),e(G,Ia),e(G,Kt),e(Kt,ja),e(G,Ua),e(G,er),e(er,$a),e(G,Ja),e(M,za),e(M,Fe),v(go,Fe,null),e(Fe,Na),e(Fe,uo),e(uo,Ea),e(uo,dt),e(dt,Pa),e(uo,Ca),e(M,Wa),e(M,Te),v(_o,Te,null),e(Te,qa),e(Te,bo),e(bo,Sa),e(bo,or),e(or,Za),e(bo,Ba),e(M,Ra),e(M,ke),v(yo,ke,null),e(ke,Ga),e(ke,vo),e(vo,Va),e(vo,tr),e(tr,Aa),e(vo,Xa),h(o,Pr,m),h(o,le,m),e(le,Oe),e(Oe,rr),v(wo,rr,null),e(le,La),e(le,nr),e(nr,Da),h(o,Cr,m),h(o,I,m),v(Fo,I,null),e(I,Ha),e(I,V),e(V,Ya),e(V,mt),e(mt,Qa),e(V,Ka),e(V,pt),e(pt,ei),e(V,oi),e(V,ht),e(ht,ti),e(V,ri),e(I,ni),e(I,Me),v(To,Me,null),e(Me,si),e(Me,ko),e(ko,ai),e(ko,ft),e(ft,ii),e(ko,li),e(I,ci),e(I,xe),v(Oo,xe,null),e(xe,di),e(xe,Mo),e(Mo,mi),e(Mo,gt),e(gt,pi),e(Mo,hi),e(I,fi),e(I,Ie),v(xo,Ie,null),e(Ie,gi),e(Ie,Io),e(Io,ui),e(Io,ut),e(ut,_i),e(Io,bi),e(I,yi),e(I,je),v(jo,je,null),e(je,vi),e(je,Uo),e(Uo,wi),e(Uo,_t),e(_t,Fi),e(Uo,Ti),h(o,Wr,m),h(o,ce,m),e(ce,Ue),e(Ue,sr),v($o,sr,null),e(ce,ki),e(ce,ar),e(ar,Oi),h(o,qr,m),h(o,A,m),v(Jo,A,null),e(A,Mi),e(A,zo),e(zo,xi),e(zo,No),e(No,Ii),e(zo,ji),e(A,Ui),e(A,C),v(Eo,C,null),e(C,$i),e(C,de),e(de,Ji),e(de,bt),e(bt,zi),e(de,Ni),e(de,ir),e(ir,Ei),e(de,Pi),e(C,Ci),v($e,C,null),e(C,Wi),v(Je,C,null),h(o,Sr,m),h(o,me,m),e(me,ze),e(ze,lr),v(Po,lr,null),e(me,qi),e(me,cr),e(cr,Si),h(o,Zr,m),h(o,X,m),v(Co,X,null),e(X,Zi),e(X,Wo),e(Wo,Bi),e(Wo,qo),e(qo,Ri),e(Wo,Gi),e(X,Vi),e(X,J),v(So,J,null),e(J,Ai),e(J,pe),e(pe,Xi),e(pe,yt),e(yt,Li),e(pe,Di),e(pe,dr),e(dr,Hi),e(pe,Yi),e(J,Qi),v(Ne,J,null),e(J,Ki),e(J,mr),e(mr,el),e(J,ol),v(Ee,J,null),Br=!0},p(o,[m]){const Zo={};m&2&&(Zo.$$scope={dirty:m,ctx:o}),ve.$set(Zo);const pr={};m&2&&(pr.$$scope={dirty:m,ctx:o}),$e.$set(pr);const hr={};m&2&&(hr.$$scope={dirty:m,ctx:o}),Je.$set(hr);const fr={};m&2&&(fr.$$scope={dirty:m,ctx:o}),Ne.$set(fr);const Bo={};m&2&&(Bo.$$scope={dirty:m,ctx:o}),Ee.$set(Bo)},i(o){Br||(w(p.$$.fragment,o),w(Be.$$.fragment,o),w(He.$$.fragment,o),w(Ke.$$.fragment,o),w(eo.$$.fragment,o),w(to.$$.fragment,o),w(no.$$.fragment,o),w(so.$$.fragment,o),w(ve.$$.fragment,o),w(lo.$$.fragment,o),w(co.$$.fragment,o),w(po.$$.fragment,o),w(ho.$$.fragment,o),w(go.$$.fragment,o),w(_o.$$.fragment,o),w(yo.$$.fragment,o),w(wo.$$.fragment,o),w(Fo.$$.fragment,o),w(To.$$.fragment,o),w(Oo.$$.fragment,o),w(xo.$$.fragment,o),w(jo.$$.fragment,o),w($o.$$.fragment,o),w(Jo.$$.fragment,o),w(Eo.$$.fragment,o),w($e.$$.fragment,o),w(Je.$$.fragment,o),w(Po.$$.fragment,o),w(Co.$$.fragment,o),w(So.$$.fragment,o),w(Ne.$$.fragment,o),w(Ee.$$.fragment,o),Br=!0)},o(o){F(p.$$.fragment,o),F(Be.$$.fragment,o),F(He.$$.fragment,o),F(Ke.$$.fragment,o),F(eo.$$.fragment,o),F(to.$$.fragment,o),F(no.$$.fragment,o),F(so.$$.fragment,o),F(ve.$$.fragment,o),F(lo.$$.fragment,o),F(co.$$.fragment,o),F(po.$$.fragment,o),F(ho.$$.fragment,o),F(go.$$.fragment,o),F(_o.$$.fragment,o),F(yo.$$.fragment,o),F(wo.$$.fragment,o),F(Fo.$$.fragment,o),F(To.$$.fragment,o),F(Oo.$$.fragment,o),F(xo.$$.fragment,o),F(jo.$$.fragment,o),F($o.$$.fragment,o),F(Jo.$$.fragment,o),F(Eo.$$.fragment,o),F($e.$$.fragment,o),F(Je.$$.fragment,o),F(Po.$$.fragment,o),F(Co.$$.fragment,o),F(So.$$.fragment,o),F(Ne.$$.fragment,o),F(Ee.$$.fragment,o),Br=!1},d(o){t(f),o&&t(O),o&&t(_),T(p),o&&t(gr),o&&t(ee),T(Be),o&&t(ur),o&&t(ge),o&&t(_r),o&&t(Ge),o&&t(br),o&&t(Ro),o&&t(yr),o&&t(Go),o&&t(vr),o&&t(Vo),o&&t(wr),o&&t($),o&&t(Fr),o&&t(ue),o&&t(Tr),o&&t(Xe),o&&t(kr),o&&t(L),o&&t(Or),o&&t(te),T(He),o&&t(Mr),o&&t(Ko),o&&t(xr),o&&t(et),o&&t(Ir),o&&t(ot),o&&t(jr),o&&t(re),T(Ke),o&&t(Ur),o&&t(ne),T(eo),o&&t($r),o&&t(Z),T(to),o&&t(Jr),o&&t(se),T(no),o&&t(zr),o&&t(E),T(so),T(ve),o&&t(Nr),o&&t(ie),T(lo),o&&t(Er),o&&t(M),T(co),T(po),T(ho),T(go),T(_o),T(yo),o&&t(Pr),o&&t(le),T(wo),o&&t(Cr),o&&t(I),T(Fo),T(To),T(Oo),T(xo),T(jo),o&&t(Wr),o&&t(ce),T($o),o&&t(qr),o&&t(A),T(Jo),T(Eo),T($e),T(Je),o&&t(Sr),o&&t(me),T(Po),o&&t(Zr),o&&t(X),T(Co),T(So),T(Ne),T(Ee)}}}const Qc={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 Kc(P){return Vc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ad extends Zc{constructor(f){super();Bc(this,f,Kc,Yc,Rc,{})}}export{ad as default,Qc as metadata};
