import{S as rm,i as nm,s as sm,e as s,k as c,w as v,t as r,M as am,c as a,d as t,m,a as i,x as b,h as n,b as l,N as om,G as e,g as h,y as F,q as y,o as O,B as w,v as im,L as _l}from"../../chunks/vendor-hf-doc-builder.js";import{T as tm}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as vl}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ul}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function lm(N){let f,x,_,g,k;return g=new vl({props:{code:`from transformers import OneFormerConfig, OneFormerModel

# Initializing a OneFormer shi-labs/oneformer_ade20k_swin_tiny configuration
configuration = OneFormerConfig()
# Initializing a model (with random weights) from the shi-labs/oneformer_ade20k_swin_tiny style configuration
model = OneFormerModel(configuration)
# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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"),x=r("Examples:"),_=c(),v(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);x=n(u,"Examples:"),u.forEach(t),_=m(p),b(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,x),h(p,_,u),F(g,p,u),k=!0},p:_l,i(p){k||(y(g.$$.fragment,p),k=!0)},o(p){O(g.$$.fragment,p),k=!1},d(p){p&&t(f),p&&t(_),w(g,p)}}}function cm(N){let f,x,_,g,k;return{c(){f=s("p"),x=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);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var D=i(_);g=n(D,"Module"),D.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,x),e(f,_),e(_,g),e(f,k)},d(p){p&&t(f)}}}function mm(N){let f,x,_,g,k;return g=new vl({props:{code:`import torch
from PIL import Image
import requests
from transformers import OneFormerProcessor, OneFormerModel

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

# load processor for preprocessing the inputs
processor = OneFormerProcessor.from_pretrained("shi-labs/oneformer_ade20k_swin_tiny")
model = OneFormerModel.from_pretrained("shi-labs/oneformer_ade20k_swin_tiny")
inputs = processor(image, ["semantic"], return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

mask_predictions = outputs.transformer_decoder_mask_predictions
class_predictions = outputs.transformer_decoder_class_predictions

f"\u{1F449} Mask Predictions Shape: {list(mask_predictions.shape)}, Class Predictions Shape: {list(class_predictions.shape)}"`,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"),x=r("Example:"),_=c(),v(g.$$.fragment)},l(p){f=a(p,"P",{});var u=i(f);x=n(u,"Example:"),u.forEach(t),_=m(p),b(g.$$.fragment,p)},m(p,u){h(p,f,u),e(f,x),h(p,_,u),F(g,p,u),k=!0},p:_l,i(p){k||(y(g.$$.fragment,p),k=!0)},o(p){O(g.$$.fragment,p),k=!1},d(p){p&&t(f),p&&t(_),w(g,p)}}}function dm(N){let f,x,_,g,k;return{c(){f=s("p"),x=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);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var D=i(_);g=n(D,"Module"),D.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,x),e(f,_),e(_,g),e(f,k)},d(p){p&&t(f)}}}function pm(N){let f,x,_,g,k;return g=new vl({props:{code:`from transformers import OneFormerProcessor, OneFormerForUniversalSegmentation
from PIL import Image
import requests
import torch

# load OneFormer fine-tuned on ADE20k for universal segmentation
processor = OneFormerProcessor.from_pretrained("shi-labs/oneformer_ade20k_swin_tiny")
model = OneFormerForUniversalSegmentation.from_pretrained("shi-labs/oneformer_ade20k_swin_tiny")

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

# Semantic Segmentation
inputs = processor(image, ["semantic"], return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
# model predicts class_queries_logits of shape \`(batch_size, num_queries)\`
# and masks_queries_logits of shape \`(batch_size, num_queries, height, width)\`
class_queries_logits = outputs.class_queries_logits
masks_queries_logits = outputs.masks_queries_logits

# you can pass them to processor for semantic postprocessing
predicted_semantic_map = processor.post_process_semantic_segmentation(
    outputs, target_sizes=[image.size[::-1]]
)[0]
f"\u{1F449} Semantic Predictions Shape: {list(predicted_semantic_map.shape)}"

# Instance Segmentation
inputs = processor(image, ["instance"], return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
# model predicts class_queries_logits of shape \`(batch_size, num_queries)\`
# and masks_queries_logits of shape \`(batch_size, num_queries, height, width)\`
class_queries_logits = outputs.class_queries_logits
masks_queries_logits = outputs.masks_queries_logits

# you can pass them to processor for instance postprocessing
predicted_instance_map = processor.post_process_instance_segmentation(
    outputs, target_sizes=[image.size[::-1]]
)[0]["segmentation"]
f"\u{1F449} Instance Predictions Shape: {list(predicted_instance_map.shape)}"

# Panoptic Segmentation
inputs = processor(image, ["panoptic"], return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
# model predicts class_queries_logits of shape \`(batch_size, num_queries)\`
# and masks_queries_logits of shape \`(batch_size, num_queries, height, width)\`
class_queries_logits = outputs.class_queries_logits
masks_queries_logits = outputs.masks_queries_logits

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