import{S as jv,i as Fv,s as Ov,e as s,k as d,w as _,t as n,M as zv,c as a,d as t,m as c,a as i,x as b,h as r,b as l,G as e,g as m,y as v,q as y,o as D,B as w,v as Cv,L as vd}from"../../chunks/vendor-hf-doc-builder.js";import{T as tg}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as mn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Te}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as bd}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Pv}from"../../chunks/PipelineTag-hf-doc-builder.js";function qv(N){let f,E,T,u,x;return u=new mn({props:{code:`from transformers import DetrConfig, DetrModel

# Initializing a DETR facebook/detr-resnet-50 style configuration
configuration = DetrConfig()

# Initializing a model (with random weights) from the facebook/detr-resnet-50 style configuration
model = DetrModel(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> DetrConfig, DetrModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DETR facebook/detr-resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DetrConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/detr-resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrModel(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"),E=n("Examples:"),T=d(),_(u.$$.fragment)},l(p){f=a(p,"P",{});var g=i(f);E=r(g,"Examples:"),g.forEach(t),T=c(p),b(u.$$.fragment,p)},m(p,g){m(p,f,g),e(f,E),m(p,T,g),v(u,p,g),x=!0},p:vd,i(p){x||(y(u.$$.fragment,p),x=!0)},o(p){D(u.$$.fragment,p),x=!1},d(p){p&&t(f),p&&t(T),w(u,p)}}}function Iv(N){let f,E,T,u,x;return{c(){f=s("p"),E=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),T=s("code"),u=n("Module"),x=n(`
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 g=i(f);E=r(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),T=a(g,"CODE",{});var G=i(T);u=r(G,"Module"),G.forEach(t),x=r(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(p,g){m(p,f,g),e(f,E),e(f,T),e(T,u),e(f,x)},d(p){p&&t(f)}}}function Nv(N){let f,E,T,u,x;return u=new mn({props:{code:`from transformers import AutoImageProcessor, DetrModel
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrModel.from_pretrained("facebook/detr-resnet-50")

# prepare image for the model
inputs = image_processor(images=image, return_tensors="pt")

# forward pass
outputs = model(**inputs)

# the last hidden states are the final query embeddings of the Transformer decoder
# these are of shape (batch_size, num_queries, hidden_size)
last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DetrModel
<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>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>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrModel.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the last hidden states are the final query embeddings of the Transformer decoder</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># these are of shape (batch_size, num_queries, hidden_size)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">100</span>, <span class="hljs-number">256</span>]`}}),{c(){f=s("p"),E=n("Examples:"),T=d(),_(u.$$.fragment)},l(p){f=a(p,"P",{});var g=i(f);E=r(g,"Examples:"),g.forEach(t),T=c(p),b(u.$$.fragment,p)},m(p,g){m(p,f,g),e(f,E),m(p,T,g),v(u,p,g),x=!0},p:vd,i(p){x||(y(u.$$.fragment,p),x=!0)},o(p){D(u.$$.fragment,p),x=!1},d(p){p&&t(f),p&&t(T),w(u,p)}}}function Av(N){let f,E,T,u,x;return{c(){f=s("p"),E=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),T=s("code"),u=n("Module"),x=n(`
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 g=i(f);E=r(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),T=a(g,"CODE",{});var G=i(T);u=r(G,"Module"),G.forEach(t),x=r(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(p,g){m(p,f,g),e(f,E),e(f,T),e(T,u),e(f,x)},d(p){p&&t(f)}}}function Sv(N){let f,E,T,u,x;return u=new mn({props:{code:`from transformers import AutoImageProcessor, DetrForObjectDetection
import torch
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)

# convert outputs (bounding boxes and class logits) to COCO API
target_sizes = torch.tensor([image.size[::-1]])
results = image_processor.post_process_object_detection(outputs, threshold=0.9, target_sizes=target_sizes)[
    0
]

for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    box = [round(i, 2) for i in box.tolist()]
    print(
        f"Detected {model.config.id2label[label.item()]} with confidence "
        f"{round(score.item(), 3)} at location {box}"
    )`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DetrForObjectDetection
<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>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>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrForObjectDetection.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span>results = image_processor.post_process_object_detection(outputs, threshold=<span class="hljs-number">0.9</span>, target_sizes=target_sizes)[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> score, label, box <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(results[<span class="hljs-string">&quot;scores&quot;</span>], results[<span class="hljs-string">&quot;labels&quot;</span>], results[<span class="hljs-string">&quot;boxes&quot;</span>]):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(
<span class="hljs-meta">... </span>        <span class="hljs-string">f&quot;Detected <span class="hljs-subst">{model.config.id2label[label.item()]}</span> with confidence &quot;</span>
<span class="hljs-meta">... </span>        <span class="hljs-string">f&quot;<span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>
<span class="hljs-meta">... </span>    )
Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.998</span> at location [<span class="hljs-number">40.16</span>, <span class="hljs-number">70.81</span>, <span class="hljs-number">175.55</span>, <span class="hljs-number">117.98</span>]
Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.996</span> at location [<span class="hljs-number">333.24</span>, <span class="hljs-number">72.55</span>, <span class="hljs-number">368.33</span>, <span class="hljs-number">187.66</span>]
Detected couch <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.995</span> at location [-<span class="hljs-number">0.02</span>, <span class="hljs-number">1.15</span>, <span class="hljs-number">639.73</span>, <span class="hljs-number">473.76</span>]
Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.999</span> at location [<span class="hljs-number">13.24</span>, <span class="hljs-number">52.05</span>, <span class="hljs-number">314.02</span>, <span class="hljs-number">470.93</span>]
Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.999</span> at location [<span class="hljs-number">345.4</span>, <span class="hljs-number">23.85</span>, <span class="hljs-number">640.37</span>, <span class="hljs-number">368.72</span>]`}}),{c(){f=s("p"),E=n("Examples:"),T=d(),_(u.$$.fragment)},l(p){f=a(p,"P",{});var g=i(f);E=r(g,"Examples:"),g.forEach(t),T=c(p),b(u.$$.fragment,p)},m(p,g){m(p,f,g),e(f,E),m(p,T,g),v(u,p,g),x=!0},p:vd,i(p){x||(y(u.$$.fragment,p),x=!0)},o(p){D(u.$$.fragment,p),x=!1},d(p){p&&t(f),p&&t(T),w(u,p)}}}function Lv(N){let f,E,T,u,x;return{c(){f=s("p"),E=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),T=s("code"),u=n("Module"),x=n(`
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 g=i(f);E=r(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),T=a(g,"CODE",{});var G=i(T);u=r(G,"Module"),G.forEach(t),x=r(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(p,g){m(p,f,g),e(f,E),e(f,T),e(T,u),e(f,x)},d(p){p&&t(f)}}}function Rv(N){let f,E,T,u,x;return u=new mn({props:{code:`import io
import requests
from PIL import Image
import torch
import numpy

from transformers import AutoImageProcessor, DetrForSegmentation
from transformers.image_transforms import rgb_to_id

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

image_processor = AutoImageProcessor.from_pretrained("facebook/detr-resnet-50-panoptic")
model = DetrForSegmentation.from_pretrained("facebook/detr-resnet-50-panoptic")

# prepare image for the model
inputs = image_processor(images=image, return_tensors="pt")

# forward pass
outputs = model(**inputs)

# Use the \`post_process_panoptic_segmentation\` method of the \`image_processor\` to retrieve post-processed panoptic segmentation maps
# Segmentation results are returned as a list of dictionaries
result = image_processor.post_process_panoptic_segmentation(outputs, target_sizes=[(300, 500)])

# A tensor of shape (height, width) where each value denotes a segment id, filled with -1 if no segment is found
panoptic_seg = result[0]["segmentation"]
# Get prediction score and segment_id to class_id mapping of each segment
panoptic_segments_info = result[0]["segments_info"]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> io
<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> PIL <span class="hljs-keyword">import</span> Image
<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">import</span> numpy

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DetrForSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_transforms <span class="hljs-keyword">import</span> rgb_to_id

<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>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50-panoptic&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrForSegmentation.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50-panoptic&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Use the \`post_process_panoptic_segmentation\` method of the \`image_processor\` to retrieve post-processed panoptic segmentation maps</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Segmentation results are returned as a list of dictionaries</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>result = image_processor.post_process_panoptic_segmentation(outputs, target_sizes=[(<span class="hljs-number">300</span>, <span class="hljs-number">500</span>)])

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># A tensor of shape (height, width) where each value denotes a segment id, filled with -1 if no segment is found</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>panoptic_seg = result[<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-comment"># Get prediction score and segment_id to class_id mapping of each segment</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>panoptic_segments_info = result[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;segments_info&quot;</span>]`}}),{c(){f=s("p"),E=n("Examples:"),T=d(),_(u.$$.fragment)},l(p){f=a(p,"P",{});var g=i(f);E=r(g,"Examples:"),g.forEach(t),T=c(p),b(u.$$.fragment,p)},m(p,g){m(p,f,g),e(f,E),m(p,T,g),v(u,p,g),x=!0},p:vd,i(p){x||(y(u.$$.fragment,p),x=!0)},o(p){D(u.$$.fragment,p),x=!1},d(p){p&&t(f),p&&t(T),w(u,p)}}}function Mv(N){let f,E,T,u,x,p,g,G,yd,qa,xe,Ve,Tr,Ht,Dd,xr,wd,Ia,We,Td,Gt,xd,Ed,Na,pn,$d,Aa,fn,Er,kd,Sa,be,jd,Vt,Fd,Od,Wt,zd,Cd,La,Be,Pd,un,qd,Id,Ra,j,Nd,$r,Ad,Sd,kr,Ld,Rd,jr,Md,Ud,Fr,Hd,Gd,Or,Vd,Wd,zr,Bd,Yd,Cr,Qd,Jd,Pr,Kd,Xd,Ma,P,Zd,qr,ec,tc,Ir,oc,nc,Nr,rc,sc,Ar,ac,ic,Sr,dc,cc,Lr,lc,hc,Ua,J,mc,Rr,pc,fc,Bt,uc,gc,Yt,_c,bc,Ha,K,vc,gn,yc,Dc,_n,wc,Tc,bn,xc,Ec,Ga,vn,$c,Va,F,re,kc,Mr,jc,Fc,Ur,Oc,zc,yn,Cc,Pc,qc,Hr,Ic,Nc,se,Ac,Gr,Sc,Lc,Dn,Rc,Mc,Vr,Uc,Hc,Gc,ae,Vc,Wr,Wc,Bc,wn,Yc,Qc,Br,Jc,Kc,Xc,Y,Zc,Yr,el,tl,Qr,ol,nl,Jr,rl,sl,Qt,al,il,dl,A,Tn,cl,ll,xn,hl,ml,Jt,pl,fl,Kr,ul,gl,En,_l,bl,Xr,vl,yl,Dl,ie,wl,$n,Tl,xl,Zr,El,$l,kn,kl,jl,Fl,Ee,Ol,es,zl,Cl,Kt,Pl,ql,Wa,jn,Il,Ba,Fn,Nl,Ya,Xt,Qa,On,Al,Ja,Zt,Ka,zn,Sl,Xa,eo,Za,Cn,Ll,ei,Ye,ts,de,os,Rl,Ml,ns,Ul,Hl,rs,Gl,Vl,ss,Wl,Bl,L,ce,as,is,Yl,Ql,ds,Jl,Kl,cs,Xl,Zl,ls,eh,th,le,hs,ms,oh,nh,ps,Pn,rh,sh,fs,qn,ah,ih,us,In,dh,ch,he,gs,_s,lh,hh,bs,mh,ph,vs,fh,uh,ys,gh,_h,me,to,Ds,bh,vh,Nn,yh,Dh,$e,wh,ws,Th,xh,Ts,Eh,$h,kh,R,jh,xs,Fh,Oh,Es,zh,Ch,$s,Ph,qh,ks,Ih,Nh,js,Ah,Sh,Lh,pe,Rh,Fs,Mh,Uh,Os,Hh,Gh,zs,Vh,Wh,Bh,fe,An,Cs,Yh,Qh,Jh,Ps,qs,Kh,Xh,Is,Ns,Zh,em,oo,As,tm,om,Ss,nm,rm,ue,Ls,Rs,sm,am,no,Ms,im,dm,Us,cm,lm,ke,Hs,hm,mm,Gs,pm,fm,Vs,um,gm,ge,Ws,_m,bm,Bs,vm,ym,Ys,Dm,wm,Qs,Tm,ti,k,xm,Sn,Em,$m,Js,km,jm,Ks,Fm,Om,Xs,zm,Cm,Ln,Pm,qm,Zs,Im,Nm,ea,Am,Sm,ro,Lm,Rm,so,Mm,Um,oi,je,Qe,ta,ao,Hm,oa,Gm,ni,Rn,Vm,ri,io,si,Je,_e,Wm,Mn,Bm,Ym,Un,Qm,Jm,co,Km,Xm,Zm,Hn,ep,Gn,tp,ai,Vn,op,ii,Fe,Ke,na,lo,np,ra,rp,di,Oe,ho,sp,sa,ap,ci,ze,mo,ip,po,dp,Wn,cp,lp,li,Ce,fo,hp,uo,mp,Bn,pp,fp,hi,Pe,Xe,aa,go,up,ia,gp,mi,I,_o,_p,qe,bp,Yn,vp,yp,bo,Dp,wp,Tp,Ie,xp,Qn,Ep,$p,Jn,kp,jp,Fp,Ze,Op,et,vo,zp,yo,Cp,Kn,Pp,qp,Ip,tt,Do,Np,Ne,Ap,Xn,Sp,Lp,da,Rp,Mp,pi,Ae,ot,ca,wo,Up,la,Hp,fi,z,To,Gp,ha,Vp,Wp,nt,xo,Bp,ma,Yp,Qp,rt,Eo,Jp,$o,Kp,Zn,Xp,Zp,ef,st,ko,tf,jo,of,er,nf,rf,sf,at,Fo,af,Oo,df,tr,cf,lf,hf,it,zo,mf,Co,pf,or,ff,uf,ui,Se,dt,pa,Po,gf,fa,_f,gi,C,qo,bf,ct,Io,vf,ua,yf,Df,lt,No,wf,ga,Tf,xf,ht,Ao,Ef,So,$f,nr,kf,jf,Ff,mt,Lo,Of,Ro,zf,rr,Cf,Pf,qf,pt,Mo,If,Uo,Nf,sr,Af,Sf,Lf,ft,Ho,Rf,Go,Mf,ar,Uf,Hf,_i,Le,ut,_a,Vo,Gf,ba,Vf,bi,M,Wo,Wf,va,Bf,Yf,Bo,Qf,ir,Jf,Kf,Xf,Yo,Zf,Qo,eu,tu,ou,X,Jo,nu,Re,ru,dr,su,au,ya,iu,du,cu,gt,lu,_t,vi,Me,bt,Da,Ko,hu,wa,mu,yi,U,Xo,pu,Ta,fu,uu,Zo,gu,cr,_u,bu,vu,en,yu,tn,Du,wu,Tu,Z,on,xu,Ue,Eu,lr,$u,ku,xa,ju,Fu,Ou,vt,zu,yt,Di,He,Dt,Ea,nn,Cu,$a,Pu,wi,H,rn,qu,ka,Iu,Nu,sn,Au,hr,Su,Lu,Ru,an,Mu,dn,Uu,Hu,Gu,ee,cn,Vu,Ge,Wu,mr,Bu,Yu,ja,Qu,Ju,Ku,wt,Xu,Tt,Ti;return p=new Te({}),Ht=new Te({}),Xt=new mn({props:{code:`from transformers import DetrForObjectDetection

model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DetrForObjectDetection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrForObjectDetection.from_pretrained(<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)`}}),Zt=new mn({props:{code:`from transformers import DetrConfig, DetrForObjectDetection

config = DetrConfig()
model = DetrForObjectDetection(config)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DetrConfig, DetrForObjectDetection

<span class="hljs-meta">&gt;&gt;&gt; </span>config = DetrConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrForObjectDetection(config)`}}),eo=new mn({props:{code:`config = DetrConfig(use_pretrained_backbone=False)
model = DetrForObjectDetection(config)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>config = DetrConfig(use_pretrained_backbone=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetrForObjectDetection(config)`}}),ao=new Te({}),io=new Pv({props:{pipeline:"object-detection"}}),lo=new Te({}),ho=new $({props:{name:"class transformers.models.detr.modeling_detr.DetrModelOutput",anchor:"transformers.models.detr.modeling_detr.DetrModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"intermediate_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the decoder of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.decoder_hidden_states",description:`<strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrModelOutput.intermediate_hidden_states",description:`<strong>intermediate_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(config.decoder_layers, batch_size, sequence_length, hidden_size)</code>, <em>optional</em>, returned when <code>config.auxiliary_loss=True</code>) &#x2014;
Intermediate decoder activations, i.e. the output of each decoder layer, each of them gone through a
layernorm.`,name:"intermediate_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L96"}}),mo=new $({props:{name:"class transformers.models.detr.modeling_detr.DetrObjectDetectionOutput",anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"loss_dict",val:": typing.Optional[typing.Dict] = None"},{name:"logits",val:": FloatTensor = None"},{name:"pred_boxes",val:": FloatTensor = None"},{name:"auxiliary_outputs",val:": typing.Optional[typing.List[typing.Dict]] = None"},{name:"last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> are provided)) &#x2014;
Total loss as a linear combination of a negative log-likehood (cross-entropy) for class prediction and a
bounding box loss. The latter is defined as a linear combination of the L1 loss and the generalized
scale-invariant IoU loss.`,name:"loss"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.loss_dict",description:`<strong>loss_dict</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A dictionary containing the individual losses. Useful for logging.`,name:"loss_dict"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes + 1)</code>) &#x2014;
Classification logits (including no-object) for all queries.`,name:"logits"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.pred_boxes",description:`<strong>pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, 4)</code>) &#x2014;
Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_object_detection">post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.`,name:"pred_boxes"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.auxiliary_outputs",description:`<strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) &#x2014;
Optional, only returned when auxilary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.`,name:"auxiliary_outputs"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the decoder of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.decoder_hidden_states",description:`<strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrObjectDetectionOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L136"}}),fo=new $({props:{name:"class transformers.models.detr.modeling_detr.DetrSegmentationOutput",anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"loss_dict",val:": typing.Optional[typing.Dict] = None"},{name:"logits",val:": FloatTensor = None"},{name:"pred_boxes",val:": FloatTensor = None"},{name:"pred_masks",val:": FloatTensor = None"},{name:"auxiliary_outputs",val:": typing.Optional[typing.List[typing.Dict]] = None"},{name:"last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> are provided)) &#x2014;
Total loss as a linear combination of a negative log-likehood (cross-entropy) for class prediction and a
bounding box loss. The latter is defined as a linear combination of the L1 loss and the generalized
scale-invariant IoU loss.`,name:"loss"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.loss_dict",description:`<strong>loss_dict</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A dictionary containing the individual losses. Useful for logging.`,name:"loss_dict"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes + 1)</code>) &#x2014;
Classification logits (including no-object) for all queries.`,name:"logits"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.pred_boxes",description:`<strong>pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, 4)</code>) &#x2014;
Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_object_detection">post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.`,name:"pred_boxes"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.pred_masks",description:`<strong>pred_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height/4, width/4)</code>) &#x2014;
Segmentation masks logits for all queries. See also
<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_semantic_segmentation">post_process_semantic_segmentation()</a> or
<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_instance_segmentation">post_process_instance_segmentation()</a>
<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_panoptic_segmentation">post_process_panoptic_segmentation()</a> to evaluate semantic, instance and panoptic
segmentation masks respectively.`,name:"pred_masks"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.auxiliary_outputs",description:`<strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) &#x2014;
Optional, only returned when auxiliary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.`,name:"auxiliary_outputs"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the decoder of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.decoder_hidden_states",description:`<strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.detr.modeling_detr.DetrSegmentationOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L199"}}),go=new Te({}),_o=new $({props:{name:"class transformers.DetrConfig",anchor:"transformers.DetrConfig",parameters:[{name:"use_timm_backbone",val:" = True"},{name:"backbone_config",val:" = None"},{name:"num_channels",val:" = 3"},{name:"num_queries",val:" = 100"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 2048"},{name:"encoder_attention_heads",val:" = 8"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 2048"},{name:"decoder_attention_heads",val:" = 8"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 256"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"init_xavier_std",val:" = 1.0"},{name:"auxiliary_loss",val:" = False"},{name:"position_embedding_type",val:" = 'sine'"},{name:"backbone",val:" = 'resnet50'"},{name:"use_pretrained_backbone",val:" = True"},{name:"dilation",val:" = False"},{name:"class_cost",val:" = 1"},{name:"bbox_cost",val:" = 5"},{name:"giou_cost",val:" = 2"},{name:"mask_loss_coefficient",val:" = 1"},{name:"dice_loss_coefficient",val:" = 1"},{name:"bbox_loss_coefficient",val:" = 5"},{name:"giou_loss_coefficient",val:" = 2"},{name:"eos_coefficient",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DetrConfig.use_timm_backbone",description:`<strong>use_timm_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the <code>timm</code> library for the backbone. If set to <code>False</code>, will use the <code>AutoBackbone</code>
API.`,name:"use_timm_backbone"},{anchor:"transformers.DetrConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>) &#x2014;
The configuration of the backbone model. Only used in case <code>use_timm_backbone</code> is set to <code>False</code> in which
case it will default to <code>ResNetConfig()</code>.`,name:"backbone_config"},{anchor:"transformers.DetrConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.DetrConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Number of object queries, i.e. detection slots. This is the maximal number of objects <a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrModel">DetrModel</a> can
detect in a single image. For COCO, we recommend 100 queries.`,name:"num_queries"},{anchor:"transformers.DetrConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimension of the layers.`,name:"d_model"},{anchor:"transformers.DetrConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.DetrConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.DetrConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.DetrConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.DetrConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.DetrConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.DetrConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.DetrConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.DetrConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.DetrConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.DetrConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.DetrConfig.init_xavier_std",description:`<strong>init_xavier_std</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
The scaling factor used for the Xavier initialization gain in the HM Attention map module.`,name:"init_xavier_std"},{anchor:"transformers.DetrConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.DetrConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.DetrConfig.auxiliary_loss",description:`<strong>auxiliary_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether auxiliary decoding losses (loss at each decoder layer) are to be used.`,name:"auxiliary_loss"},{anchor:"transformers.DetrConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sine&quot;</code>) &#x2014;
Type of position embeddings to be used on top of the image features. One of <code>&quot;sine&quot;</code> or <code>&quot;learned&quot;</code>.`,name:"position_embedding_type"},{anchor:"transformers.DetrConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;resnet50&quot;</code>) &#x2014;
Name of convolutional backbone to use in case <code>use_timm_backbone</code> = <code>True</code>. Supports any convolutional
backbone from the timm package. For a list of all available models, see <a href="https://rwightman.github.io/pytorch-image-models/#load-a-pretrained-model" rel="nofollow">this
page</a>.`,name:"backbone"},{anchor:"transformers.DetrConfig.use_pretrained_backbone",description:`<strong>use_pretrained_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use pretrained weights for the backbone. Only supported when <code>use_timm_backbone</code> = <code>True</code>.`,name:"use_pretrained_backbone"},{anchor:"transformers.DetrConfig.dilation",description:`<strong>dilation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to replace stride with dilation in the last convolutional block (DC5). Only supported when
<code>use_timm_backbone</code> = <code>True</code>.`,name:"dilation"},{anchor:"transformers.DetrConfig.class_cost",description:`<strong>class_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the classification error in the Hungarian matching cost.`,name:"class_cost"},{anchor:"transformers.DetrConfig.bbox_cost",description:`<strong>bbox_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 5) &#x2014;
Relative weight of the L1 error of the bounding box coordinates in the Hungarian matching cost.`,name:"bbox_cost"},{anchor:"transformers.DetrConfig.giou_cost",description:`<strong>giou_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
Relative weight of the generalized IoU loss of the bounding box in the Hungarian matching cost.`,name:"giou_cost"},{anchor:"transformers.DetrConfig.mask_loss_coefficient",description:`<strong>mask_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the Focal loss in the panoptic segmentation loss.`,name:"mask_loss_coefficient"},{anchor:"transformers.DetrConfig.dice_loss_coefficient",description:`<strong>dice_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the DICE/F-1 loss in the panoptic segmentation loss.`,name:"dice_loss_coefficient"},{anchor:"transformers.DetrConfig.bbox_loss_coefficient",description:`<strong>bbox_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 5) &#x2014;
Relative weight of the L1 bounding box loss in the object detection loss.`,name:"bbox_loss_coefficient"},{anchor:"transformers.DetrConfig.giou_loss_coefficient",description:`<strong>giou_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
Relative weight of the generalized IoU loss in the object detection loss.`,name:"giou_loss_coefficient"},{anchor:"transformers.DetrConfig.eos_coefficient",description:`<strong>eos_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Relative classification weight of the &#x2018;no-object&#x2019; class in the object detection loss.`,name:"eos_coefficient"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/configuration_detr.py#L37"}}),Ze=new bd({props:{anchor:"transformers.DetrConfig.example",$$slots:{default:[qv]},$$scope:{ctx:N}}}),vo=new $({props:{name:"from_backbone_config",anchor:"transformers.DetrConfig.from_backbone_config",parameters:[{name:"backbone_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DetrConfig.from_backbone_config.backbone_config",description:`<strong>backbone_config</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) &#x2014;
The backbone configuration.`,name:"backbone_config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/configuration_detr.py#L239",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"
>DetrConfig</a></p>
`}}),Do=new $({props:{name:"to_dict",anchor:"transformers.DetrConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/configuration_detr.py#L251"}}),wo=new Te({}),To=new $({props:{name:"class transformers.DetrImageProcessor",anchor:"transformers.DetrImageProcessor",parameters:[{name:"format",val:": typing.Union[str, transformers.models.detr.image_processing_detr.AnnotionFormat] = <AnnotionFormat.COCO_DETECTION: 'coco_detection'>"},{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:": typing.Union[int, 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:"do_pad",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DetrImageProcessor.format",description:`<strong>format</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;coco_detection&quot;</code>) &#x2014;
Data format of the annotations. One of &#x201C;coco_detection&#x201D; or &#x201C;coco_panoptic&#x201D;.`,name:"format"},{anchor:"transformers.DetrImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Controls whether to resize the image&#x2019;s <code>(height, width)</code> dimensions to the specified <code>size</code>. Can be
overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.DetrImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 800, &quot;longest_edge&quot;: 1333}</code>):
Size of the image&#x2019;s <code>(height, width)</code> dimensions after resizing. Can be overridden by the <code>size</code> parameter
in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.DetrImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image.`,name:"resample"},{anchor:"transformers.DetrImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Controls whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.DetrImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.
do_normalize &#x2014;
Controls whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.DetrImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_MEAN</code>) &#x2014;
Mean values to use when normalizing the image. Can be a single value or a list of values, one for each
channel. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.DetrImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_STD</code>) &#x2014;
Standard deviation values to use when normalizing the image. Can be a single value or a list of values, one
for each channel. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.DetrImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Controls whether to pad the image to the largest image in a batch and create a pixel mask. Can be
overridden by the <code>do_pad</code> parameter in the <code>preprocess</code> method.`,name:"do_pad"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L725"}}),xo=new $({props:{name:"preprocess",anchor:"transformers.DetrImageProcessor.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:"annotations",val:": typing.Union[typing.Dict[str, typing.Union[int, str, typing.List[typing.Dict]]], typing.List[typing.Dict[str, typing.Union[int, str, typing.List[typing.Dict]]]], NoneType] = None"},{name:"return_segmentation_masks",val:": bool = None"},{name:"masks_path",val:": typing.Union[str, pathlib.Path, NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:" = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Union[int, float, NoneType] = 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:"do_pad",val:": typing.Optional[bool] = None"},{name:"format",val:": typing.Union[str, transformers.models.detr.image_processing_detr.AnnotionFormat, NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DetrImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image or batch of images to preprocess.`,name:"images"},{anchor:"transformers.DetrImageProcessor.preprocess.annotations",description:`<strong>annotations</strong> (<code>AnnotationType</code> or <code>List[AnnotationType]</code>, <em>optional</em>) &#x2014;
List of annotations associated with the image or batch of images. If annotation is for object
detection, the annotations should be a dictionary with the following keys:<ul>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;annotations&#x201D; (<code>List[Dict]</code>): List of annotations for an image. Each annotation should be a
dictionary. An image can have no annotations, in which case the list should be empty.
If annotation is for segmentation, the annotations should be a dictionary with the following keys:</li>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;segments_info&#x201D; (<code>List[Dict]</code>): List of segments for an image. Each segment should be a dictionary.
An image can have no segments, in which case the list should be empty.</li>
<li>&#x201C;file_name&#x201D; (<code>str</code>): The file name of the image.</li>
</ul>`,name:"annotations"},{anchor:"transformers.DetrImageProcessor.preprocess.return_segmentation_masks",description:`<strong>return_segmentation_masks</strong> (<code>bool</code>, <em>optional</em>, defaults to self.return_segmentation_masks) &#x2014;
Whether to return segmentation masks.`,name:"return_segmentation_masks"},{anchor:"transformers.DetrImageProcessor.preprocess.masks_path",description:`<strong>masks_path</strong> (<code>str</code> or <code>pathlib.Path</code>, <em>optional</em>) &#x2014;
Path to the directory containing the segmentation masks.`,name:"masks_path"},{anchor:"transformers.DetrImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_resize) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.DetrImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to self.size) &#x2014;
Size of the image after resizing.`,name:"size"},{anchor:"transformers.DetrImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to self.resample) &#x2014;
Resampling filter to use when resizing the image.`,name:"resample"},{anchor:"transformers.DetrImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_rescale) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.DetrImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to self.rescale_factor) &#x2014;
Rescale factor to use when rescaling the image.`,name:"rescale_factor"},{anchor:"transformers.DetrImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_normalize) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.DetrImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to self.image_mean) &#x2014;
Mean to use when normalizing the image.`,name:"image_mean"},{anchor:"transformers.DetrImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to self.image_std) &#x2014;
Standard deviation to use when normalizing the image.`,name:"image_std"},{anchor:"transformers.DetrImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_pad) &#x2014;
Whether to pad the image.`,name:"do_pad"},{anchor:"transformers.DetrImageProcessor.preprocess.format",description:`<strong>format</strong> (<code>str</code> or <code>AnnotionFormat</code>, <em>optional</em>, defaults to self.format) &#x2014;
Format of the annotations.`,name:"format"},{anchor:"transformers.DetrImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to self.return_tensors) &#x2014;
Type of tensors to return. If <code>None</code>, will return the list of images.`,name:"return_tensors"},{anchor:"transformers.DetrImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>, defaults to self.data_format) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1041"}}),Eo=new $({props:{name:"post_process_object_detection",anchor:"transformers.DetrImageProcessor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"}],parametersDescription:[{anchor:"transformers.DetrImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrImageProcessor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.DetrImageProcessor.post_process_object_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> or <code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size
<code>(height, width)</code> of each image in the batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1525",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),ko=new $({props:{name:"post_process_semantic_segmentation",anchor:"transformers.DetrImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple[int, int]] = None"}],parametersDescription:[{anchor:"transformers.DetrImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
A list of tuples (<code>Tuple[int, int]</code>) containing the target size (height, width) of each image in the
batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1578",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.DetrImageProcessor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.DetrImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrImageProcessor.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.DetrImageProcessor.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.DetrImageProcessor.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.DetrImageProcessor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If unset, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.DetrImageProcessor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE)
format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1626",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to
<code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 An integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),zo=new $({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.DetrImageProcessor.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.DetrImageProcessor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
The outputs from <a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>.`,name:"outputs"},{anchor:"transformers.DetrImageProcessor.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.DetrImageProcessor.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.DetrImageProcessor.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.DetrImageProcessor.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.DetrImageProcessor.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 unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1710",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>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>
`}}),Po=new Te({}),qo=new $({props:{name:"class transformers.DetrFeatureExtractor",anchor:"transformers.DetrFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/feature_extraction_detr.py#L26"}}),Io=new $({props:{name:"__call__",anchor:"transformers.DetrFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/image_processing_utils.py#L456"}}),No=new $({props:{name:"pad_and_create_pixel_mask",anchor:"transformers.DetrFeatureExtractor.pad_and_create_pixel_mask",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:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"}],parametersDescription:[{anchor:"transformers.DetrFeatureExtractor.pad_and_create_pixel_mask.images",description:`<strong>images</strong> (<code>List[np.ndarray]</code>) &#x2014;
Batch of images to pad.`,name:"images"},{anchor:"transformers.DetrFeatureExtractor.pad_and_create_pixel_mask.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DetrFeatureExtractor.pad_and_create_pixel_mask.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L947"}}),Ao=new $({props:{name:"post_process_object_detection",anchor:"transformers.DetrFeatureExtractor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"}],parametersDescription:[{anchor:"transformers.DetrFeatureExtractor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrFeatureExtractor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.DetrFeatureExtractor.post_process_object_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> or <code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size
<code>(height, width)</code> of each image in the batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1525",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Lo=new $({props:{name:"post_process_semantic_segmentation",anchor:"transformers.DetrFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple[int, int]] = None"}],parametersDescription:[{anchor:"transformers.DetrFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
A list of tuples (<code>Tuple[int, int]</code>) containing the target size (height, width) of each image in the
batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1578",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>
`}}),Mo=new $({props:{name:"post_process_instance_segmentation",anchor:"transformers.DetrFeatureExtractor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.DetrFeatureExtractor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetrFeatureExtractor.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.DetrFeatureExtractor.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.DetrFeatureExtractor.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.DetrFeatureExtractor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested
final size (height, width) of each prediction. If unset, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.DetrFeatureExtractor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE)
format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1626",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to
<code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li>
<li><strong>segments_info</strong> \u2014 A dictionary that contains additional information on each segment.<ul>
<li><strong>id</strong> \u2014 An integer representing the <code>segment_id</code>.</li>
<li><strong>label_id</strong> \u2014 An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li>
<li><strong>score</strong> \u2014 Prediction score of segment with <code>segment_id</code>.</li>
</ul></li>
</ul>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Ho=new $({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.DetrFeatureExtractor.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.DetrFeatureExtractor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>) &#x2014;
The outputs from <a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation">DetrForSegmentation</a>.`,name:"outputs"},{anchor:"transformers.DetrFeatureExtractor.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.DetrFeatureExtractor.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.DetrFeatureExtractor.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.DetrFeatureExtractor.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.DetrFeatureExtractor.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 unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/image_processing_detr.py#L1710",returnDescription:`
<p>A list of dictionaries, one per image, each dictionary containing two keys:</p>
<ul>
<li><strong>segmentation</strong> \u2014 a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or
<code>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>
`}}),Vo=new Te({}),Wo=new $({props:{name:"class transformers.DetrModel",anchor:"transformers.DetrModel",parameters:[{name:"config",val:": DetrConfig"}],parametersDescription:[{anchor:"transformers.DetrModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig">DetrConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1201"}}),Jo=new $({props:{name:"forward",anchor:"transformers.DetrModel.forward",parameters:[{name:"pixel_values",val:""},{name:"pixel_mask",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DetrModel.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. Padding will be ignored by default should you provide it.</p>
<p>Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DetrModel.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.DetrModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) &#x2014;
Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.DetrModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.DetrModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing the flattened feature map (output of the backbone + projection layer), you
can choose to directly pass a flattened representation of an image.`,name:"inputs_embeds"},{anchor:"transformers.DetrModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of initializing the queries with a tensor of zeros, you can choose to directly pass an
embedded representation.`,name:"decoder_inputs_embeds"},{anchor:"transformers.DetrModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DetrModel.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.DetrModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1235",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrModelOutput"
>transformers.models.detr.modeling_detr.DetrModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"
>DetrConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</li>
<li><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>intermediate_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(config.decoder_layers, batch_size, sequence_length, hidden_size)</code>, <em>optional</em>, returned when <code>config.auxiliary_loss=True</code>) \u2014 Intermediate decoder activations, i.e. the output of each decoder layer, each of them gone through a
layernorm.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrModelOutput"
>transformers.models.detr.modeling_detr.DetrModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),gt=new tg({props:{$$slots:{default:[Iv]},$$scope:{ctx:N}}}),_t=new bd({props:{anchor:"transformers.DetrModel.forward.example",$$slots:{default:[Nv]},$$scope:{ctx:N}}}),Ko=new Te({}),Xo=new $({props:{name:"class transformers.DetrForObjectDetection",anchor:"transformers.DetrForObjectDetection",parameters:[{name:"config",val:": DetrConfig"}],parametersDescription:[{anchor:"transformers.DetrForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig">DetrConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1369"}}),on=new $({props:{name:"forward",anchor:"transformers.DetrForObjectDetection.forward",parameters:[{name:"pixel_values",val:""},{name:"pixel_mask",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DetrForObjectDetection.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. Padding will be ignored by default should you provide it.</p>
<p>Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DetrForObjectDetection.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.DetrForObjectDetection.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) &#x2014;
Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.DetrForObjectDetection.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.DetrForObjectDetection.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing the flattened feature map (output of the backbone + projection layer), you
can choose to directly pass a flattened representation of an image.`,name:"inputs_embeds"},{anchor:"transformers.DetrForObjectDetection.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of initializing the queries with a tensor of zeros, you can choose to directly pass an
embedded representation.`,name:"decoder_inputs_embeds"},{anchor:"transformers.DetrForObjectDetection.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DetrForObjectDetection.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.DetrForObjectDetection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DetrForObjectDetection.forward.labels",description:`<strong>labels</strong> (<code>List[Dict]</code> of len <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the bipartite matching loss. List of dicts, each dictionary containing at least the
following 2 keys: &#x2018;class_labels&#x2019; and &#x2018;boxes&#x2019; (the class labels and bounding boxes of an image in the batch
respectively). The class labels themselves should be a <code>torch.LongTensor</code> of len <code>(number of bounding boxes in the image,)</code> and the boxes a <code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, 4)</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1395",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrObjectDetectionOutput"
>transformers.models.detr.modeling_detr.DetrObjectDetectionOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"
>DetrConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> are provided)) \u2014 Total loss as a linear combination of a negative log-likehood (cross-entropy) for class prediction and a
bounding box loss. The latter is defined as a linear combination of the L1 loss and the generalized
scale-invariant IoU loss.</li>
<li><strong>loss_dict</strong> (<code>Dict</code>, <em>optional</em>) \u2014 A dictionary containing the individual losses. Useful for logging.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes + 1)</code>) \u2014 Classification logits (including no-object) for all queries.</li>
<li><strong>pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, 4)</code>) \u2014 Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_object_detection"
>post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.</li>
<li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) \u2014 Optional, only returned when auxilary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.</li>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</li>
<li><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrObjectDetectionOutput"
>transformers.models.detr.modeling_detr.DetrObjectDetectionOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),vt=new tg({props:{$$slots:{default:[Av]},$$scope:{ctx:N}}}),yt=new bd({props:{anchor:"transformers.DetrForObjectDetection.forward.example",$$slots:{default:[Sv]},$$scope:{ctx:N}}}),nn=new Te({}),rn=new $({props:{name:"class transformers.DetrForSegmentation",anchor:"transformers.DetrForSegmentation",parameters:[{name:"config",val:": DetrConfig"}],parametersDescription:[{anchor:"transformers.DetrForSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig">DetrConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1543"}}),cn=new $({props:{name:"forward",anchor:"transformers.DetrForSegmentation.forward",parameters:[{name:"pixel_values",val:""},{name:"pixel_mask",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DetrForSegmentation.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. Padding will be ignored by default should you provide it.</p>
<p>Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DetrForSegmentation.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.DetrForSegmentation.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) &#x2014;
Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.DetrForSegmentation.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.DetrForSegmentation.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing the flattened feature map (output of the backbone + projection layer), you
can choose to directly pass a flattened representation of an image.`,name:"inputs_embeds"},{anchor:"transformers.DetrForSegmentation.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of initializing the queries with a tensor of zeros, you can choose to directly pass an
embedded representation.`,name:"decoder_inputs_embeds"},{anchor:"transformers.DetrForSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DetrForSegmentation.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.DetrForSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DetrForSegmentation.forward.labels",description:`<strong>labels</strong> (<code>List[Dict]</code> of len <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the bipartite matching loss, DICE/F-1 loss and Focal loss. List of dicts, each
dictionary containing at least the following 3 keys: &#x2018;class_labels&#x2019;, &#x2018;boxes&#x2019; and &#x2018;masks&#x2019; (the class labels,
bounding boxes and segmentation masks of an image in the batch respectively). The class labels themselves
should be a <code>torch.LongTensor</code> of len <code>(number of bounding boxes in the image,)</code>, the boxes a
<code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, 4)</code> and the masks a
<code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, height, width)</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/detr/modeling_detr.py#L1565",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrSegmentationOutput"
>transformers.models.detr.modeling_detr.DetrSegmentationOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"
>DetrConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> are provided)) \u2014 Total loss as a linear combination of a negative log-likehood (cross-entropy) for class prediction and a
bounding box loss. The latter is defined as a linear combination of the L1 loss and the generalized
scale-invariant IoU loss.</li>
<li><strong>loss_dict</strong> (<code>Dict</code>, <em>optional</em>) \u2014 A dictionary containing the individual losses. Useful for logging.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, num_classes + 1)</code>) \u2014 Classification logits (including no-object) for all queries.</li>
<li><strong>pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, 4)</code>) \u2014 Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_object_detection"
>post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.</li>
<li><strong>pred_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height/4, width/4)</code>) \u2014 Segmentation masks logits for all queries. See also
<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_semantic_segmentation"
>post_process_semantic_segmentation()</a> or
<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_instance_segmentation"
>post_process_instance_segmentation()</a>
<a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process_panoptic_segmentation"
>post_process_panoptic_segmentation()</a> to evaluate semantic, instance and panoptic
segmentation masks respectively.</li>
<li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) \u2014 Optional, only returned when auxiliary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.</li>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><strong>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 layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</li>
<li><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/detr#transformers.models.detr.modeling_detr.DetrSegmentationOutput"
>transformers.models.detr.modeling_detr.DetrSegmentationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wt=new tg({props:{$$slots:{default:[Lv]},$$scope:{ctx:N}}}),Tt=new bd({props:{anchor:"transformers.DetrForSegmentation.forward.example",$$slots:{default:[Rv]},$$scope:{ctx:N}}}),{c(){f=s("meta"),E=d(),T=s("h1"),u=s("a"),x=s("span"),_(p.$$.fragment),g=d(),G=s("span"),yd=n("DETR"),qa=d(),xe=s("h2"),Ve=s("a"),Tr=s("span"),_(Ht.$$.fragment),Dd=d(),xr=s("span"),wd=n("Overview"),Ia=d(),We=s("p"),Td=n("The DETR model was proposed in "),Gt=s("a"),xd=n("End-to-End Object Detection with Transformers"),Ed=n(` by
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko. DETR
consists of a convolutional backbone followed by an encoder-decoder Transformer which can be trained end-to-end for
object detection. It greatly simplifies a lot of the complexity of models like Faster-R-CNN and Mask-R-CNN, which use
things like region proposals, non-maximum suppression procedure and anchor generation. Moreover, DETR can also be
naturally extended to perform panoptic segmentation, by simply adding a mask head on top of the decoder outputs.`),Na=d(),pn=s("p"),$d=n("The abstract from the paper is the following:"),Aa=d(),fn=s("p"),Er=s("em"),kd=n(`We present a new method that views object detection as a direct set prediction problem. Our approach streamlines the
detection pipeline, effectively removing the need for many hand-designed components like a non-maximum suppression
procedure or anchor generation that explicitly encode our prior knowledge about the task. The main ingredients of the
new framework, called DEtection TRansformer or DETR, are a set-based global loss that forces unique predictions via
bipartite matching, and a transformer encoder-decoder architecture. Given a fixed small set of learned object queries,
DETR reasons about the relations of the objects and the global image context to directly output the final set of
predictions in parallel. The new model is conceptually simple and does not require a specialized library, unlike many
other modern detectors. DETR demonstrates accuracy and run-time performance on par with the well-established and
highly-optimized Faster RCNN baseline on the challenging COCO object detection dataset. Moreover, DETR can be easily
generalized to produce panoptic segmentation in a unified manner. We show that it significantly outperforms competitive
baselines.`),Sa=d(),be=s("p"),jd=n("This model was contributed by "),Vt=s("a"),Fd=n("nielsr"),Od=n(". The original code can be found "),Wt=s("a"),zd=n("here"),Cd=n("."),La=d(),Be=s("p"),Pd=n("Here\u2019s a TLDR explaining how "),un=s("a"),qd=n("DetrForObjectDetection"),Id=n(" works:"),Ra=d(),j=s("p"),Nd=n(`First, an image is sent through a pre-trained convolutional backbone (in the paper, the authors use
ResNet-50/ResNet-101). Let\u2019s assume we also add a batch dimension. This means that the input to the backbone is a
tensor of shape `),$r=s("code"),Ad=n("(batch_size, 3, height, width)"),Sd=n(`, assuming the image has 3 color channels (RGB). The CNN backbone
outputs a new lower-resolution feature map, typically of shape `),kr=s("code"),Ld=n("(batch_size, 2048, height/32, width/32)"),Rd=n(`. This is
then projected to match the hidden dimension of the Transformer of DETR, which is `),jr=s("code"),Md=n("256"),Ud=n(` by default, using a
`),Fr=s("code"),Hd=n("nn.Conv2D"),Gd=n(" layer. So now, we have a tensor of shape "),Or=s("code"),Vd=n("(batch_size, 256, height/32, width/32)."),Wd=n(` Next, the
feature map is flattened and transposed to obtain a tensor of shape `),zr=s("code"),Bd=n("(batch_size, seq_len, d_model)"),Yd=n(` =
`),Cr=s("code"),Qd=n("(batch_size, width/32*height/32, 256)"),Jd=n(`. So a difference with NLP models is that the sequence length is actually
longer than usual, but with a smaller `),Pr=s("code"),Kd=n("d_model"),Xd=n(" (which in NLP is typically 768 or higher)."),Ma=d(),P=s("p"),Zd=n("Next, this is sent through the encoder, outputting "),qr=s("code"),ec=n("encoder_hidden_states"),tc=n(` of the same shape (you can consider
these as image features). Next, so-called `),Ir=s("strong"),oc=n("object queries"),nc=n(` are sent through the decoder. This is a tensor of shape
`),Nr=s("code"),rc=n("(batch_size, num_queries, d_model)"),sc=n(", with "),Ar=s("code"),ac=n("num_queries"),ic=n(` typically set to 100 and initialized with zeros.
These input embeddings are learnt positional encodings that the authors refer to as object queries, and similarly to
the encoder, they are added to the input of each attention layer. Each object query will look for a particular object
in the image. The decoder updates these embeddings through multiple self-attention and encoder-decoder attention layers
to output `),Sr=s("code"),dc=n("decoder_hidden_states"),cc=n(" of the same shape: "),Lr=s("code"),lc=n("(batch_size, num_queries, d_model)"),hc=n(`. Next, two heads
are added on top for object detection: a linear layer for classifying each object query into one of the objects or \u201Cno
object\u201D, and a MLP to predict bounding boxes for each query.`),Ua=d(),J=s("p"),mc=n("The model is trained using a "),Rr=s("strong"),pc=n("bipartite matching loss"),fc=n(`: so what we actually do is compare the predicted classes +
bounding boxes of each of the N = 100 object queries to the ground truth annotations, padded up to the same length N
(so if an image only contains 4 objects, 96 annotations will just have a \u201Cno object\u201D as class and \u201Cno bounding box\u201D as
bounding box). The `),Bt=s("a"),uc=n("Hungarian matching algorithm"),gc=n(` is used to find
an optimal one-to-one mapping of each of the N queries to each of the N annotations. Next, standard cross-entropy (for
the classes) and a linear combination of the L1 and `),Yt=s("a"),_c=n("generalized IoU loss"),bc=n(` (for the
bounding boxes) are used to optimize the parameters of the model.`),Ha=d(),K=s("p"),vc=n(`DETR can be naturally extended to perform panoptic segmentation (which unifies semantic segmentation and instance
segmentation). `),gn=s("a"),yc=n("DetrForSegmentation"),Dc=n(` adds a segmentation mask head on top of
`),_n=s("a"),wc=n("DetrForObjectDetection"),Tc=n(`. The mask head can be trained either jointly, or in a two steps process,
where one first trains a `),bn=s("a"),xc=n("DetrForObjectDetection"),Ec=n(` model to detect bounding boxes around both
\u201Cthings\u201D (instances) and \u201Cstuff\u201D (background things like trees, roads, sky), then freeze all the weights and train only
the mask head for 25 epochs. Experimentally, these two approaches give similar results. Note that predicting boxes is
required for the training to be possible, since the Hungarian matching is computed using distances between boxes.`),Ga=d(),vn=s("p"),$c=n("Tips:"),Va=d(),F=s("ul"),re=s("li"),kc=n("DETR uses so-called "),Mr=s("strong"),jc=n("object queries"),Fc=n(` to detect objects in an image. The number of queries determines the maximum
number of objects that can be detected in a single image, and is set to 100 by default (see parameter
`),Ur=s("code"),Oc=n("num_queries"),zc=n(" of "),yn=s("a"),Cc=n("DetrConfig"),Pc=n(`). Note that it\u2019s good to have some slack (in COCO, the
authors used 100, while the maximum number of objects in a COCO image is ~70).`),qc=d(),Hr=s("li"),Ic=n(`The decoder of DETR updates the query embeddings in parallel. This is different from language models like GPT-2,
which use autoregressive decoding instead of parallel. Hence, no causal attention mask is used.`),Nc=d(),se=s("li"),Ac=n(`DETR adds position embeddings to the hidden states at each self-attention and cross-attention layer before projecting
to queries and keys. For the position embeddings of the image, one can choose between fixed sinusoidal or learned
absolute position embeddings. By default, the parameter `),Gr=s("code"),Sc=n("position_embedding_type"),Lc=n(` of
`),Dn=s("a"),Rc=n("DetrConfig"),Mc=n(" is set to "),Vr=s("code"),Uc=n('"sine"'),Hc=n("."),Gc=d(),ae=s("li"),Vc=n(`During training, the authors of DETR did find it helpful to use auxiliary losses in the decoder, especially to help
the model output the correct number of objects of each class. If you set the parameter `),Wr=s("code"),Wc=n("auxiliary_loss"),Bc=n(` of
`),wn=s("a"),Yc=n("DetrConfig"),Qc=n(" to "),Br=s("code"),Jc=n("True"),Kc=n(`, then prediction feedforward neural networks and Hungarian losses
are added after each decoder layer (with the FFNs sharing parameters).`),Xc=d(),Y=s("li"),Zc=n(`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Yr=s("em"),el=n("num_boxes"),tl=n(" variable in the "),Qr=s("em"),ol=n("DetrLoss"),nl=n(" class of "),Jr=s("em"),rl=n("modeling_detr.py"),sl=n(`. When training on multiple nodes, this should be
set to the average number of target boxes across all nodes, as can be seen in the original implementation `),Qt=s("a"),al=n("here"),il=n("."),dl=d(),A=s("li"),Tn=s("a"),cl=n("DetrForObjectDetection"),ll=n(" and "),xn=s("a"),hl=n("DetrForSegmentation"),ml=n(` can be initialized with
any convolutional backbone available in the `),Jt=s("a"),pl=n("timm library"),fl=n(`.
Initializing with a MobileNet backbone for example can be done by setting the `),Kr=s("code"),ul=n("backbone"),gl=n(` attribute of
`),En=s("a"),_l=n("DetrConfig"),bl=n(" to "),Xr=s("code"),vl=n('"tf_mobilenetv3_small_075"'),yl=n(`, and then initializing the model with that
config.`),Dl=d(),ie=s("li"),wl=n(`DETR resizes the input images such that the shortest side is at least a certain amount of pixels while the longest is
at most 1333 pixels. At training time, scale augmentation is used such that the shortest side is randomly set to at
least 480 and at most 800 pixels. At inference time, the shortest side is set to 800. One can use
`),$n=s("a"),Tl=n("DetrImageProcessor"),xl=n(` to prepare images (and optional annotations in COCO format) for the
model. Due to this resizing, images in a batch can have different sizes. DETR solves this by padding images up to the
largest size in a batch, and by creating a pixel mask that indicates which pixels are real/which are padding.
Alternatively, one can also define a custom `),Zr=s("code"),El=n("collate_fn"),$l=n(` in order to batch images together, using
`),kn=s("a"),kl=n("pad_and_create_pixel_mask()"),jl=n("."),Fl=d(),Ee=s("li"),Ol=n("The size of the images will determine the amount of memory being used, and will thus determine the "),es=s("code"),zl=n("batch_size"),Cl=n(`.
It is advised to use a batch size of 2 per GPU. See `),Kt=s("a"),Pl=n("this Github thread"),ql=n(" for more info."),Wa=d(),jn=s("p"),Il=n("There are three ways to instantiate a DETR model (depending on what you prefer):"),Ba=d(),Fn=s("p"),Nl=n("Option 1: Instantiate DETR with pre-trained weights for entire model"),Ya=d(),_(Xt.$$.fragment),Qa=d(),On=s("p"),Al=n("Option 2: Instantiate DETR with randomly initialized weights for Transformer, but pre-trained weights for backbone"),Ja=d(),_(Zt.$$.fragment),Ka=d(),zn=s("p"),Sl=n("Option 3: Instantiate DETR with randomly initialized weights for backbone + Transformer"),Xa=d(),_(eo.$$.fragment),Za=d(),Cn=s("p"),Ll=n("As a summary, consider the following table:"),ei=d(),Ye=s("table"),ts=s("thead"),de=s("tr"),os=s("th"),Rl=n("Task"),Ml=d(),ns=s("th"),Ul=n("Object detection"),Hl=d(),rs=s("th"),Gl=n("Instance segmentation"),Vl=d(),ss=s("th"),Wl=n("Panoptic segmentation"),Bl=d(),L=s("tbody"),ce=s("tr"),as=s("td"),is=s("strong"),Yl=n("Description"),Ql=d(),ds=s("td"),Jl=n("Predicting bounding boxes and class labels around objects in an image"),Kl=d(),cs=s("td"),Xl=n("Predicting masks around objects (i.e. instances) in an image"),Zl=d(),ls=s("td"),eh=n("Predicting masks around both objects (i.e. instances) as well as \u201Cstuff\u201D (i.e. background things like trees and roads) in an image"),th=d(),le=s("tr"),hs=s("td"),ms=s("strong"),oh=n("Model"),nh=d(),ps=s("td"),Pn=s("a"),rh=n("DetrForObjectDetection"),sh=d(),fs=s("td"),qn=s("a"),ah=n("DetrForSegmentation"),ih=d(),us=s("td"),In=s("a"),dh=n("DetrForSegmentation"),ch=d(),he=s("tr"),gs=s("td"),_s=s("strong"),lh=n("Example dataset"),hh=d(),bs=s("td"),mh=n("COCO detection"),ph=d(),vs=s("td"),fh=n("COCO detection, COCO panoptic"),uh=d(),ys=s("td"),gh=n("COCO panoptic"),_h=d(),me=s("tr"),to=s("td"),Ds=s("strong"),bh=n("Format of annotations to provide to"),vh=d(),Nn=s("a"),yh=n("DetrImageProcessor"),Dh=d(),$e=s("td"),wh=n("{\u2018image_id\u2019: "),ws=s("code"),Th=n("int"),xh=n(", \u2018annotations\u2019: "),Ts=s("code"),Eh=n("List[Dict]"),$h=n("} each Dict being a COCO object annotation"),kh=d(),R=s("td"),jh=n("{\u2018image_id\u2019: "),xs=s("code"),Fh=n("int"),Oh=n(", \u2018annotations\u2019: "),Es=s("code"),zh=n("List[Dict]"),Ch=n("}  (in case of COCO detection) or {\u2018file_name\u2019: "),$s=s("code"),Ph=n("str"),qh=n(", \u2018image_id\u2019: "),ks=s("code"),Ih=n("int"),Nh=n(", \u2018segments_info\u2019: "),js=s("code"),Ah=n("List[Dict]"),Sh=n("} (in case of COCO panoptic)"),Lh=d(),pe=s("td"),Rh=n("{\u2018file_name\u2019: "),Fs=s("code"),Mh=n("str"),Uh=n(", \u2018image_id\u2019: "),Os=s("code"),Hh=n("int"),Gh=n(", \u2018segments_info\u2019: "),zs=s("code"),Vh=n("List[Dict]"),Wh=n("} and masks_path (path to directory containing PNG files of the masks)"),Bh=d(),fe=s("tr"),An=s("td"),Cs=s("strong"),Yh=n("Postprocessing"),Qh=n(" (i.e. converting the output of the model to COCO API)"),Jh=d(),Ps=s("td"),qs=s("code"),Kh=n("post_process()"),Xh=d(),Is=s("td"),Ns=s("code"),Zh=n("post_process_segmentation()"),em=d(),oo=s("td"),As=s("code"),tm=n("post_process_segmentation()"),om=n(", "),Ss=s("code"),nm=n("post_process_panoptic()"),rm=d(),ue=s("tr"),Ls=s("td"),Rs=s("strong"),sm=n("evaluators"),am=d(),no=s("td"),Ms=s("code"),im=n("CocoEvaluator"),dm=n(" with "),Us=s("code"),cm=n('iou_types="bbox"'),lm=d(),ke=s("td"),Hs=s("code"),hm=n("CocoEvaluator"),mm=n(" with "),Gs=s("code"),pm=n('iou_types="bbox"'),fm=n(" or "),Vs=s("code"),um=n('"segm"'),gm=d(),ge=s("td"),Ws=s("code"),_m=n("CocoEvaluator"),bm=n(" with "),Bs=s("code"),vm=n('iou_tupes="bbox"'),ym=n(" or "),Ys=s("code"),Dm=n('"segm"'),wm=n(", "),Qs=s("code"),Tm=n("PanopticEvaluator"),ti=d(),k=s("p"),xm=n(`In short, one should prepare the data either in COCO detection or COCO panoptic format, then use
`),Sn=s("a"),Em=n("DetrImageProcessor"),$m=n(" to create "),Js=s("code"),km=n("pixel_values"),jm=n(", "),Ks=s("code"),Fm=n("pixel_mask"),Om=n(` and optional
`),Xs=s("code"),zm=n("labels"),Cm=n(`, which can then be used to train (or fine-tune) a model. For evaluation, one should first convert the
outputs of the model using one of the postprocessing methods of `),Ln=s("a"),Pm=n("DetrImageProcessor"),qm=n(`. These can
be be provided to either `),Zs=s("code"),Im=n("CocoEvaluator"),Nm=n(" or "),ea=s("code"),Am=n("PanopticEvaluator"),Sm=n(`, which allow you to calculate metrics like
mean Average Precision (mAP) and Panoptic Quality (PQ). The latter objects are implemented in the `),ro=s("a"),Lm=n("original repository"),Rm=n(". See the "),so=s("a"),Mm=n("example notebooks"),Um=n(" for more info regarding evaluation."),oi=d(),je=s("h2"),Qe=s("a"),ta=s("span"),_(ao.$$.fragment),Hm=d(),oa=s("span"),Gm=n("Resources"),ni=d(),Rn=s("p"),Vm=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DETR."),ri=d(),_(io.$$.fragment),si=d(),Je=s("ul"),_e=s("li"),Wm=n("All example notebooks illustrating fine-tuning "),Mn=s("a"),Bm=n("DetrForObjectDetection"),Ym=n(" and "),Un=s("a"),Qm=n("DetrForSegmentation"),Jm=n(" on a custom dataset an be found "),co=s("a"),Km=n("here"),Xm=n("."),Zm=d(),Hn=s("li"),ep=n("See also: "),Gn=s("a"),tp=n("Object detection task guide"),ai=d(),Vn=s("p"),op=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ii=d(),Fe=s("h2"),Ke=s("a"),na=s("span"),_(lo.$$.fragment),np=d(),ra=s("span"),rp=n("DETR specific outputs"),di=d(),Oe=s("div"),_(ho.$$.fragment),sp=d(),sa=s("p"),ap=n(`Base class for outputs of the DETR encoder-decoder model. This class adds one attribute to Seq2SeqModelOutput,
namely an optional stack of intermediate decoder activations, i.e. the output of each decoder layer, each of them
gone through a layernorm. This is useful when training the model with auxiliary decoding losses.`),ci=d(),ze=s("div"),_(mo.$$.fragment),ip=d(),po=s("p"),dp=n("Output type of "),Wn=s("a"),cp=n("DetrForObjectDetection"),lp=n("."),li=d(),Ce=s("div"),_(fo.$$.fragment),hp=d(),uo=s("p"),mp=n("Output type of "),Bn=s("a"),pp=n("DetrForSegmentation"),fp=n("."),hi=d(),Pe=s("h2"),Xe=s("a"),aa=s("span"),_(go.$$.fragment),up=d(),ia=s("span"),gp=n("DetrConfig"),mi=d(),I=s("div"),_(_o.$$.fragment),_p=d(),qe=s("p"),bp=n("This is the configuration class to store the configuration of a "),Yn=s("a"),vp=n("DetrModel"),yp=n(`. It is used to instantiate a DETR
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 DETR
`),bo=s("a"),Dp=n("facebook/detr-resnet-50"),wp=n(" architecture."),Tp=d(),Ie=s("p"),xp=n("Configuration objects inherit from "),Qn=s("a"),Ep=n("PretrainedConfig"),$p=n(` and can be used to control the model outputs. Read the
documentation from `),Jn=s("a"),kp=n("PretrainedConfig"),jp=n(" for more information."),Fp=d(),_(Ze.$$.fragment),Op=d(),et=s("div"),_(vo.$$.fragment),zp=d(),yo=s("p"),Cp=n("Instantiate a "),Kn=s("a"),Pp=n("DetrConfig"),qp=n(" (or a derived class) from a pre-trained backbone model configuration."),Ip=d(),tt=s("div"),_(Do.$$.fragment),Np=d(),Ne=s("p"),Ap=n("Serializes this instance to a Python dictionary. Override the default "),Xn=s("a"),Sp=n("to_dict()"),Lp=n(`. Returns:
`),da=s("code"),Rp=n("Dict[str, any]"),Mp=n(": Dictionary of all the attributes that make up this configuration instance,"),pi=d(),Ae=s("h2"),ot=s("a"),ca=s("span"),_(wo.$$.fragment),Up=d(),la=s("span"),Hp=n("DetrImageProcessor"),fi=d(),z=s("div"),_(To.$$.fragment),Gp=d(),ha=s("p"),Vp=n("Constructs a Detr image processor."),Wp=d(),nt=s("div"),_(xo.$$.fragment),Bp=d(),ma=s("p"),Yp=n("Preprocess an image or a batch of images so that it can be used by the model."),Qp=d(),rt=s("div"),_(Eo.$$.fragment),Jp=d(),$o=s("p"),Kp=n("Converts the raw output of "),Zn=s("a"),Xp=n("DetrForObjectDetection"),Zp=n(` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),ef=d(),st=s("div"),_(ko.$$.fragment),tf=d(),jo=s("p"),of=n("Converts the output of "),er=s("a"),nf=n("DetrForSegmentation"),rf=n(" into semantic segmentation maps. Only supports PyTorch."),sf=d(),at=s("div"),_(Fo.$$.fragment),af=d(),Oo=s("p"),df=n("Converts the output of "),tr=s("a"),cf=n("DetrForSegmentation"),lf=n(" into instance segmentation predictions. Only supports PyTorch."),hf=d(),it=s("div"),_(zo.$$.fragment),mf=d(),Co=s("p"),pf=n("Converts the output of "),or=s("a"),ff=n("DetrForSegmentation"),uf=n(` into image panoptic segmentation predictions. Only supports
PyTorch.`),ui=d(),Se=s("h2"),dt=s("a"),pa=s("span"),_(Po.$$.fragment),gf=d(),fa=s("span"),_f=n("DetrFeatureExtractor"),gi=d(),C=s("div"),_(qo.$$.fragment),bf=d(),ct=s("div"),_(Io.$$.fragment),vf=d(),ua=s("p"),yf=n("Preprocess an image or a batch of images."),Df=d(),lt=s("div"),_(No.$$.fragment),wf=d(),ga=s("p"),Tf=n(`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),xf=d(),ht=s("div"),_(Ao.$$.fragment),Ef=d(),So=s("p"),$f=n("Converts the raw output of "),nr=s("a"),kf=n("DetrForObjectDetection"),jf=n(` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Ff=d(),mt=s("div"),_(Lo.$$.fragment),Of=d(),Ro=s("p"),zf=n("Converts the output of "),rr=s("a"),Cf=n("DetrForSegmentation"),Pf=n(" into semantic segmentation maps. Only supports PyTorch."),qf=d(),pt=s("div"),_(Mo.$$.fragment),If=d(),Uo=s("p"),Nf=n("Converts the output of "),sr=s("a"),Af=n("DetrForSegmentation"),Sf=n(" into instance segmentation predictions. Only supports PyTorch."),Lf=d(),ft=s("div"),_(Ho.$$.fragment),Rf=d(),Go=s("p"),Mf=n("Converts the output of "),ar=s("a"),Uf=n("DetrForSegmentation"),Hf=n(` into image panoptic segmentation predictions. Only supports
PyTorch.`),_i=d(),Le=s("h2"),ut=s("a"),_a=s("span"),_(Vo.$$.fragment),Gf=d(),ba=s("span"),Vf=n("DetrModel"),bi=d(),M=s("div"),_(Wo.$$.fragment),Wf=d(),va=s("p"),Bf=n(`The bare DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw hidden-states without
any specific head on top.`),Yf=d(),Bo=s("p"),Qf=n("This model inherits from "),ir=s("a"),Jf=n("PreTrainedModel"),Kf=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xf=d(),Yo=s("p"),Zf=n("This model is also a PyTorch "),Qo=s("a"),eu=n("torch.nn.Module"),tu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ou=d(),X=s("div"),_(Jo.$$.fragment),nu=d(),Re=s("p"),ru=n("The "),dr=s("a"),su=n("DetrModel"),au=n(" forward method, overrides the "),ya=s("code"),iu=n("__call__"),du=n(" special method."),cu=d(),_(gt.$$.fragment),lu=d(),_(_t.$$.fragment),vi=d(),Me=s("h2"),bt=s("a"),Da=s("span"),_(Ko.$$.fragment),hu=d(),wa=s("span"),mu=n("DetrForObjectDetection"),yi=d(),U=s("div"),_(Xo.$$.fragment),pu=d(),Ta=s("p"),fu=n(`DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on top, for tasks
such as COCO detection.`),uu=d(),Zo=s("p"),gu=n("This model inherits from "),cr=s("a"),_u=n("PreTrainedModel"),bu=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vu=d(),en=s("p"),yu=n("This model is also a PyTorch "),tn=s("a"),Du=n("torch.nn.Module"),wu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tu=d(),Z=s("div"),_(on.$$.fragment),xu=d(),Ue=s("p"),Eu=n("The "),lr=s("a"),$u=n("DetrForObjectDetection"),ku=n(" forward method, overrides the "),xa=s("code"),ju=n("__call__"),Fu=n(" special method."),Ou=d(),_(vt.$$.fragment),zu=d(),_(yt.$$.fragment),Di=d(),He=s("h2"),Dt=s("a"),Ea=s("span"),_(nn.$$.fragment),Cu=d(),$a=s("span"),Pu=n("DetrForSegmentation"),wi=d(),H=s("div"),_(rn.$$.fragment),qu=d(),ka=s("p"),Iu=n(`DETR Model (consisting of a backbone and encoder-decoder Transformer) with a segmentation head on top, for tasks
such as COCO panoptic.`),Nu=d(),sn=s("p"),Au=n("This model inherits from "),hr=s("a"),Su=n("PreTrainedModel"),Lu=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ru=d(),an=s("p"),Mu=n("This model is also a PyTorch "),dn=s("a"),Uu=n("torch.nn.Module"),Hu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gu=d(),ee=s("div"),_(cn.$$.fragment),Vu=d(),Ge=s("p"),Wu=n("The "),mr=s("a"),Bu=n("DetrForSegmentation"),Yu=n(" forward method, overrides the "),ja=s("code"),Qu=n("__call__"),Ju=n(" special method."),Ku=d(),_(wt.$$.fragment),Xu=d(),_(Tt.$$.fragment),this.h()},l(o){const h=zv('[data-svelte="svelte-1phssyn"]',document.head);f=a(h,"META",{name:!0,content:!0}),h.forEach(t),E=c(o),T=a(o,"H1",{class:!0});var ln=i(T);u=a(ln,"A",{id:!0,class:!0,href:!0});var Fa=i(u);x=a(Fa,"SPAN",{});var Oa=i(x);b(p.$$.fragment,Oa),Oa.forEach(t),Fa.forEach(t),g=c(ln),G=a(ln,"SPAN",{});var za=i(G);yd=r(za,"DETR"),za.forEach(t),ln.forEach(t),qa=c(o),xe=a(o,"H2",{class:!0});var hn=i(xe);Ve=a(hn,"A",{id:!0,class:!0,href:!0});var Ca=i(Ve);Tr=a(Ca,"SPAN",{});var Pa=i(Tr);b(Ht.$$.fragment,Pa),Pa.forEach(t),Ca.forEach(t),Dd=c(hn),xr=a(hn,"SPAN",{});var og=i(xr);wd=r(og,"Overview"),og.forEach(t),hn.forEach(t),Ia=c(o),We=a(o,"P",{});var xi=i(We);Td=r(xi,"The DETR model was proposed in "),Gt=a(xi,"A",{href:!0,rel:!0});var ng=i(Gt);xd=r(ng,"End-to-End Object Detection with Transformers"),ng.forEach(t),Ed=r(xi,` by
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko. DETR
consists of a convolutional backbone followed by an encoder-decoder Transformer which can be trained end-to-end for
object detection. It greatly simplifies a lot of the complexity of models like Faster-R-CNN and Mask-R-CNN, which use
things like region proposals, non-maximum suppression procedure and anchor generation. Moreover, DETR can also be
naturally extended to perform panoptic segmentation, by simply adding a mask head on top of the decoder outputs.`),xi.forEach(t),Na=c(o),pn=a(o,"P",{});var rg=i(pn);$d=r(rg,"The abstract from the paper is the following:"),rg.forEach(t),Aa=c(o),fn=a(o,"P",{});var sg=i(fn);Er=a(sg,"EM",{});var ag=i(Er);kd=r(ag,`We present a new method that views object detection as a direct set prediction problem. Our approach streamlines the
detection pipeline, effectively removing the need for many hand-designed components like a non-maximum suppression
procedure or anchor generation that explicitly encode our prior knowledge about the task. The main ingredients of the
new framework, called DEtection TRansformer or DETR, are a set-based global loss that forces unique predictions via
bipartite matching, and a transformer encoder-decoder architecture. Given a fixed small set of learned object queries,
DETR reasons about the relations of the objects and the global image context to directly output the final set of
predictions in parallel. The new model is conceptually simple and does not require a specialized library, unlike many
other modern detectors. DETR demonstrates accuracy and run-time performance on par with the well-established and
highly-optimized Faster RCNN baseline on the challenging COCO object detection dataset. Moreover, DETR can be easily
generalized to produce panoptic segmentation in a unified manner. We show that it significantly outperforms competitive
baselines.`),ag.forEach(t),sg.forEach(t),Sa=c(o),be=a(o,"P",{});var pr=i(be);jd=r(pr,"This model was contributed by "),Vt=a(pr,"A",{href:!0,rel:!0});var ig=i(Vt);Fd=r(ig,"nielsr"),ig.forEach(t),Od=r(pr,". The original code can be found "),Wt=a(pr,"A",{href:!0,rel:!0});var dg=i(Wt);zd=r(dg,"here"),dg.forEach(t),Cd=r(pr,"."),pr.forEach(t),La=c(o),Be=a(o,"P",{});var Ei=i(Be);Pd=r(Ei,"Here\u2019s a TLDR explaining how "),un=a(Ei,"A",{href:!0});var cg=i(un);qd=r(cg,"DetrForObjectDetection"),cg.forEach(t),Id=r(Ei," works:"),Ei.forEach(t),Ra=c(o),j=a(o,"P",{});var q=i(j);Nd=r(q,`First, an image is sent through a pre-trained convolutional backbone (in the paper, the authors use
ResNet-50/ResNet-101). Let\u2019s assume we also add a batch dimension. This means that the input to the backbone is a
tensor of shape `),$r=a(q,"CODE",{});var lg=i($r);Ad=r(lg,"(batch_size, 3, height, width)"),lg.forEach(t),Sd=r(q,`, assuming the image has 3 color channels (RGB). The CNN backbone
outputs a new lower-resolution feature map, typically of shape `),kr=a(q,"CODE",{});var hg=i(kr);Ld=r(hg,"(batch_size, 2048, height/32, width/32)"),hg.forEach(t),Rd=r(q,`. This is
then projected to match the hidden dimension of the Transformer of DETR, which is `),jr=a(q,"CODE",{});var mg=i(jr);Md=r(mg,"256"),mg.forEach(t),Ud=r(q,` by default, using a
`),Fr=a(q,"CODE",{});var pg=i(Fr);Hd=r(pg,"nn.Conv2D"),pg.forEach(t),Gd=r(q," layer. So now, we have a tensor of shape "),Or=a(q,"CODE",{});var fg=i(Or);Vd=r(fg,"(batch_size, 256, height/32, width/32)."),fg.forEach(t),Wd=r(q,` Next, the
feature map is flattened and transposed to obtain a tensor of shape `),zr=a(q,"CODE",{});var ug=i(zr);Bd=r(ug,"(batch_size, seq_len, d_model)"),ug.forEach(t),Yd=r(q,` =
`),Cr=a(q,"CODE",{});var gg=i(Cr);Qd=r(gg,"(batch_size, width/32*height/32, 256)"),gg.forEach(t),Jd=r(q,`. So a difference with NLP models is that the sequence length is actually
longer than usual, but with a smaller `),Pr=a(q,"CODE",{});var _g=i(Pr);Kd=r(_g,"d_model"),_g.forEach(t),Xd=r(q," (which in NLP is typically 768 or higher)."),q.forEach(t),Ma=c(o),P=a(o,"P",{});var V=i(P);Zd=r(V,"Next, this is sent through the encoder, outputting "),qr=a(V,"CODE",{});var bg=i(qr);ec=r(bg,"encoder_hidden_states"),bg.forEach(t),tc=r(V,` of the same shape (you can consider
these as image features). Next, so-called `),Ir=a(V,"STRONG",{});var vg=i(Ir);oc=r(vg,"object queries"),vg.forEach(t),nc=r(V,` are sent through the decoder. This is a tensor of shape
`),Nr=a(V,"CODE",{});var yg=i(Nr);rc=r(yg,"(batch_size, num_queries, d_model)"),yg.forEach(t),sc=r(V,", with "),Ar=a(V,"CODE",{});var Dg=i(Ar);ac=r(Dg,"num_queries"),Dg.forEach(t),ic=r(V,` typically set to 100 and initialized with zeros.
These input embeddings are learnt positional encodings that the authors refer to as object queries, and similarly to
the encoder, they are added to the input of each attention layer. Each object query will look for a particular object
in the image. The decoder updates these embeddings through multiple self-attention and encoder-decoder attention layers
to output `),Sr=a(V,"CODE",{});var wg=i(Sr);dc=r(wg,"decoder_hidden_states"),wg.forEach(t),cc=r(V," of the same shape: "),Lr=a(V,"CODE",{});var Tg=i(Lr);lc=r(Tg,"(batch_size, num_queries, d_model)"),Tg.forEach(t),hc=r(V,`. Next, two heads
are added on top for object detection: a linear layer for classifying each object query into one of the objects or \u201Cno
object\u201D, and a MLP to predict bounding boxes for each query.`),V.forEach(t),Ua=c(o),J=a(o,"P",{});var xt=i(J);mc=r(xt,"The model is trained using a "),Rr=a(xt,"STRONG",{});var xg=i(Rr);pc=r(xg,"bipartite matching loss"),xg.forEach(t),fc=r(xt,`: so what we actually do is compare the predicted classes +
bounding boxes of each of the N = 100 object queries to the ground truth annotations, padded up to the same length N
(so if an image only contains 4 objects, 96 annotations will just have a \u201Cno object\u201D as class and \u201Cno bounding box\u201D as
bounding box). The `),Bt=a(xt,"A",{href:!0,rel:!0});var Eg=i(Bt);uc=r(Eg,"Hungarian matching algorithm"),Eg.forEach(t),gc=r(xt,` is used to find
an optimal one-to-one mapping of each of the N queries to each of the N annotations. Next, standard cross-entropy (for
the classes) and a linear combination of the L1 and `),Yt=a(xt,"A",{href:!0,rel:!0});var $g=i(Yt);_c=r($g,"generalized IoU loss"),$g.forEach(t),bc=r(xt,` (for the
bounding boxes) are used to optimize the parameters of the model.`),xt.forEach(t),Ha=c(o),K=a(o,"P",{});var Et=i(K);vc=r(Et,`DETR can be naturally extended to perform panoptic segmentation (which unifies semantic segmentation and instance
segmentation). `),gn=a(Et,"A",{href:!0});var kg=i(gn);yc=r(kg,"DetrForSegmentation"),kg.forEach(t),Dc=r(Et,` adds a segmentation mask head on top of
`),_n=a(Et,"A",{href:!0});var jg=i(_n);wc=r(jg,"DetrForObjectDetection"),jg.forEach(t),Tc=r(Et,`. The mask head can be trained either jointly, or in a two steps process,
where one first trains a `),bn=a(Et,"A",{href:!0});var Fg=i(bn);xc=r(Fg,"DetrForObjectDetection"),Fg.forEach(t),Ec=r(Et,` model to detect bounding boxes around both
\u201Cthings\u201D (instances) and \u201Cstuff\u201D (background things like trees, roads, sky), then freeze all the weights and train only
the mask head for 25 epochs. Experimentally, these two approaches give similar results. Note that predicting boxes is
required for the training to be possible, since the Hungarian matching is computed using distances between boxes.`),Et.forEach(t),Ga=c(o),vn=a(o,"P",{});var Og=i(vn);$c=r(Og,"Tips:"),Og.forEach(t),Va=c(o),F=a(o,"UL",{});var S=i(F);re=a(S,"LI",{});var $t=i(re);kc=r($t,"DETR uses so-called "),Mr=a($t,"STRONG",{});var zg=i(Mr);jc=r(zg,"object queries"),zg.forEach(t),Fc=r($t,` to detect objects in an image. The number of queries determines the maximum
number of objects that can be detected in a single image, and is set to 100 by default (see parameter
`),Ur=a($t,"CODE",{});var Cg=i(Ur);Oc=r(Cg,"num_queries"),Cg.forEach(t),zc=r($t," of "),yn=a($t,"A",{href:!0});var Pg=i(yn);Cc=r(Pg,"DetrConfig"),Pg.forEach(t),Pc=r($t,`). Note that it\u2019s good to have some slack (in COCO, the
authors used 100, while the maximum number of objects in a COCO image is ~70).`),$t.forEach(t),qc=c(S),Hr=a(S,"LI",{});var qg=i(Hr);Ic=r(qg,`The decoder of DETR updates the query embeddings in parallel. This is different from language models like GPT-2,
which use autoregressive decoding instead of parallel. Hence, no causal attention mask is used.`),qg.forEach(t),Nc=c(S),se=a(S,"LI",{});var kt=i(se);Ac=r(kt,`DETR adds position embeddings to the hidden states at each self-attention and cross-attention layer before projecting
to queries and keys. For the position embeddings of the image, one can choose between fixed sinusoidal or learned
absolute position embeddings. By default, the parameter `),Gr=a(kt,"CODE",{});var Ig=i(Gr);Sc=r(Ig,"position_embedding_type"),Ig.forEach(t),Lc=r(kt,` of
`),Dn=a(kt,"A",{href:!0});var Ng=i(Dn);Rc=r(Ng,"DetrConfig"),Ng.forEach(t),Mc=r(kt," is set to "),Vr=a(kt,"CODE",{});var Ag=i(Vr);Uc=r(Ag,'"sine"'),Ag.forEach(t),Hc=r(kt,"."),kt.forEach(t),Gc=c(S),ae=a(S,"LI",{});var jt=i(ae);Vc=r(jt,`During training, the authors of DETR did find it helpful to use auxiliary losses in the decoder, especially to help
the model output the correct number of objects of each class. If you set the parameter `),Wr=a(jt,"CODE",{});var Sg=i(Wr);Wc=r(Sg,"auxiliary_loss"),Sg.forEach(t),Bc=r(jt,` of
`),wn=a(jt,"A",{href:!0});var Lg=i(wn);Yc=r(Lg,"DetrConfig"),Lg.forEach(t),Qc=r(jt," to "),Br=a(jt,"CODE",{});var Rg=i(Br);Jc=r(Rg,"True"),Rg.forEach(t),Kc=r(jt,`, then prediction feedforward neural networks and Hungarian losses
are added after each decoder layer (with the FFNs sharing parameters).`),jt.forEach(t),Xc=c(S),Y=a(S,"LI",{});var ve=i(Y);Zc=r(ve,`If you want to train the model in a distributed environment across multiple nodes, then one should update the
`),Yr=a(ve,"EM",{});var Mg=i(Yr);el=r(Mg,"num_boxes"),Mg.forEach(t),tl=r(ve," variable in the "),Qr=a(ve,"EM",{});var Ug=i(Qr);ol=r(Ug,"DetrLoss"),Ug.forEach(t),nl=r(ve," class of "),Jr=a(ve,"EM",{});var Hg=i(Jr);rl=r(Hg,"modeling_detr.py"),Hg.forEach(t),sl=r(ve,`. When training on multiple nodes, this should be
set to the average number of target boxes across all nodes, as can be seen in the original implementation `),Qt=a(ve,"A",{href:!0,rel:!0});var Gg=i(Qt);al=r(Gg,"here"),Gg.forEach(t),il=r(ve,"."),ve.forEach(t),dl=c(S),A=a(S,"LI",{});var Q=i(A);Tn=a(Q,"A",{href:!0});var Vg=i(Tn);cl=r(Vg,"DetrForObjectDetection"),Vg.forEach(t),ll=r(Q," and "),xn=a(Q,"A",{href:!0});var Wg=i(xn);hl=r(Wg,"DetrForSegmentation"),Wg.forEach(t),ml=r(Q,` can be initialized with
any convolutional backbone available in the `),Jt=a(Q,"A",{href:!0,rel:!0});var Bg=i(Jt);pl=r(Bg,"timm library"),Bg.forEach(t),fl=r(Q,`.
Initializing with a MobileNet backbone for example can be done by setting the `),Kr=a(Q,"CODE",{});var Yg=i(Kr);ul=r(Yg,"backbone"),Yg.forEach(t),gl=r(Q,` attribute of
`),En=a(Q,"A",{href:!0});var Qg=i(En);_l=r(Qg,"DetrConfig"),Qg.forEach(t),bl=r(Q," to "),Xr=a(Q,"CODE",{});var Jg=i(Xr);vl=r(Jg,'"tf_mobilenetv3_small_075"'),Jg.forEach(t),yl=r(Q,`, and then initializing the model with that
config.`),Q.forEach(t),Dl=c(S),ie=a(S,"LI",{});var Ft=i(ie);wl=r(Ft,`DETR resizes the input images such that the shortest side is at least a certain amount of pixels while the longest is
at most 1333 pixels. At training time, scale augmentation is used such that the shortest side is randomly set to at
least 480 and at most 800 pixels. At inference time, the shortest side is set to 800. One can use
`),$n=a(Ft,"A",{href:!0});var Kg=i($n);Tl=r(Kg,"DetrImageProcessor"),Kg.forEach(t),xl=r(Ft,` to prepare images (and optional annotations in COCO format) for the
model. Due to this resizing, images in a batch can have different sizes. DETR solves this by padding images up to the
largest size in a batch, and by creating a pixel mask that indicates which pixels are real/which are padding.
Alternatively, one can also define a custom `),Zr=a(Ft,"CODE",{});var Xg=i(Zr);El=r(Xg,"collate_fn"),Xg.forEach(t),$l=r(Ft,` in order to batch images together, using
`),kn=a(Ft,"A",{href:!0});var Zg=i(kn);kl=r(Zg,"pad_and_create_pixel_mask()"),Zg.forEach(t),jl=r(Ft,"."),Ft.forEach(t),Fl=c(S),Ee=a(S,"LI",{});var fr=i(Ee);Ol=r(fr,"The size of the images will determine the amount of memory being used, and will thus determine the "),es=a(fr,"CODE",{});var e_=i(es);zl=r(e_,"batch_size"),e_.forEach(t),Cl=r(fr,`.
It is advised to use a batch size of 2 per GPU. See `),Kt=a(fr,"A",{href:!0,rel:!0});var t_=i(Kt);Pl=r(t_,"this Github thread"),t_.forEach(t),ql=r(fr," for more info."),fr.forEach(t),S.forEach(t),Wa=c(o),jn=a(o,"P",{});var o_=i(jn);Il=r(o_,"There are three ways to instantiate a DETR model (depending on what you prefer):"),o_.forEach(t),Ba=c(o),Fn=a(o,"P",{});var n_=i(Fn);Nl=r(n_,"Option 1: Instantiate DETR with pre-trained weights for entire model"),n_.forEach(t),Ya=c(o),b(Xt.$$.fragment,o),Qa=c(o),On=a(o,"P",{});var r_=i(On);Al=r(r_,"Option 2: Instantiate DETR with randomly initialized weights for Transformer, but pre-trained weights for backbone"),r_.forEach(t),Ja=c(o),b(Zt.$$.fragment,o),Ka=c(o),zn=a(o,"P",{});var s_=i(zn);Sl=r(s_,"Option 3: Instantiate DETR with randomly initialized weights for backbone + Transformer"),s_.forEach(t),Xa=c(o),b(eo.$$.fragment,o),Za=c(o),Cn=a(o,"P",{});var a_=i(Cn);Ll=r(a_,"As a summary, consider the following table:"),a_.forEach(t),ei=c(o),Ye=a(o,"TABLE",{});var $i=i(Ye);ts=a($i,"THEAD",{});var i_=i(ts);de=a(i_,"TR",{});var Ot=i(de);os=a(Ot,"TH",{});var d_=i(os);Rl=r(d_,"Task"),d_.forEach(t),Ml=c(Ot),ns=a(Ot,"TH",{});var c_=i(ns);Ul=r(c_,"Object detection"),c_.forEach(t),Hl=c(Ot),rs=a(Ot,"TH",{});var l_=i(rs);Gl=r(l_,"Instance segmentation"),l_.forEach(t),Vl=c(Ot),ss=a(Ot,"TH",{});var h_=i(ss);Wl=r(h_,"Panoptic segmentation"),h_.forEach(t),Ot.forEach(t),i_.forEach(t),Bl=c($i),L=a($i,"TBODY",{});var te=i(L);ce=a(te,"TR",{});var zt=i(ce);as=a(zt,"TD",{});var m_=i(as);is=a(m_,"STRONG",{});var p_=i(is);Yl=r(p_,"Description"),p_.forEach(t),m_.forEach(t),Ql=c(zt),ds=a(zt,"TD",{});var f_=i(ds);Jl=r(f_,"Predicting bounding boxes and class labels around objects in an image"),f_.forEach(t),Kl=c(zt),cs=a(zt,"TD",{});var u_=i(cs);Xl=r(u_,"Predicting masks around objects (i.e. instances) in an image"),u_.forEach(t),Zl=c(zt),ls=a(zt,"TD",{});var g_=i(ls);eh=r(g_,"Predicting masks around both objects (i.e. instances) as well as \u201Cstuff\u201D (i.e. background things like trees and roads) in an image"),g_.forEach(t),zt.forEach(t),th=c(te),le=a(te,"TR",{});var Ct=i(le);hs=a(Ct,"TD",{});var __=i(hs);ms=a(__,"STRONG",{});var b_=i(ms);oh=r(b_,"Model"),b_.forEach(t),__.forEach(t),nh=c(Ct),ps=a(Ct,"TD",{});var v_=i(ps);Pn=a(v_,"A",{href:!0});var y_=i(Pn);rh=r(y_,"DetrForObjectDetection"),y_.forEach(t),v_.forEach(t),sh=c(Ct),fs=a(Ct,"TD",{});var D_=i(fs);qn=a(D_,"A",{href:!0});var w_=i(qn);ah=r(w_,"DetrForSegmentation"),w_.forEach(t),D_.forEach(t),ih=c(Ct),us=a(Ct,"TD",{});var T_=i(us);In=a(T_,"A",{href:!0});var x_=i(In);dh=r(x_,"DetrForSegmentation"),x_.forEach(t),T_.forEach(t),Ct.forEach(t),ch=c(te),he=a(te,"TR",{});var Pt=i(he);gs=a(Pt,"TD",{});var E_=i(gs);_s=a(E_,"STRONG",{});var $_=i(_s);lh=r($_,"Example dataset"),$_.forEach(t),E_.forEach(t),hh=c(Pt),bs=a(Pt,"TD",{});var k_=i(bs);mh=r(k_,"COCO detection"),k_.forEach(t),ph=c(Pt),vs=a(Pt,"TD",{});var j_=i(vs);fh=r(j_,"COCO detection, COCO panoptic"),j_.forEach(t),uh=c(Pt),ys=a(Pt,"TD",{});var F_=i(ys);gh=r(F_,"COCO panoptic"),F_.forEach(t),Pt.forEach(t),_h=c(te),me=a(te,"TR",{});var qt=i(me);to=a(qt,"TD",{});var ki=i(to);Ds=a(ki,"STRONG",{});var O_=i(Ds);bh=r(O_,"Format of annotations to provide to"),O_.forEach(t),vh=c(ki),Nn=a(ki,"A",{href:!0});var z_=i(Nn);yh=r(z_,"DetrImageProcessor"),z_.forEach(t),ki.forEach(t),Dh=c(qt),$e=a(qt,"TD",{});var ur=i($e);wh=r(ur,"{\u2018image_id\u2019: "),ws=a(ur,"CODE",{});var C_=i(ws);Th=r(C_,"int"),C_.forEach(t),xh=r(ur,", \u2018annotations\u2019: "),Ts=a(ur,"CODE",{});var P_=i(Ts);Eh=r(P_,"List[Dict]"),P_.forEach(t),$h=r(ur,"} each Dict being a COCO object annotation"),ur.forEach(t),kh=c(qt),R=a(qt,"TD",{});var oe=i(R);jh=r(oe,"{\u2018image_id\u2019: "),xs=a(oe,"CODE",{});var q_=i(xs);Fh=r(q_,"int"),q_.forEach(t),Oh=r(oe,", \u2018annotations\u2019: "),Es=a(oe,"CODE",{});var I_=i(Es);zh=r(I_,"List[Dict]"),I_.forEach(t),Ch=r(oe,"}  (in case of COCO detection) or {\u2018file_name\u2019: "),$s=a(oe,"CODE",{});var N_=i($s);Ph=r(N_,"str"),N_.forEach(t),qh=r(oe,", \u2018image_id\u2019: "),ks=a(oe,"CODE",{});var A_=i(ks);Ih=r(A_,"int"),A_.forEach(t),Nh=r(oe,", \u2018segments_info\u2019: "),js=a(oe,"CODE",{});var S_=i(js);Ah=r(S_,"List[Dict]"),S_.forEach(t),Sh=r(oe,"} (in case of COCO panoptic)"),oe.forEach(t),Lh=c(qt),pe=a(qt,"TD",{});var It=i(pe);Rh=r(It,"{\u2018file_name\u2019: "),Fs=a(It,"CODE",{});var L_=i(Fs);Mh=r(L_,"str"),L_.forEach(t),Uh=r(It,", \u2018image_id\u2019: "),Os=a(It,"CODE",{});var R_=i(Os);Hh=r(R_,"int"),R_.forEach(t),Gh=r(It,", \u2018segments_info\u2019: "),zs=a(It,"CODE",{});var M_=i(zs);Vh=r(M_,"List[Dict]"),M_.forEach(t),Wh=r(It,"} and masks_path (path to directory containing PNG files of the masks)"),It.forEach(t),qt.forEach(t),Bh=c(te),fe=a(te,"TR",{});var Nt=i(fe);An=a(Nt,"TD",{});var Zu=i(An);Cs=a(Zu,"STRONG",{});var U_=i(Cs);Yh=r(U_,"Postprocessing"),U_.forEach(t),Qh=r(Zu," (i.e. converting the output of the model to COCO API)"),Zu.forEach(t),Jh=c(Nt),Ps=a(Nt,"TD",{});var H_=i(Ps);qs=a(H_,"CODE",{});var G_=i(qs);Kh=r(G_,"post_process()"),G_.forEach(t),H_.forEach(t),Xh=c(Nt),Is=a(Nt,"TD",{});var V_=i(Is);Ns=a(V_,"CODE",{});var W_=i(Ns);Zh=r(W_,"post_process_segmentation()"),W_.forEach(t),V_.forEach(t),em=c(Nt),oo=a(Nt,"TD",{});var ji=i(oo);As=a(ji,"CODE",{});var B_=i(As);tm=r(B_,"post_process_segmentation()"),B_.forEach(t),om=r(ji,", "),Ss=a(ji,"CODE",{});var Y_=i(Ss);nm=r(Y_,"post_process_panoptic()"),Y_.forEach(t),ji.forEach(t),Nt.forEach(t),rm=c(te),ue=a(te,"TR",{});var At=i(ue);Ls=a(At,"TD",{});var Q_=i(Ls);Rs=a(Q_,"STRONG",{});var J_=i(Rs);sm=r(J_,"evaluators"),J_.forEach(t),Q_.forEach(t),am=c(At),no=a(At,"TD",{});var Fi=i(no);Ms=a(Fi,"CODE",{});var K_=i(Ms);im=r(K_,"CocoEvaluator"),K_.forEach(t),dm=r(Fi," with "),Us=a(Fi,"CODE",{});var X_=i(Us);cm=r(X_,'iou_types="bbox"'),X_.forEach(t),Fi.forEach(t),lm=c(At),ke=a(At,"TD",{});var gr=i(ke);Hs=a(gr,"CODE",{});var Z_=i(Hs);hm=r(Z_,"CocoEvaluator"),Z_.forEach(t),mm=r(gr," with "),Gs=a(gr,"CODE",{});var eb=i(Gs);pm=r(eb,'iou_types="bbox"'),eb.forEach(t),fm=r(gr," or "),Vs=a(gr,"CODE",{});var tb=i(Vs);um=r(tb,'"segm"'),tb.forEach(t),gr.forEach(t),gm=c(At),ge=a(At,"TD",{});var St=i(ge);Ws=a(St,"CODE",{});var ob=i(Ws);_m=r(ob,"CocoEvaluator"),ob.forEach(t),bm=r(St," with "),Bs=a(St,"CODE",{});var nb=i(Bs);vm=r(nb,'iou_tupes="bbox"'),nb.forEach(t),ym=r(St," or "),Ys=a(St,"CODE",{});var rb=i(Ys);Dm=r(rb,'"segm"'),rb.forEach(t),wm=r(St,", "),Qs=a(St,"CODE",{});var sb=i(Qs);Tm=r(sb,"PanopticEvaluator"),sb.forEach(t),St.forEach(t),At.forEach(t),te.forEach(t),$i.forEach(t),ti=c(o),k=a(o,"P",{});var O=i(k);xm=r(O,`In short, one should prepare the data either in COCO detection or COCO panoptic format, then use
`),Sn=a(O,"A",{href:!0});var ab=i(Sn);Em=r(ab,"DetrImageProcessor"),ab.forEach(t),$m=r(O," to create "),Js=a(O,"CODE",{});var ib=i(Js);km=r(ib,"pixel_values"),ib.forEach(t),jm=r(O,", "),Ks=a(O,"CODE",{});var db=i(Ks);Fm=r(db,"pixel_mask"),db.forEach(t),Om=r(O,` and optional
`),Xs=a(O,"CODE",{});var cb=i(Xs);zm=r(cb,"labels"),cb.forEach(t),Cm=r(O,`, which can then be used to train (or fine-tune) a model. For evaluation, one should first convert the
outputs of the model using one of the postprocessing methods of `),Ln=a(O,"A",{href:!0});var lb=i(Ln);Pm=r(lb,"DetrImageProcessor"),lb.forEach(t),qm=r(O,`. These can
be be provided to either `),Zs=a(O,"CODE",{});var hb=i(Zs);Im=r(hb,"CocoEvaluator"),hb.forEach(t),Nm=r(O," or "),ea=a(O,"CODE",{});var mb=i(ea);Am=r(mb,"PanopticEvaluator"),mb.forEach(t),Sm=r(O,`, which allow you to calculate metrics like
mean Average Precision (mAP) and Panoptic Quality (PQ). The latter objects are implemented in the `),ro=a(O,"A",{href:!0,rel:!0});var pb=i(ro);Lm=r(pb,"original repository"),pb.forEach(t),Rm=r(O,". See the "),so=a(O,"A",{href:!0,rel:!0});var fb=i(so);Mm=r(fb,"example notebooks"),fb.forEach(t),Um=r(O," for more info regarding evaluation."),O.forEach(t),oi=c(o),je=a(o,"H2",{class:!0});var Oi=i(je);Qe=a(Oi,"A",{id:!0,class:!0,href:!0});var ub=i(Qe);ta=a(ub,"SPAN",{});var gb=i(ta);b(ao.$$.fragment,gb),gb.forEach(t),ub.forEach(t),Hm=c(Oi),oa=a(Oi,"SPAN",{});var _b=i(oa);Gm=r(_b,"Resources"),_b.forEach(t),Oi.forEach(t),ni=c(o),Rn=a(o,"P",{});var bb=i(Rn);Vm=r(bb,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DETR."),bb.forEach(t),ri=c(o),b(io.$$.fragment,o),si=c(o),Je=a(o,"UL",{});var zi=i(Je);_e=a(zi,"LI",{});var Lt=i(_e);Wm=r(Lt,"All example notebooks illustrating fine-tuning "),Mn=a(Lt,"A",{href:!0});var vb=i(Mn);Bm=r(vb,"DetrForObjectDetection"),vb.forEach(t),Ym=r(Lt," and "),Un=a(Lt,"A",{href:!0});var yb=i(Un);Qm=r(yb,"DetrForSegmentation"),yb.forEach(t),Jm=r(Lt," on a custom dataset an be found "),co=a(Lt,"A",{href:!0,rel:!0});var Db=i(co);Km=r(Db,"here"),Db.forEach(t),Xm=r(Lt,"."),Lt.forEach(t),Zm=c(zi),Hn=a(zi,"LI",{});var eg=i(Hn);ep=r(eg,"See also: "),Gn=a(eg,"A",{href:!0});var wb=i(Gn);tp=r(wb,"Object detection task guide"),wb.forEach(t),eg.forEach(t),zi.forEach(t),ai=c(o),Vn=a(o,"P",{});var Tb=i(Vn);op=r(Tb,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Tb.forEach(t),ii=c(o),Fe=a(o,"H2",{class:!0});var Ci=i(Fe);Ke=a(Ci,"A",{id:!0,class:!0,href:!0});var xb=i(Ke);na=a(xb,"SPAN",{});var Eb=i(na);b(lo.$$.fragment,Eb),Eb.forEach(t),xb.forEach(t),np=c(Ci),ra=a(Ci,"SPAN",{});var $b=i(ra);rp=r($b,"DETR specific outputs"),$b.forEach(t),Ci.forEach(t),di=c(o),Oe=a(o,"DIV",{class:!0});var Pi=i(Oe);b(ho.$$.fragment,Pi),sp=c(Pi),sa=a(Pi,"P",{});var kb=i(sa);ap=r(kb,`Base class for outputs of the DETR encoder-decoder model. This class adds one attribute to Seq2SeqModelOutput,
namely an optional stack of intermediate decoder activations, i.e. the output of each decoder layer, each of them
gone through a layernorm. This is useful when training the model with auxiliary decoding losses.`),kb.forEach(t),Pi.forEach(t),ci=c(o),ze=a(o,"DIV",{class:!0});var qi=i(ze);b(mo.$$.fragment,qi),ip=c(qi),po=a(qi,"P",{});var Ii=i(po);dp=r(Ii,"Output type of "),Wn=a(Ii,"A",{href:!0});var jb=i(Wn);cp=r(jb,"DetrForObjectDetection"),jb.forEach(t),lp=r(Ii,"."),Ii.forEach(t),qi.forEach(t),li=c(o),Ce=a(o,"DIV",{class:!0});var Ni=i(Ce);b(fo.$$.fragment,Ni),hp=c(Ni),uo=a(Ni,"P",{});var Ai=i(uo);mp=r(Ai,"Output type of "),Bn=a(Ai,"A",{href:!0});var Fb=i(Bn);pp=r(Fb,"DetrForSegmentation"),Fb.forEach(t),fp=r(Ai,"."),Ai.forEach(t),Ni.forEach(t),hi=c(o),Pe=a(o,"H2",{class:!0});var Si=i(Pe);Xe=a(Si,"A",{id:!0,class:!0,href:!0});var Ob=i(Xe);aa=a(Ob,"SPAN",{});var zb=i(aa);b(go.$$.fragment,zb),zb.forEach(t),Ob.forEach(t),up=c(Si),ia=a(Si,"SPAN",{});var Cb=i(ia);gp=r(Cb,"DetrConfig"),Cb.forEach(t),Si.forEach(t),mi=c(o),I=a(o,"DIV",{class:!0});var ne=i(I);b(_o.$$.fragment,ne),_p=c(ne),qe=a(ne,"P",{});var _r=i(qe);bp=r(_r,"This is the configuration class to store the configuration of a "),Yn=a(_r,"A",{href:!0});var Pb=i(Yn);vp=r(Pb,"DetrModel"),Pb.forEach(t),yp=r(_r,`. It is used to instantiate a DETR
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 DETR
`),bo=a(_r,"A",{href:!0,rel:!0});var qb=i(bo);Dp=r(qb,"facebook/detr-resnet-50"),qb.forEach(t),wp=r(_r," architecture."),_r.forEach(t),Tp=c(ne),Ie=a(ne,"P",{});var br=i(Ie);xp=r(br,"Configuration objects inherit from "),Qn=a(br,"A",{href:!0});var Ib=i(Qn);Ep=r(Ib,"PretrainedConfig"),Ib.forEach(t),$p=r(br,` and can be used to control the model outputs. Read the
documentation from `),Jn=a(br,"A",{href:!0});var Nb=i(Jn);kp=r(Nb,"PretrainedConfig"),Nb.forEach(t),jp=r(br," for more information."),br.forEach(t),Fp=c(ne),b(Ze.$$.fragment,ne),Op=c(ne),et=a(ne,"DIV",{class:!0});var Li=i(et);b(vo.$$.fragment,Li),zp=c(Li),yo=a(Li,"P",{});var Ri=i(yo);Cp=r(Ri,"Instantiate a "),Kn=a(Ri,"A",{href:!0});var Ab=i(Kn);Pp=r(Ab,"DetrConfig"),Ab.forEach(t),qp=r(Ri," (or a derived class) from a pre-trained backbone model configuration."),Ri.forEach(t),Li.forEach(t),Ip=c(ne),tt=a(ne,"DIV",{class:!0});var Mi=i(tt);b(Do.$$.fragment,Mi),Np=c(Mi),Ne=a(Mi,"P",{});var vr=i(Ne);Ap=r(vr,"Serializes this instance to a Python dictionary. Override the default "),Xn=a(vr,"A",{href:!0});var Sb=i(Xn);Sp=r(Sb,"to_dict()"),Sb.forEach(t),Lp=r(vr,`. Returns:
`),da=a(vr,"CODE",{});var Lb=i(da);Rp=r(Lb,"Dict[str, any]"),Lb.forEach(t),Mp=r(vr,": Dictionary of all the attributes that make up this configuration instance,"),vr.forEach(t),Mi.forEach(t),ne.forEach(t),pi=c(o),Ae=a(o,"H2",{class:!0});var Ui=i(Ae);ot=a(Ui,"A",{id:!0,class:!0,href:!0});var Rb=i(ot);ca=a(Rb,"SPAN",{});var Mb=i(ca);b(wo.$$.fragment,Mb),Mb.forEach(t),Rb.forEach(t),Up=c(Ui),la=a(Ui,"SPAN",{});var Ub=i(la);Hp=r(Ub,"DetrImageProcessor"),Ub.forEach(t),Ui.forEach(t),fi=c(o),z=a(o,"DIV",{class:!0});var W=i(z);b(To.$$.fragment,W),Gp=c(W),ha=a(W,"P",{});var Hb=i(ha);Vp=r(Hb,"Constructs a Detr image processor."),Hb.forEach(t),Wp=c(W),nt=a(W,"DIV",{class:!0});var Hi=i(nt);b(xo.$$.fragment,Hi),Bp=c(Hi),ma=a(Hi,"P",{});var Gb=i(ma);Yp=r(Gb,"Preprocess an image or a batch of images so that it can be used by the model."),Gb.forEach(t),Hi.forEach(t),Qp=c(W),rt=a(W,"DIV",{class:!0});var Gi=i(rt);b(Eo.$$.fragment,Gi),Jp=c(Gi),$o=a(Gi,"P",{});var Vi=i($o);Kp=r(Vi,"Converts the raw output of "),Zn=a(Vi,"A",{href:!0});var Vb=i(Zn);Xp=r(Vb,"DetrForObjectDetection"),Vb.forEach(t),Zp=r(Vi,` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Vi.forEach(t),Gi.forEach(t),ef=c(W),st=a(W,"DIV",{class:!0});var Wi=i(st);b(ko.$$.fragment,Wi),tf=c(Wi),jo=a(Wi,"P",{});var Bi=i(jo);of=r(Bi,"Converts the output of "),er=a(Bi,"A",{href:!0});var Wb=i(er);nf=r(Wb,"DetrForSegmentation"),Wb.forEach(t),rf=r(Bi," into semantic segmentation maps. Only supports PyTorch."),Bi.forEach(t),Wi.forEach(t),sf=c(W),at=a(W,"DIV",{class:!0});var Yi=i(at);b(Fo.$$.fragment,Yi),af=c(Yi),Oo=a(Yi,"P",{});var Qi=i(Oo);df=r(Qi,"Converts the output of "),tr=a(Qi,"A",{href:!0});var Bb=i(tr);cf=r(Bb,"DetrForSegmentation"),Bb.forEach(t),lf=r(Qi," into instance segmentation predictions. Only supports PyTorch."),Qi.forEach(t),Yi.forEach(t),hf=c(W),it=a(W,"DIV",{class:!0});var Ji=i(it);b(zo.$$.fragment,Ji),mf=c(Ji),Co=a(Ji,"P",{});var Ki=i(Co);pf=r(Ki,"Converts the output of "),or=a(Ki,"A",{href:!0});var Yb=i(or);ff=r(Yb,"DetrForSegmentation"),Yb.forEach(t),uf=r(Ki,` into image panoptic segmentation predictions. Only supports
PyTorch.`),Ki.forEach(t),Ji.forEach(t),W.forEach(t),ui=c(o),Se=a(o,"H2",{class:!0});var Xi=i(Se);dt=a(Xi,"A",{id:!0,class:!0,href:!0});var Qb=i(dt);pa=a(Qb,"SPAN",{});var Jb=i(pa);b(Po.$$.fragment,Jb),Jb.forEach(t),Qb.forEach(t),gf=c(Xi),fa=a(Xi,"SPAN",{});var Kb=i(fa);_f=r(Kb,"DetrFeatureExtractor"),Kb.forEach(t),Xi.forEach(t),gi=c(o),C=a(o,"DIV",{class:!0});var B=i(C);b(qo.$$.fragment,B),bf=c(B),ct=a(B,"DIV",{class:!0});var Zi=i(ct);b(Io.$$.fragment,Zi),vf=c(Zi),ua=a(Zi,"P",{});var Xb=i(ua);yf=r(Xb,"Preprocess an image or a batch of images."),Xb.forEach(t),Zi.forEach(t),Df=c(B),lt=a(B,"DIV",{class:!0});var ed=i(lt);b(No.$$.fragment,ed),wf=c(ed),ga=a(ed,"P",{});var Zb=i(ga);Tf=r(Zb,`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),Zb.forEach(t),ed.forEach(t),xf=c(B),ht=a(B,"DIV",{class:!0});var td=i(ht);b(Ao.$$.fragment,td),Ef=c(td),So=a(td,"P",{});var od=i(So);$f=r(od,"Converts the raw output of "),nr=a(od,"A",{href:!0});var ev=i(nr);kf=r(ev,"DetrForObjectDetection"),ev.forEach(t),jf=r(od,` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),od.forEach(t),td.forEach(t),Ff=c(B),mt=a(B,"DIV",{class:!0});var nd=i(mt);b(Lo.$$.fragment,nd),Of=c(nd),Ro=a(nd,"P",{});var rd=i(Ro);zf=r(rd,"Converts the output of "),rr=a(rd,"A",{href:!0});var tv=i(rr);Cf=r(tv,"DetrForSegmentation"),tv.forEach(t),Pf=r(rd," into semantic segmentation maps. Only supports PyTorch."),rd.forEach(t),nd.forEach(t),qf=c(B),pt=a(B,"DIV",{class:!0});var sd=i(pt);b(Mo.$$.fragment,sd),If=c(sd),Uo=a(sd,"P",{});var ad=i(Uo);Nf=r(ad,"Converts the output of "),sr=a(ad,"A",{href:!0});var ov=i(sr);Af=r(ov,"DetrForSegmentation"),ov.forEach(t),Sf=r(ad," into instance segmentation predictions. Only supports PyTorch."),ad.forEach(t),sd.forEach(t),Lf=c(B),ft=a(B,"DIV",{class:!0});var id=i(ft);b(Ho.$$.fragment,id),Rf=c(id),Go=a(id,"P",{});var dd=i(Go);Mf=r(dd,"Converts the output of "),ar=a(dd,"A",{href:!0});var nv=i(ar);Uf=r(nv,"DetrForSegmentation"),nv.forEach(t),Hf=r(dd,` into image panoptic segmentation predictions. Only supports
PyTorch.`),dd.forEach(t),id.forEach(t),B.forEach(t),_i=c(o),Le=a(o,"H2",{class:!0});var cd=i(Le);ut=a(cd,"A",{id:!0,class:!0,href:!0});var rv=i(ut);_a=a(rv,"SPAN",{});var sv=i(_a);b(Vo.$$.fragment,sv),sv.forEach(t),rv.forEach(t),Gf=c(cd),ba=a(cd,"SPAN",{});var av=i(ba);Vf=r(av,"DetrModel"),av.forEach(t),cd.forEach(t),bi=c(o),M=a(o,"DIV",{class:!0});var ye=i(M);b(Wo.$$.fragment,ye),Wf=c(ye),va=a(ye,"P",{});var iv=i(va);Bf=r(iv,`The bare DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw hidden-states without
any specific head on top.`),iv.forEach(t),Yf=c(ye),Bo=a(ye,"P",{});var ld=i(Bo);Qf=r(ld,"This model inherits from "),ir=a(ld,"A",{href:!0});var dv=i(ir);Jf=r(dv,"PreTrainedModel"),dv.forEach(t),Kf=r(ld,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ld.forEach(t),Xf=c(ye),Yo=a(ye,"P",{});var hd=i(Yo);Zf=r(hd,"This model is also a PyTorch "),Qo=a(hd,"A",{href:!0,rel:!0});var cv=i(Qo);eu=r(cv,"torch.nn.Module"),cv.forEach(t),tu=r(hd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hd.forEach(t),ou=c(ye),X=a(ye,"DIV",{class:!0});var Rt=i(X);b(Jo.$$.fragment,Rt),nu=c(Rt),Re=a(Rt,"P",{});var yr=i(Re);ru=r(yr,"The "),dr=a(yr,"A",{href:!0});var lv=i(dr);su=r(lv,"DetrModel"),lv.forEach(t),au=r(yr," forward method, overrides the "),ya=a(yr,"CODE",{});var hv=i(ya);iu=r(hv,"__call__"),hv.forEach(t),du=r(yr," special method."),yr.forEach(t),cu=c(Rt),b(gt.$$.fragment,Rt),lu=c(Rt),b(_t.$$.fragment,Rt),Rt.forEach(t),ye.forEach(t),vi=c(o),Me=a(o,"H2",{class:!0});var md=i(Me);bt=a(md,"A",{id:!0,class:!0,href:!0});var mv=i(bt);Da=a(mv,"SPAN",{});var pv=i(Da);b(Ko.$$.fragment,pv),pv.forEach(t),mv.forEach(t),hu=c(md),wa=a(md,"SPAN",{});var fv=i(wa);mu=r(fv,"DetrForObjectDetection"),fv.forEach(t),md.forEach(t),yi=c(o),U=a(o,"DIV",{class:!0});var De=i(U);b(Xo.$$.fragment,De),pu=c(De),Ta=a(De,"P",{});var uv=i(Ta);fu=r(uv,`DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on top, for tasks
such as COCO detection.`),uv.forEach(t),uu=c(De),Zo=a(De,"P",{});var pd=i(Zo);gu=r(pd,"This model inherits from "),cr=a(pd,"A",{href:!0});var gv=i(cr);_u=r(gv,"PreTrainedModel"),gv.forEach(t),bu=r(pd,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pd.forEach(t),vu=c(De),en=a(De,"P",{});var fd=i(en);yu=r(fd,"This model is also a PyTorch "),tn=a(fd,"A",{href:!0,rel:!0});var _v=i(tn);Du=r(_v,"torch.nn.Module"),_v.forEach(t),wu=r(fd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fd.forEach(t),Tu=c(De),Z=a(De,"DIV",{class:!0});var Mt=i(Z);b(on.$$.fragment,Mt),xu=c(Mt),Ue=a(Mt,"P",{});var Dr=i(Ue);Eu=r(Dr,"The "),lr=a(Dr,"A",{href:!0});var bv=i(lr);$u=r(bv,"DetrForObjectDetection"),bv.forEach(t),ku=r(Dr," forward method, overrides the "),xa=a(Dr,"CODE",{});var vv=i(xa);ju=r(vv,"__call__"),vv.forEach(t),Fu=r(Dr," special method."),Dr.forEach(t),Ou=c(Mt),b(vt.$$.fragment,Mt),zu=c(Mt),b(yt.$$.fragment,Mt),Mt.forEach(t),De.forEach(t),Di=c(o),He=a(o,"H2",{class:!0});var ud=i(He);Dt=a(ud,"A",{id:!0,class:!0,href:!0});var yv=i(Dt);Ea=a(yv,"SPAN",{});var Dv=i(Ea);b(nn.$$.fragment,Dv),Dv.forEach(t),yv.forEach(t),Cu=c(ud),$a=a(ud,"SPAN",{});var wv=i($a);Pu=r(wv,"DetrForSegmentation"),wv.forEach(t),ud.forEach(t),wi=c(o),H=a(o,"DIV",{class:!0});var we=i(H);b(rn.$$.fragment,we),qu=c(we),ka=a(we,"P",{});var Tv=i(ka);Iu=r(Tv,`DETR Model (consisting of a backbone and encoder-decoder Transformer) with a segmentation head on top, for tasks
such as COCO panoptic.`),Tv.forEach(t),Nu=c(we),sn=a(we,"P",{});var gd=i(sn);Au=r(gd,"This model inherits from "),hr=a(gd,"A",{href:!0});var xv=i(hr);Su=r(xv,"PreTrainedModel"),xv.forEach(t),Lu=r(gd,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),gd.forEach(t),Ru=c(we),an=a(we,"P",{});var _d=i(an);Mu=r(_d,"This model is also a PyTorch "),dn=a(_d,"A",{href:!0,rel:!0});var Ev=i(dn);Uu=r(Ev,"torch.nn.Module"),Ev.forEach(t),Hu=r(_d,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_d.forEach(t),Gu=c(we),ee=a(we,"DIV",{class:!0});var Ut=i(ee);b(cn.$$.fragment,Ut),Vu=c(Ut),Ge=a(Ut,"P",{});var wr=i(Ge);Wu=r(wr,"The "),mr=a(wr,"A",{href:!0});var $v=i(mr);Bu=r($v,"DetrForSegmentation"),$v.forEach(t),Yu=r(wr," forward method, overrides the "),ja=a(wr,"CODE",{});var kv=i(ja);Qu=r(kv,"__call__"),kv.forEach(t),Ju=r(wr," special method."),wr.forEach(t),Ku=c(Ut),b(wt.$$.fragment,Ut),Xu=c(Ut),b(Tt.$$.fragment,Ut),Ut.forEach(t),we.forEach(t),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(Uv)),l(u,"id","detr"),l(u,"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(u,"href","#detr"),l(T,"class","relative group"),l(Ve,"id","overview"),l(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ve,"href","#overview"),l(xe,"class","relative group"),l(Gt,"href","https://arxiv.org/abs/2005.12872"),l(Gt,"rel","nofollow"),l(Vt,"href","https://huggingface.co/nielsr"),l(Vt,"rel","nofollow"),l(Wt,"href","https://github.com/facebookresearch/detr"),l(Wt,"rel","nofollow"),l(un,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(Bt,"href","https://en.wikipedia.org/wiki/Hungarian_algorithm"),l(Bt,"rel","nofollow"),l(Yt,"href","https://giou.stanford.edu/"),l(Yt,"rel","nofollow"),l(gn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(_n,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(bn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(yn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"),l(Dn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"),l(wn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"),l(Qt,"href","https://github.com/facebookresearch/detr/blob/a54b77800eb8e64e3ad0d8237789fcbf2f8350c5/models/detr.py#L227-L232"),l(Qt,"rel","nofollow"),l(Tn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(xn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(Jt,"href","https://github.com/rwightman/pytorch-image-models"),l(Jt,"rel","nofollow"),l(En,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"),l($n,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrImageProcessor"),l(kn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrFeatureExtractor.pad_and_create_pixel_mask"),l(Kt,"href","https://github.com/facebookresearch/detr/issues/150"),l(Kt,"rel","nofollow"),l(Pn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(qn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(In,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(Nn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrImageProcessor"),l(Sn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrImageProcessor"),l(Ln,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrImageProcessor"),l(ro,"href","https://github.com/facebookresearch/detr"),l(ro,"rel","nofollow"),l(so,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DETR"),l(so,"rel","nofollow"),l(Qe,"id","resources"),l(Qe,"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(Qe,"href","#resources"),l(je,"class","relative group"),l(Mn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(Un,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(co,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DETR"),l(co,"rel","nofollow"),l(Gn,"href","./tasks/object_detection"),l(Ke,"id","transformers.models.detr.modeling_detr.DetrModelOutput"),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.models.detr.modeling_detr.DetrModelOutput"),l(Fe,"class","relative group"),l(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Wn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Bn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Xe,"id","transformers.DetrConfig"),l(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Xe,"href","#transformers.DetrConfig"),l(Pe,"class","relative group"),l(Yn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrModel"),l(bo,"href","https://huggingface.co/facebook/detr-resnet-50"),l(bo,"rel","nofollow"),l(Qn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Jn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Kn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrConfig"),l(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Xn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ot,"id","transformers.DetrImageProcessor"),l(ot,"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(ot,"href","#transformers.DetrImageProcessor"),l(Ae,"class","relative group"),l(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Zn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),l(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(er,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(tr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(or,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(dt,"id","transformers.DetrFeatureExtractor"),l(dt,"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(dt,"href","#transformers.DetrFeatureExtractor"),l(Se,"class","relative group"),l(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(nr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),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(rr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(sr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ar,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),l(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ut,"id","transformers.DetrModel"),l(ut,"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(ut,"href","#transformers.DetrModel"),l(Le,"class","relative group"),l(ir,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(Qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Qo,"rel","nofollow"),l(dr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrModel"),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(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(bt,"id","transformers.DetrForObjectDetection"),l(bt,"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(bt,"href","#transformers.DetrForObjectDetection"),l(Me,"class","relative group"),l(cr,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(tn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(tn,"rel","nofollow"),l(lr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),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(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(Dt,"id","transformers.DetrForSegmentation"),l(Dt,"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(Dt,"href","#transformers.DetrForSegmentation"),l(He,"class","relative group"),l(hr,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(dn,"rel","nofollow"),l(mr,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForSegmentation"),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(H,"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,h){e(document.head,f),m(o,E,h),m(o,T,h),e(T,u),e(u,x),v(p,x,null),e(T,g),e(T,G),e(G,yd),m(o,qa,h),m(o,xe,h),e(xe,Ve),e(Ve,Tr),v(Ht,Tr,null),e(xe,Dd),e(xe,xr),e(xr,wd),m(o,Ia,h),m(o,We,h),e(We,Td),e(We,Gt),e(Gt,xd),e(We,Ed),m(o,Na,h),m(o,pn,h),e(pn,$d),m(o,Aa,h),m(o,fn,h),e(fn,Er),e(Er,kd),m(o,Sa,h),m(o,be,h),e(be,jd),e(be,Vt),e(Vt,Fd),e(be,Od),e(be,Wt),e(Wt,zd),e(be,Cd),m(o,La,h),m(o,Be,h),e(Be,Pd),e(Be,un),e(un,qd),e(Be,Id),m(o,Ra,h),m(o,j,h),e(j,Nd),e(j,$r),e($r,Ad),e(j,Sd),e(j,kr),e(kr,Ld),e(j,Rd),e(j,jr),e(jr,Md),e(j,Ud),e(j,Fr),e(Fr,Hd),e(j,Gd),e(j,Or),e(Or,Vd),e(j,Wd),e(j,zr),e(zr,Bd),e(j,Yd),e(j,Cr),e(Cr,Qd),e(j,Jd),e(j,Pr),e(Pr,Kd),e(j,Xd),m(o,Ma,h),m(o,P,h),e(P,Zd),e(P,qr),e(qr,ec),e(P,tc),e(P,Ir),e(Ir,oc),e(P,nc),e(P,Nr),e(Nr,rc),e(P,sc),e(P,Ar),e(Ar,ac),e(P,ic),e(P,Sr),e(Sr,dc),e(P,cc),e(P,Lr),e(Lr,lc),e(P,hc),m(o,Ua,h),m(o,J,h),e(J,mc),e(J,Rr),e(Rr,pc),e(J,fc),e(J,Bt),e(Bt,uc),e(J,gc),e(J,Yt),e(Yt,_c),e(J,bc),m(o,Ha,h),m(o,K,h),e(K,vc),e(K,gn),e(gn,yc),e(K,Dc),e(K,_n),e(_n,wc),e(K,Tc),e(K,bn),e(bn,xc),e(K,Ec),m(o,Ga,h),m(o,vn,h),e(vn,$c),m(o,Va,h),m(o,F,h),e(F,re),e(re,kc),e(re,Mr),e(Mr,jc),e(re,Fc),e(re,Ur),e(Ur,Oc),e(re,zc),e(re,yn),e(yn,Cc),e(re,Pc),e(F,qc),e(F,Hr),e(Hr,Ic),e(F,Nc),e(F,se),e(se,Ac),e(se,Gr),e(Gr,Sc),e(se,Lc),e(se,Dn),e(Dn,Rc),e(se,Mc),e(se,Vr),e(Vr,Uc),e(se,Hc),e(F,Gc),e(F,ae),e(ae,Vc),e(ae,Wr),e(Wr,Wc),e(ae,Bc),e(ae,wn),e(wn,Yc),e(ae,Qc),e(ae,Br),e(Br,Jc),e(ae,Kc),e(F,Xc),e(F,Y),e(Y,Zc),e(Y,Yr),e(Yr,el),e(Y,tl),e(Y,Qr),e(Qr,ol),e(Y,nl),e(Y,Jr),e(Jr,rl),e(Y,sl),e(Y,Qt),e(Qt,al),e(Y,il),e(F,dl),e(F,A),e(A,Tn),e(Tn,cl),e(A,ll),e(A,xn),e(xn,hl),e(A,ml),e(A,Jt),e(Jt,pl),e(A,fl),e(A,Kr),e(Kr,ul),e(A,gl),e(A,En),e(En,_l),e(A,bl),e(A,Xr),e(Xr,vl),e(A,yl),e(F,Dl),e(F,ie),e(ie,wl),e(ie,$n),e($n,Tl),e(ie,xl),e(ie,Zr),e(Zr,El),e(ie,$l),e(ie,kn),e(kn,kl),e(ie,jl),e(F,Fl),e(F,Ee),e(Ee,Ol),e(Ee,es),e(es,zl),e(Ee,Cl),e(Ee,Kt),e(Kt,Pl),e(Ee,ql),m(o,Wa,h),m(o,jn,h),e(jn,Il),m(o,Ba,h),m(o,Fn,h),e(Fn,Nl),m(o,Ya,h),v(Xt,o,h),m(o,Qa,h),m(o,On,h),e(On,Al),m(o,Ja,h),v(Zt,o,h),m(o,Ka,h),m(o,zn,h),e(zn,Sl),m(o,Xa,h),v(eo,o,h),m(o,Za,h),m(o,Cn,h),e(Cn,Ll),m(o,ei,h),m(o,Ye,h),e(Ye,ts),e(ts,de),e(de,os),e(os,Rl),e(de,Ml),e(de,ns),e(ns,Ul),e(de,Hl),e(de,rs),e(rs,Gl),e(de,Vl),e(de,ss),e(ss,Wl),e(Ye,Bl),e(Ye,L),e(L,ce),e(ce,as),e(as,is),e(is,Yl),e(ce,Ql),e(ce,ds),e(ds,Jl),e(ce,Kl),e(ce,cs),e(cs,Xl),e(ce,Zl),e(ce,ls),e(ls,eh),e(L,th),e(L,le),e(le,hs),e(hs,ms),e(ms,oh),e(le,nh),e(le,ps),e(ps,Pn),e(Pn,rh),e(le,sh),e(le,fs),e(fs,qn),e(qn,ah),e(le,ih),e(le,us),e(us,In),e(In,dh),e(L,ch),e(L,he),e(he,gs),e(gs,_s),e(_s,lh),e(he,hh),e(he,bs),e(bs,mh),e(he,ph),e(he,vs),e(vs,fh),e(he,uh),e(he,ys),e(ys,gh),e(L,_h),e(L,me),e(me,to),e(to,Ds),e(Ds,bh),e(to,vh),e(to,Nn),e(Nn,yh),e(me,Dh),e(me,$e),e($e,wh),e($e,ws),e(ws,Th),e($e,xh),e($e,Ts),e(Ts,Eh),e($e,$h),e(me,kh),e(me,R),e(R,jh),e(R,xs),e(xs,Fh),e(R,Oh),e(R,Es),e(Es,zh),e(R,Ch),e(R,$s),e($s,Ph),e(R,qh),e(R,ks),e(ks,Ih),e(R,Nh),e(R,js),e(js,Ah),e(R,Sh),e(me,Lh),e(me,pe),e(pe,Rh),e(pe,Fs),e(Fs,Mh),e(pe,Uh),e(pe,Os),e(Os,Hh),e(pe,Gh),e(pe,zs),e(zs,Vh),e(pe,Wh),e(L,Bh),e(L,fe),e(fe,An),e(An,Cs),e(Cs,Yh),e(An,Qh),e(fe,Jh),e(fe,Ps),e(Ps,qs),e(qs,Kh),e(fe,Xh),e(fe,Is),e(Is,Ns),e(Ns,Zh),e(fe,em),e(fe,oo),e(oo,As),e(As,tm),e(oo,om),e(oo,Ss),e(Ss,nm),e(L,rm),e(L,ue),e(ue,Ls),e(Ls,Rs),e(Rs,sm),e(ue,am),e(ue,no),e(no,Ms),e(Ms,im),e(no,dm),e(no,Us),e(Us,cm),e(ue,lm),e(ue,ke),e(ke,Hs),e(Hs,hm),e(ke,mm),e(ke,Gs),e(Gs,pm),e(ke,fm),e(ke,Vs),e(Vs,um),e(ue,gm),e(ue,ge),e(ge,Ws),e(Ws,_m),e(ge,bm),e(ge,Bs),e(Bs,vm),e(ge,ym),e(ge,Ys),e(Ys,Dm),e(ge,wm),e(ge,Qs),e(Qs,Tm),m(o,ti,h),m(o,k,h),e(k,xm),e(k,Sn),e(Sn,Em),e(k,$m),e(k,Js),e(Js,km),e(k,jm),e(k,Ks),e(Ks,Fm),e(k,Om),e(k,Xs),e(Xs,zm),e(k,Cm),e(k,Ln),e(Ln,Pm),e(k,qm),e(k,Zs),e(Zs,Im),e(k,Nm),e(k,ea),e(ea,Am),e(k,Sm),e(k,ro),e(ro,Lm),e(k,Rm),e(k,so),e(so,Mm),e(k,Um),m(o,oi,h),m(o,je,h),e(je,Qe),e(Qe,ta),v(ao,ta,null),e(je,Hm),e(je,oa),e(oa,Gm),m(o,ni,h),m(o,Rn,h),e(Rn,Vm),m(o,ri,h),v(io,o,h),m(o,si,h),m(o,Je,h),e(Je,_e),e(_e,Wm),e(_e,Mn),e(Mn,Bm),e(_e,Ym),e(_e,Un),e(Un,Qm),e(_e,Jm),e(_e,co),e(co,Km),e(_e,Xm),e(Je,Zm),e(Je,Hn),e(Hn,ep),e(Hn,Gn),e(Gn,tp),m(o,ai,h),m(o,Vn,h),e(Vn,op),m(o,ii,h),m(o,Fe,h),e(Fe,Ke),e(Ke,na),v(lo,na,null),e(Fe,np),e(Fe,ra),e(ra,rp),m(o,di,h),m(o,Oe,h),v(ho,Oe,null),e(Oe,sp),e(Oe,sa),e(sa,ap),m(o,ci,h),m(o,ze,h),v(mo,ze,null),e(ze,ip),e(ze,po),e(po,dp),e(po,Wn),e(Wn,cp),e(po,lp),m(o,li,h),m(o,Ce,h),v(fo,Ce,null),e(Ce,hp),e(Ce,uo),e(uo,mp),e(uo,Bn),e(Bn,pp),e(uo,fp),m(o,hi,h),m(o,Pe,h),e(Pe,Xe),e(Xe,aa),v(go,aa,null),e(Pe,up),e(Pe,ia),e(ia,gp),m(o,mi,h),m(o,I,h),v(_o,I,null),e(I,_p),e(I,qe),e(qe,bp),e(qe,Yn),e(Yn,vp),e(qe,yp),e(qe,bo),e(bo,Dp),e(qe,wp),e(I,Tp),e(I,Ie),e(Ie,xp),e(Ie,Qn),e(Qn,Ep),e(Ie,$p),e(Ie,Jn),e(Jn,kp),e(Ie,jp),e(I,Fp),v(Ze,I,null),e(I,Op),e(I,et),v(vo,et,null),e(et,zp),e(et,yo),e(yo,Cp),e(yo,Kn),e(Kn,Pp),e(yo,qp),e(I,Ip),e(I,tt),v(Do,tt,null),e(tt,Np),e(tt,Ne),e(Ne,Ap),e(Ne,Xn),e(Xn,Sp),e(Ne,Lp),e(Ne,da),e(da,Rp),e(Ne,Mp),m(o,pi,h),m(o,Ae,h),e(Ae,ot),e(ot,ca),v(wo,ca,null),e(Ae,Up),e(Ae,la),e(la,Hp),m(o,fi,h),m(o,z,h),v(To,z,null),e(z,Gp),e(z,ha),e(ha,Vp),e(z,Wp),e(z,nt),v(xo,nt,null),e(nt,Bp),e(nt,ma),e(ma,Yp),e(z,Qp),e(z,rt),v(Eo,rt,null),e(rt,Jp),e(rt,$o),e($o,Kp),e($o,Zn),e(Zn,Xp),e($o,Zp),e(z,ef),e(z,st),v(ko,st,null),e(st,tf),e(st,jo),e(jo,of),e(jo,er),e(er,nf),e(jo,rf),e(z,sf),e(z,at),v(Fo,at,null),e(at,af),e(at,Oo),e(Oo,df),e(Oo,tr),e(tr,cf),e(Oo,lf),e(z,hf),e(z,it),v(zo,it,null),e(it,mf),e(it,Co),e(Co,pf),e(Co,or),e(or,ff),e(Co,uf),m(o,ui,h),m(o,Se,h),e(Se,dt),e(dt,pa),v(Po,pa,null),e(Se,gf),e(Se,fa),e(fa,_f),m(o,gi,h),m(o,C,h),v(qo,C,null),e(C,bf),e(C,ct),v(Io,ct,null),e(ct,vf),e(ct,ua),e(ua,yf),e(C,Df),e(C,lt),v(No,lt,null),e(lt,wf),e(lt,ga),e(ga,Tf),e(C,xf),e(C,ht),v(Ao,ht,null),e(ht,Ef),e(ht,So),e(So,$f),e(So,nr),e(nr,kf),e(So,jf),e(C,Ff),e(C,mt),v(Lo,mt,null),e(mt,Of),e(mt,Ro),e(Ro,zf),e(Ro,rr),e(rr,Cf),e(Ro,Pf),e(C,qf),e(C,pt),v(Mo,pt,null),e(pt,If),e(pt,Uo),e(Uo,Nf),e(Uo,sr),e(sr,Af),e(Uo,Sf),e(C,Lf),e(C,ft),v(Ho,ft,null),e(ft,Rf),e(ft,Go),e(Go,Mf),e(Go,ar),e(ar,Uf),e(Go,Hf),m(o,_i,h),m(o,Le,h),e(Le,ut),e(ut,_a),v(Vo,_a,null),e(Le,Gf),e(Le,ba),e(ba,Vf),m(o,bi,h),m(o,M,h),v(Wo,M,null),e(M,Wf),e(M,va),e(va,Bf),e(M,Yf),e(M,Bo),e(Bo,Qf),e(Bo,ir),e(ir,Jf),e(Bo,Kf),e(M,Xf),e(M,Yo),e(Yo,Zf),e(Yo,Qo),e(Qo,eu),e(Yo,tu),e(M,ou),e(M,X),v(Jo,X,null),e(X,nu),e(X,Re),e(Re,ru),e(Re,dr),e(dr,su),e(Re,au),e(Re,ya),e(ya,iu),e(Re,du),e(X,cu),v(gt,X,null),e(X,lu),v(_t,X,null),m(o,vi,h),m(o,Me,h),e(Me,bt),e(bt,Da),v(Ko,Da,null),e(Me,hu),e(Me,wa),e(wa,mu),m(o,yi,h),m(o,U,h),v(Xo,U,null),e(U,pu),e(U,Ta),e(Ta,fu),e(U,uu),e(U,Zo),e(Zo,gu),e(Zo,cr),e(cr,_u),e(Zo,bu),e(U,vu),e(U,en),e(en,yu),e(en,tn),e(tn,Du),e(en,wu),e(U,Tu),e(U,Z),v(on,Z,null),e(Z,xu),e(Z,Ue),e(Ue,Eu),e(Ue,lr),e(lr,$u),e(Ue,ku),e(Ue,xa),e(xa,ju),e(Ue,Fu),e(Z,Ou),v(vt,Z,null),e(Z,zu),v(yt,Z,null),m(o,Di,h),m(o,He,h),e(He,Dt),e(Dt,Ea),v(nn,Ea,null),e(He,Cu),e(He,$a),e($a,Pu),m(o,wi,h),m(o,H,h),v(rn,H,null),e(H,qu),e(H,ka),e(ka,Iu),e(H,Nu),e(H,sn),e(sn,Au),e(sn,hr),e(hr,Su),e(sn,Lu),e(H,Ru),e(H,an),e(an,Mu),e(an,dn),e(dn,Uu),e(an,Hu),e(H,Gu),e(H,ee),v(cn,ee,null),e(ee,Vu),e(ee,Ge),e(Ge,Wu),e(Ge,mr),e(mr,Bu),e(Ge,Yu),e(Ge,ja),e(ja,Qu),e(Ge,Ju),e(ee,Ku),v(wt,ee,null),e(ee,Xu),v(Tt,ee,null),Ti=!0},p(o,[h]){const ln={};h&2&&(ln.$$scope={dirty:h,ctx:o}),Ze.$set(ln);const Fa={};h&2&&(Fa.$$scope={dirty:h,ctx:o}),gt.$set(Fa);const Oa={};h&2&&(Oa.$$scope={dirty:h,ctx:o}),_t.$set(Oa);const za={};h&2&&(za.$$scope={dirty:h,ctx:o}),vt.$set(za);const hn={};h&2&&(hn.$$scope={dirty:h,ctx:o}),yt.$set(hn);const Ca={};h&2&&(Ca.$$scope={dirty:h,ctx:o}),wt.$set(Ca);const Pa={};h&2&&(Pa.$$scope={dirty:h,ctx:o}),Tt.$set(Pa)},i(o){Ti||(y(p.$$.fragment,o),y(Ht.$$.fragment,o),y(Xt.$$.fragment,o),y(Zt.$$.fragment,o),y(eo.$$.fragment,o),y(ao.$$.fragment,o),y(io.$$.fragment,o),y(lo.$$.fragment,o),y(ho.$$.fragment,o),y(mo.$$.fragment,o),y(fo.$$.fragment,o),y(go.$$.fragment,o),y(_o.$$.fragment,o),y(Ze.$$.fragment,o),y(vo.$$.fragment,o),y(Do.$$.fragment,o),y(wo.$$.fragment,o),y(To.$$.fragment,o),y(xo.$$.fragment,o),y(Eo.$$.fragment,o),y(ko.$$.fragment,o),y(Fo.$$.fragment,o),y(zo.$$.fragment,o),y(Po.$$.fragment,o),y(qo.$$.fragment,o),y(Io.$$.fragment,o),y(No.$$.fragment,o),y(Ao.$$.fragment,o),y(Lo.$$.fragment,o),y(Mo.$$.fragment,o),y(Ho.$$.fragment,o),y(Vo.$$.fragment,o),y(Wo.$$.fragment,o),y(Jo.$$.fragment,o),y(gt.$$.fragment,o),y(_t.$$.fragment,o),y(Ko.$$.fragment,o),y(Xo.$$.fragment,o),y(on.$$.fragment,o),y(vt.$$.fragment,o),y(yt.$$.fragment,o),y(nn.$$.fragment,o),y(rn.$$.fragment,o),y(cn.$$.fragment,o),y(wt.$$.fragment,o),y(Tt.$$.fragment,o),Ti=!0)},o(o){D(p.$$.fragment,o),D(Ht.$$.fragment,o),D(Xt.$$.fragment,o),D(Zt.$$.fragment,o),D(eo.$$.fragment,o),D(ao.$$.fragment,o),D(io.$$.fragment,o),D(lo.$$.fragment,o),D(ho.$$.fragment,o),D(mo.$$.fragment,o),D(fo.$$.fragment,o),D(go.$$.fragment,o),D(_o.$$.fragment,o),D(Ze.$$.fragment,o),D(vo.$$.fragment,o),D(Do.$$.fragment,o),D(wo.$$.fragment,o),D(To.$$.fragment,o),D(xo.$$.fragment,o),D(Eo.$$.fragment,o),D(ko.$$.fragment,o),D(Fo.$$.fragment,o),D(zo.$$.fragment,o),D(Po.$$.fragment,o),D(qo.$$.fragment,o),D(Io.$$.fragment,o),D(No.$$.fragment,o),D(Ao.$$.fragment,o),D(Lo.$$.fragment,o),D(Mo.$$.fragment,o),D(Ho.$$.fragment,o),D(Vo.$$.fragment,o),D(Wo.$$.fragment,o),D(Jo.$$.fragment,o),D(gt.$$.fragment,o),D(_t.$$.fragment,o),D(Ko.$$.fragment,o),D(Xo.$$.fragment,o),D(on.$$.fragment,o),D(vt.$$.fragment,o),D(yt.$$.fragment,o),D(nn.$$.fragment,o),D(rn.$$.fragment,o),D(cn.$$.fragment,o),D(wt.$$.fragment,o),D(Tt.$$.fragment,o),Ti=!1},d(o){t(f),o&&t(E),o&&t(T),w(p),o&&t(qa),o&&t(xe),w(Ht),o&&t(Ia),o&&t(We),o&&t(Na),o&&t(pn),o&&t(Aa),o&&t(fn),o&&t(Sa),o&&t(be),o&&t(La),o&&t(Be),o&&t(Ra),o&&t(j),o&&t(Ma),o&&t(P),o&&t(Ua),o&&t(J),o&&t(Ha),o&&t(K),o&&t(Ga),o&&t(vn),o&&t(Va),o&&t(F),o&&t(Wa),o&&t(jn),o&&t(Ba),o&&t(Fn),o&&t(Ya),w(Xt,o),o&&t(Qa),o&&t(On),o&&t(Ja),w(Zt,o),o&&t(Ka),o&&t(zn),o&&t(Xa),w(eo,o),o&&t(Za),o&&t(Cn),o&&t(ei),o&&t(Ye),o&&t(ti),o&&t(k),o&&t(oi),o&&t(je),w(ao),o&&t(ni),o&&t(Rn),o&&t(ri),w(io,o),o&&t(si),o&&t(Je),o&&t(ai),o&&t(Vn),o&&t(ii),o&&t(Fe),w(lo),o&&t(di),o&&t(Oe),w(ho),o&&t(ci),o&&t(ze),w(mo),o&&t(li),o&&t(Ce),w(fo),o&&t(hi),o&&t(Pe),w(go),o&&t(mi),o&&t(I),w(_o),w(Ze),w(vo),w(Do),o&&t(pi),o&&t(Ae),w(wo),o&&t(fi),o&&t(z),w(To),w(xo),w(Eo),w(ko),w(Fo),w(zo),o&&t(ui),o&&t(Se),w(Po),o&&t(gi),o&&t(C),w(qo),w(Io),w(No),w(Ao),w(Lo),w(Mo),w(Ho),o&&t(_i),o&&t(Le),w(Vo),o&&t(bi),o&&t(M),w(Wo),w(Jo),w(gt),w(_t),o&&t(vi),o&&t(Me),w(Ko),o&&t(yi),o&&t(U),w(Xo),w(on),w(vt),w(yt),o&&t(Di),o&&t(He),w(nn),o&&t(wi),o&&t(H),w(rn),w(cn),w(wt),w(Tt)}}}const Uv={local:"detr",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.models.detr.modeling_detr.DetrModelOutput",title:"DETR specific outputs"},{local:"transformers.DetrConfig",title:"DetrConfig"},{local:"transformers.DetrImageProcessor",title:"DetrImageProcessor"},{local:"transformers.DetrFeatureExtractor",title:"DetrFeatureExtractor"},{local:"transformers.DetrModel",title:"DetrModel"},{local:"transformers.DetrForObjectDetection",title:"DetrForObjectDetection"},{local:"transformers.DetrForSegmentation",title:"DetrForSegmentation"}],title:"DETR"};function Hv(N){return Cv(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Kv extends jv{constructor(f){super();Fv(this,f,Hv,Mv,Ov,{})}}export{Kv as default,Uv as metadata};
