import{S as Aa,i as Ua,s as Ja,e as n,k as m,w as y,t as r,M as Ra,c as s,d as o,m as h,a,x as w,h as i,b as l,N as qa,G as e,g as p,y as T,q as D,o as M,B as j,v as Za,L as Ns}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fa}from"../../chunks/Tip-hf-doc-builder.js";import{D as H}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fs}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ps}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Wa(C){let f,v,_,u,b;return u=new Fs({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERldGFDb25maWclMkMlMjBEZXRhTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwREVUQSUyMFNlbnNlVGltZSUyRmRlZm9ybWFibGUtZGV0ciUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBEZXRhQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMFNlbnNlVGltZSUyRmRlZm9ybWFibGUtZGV0ciUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRGV0YU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DetaConfig, DetaModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DETA SenseTime/deformable-detr style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DetaConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the SenseTime/deformable-detr style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetaModel(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=n("p"),v=r("Examples:"),_=m(),y(u.$$.fragment)},l(d){f=s(d,"P",{});var g=a(f);v=i(g,"Examples:"),g.forEach(o),_=h(d),w(u.$$.fragment,d)},m(d,g){p(d,f,g),e(f,v),p(d,_,g),T(u,d,g),b=!0},p:Ns,i(d){b||(D(u.$$.fragment,d),b=!0)},o(d){M(u.$$.fragment,d),b=!1},d(d){d&&o(f),d&&o(_),j(u,d)}}}function Sa(C){let f,v,_,u,b;return{c(){f=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){f=s(d,"P",{});var g=a(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var P=a(_);u=i(P,"Module"),P.forEach(o),b=i(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(o)},m(d,g){p(d,f,g),e(f,v),e(f,_),e(_,u),e(f,b)},d(d){d&&o(f)}}}function Oa(C){let f,v,_,u,b;return u=new Fs({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERldGFNb2RlbCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyam96aGFuZzk3JTJGZGV0YS1zd2luLWxhcmdlLW8zNjUlMjIpJTBBbW9kZWwlMjAlM0QlMjBEZXRhTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmpvemhhbmc5NyUyRmRldGEtc3dpbi1sYXJnZS1vMzY1JTIyJTJDJTIwdHdvX3N0YWdlJTNERmFsc2UpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DetaModel
<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;jozhang97/deta-swin-large-o365&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetaModel.from_pretrained(<span class="hljs-string">&quot;jozhang97/deta-swin-large-o365&quot;</span>, two_stage=<span class="hljs-literal">False</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>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">900</span>, <span class="hljs-number">256</span>]`}}),{c(){f=n("p"),v=r("Examples:"),_=m(),y(u.$$.fragment)},l(d){f=s(d,"P",{});var g=a(f);v=i(g,"Examples:"),g.forEach(o),_=h(d),w(u.$$.fragment,d)},m(d,g){p(d,f,g),e(f,v),p(d,_,g),T(u,d,g),b=!0},p:Ns,i(d){b||(D(u.$$.fragment,d),b=!0)},o(d){M(u.$$.fragment,d),b=!1},d(d){d&&o(f),d&&o(_),j(u,d)}}}function Va(C){let f,v,_,u,b;return{c(){f=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){f=s(d,"P",{});var g=a(f);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var P=a(_);u=i(P,"Module"),P.forEach(o),b=i(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(o)},m(d,g){p(d,f,g),e(f,v),e(f,_),e(_,u),e(f,b)},d(d){d&&o(f)}}}function La(C){let f,v,_,u,b;return u=new Fs({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERldGFGb3JPYmplY3REZXRlY3Rpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmpvemhhbmc5NyUyRmRldGEtc3dpbi1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMERldGFGb3JPYmplY3REZXRlY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmpvemhhbmc5NyUyRmRldGEtc3dpbi1sYXJnZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEElMjMlMjBjb252ZXJ0JTIwb3V0cHV0cyUyMChib3VuZGluZyUyMGJveGVzJTIwYW5kJTIwY2xhc3MlMjBsb2dpdHMpJTIwdG8lMjBDT0NPJTIwQVBJJTBBdGFyZ2V0X3NpemVzJTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QmltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCU1RCklMEFyZXN1bHRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19vYmplY3RfZGV0ZWN0aW9uKG91dHB1dHMlMkMlMjB0aHJlc2hvbGQlM0QwLjUlMkMlMjB0YXJnZXRfc2l6ZXMlM0R0YXJnZXRfc2l6ZXMpJTVCJTBBJTIwJTIwJTIwJTIwMCUwQSU1RCUwQWZvciUyMHNjb3JlJTJDJTIwbGFiZWwlMkMlMjBib3glMjBpbiUyMHppcChyZXN1bHRzJTVCJTIyc2NvcmVzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QiUyMmxhYmVscyUyMiU1RCUyQyUyMHJlc3VsdHMlNUIlMjJib3hlcyUyMiU1RCklM0ElMEElMjAlMjAlMjAlMjBib3glMjAlM0QlMjAlNUJyb3VuZChpJTJDJTIwMiklMjBmb3IlMjBpJTIwaW4lMjBib3gudG9saXN0KCklNUQlMEElMjAlMjAlMjAlMjBwcmludCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmJTIyRGV0ZWN0ZWQlMjAlN0Jtb2RlbC5jb25maWcuaWQybGFiZWwlNUJsYWJlbC5pdGVtKCklNUQlN0QlMjB3aXRoJTIwY29uZmlkZW5jZSUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGYlMjIlN0Jyb3VuZChzY29yZS5pdGVtKCklMkMlMjAzKSU3RCUyMGF0JTIwbG9jYXRpb24lMjAlN0Jib3glN0QlMjIlMEElMjAlMjAlMjAlMjAp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DetaForObjectDetection
<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;jozhang97/deta-swin-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DetaForObjectDetection.from_pretrained(<span class="hljs-string">&quot;jozhang97/deta-swin-large&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.5</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 cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.683</span> at location [<span class="hljs-number">345.85</span>, <span class="hljs-number">23.68</span>, <span class="hljs-number">639.86</span>, <span class="hljs-number">372.83</span>]
Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.683</span> at location [<span class="hljs-number">8.8</span>, <span class="hljs-number">52.49</span>, <span class="hljs-number">316.93</span>, <span class="hljs-number">473.45</span>]
Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.568</span> at location [<span class="hljs-number">40.02</span>, <span class="hljs-number">73.75</span>, <span class="hljs-number">175.96</span>, <span class="hljs-number">117.33</span>]
Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.546</span> at location [<span class="hljs-number">333.68</span>, <span class="hljs-number">77.13</span>, <span class="hljs-number">370.12</span>, <span class="hljs-number">187.51</span>]`}}),{c(){f=n("p"),v=r("Examples:"),_=m(),y(u.$$.fragment)},l(d){f=s(d,"P",{});var g=a(f);v=i(g,"Examples:"),g.forEach(o),_=h(d),w(u.$$.fragment,d)},m(d,g){p(d,f,g),e(f,v),p(d,_,g),T(u,d,g),b=!0},p:Ns,i(d){b||(D(u.$$.fragment,d),b=!0)},o(d){M(u.$$.fragment,d),b=!1},d(d){d&&o(f),d&&o(_),j(u,d)}}}function Ba(C){let f,v,_,u,b,d,g,P,Io,Vt,R,Y,Tt,_e,zo,Dt,Po,Lt,N,No,be,Fo,Ao,Xe,Uo,Jo,Bt,He,Ro,Gt,Ye,Mt,qo,Xt,Qe,Zo,Ht,Ke,ve,Wo,et,So,Oo,Yt,Q,As,Qt,K,Vo,tt,Lo,Bo,Kt,F,Go,ye,Xo,Ho,we,Yo,Qo,eo,q,ee,jt,Te,Ko,xt,en,to,ot,tn,oo,te,De,on,Me,nn,sn,an,nt,rn,st,ln,no,at,dn,so,Z,oe,Et,je,cn,$t,mn,ao,x,xe,hn,W,pn,rt,fn,un,Ee,gn,_n,bn,S,vn,it,yn,wn,lt,Tn,Dn,Mn,ne,jn,se,$e,xn,O,En,dt,$n,kn,kt,Cn,In,ro,V,ae,Ct,ke,zn,It,Pn,io,k,Ce,Nn,zt,Fn,An,re,Ie,Un,Pt,Jn,Rn,ie,ze,qn,Pe,Zn,ct,Wn,Sn,lo,L,le,Nt,Ne,On,Ft,Vn,co,E,Fe,Ln,At,Bn,Gn,Ae,Xn,mt,Hn,Yn,Qn,Ue,Kn,Je,es,ts,os,I,Re,ns,B,ss,ht,as,rs,Ut,is,ls,ds,de,cs,ce,mo,G,me,Jt,qe,ms,Rt,hs,ho,$,Ze,ps,qt,fs,us,We,gs,pt,_s,bs,vs,Se,ys,Oe,ws,Ts,Ds,z,Ve,Ms,X,js,ft,xs,Es,Zt,$s,ks,Cs,he,Is,pe,po;return d=new Ge({}),_e=new Ge({}),Te=new Ge({}),je=new Ge({}),xe=new H({props:{name:"class transformers.DetaConfig",anchor:"transformers.DetaConfig",parameters:[{name:"backbone_config",val:" = None"},{name:"num_queries",val:" = 900"},{name:"max_position_embeddings",val:" = 2048"},{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:" = 1024"},{name:"decoder_attention_heads",val:" = 8"},{name:"encoder_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:"return_intermediate",val:" = True"},{name:"auxiliary_loss",val:" = False"},{name:"position_embedding_type",val:" = 'sine'"},{name:"num_feature_levels",val:" = 5"},{name:"encoder_n_points",val:" = 4"},{name:"decoder_n_points",val:" = 4"},{name:"two_stage",val:" = True"},{name:"two_stage_num_proposals",val:" = 300"},{name:"with_box_refine",val:" = True"},{name:"assign_first_stage",val:" = True"},{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:"focal_alpha",val:" = 0.25"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DetaConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>ResNetConfig()</code>) &#x2014;
The configuration of the backbone model.`,name:"backbone_config"},{anchor:"transformers.DetaConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 900) &#x2014;
Number of object queries, i.e. detection slots. This is the maximal number of objects <a href="/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaModel">DetaModel</a> can
detect in a single image. In case <code>two_stage</code> is set to <code>True</code>, we use <code>two_stage_num_proposals</code> instead.`,name:"num_queries"},{anchor:"transformers.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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.DetaConfig.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"},{anchor:"transformers.DetaConfig.num_feature_levels",description:`<strong>num_feature_levels</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The number of input feature levels.`,name:"num_feature_levels"},{anchor:"transformers.DetaConfig.encoder_n_points",description:`<strong>encoder_n_points</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of sampled keys in each feature level for each attention head in the encoder.`,name:"encoder_n_points"},{anchor:"transformers.DetaConfig.decoder_n_points",description:`<strong>decoder_n_points</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of sampled keys in each feature level for each attention head in the decoder.`,name:"decoder_n_points"},{anchor:"transformers.DetaConfig.two_stage",description:`<strong>two_stage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply a two-stage deformable DETR, where the region proposals are also generated by a variant of
DETA, which are further fed into the decoder for iterative bounding box refinement.`,name:"two_stage"},{anchor:"transformers.DetaConfig.two_stage_num_proposals",description:`<strong>two_stage_num_proposals</strong> (<code>int</code>, <em>optional</em>, defaults to 300) &#x2014;
The number of region proposals to be generated, in case <code>two_stage</code> is set to <code>True</code>.`,name:"two_stage_num_proposals"},{anchor:"transformers.DetaConfig.with_box_refine",description:`<strong>with_box_refine</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply iterative bounding box refinement, where each decoder layer refines the bounding boxes
based on the predictions from the previous layer.`,name:"with_box_refine"},{anchor:"transformers.DetaConfig.focal_alpha",description:`<strong>focal_alpha</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) &#x2014;
Alpha parameter in the focal loss.`,name:"focal_alpha"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deta/configuration_deta.py#L31"}}),ne=new Ps({props:{anchor:"transformers.DetaConfig.example",$$slots:{default:[Wa]},$$scope:{ctx:C}}}),$e=new H({props:{name:"to_dict",anchor:"transformers.DetaConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deta/configuration_deta.py#L234"}}),ke=new Ge({}),Ce=new H({props:{name:"class transformers.DetaImageProcessor",anchor:"transformers.DetaImageProcessor",parameters:[{name:"format",val:": typing.Union[str, transformers.models.deta.image_processing_deta.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.DetaImageProcessor.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.DetaImageProcessor.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 (height, width) 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.DetaImageProcessor.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 (height, width) dimensions after resizing. Can be overridden by the <code>size</code> parameter in
the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.30.0/src/transformers/models/deta/image_processing_deta.py#L449"}}),Ie=new H({props:{name:"preprocess",anchor:"transformers.DetaImageProcessor.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.List[typing.Dict], typing.List[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.deta.image_processing_deta.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.DetaImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image or batch of images to preprocess.`,name:"images"},{anchor:"transformers.DetaImageProcessor.preprocess.annotations",description:`<strong>annotations</strong> (<code>List[Dict]</code> or <code>List[List[Dict]]</code>, <em>optional</em>) &#x2014;
List of annotations associated with the image or batch of images. If annotionation 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 annotionation 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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.DetaImageProcessor.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.30.0/src/transformers/models/deta/image_processing_deta.py#L739"}}),ze=new H({props:{name:"post_process_object_detection",anchor:"transformers.DetaImageProcessor.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"},{name:"nms_threshold",val:": float = 0.7"}],parametersDescription:[{anchor:"transformers.DetaImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DetaImageProcessor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.DetaImageProcessor.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
(height, width) of each image in the batch. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.DetaImageProcessor.post_process_object_detection.nms_threshold",description:`<strong>nms_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.7) &#x2014;
NMS threshold.`,name:"nms_threshold"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deta/image_processing_deta.py#L936",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>
`}}),Ne=new Ge({}),Fe=new H({props:{name:"class transformers.DetaModel",anchor:"transformers.DetaModel",parameters:[{name:"config",val:": DetaConfig"}],parametersDescription:[{anchor:"transformers.DetaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaConfig">DetaConfig</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.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deta/modeling_deta.py#L1359"}}),Re=new H({props:{name:"forward",anchor:"transformers.DetaModel.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.DetaModel.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.DetaModel.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.DetaModel.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.DetaModel.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.DetaModel.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.DetaModel.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.DetaModel.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.DetaModel.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.DetaModel.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.30.0/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.30.0/src/transformers/models/deta/modeling_deta.py#L1524",returnDescription:`
<p>A <code>transformers.models.deta.modeling_deta.DetaModelOutput</code> 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.30.0/en/model_doc/deta#transformers.DetaConfig"
>DetaConfig</a>) and inputs.</p>
<ul>
<li><strong>init_reference_points</strong> (<code>torch.FloatTensor</code> of shape  <code>(batch_size, num_queries, 4)</code>) \u2014 Initial reference points sent through the Transformer decoder.</li>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><strong>intermediate_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.decoder_layers, num_queries, hidden_size)</code>) \u2014 Stacked intermediate hidden states (output of each layer of the decoder).</li>
<li><strong>intermediate_reference_points</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.decoder_layers, num_queries, 4)</code>) \u2014 Stacked intermediate reference points (reference points of each layer of the decoder).</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, num_queries, 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, num_queries, num_queries)</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_queries, num_heads, 4, 4)</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_queries, num_heads, 4, 4)</code>.
Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</li>
<li><strong>enc_outputs_class</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Predicted bounding boxes scores where the top <code>config.two_stage_num_proposals</code> scoring bounding boxes are
picked as region proposals in the first stage. Output of bounding box binary classification (i.e.
foreground and background).</li>
<li><strong>enc_outputs_coord_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Logits of predicted bounding boxes coordinates in the first stage.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deta.modeling_deta.DetaModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new Fa({props:{$$slots:{default:[Sa]},$$scope:{ctx:C}}}),ce=new Ps({props:{anchor:"transformers.DetaModel.forward.example",$$slots:{default:[Oa]},$$scope:{ctx:C}}}),qe=new Ge({}),Ze=new H({props:{name:"class transformers.DetaForObjectDetection",anchor:"transformers.DetaForObjectDetection",parameters:[{name:"config",val:": DetaConfig"}],parametersDescription:[{anchor:"transformers.DetaForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaConfig">DetaConfig</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.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deta/modeling_deta.py#L1776"}}),Ve=new H({props:{name:"forward",anchor:"transformers.DetaForObjectDetection.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.DetaForObjectDetection.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.DetaForObjectDetection.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DetaForObjectDetection.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.30.0/src/transformers/models/deta/modeling_deta.py#L1829",returnDescription:`
<p>A <code>transformers.models.deta.modeling_deta.DetaObjectDetectionOutput</code> 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.30.0/en/model_doc/deta#transformers.DetaConfig"
>DetaConfig</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 <code>~DetaProcessor.post_process_object_detection</code> 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, num_queries, 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, num_queries, 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, num_queries, num_queries)</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_queries, num_heads, 4, 4)</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, sequence_length, num_heads, 4, 4)</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>(batch_size, config.decoder_layers, num_queries, hidden_size)</code>) \u2014 Stacked intermediate hidden states (output of each layer of the decoder).</li>
<li><strong>intermediate_reference_points</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.decoder_layers, num_queries, 4)</code>) \u2014 Stacked intermediate reference points (reference points of each layer of the decoder).</li>
<li><strong>init_reference_points</strong> (<code>torch.FloatTensor</code> of shape  <code>(batch_size, num_queries, 4)</code>) \u2014 Initial reference points sent through the Transformer decoder.</li>
<li><strong>enc_outputs_class</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Predicted bounding boxes scores where the top <code>config.two_stage_num_proposals</code> scoring bounding boxes are
picked as region proposals in the first stage. Output of bounding box binary classification (i.e.
foreground and background).</li>
<li><strong>enc_outputs_coord_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Logits of predicted bounding boxes coordinates in the first stage.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deta.modeling_deta.DetaObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new Fa({props:{$$slots:{default:[Va]},$$scope:{ctx:C}}}),pe=new Ps({props:{anchor:"transformers.DetaForObjectDetection.forward.example",$$slots:{default:[La]},$$scope:{ctx:C}}}),{c(){f=n("meta"),v=m(),_=n("h1"),u=n("a"),b=n("span"),y(d.$$.fragment),g=m(),P=n("span"),Io=r("DETA"),Vt=m(),R=n("h2"),Y=n("a"),Tt=n("span"),y(_e.$$.fragment),zo=m(),Dt=n("span"),Po=r("Overview"),Lt=m(),N=n("p"),No=r("The DETA model was proposed in "),be=n("a"),Fo=r("NMS Strikes Back"),Ao=r(` by Jeffrey Ouyang-Zhang, Jang Hyun Cho, Xingyi Zhou, Philipp Kr\xE4henb\xFChl.
DETA (short for Detection Transformers with Assignment) improves `),Xe=n("a"),Uo=r("Deformable DETR"),Jo=r(` by replacing the one-to-one bipartite Hungarian matching loss
with one-to-many label assignments used in traditional detectors with non-maximum suppression (NMS). This leads to significant gains of up to 2.5 mAP.`),Bt=m(),He=n("p"),Ro=r("The abstract from the paper is the following:"),Gt=m(),Ye=n("p"),Mt=n("em"),qo=r("Detection Transformer (DETR) directly transforms queries to unique objects by using one-to-one bipartite matching during training and enables end-to-end object detection. Recently, these models have surpassed traditional detectors on COCO with undeniable elegance. However, they differ from traditional detectors in multiple designs, including model architecture and training schedules, and thus the effectiveness of one-to-one matching is not fully understood. In this work, we conduct a strict comparison between the one-to-one Hungarian matching in DETRs and the one-to-many label assignments in traditional detectors with non-maximum supervision (NMS). Surprisingly, we observe one-to-many assignments with NMS consistently outperform standard one-to-one matching under the same setting, with a significant gain of up to 2.5 mAP. Our detector that trains Deformable-DETR with traditional IoU-based label assignment achieved 50.2 COCO mAP within 12 epochs (1x schedule) with ResNet50 backbone, outperforming all existing traditional or transformer-based detectors in this setting. On multiple datasets, schedules, and architectures, we consistently show bipartite matching is unnecessary for performant detection transformers. Furthermore, we attribute the success of detection transformers to their expressive transformer architecture."),Xt=m(),Qe=n("p"),Zo=r("Tips:"),Ht=m(),Ke=n("ul"),ve=n("li"),Wo=r("One can use "),et=n("a"),So=r("DetaImageProcessor"),Oo=r(" to prepare images and optional targets for the model."),Yt=m(),Q=n("img"),Qt=m(),K=n("small"),Vo=r("DETA overview. Taken from the "),tt=n("a"),Lo=r("original paper"),Bo=r("."),Kt=m(),F=n("p"),Go=r("This model was contributed by "),ye=n("a"),Xo=r("nielsr"),Ho=r(`.
The original code can be found `),we=n("a"),Yo=r("here"),Qo=r("."),eo=m(),q=n("h2"),ee=n("a"),jt=n("span"),y(Te.$$.fragment),Ko=m(),xt=n("span"),en=r("Resources"),to=m(),ot=n("p"),tn=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DETA."),oo=m(),te=n("ul"),De=n("li"),on=r("Demo notebooks for DETA can be found "),Me=n("a"),nn=r("here"),sn=r("."),an=m(),nt=n("li"),rn=r("See also: "),st=n("a"),ln=r("Object detection task guide"),no=m(),at=n("p"),dn=r("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."),so=m(),Z=n("h2"),oe=n("a"),Et=n("span"),y(je.$$.fragment),cn=m(),$t=n("span"),mn=r("DetaConfig"),ao=m(),x=n("div"),y(xe.$$.fragment),hn=m(),W=n("p"),pn=r("This is the configuration class to store the configuration of a "),rt=n("a"),fn=r("DetaModel"),un=r(`. It is used to instantiate a DETA
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 DETA
`),Ee=n("a"),gn=r("SenseTime/deformable-detr"),_n=r(" architecture."),bn=m(),S=n("p"),vn=r("Configuration objects inherit from "),it=n("a"),yn=r("PretrainedConfig"),wn=r(` and can be used to control the model outputs. Read the
documentation from `),lt=n("a"),Tn=r("PretrainedConfig"),Dn=r(" for more information."),Mn=m(),y(ne.$$.fragment),jn=m(),se=n("div"),y($e.$$.fragment),xn=m(),O=n("p"),En=r("Serializes this instance to a Python dictionary. Override the default "),dt=n("a"),$n=r("to_dict()"),kn=r(`. Returns:
`),kt=n("code"),Cn=r("Dict[str, any]"),In=r(": Dictionary of all the attributes that make up this configuration instance,"),ro=m(),V=n("h2"),ae=n("a"),Ct=n("span"),y(ke.$$.fragment),zn=m(),It=n("span"),Pn=r("DetaImageProcessor"),io=m(),k=n("div"),y(Ce.$$.fragment),Nn=m(),zt=n("p"),Fn=r("Constructs a Deformable DETR image processor."),An=m(),re=n("div"),y(Ie.$$.fragment),Un=m(),Pt=n("p"),Jn=r("Preprocess an image or a batch of images so that it can be used by the model."),Rn=m(),ie=n("div"),y(ze.$$.fragment),qn=m(),Pe=n("p"),Zn=r("Converts the output of "),ct=n("a"),Wn=r("DetaForObjectDetection"),Sn=r(` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),lo=m(),L=n("h2"),le=n("a"),Nt=n("span"),y(Ne.$$.fragment),On=m(),Ft=n("span"),Vn=r("DetaModel"),co=m(),E=n("div"),y(Fe.$$.fragment),Ln=m(),At=n("p"),Bn=r(`The bare DETA Model (consisting of a backbone and encoder-decoder Transformer) outputting raw hidden-states without
any specific head on top.`),Gn=m(),Ae=n("p"),Xn=r("This model inherits from "),mt=n("a"),Hn=r("PreTrainedModel"),Yn=r(`. 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.)`),Qn=m(),Ue=n("p"),Kn=r("This model is also a PyTorch "),Je=n("a"),es=r("torch.nn.Module"),ts=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),os=m(),I=n("div"),y(Re.$$.fragment),ns=m(),B=n("p"),ss=r("The "),ht=n("a"),as=r("DetaModel"),rs=r(" forward method, overrides the "),Ut=n("code"),is=r("__call__"),ls=r(" special method."),ds=m(),y(de.$$.fragment),cs=m(),y(ce.$$.fragment),mo=m(),G=n("h2"),me=n("a"),Jt=n("span"),y(qe.$$.fragment),ms=m(),Rt=n("span"),hs=r("DetaForObjectDetection"),ho=m(),$=n("div"),y(Ze.$$.fragment),ps=m(),qt=n("p"),fs=r(`DETA Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on top, for tasks
such as COCO detection.`),us=m(),We=n("p"),gs=r("This model inherits from "),pt=n("a"),_s=r("PreTrainedModel"),bs=r(`. 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.)`),vs=m(),Se=n("p"),ys=r("This model is also a PyTorch "),Oe=n("a"),ws=r("torch.nn.Module"),Ts=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ds=m(),z=n("div"),y(Ve.$$.fragment),Ms=m(),X=n("p"),js=r("The "),ft=n("a"),xs=r("DetaForObjectDetection"),Es=r(" forward method, overrides the "),Zt=n("code"),$s=r("__call__"),ks=r(" special method."),Cs=m(),y(he.$$.fragment),Is=m(),y(pe.$$.fragment),this.h()},l(t){const c=Ra('[data-svelte="svelte-1phssyn"]',document.head);f=s(c,"META",{name:!0,content:!0}),c.forEach(o),v=h(t),_=s(t,"H1",{class:!0});var Le=a(_);u=s(Le,"A",{id:!0,class:!0,href:!0});var Wt=a(u);b=s(Wt,"SPAN",{});var St=a(b);w(d.$$.fragment,St),St.forEach(o),Wt.forEach(o),g=h(Le),P=s(Le,"SPAN",{});var Ot=a(P);Io=i(Ot,"DETA"),Ot.forEach(o),Le.forEach(o),Vt=h(t),R=s(t,"H2",{class:!0});var Be=a(R);Y=s(Be,"A",{id:!0,class:!0,href:!0});var Us=a(Y);Tt=s(Us,"SPAN",{});var Js=a(Tt);w(_e.$$.fragment,Js),Js.forEach(o),Us.forEach(o),zo=h(Be),Dt=s(Be,"SPAN",{});var Rs=a(Dt);Po=i(Rs,"Overview"),Rs.forEach(o),Be.forEach(o),Lt=h(t),N=s(t,"P",{});var ut=a(N);No=i(ut,"The DETA model was proposed in "),be=s(ut,"A",{href:!0,rel:!0});var qs=a(be);Fo=i(qs,"NMS Strikes Back"),qs.forEach(o),Ao=i(ut,` by Jeffrey Ouyang-Zhang, Jang Hyun Cho, Xingyi Zhou, Philipp Kr\xE4henb\xFChl.
DETA (short for Detection Transformers with Assignment) improves `),Xe=s(ut,"A",{href:!0});var Zs=a(Xe);Uo=i(Zs,"Deformable DETR"),Zs.forEach(o),Jo=i(ut,` by replacing the one-to-one bipartite Hungarian matching loss
with one-to-many label assignments used in traditional detectors with non-maximum suppression (NMS). This leads to significant gains of up to 2.5 mAP.`),ut.forEach(o),Bt=h(t),He=s(t,"P",{});var Ws=a(He);Ro=i(Ws,"The abstract from the paper is the following:"),Ws.forEach(o),Gt=h(t),Ye=s(t,"P",{});var Ss=a(Ye);Mt=s(Ss,"EM",{});var Os=a(Mt);qo=i(Os,"Detection Transformer (DETR) directly transforms queries to unique objects by using one-to-one bipartite matching during training and enables end-to-end object detection. Recently, these models have surpassed traditional detectors on COCO with undeniable elegance. However, they differ from traditional detectors in multiple designs, including model architecture and training schedules, and thus the effectiveness of one-to-one matching is not fully understood. In this work, we conduct a strict comparison between the one-to-one Hungarian matching in DETRs and the one-to-many label assignments in traditional detectors with non-maximum supervision (NMS). Surprisingly, we observe one-to-many assignments with NMS consistently outperform standard one-to-one matching under the same setting, with a significant gain of up to 2.5 mAP. Our detector that trains Deformable-DETR with traditional IoU-based label assignment achieved 50.2 COCO mAP within 12 epochs (1x schedule) with ResNet50 backbone, outperforming all existing traditional or transformer-based detectors in this setting. On multiple datasets, schedules, and architectures, we consistently show bipartite matching is unnecessary for performant detection transformers. Furthermore, we attribute the success of detection transformers to their expressive transformer architecture."),Os.forEach(o),Ss.forEach(o),Xt=h(t),Qe=s(t,"P",{});var Vs=a(Qe);Zo=i(Vs,"Tips:"),Vs.forEach(o),Ht=h(t),Ke=s(t,"UL",{});var Ls=a(Ke);ve=s(Ls,"LI",{});var fo=a(ve);Wo=i(fo,"One can use "),et=s(fo,"A",{href:!0});var Bs=a(et);So=i(Bs,"DetaImageProcessor"),Bs.forEach(o),Oo=i(fo," to prepare images and optional targets for the model."),fo.forEach(o),Ls.forEach(o),Yt=h(t),Q=s(t,"IMG",{src:!0,alt:!0,width:!0}),Qt=h(t),K=s(t,"SMALL",{});var uo=a(K);Vo=i(uo,"DETA overview. Taken from the "),tt=s(uo,"A",{href:!0});var Gs=a(tt);Lo=i(Gs,"original paper"),Gs.forEach(o),Bo=i(uo,"."),uo.forEach(o),Kt=h(t),F=s(t,"P",{});var gt=a(F);Go=i(gt,"This model was contributed by "),ye=s(gt,"A",{href:!0,rel:!0});var Xs=a(ye);Xo=i(Xs,"nielsr"),Xs.forEach(o),Ho=i(gt,`.
The original code can be found `),we=s(gt,"A",{href:!0,rel:!0});var Hs=a(we);Yo=i(Hs,"here"),Hs.forEach(o),Qo=i(gt,"."),gt.forEach(o),eo=h(t),q=s(t,"H2",{class:!0});var go=a(q);ee=s(go,"A",{id:!0,class:!0,href:!0});var Ys=a(ee);jt=s(Ys,"SPAN",{});var Qs=a(jt);w(Te.$$.fragment,Qs),Qs.forEach(o),Ys.forEach(o),Ko=h(go),xt=s(go,"SPAN",{});var Ks=a(xt);en=i(Ks,"Resources"),Ks.forEach(o),go.forEach(o),to=h(t),ot=s(t,"P",{});var ea=a(ot);tn=i(ea,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DETA."),ea.forEach(o),oo=h(t),te=s(t,"UL",{});var _o=a(te);De=s(_o,"LI",{});var bo=a(De);on=i(bo,"Demo notebooks for DETA can be found "),Me=s(bo,"A",{href:!0,rel:!0});var ta=a(Me);nn=i(ta,"here"),ta.forEach(o),sn=i(bo,"."),bo.forEach(o),an=h(_o),nt=s(_o,"LI",{});var zs=a(nt);rn=i(zs,"See also: "),st=s(zs,"A",{href:!0});var oa=a(st);ln=i(oa,"Object detection task guide"),oa.forEach(o),zs.forEach(o),_o.forEach(o),no=h(t),at=s(t,"P",{});var na=a(at);dn=i(na,"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."),na.forEach(o),so=h(t),Z=s(t,"H2",{class:!0});var vo=a(Z);oe=s(vo,"A",{id:!0,class:!0,href:!0});var sa=a(oe);Et=s(sa,"SPAN",{});var aa=a(Et);w(je.$$.fragment,aa),aa.forEach(o),sa.forEach(o),cn=h(vo),$t=s(vo,"SPAN",{});var ra=a($t);mn=i(ra,"DetaConfig"),ra.forEach(o),vo.forEach(o),ao=h(t),x=s(t,"DIV",{class:!0});var A=a(x);w(xe.$$.fragment,A),hn=h(A),W=s(A,"P",{});var _t=a(W);pn=i(_t,"This is the configuration class to store the configuration of a "),rt=s(_t,"A",{href:!0});var ia=a(rt);fn=i(ia,"DetaModel"),ia.forEach(o),un=i(_t,`. It is used to instantiate a DETA
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 DETA
`),Ee=s(_t,"A",{href:!0,rel:!0});var la=a(Ee);gn=i(la,"SenseTime/deformable-detr"),la.forEach(o),_n=i(_t," architecture."),_t.forEach(o),bn=h(A),S=s(A,"P",{});var bt=a(S);vn=i(bt,"Configuration objects inherit from "),it=s(bt,"A",{href:!0});var da=a(it);yn=i(da,"PretrainedConfig"),da.forEach(o),wn=i(bt,` and can be used to control the model outputs. Read the
documentation from `),lt=s(bt,"A",{href:!0});var ca=a(lt);Tn=i(ca,"PretrainedConfig"),ca.forEach(o),Dn=i(bt," for more information."),bt.forEach(o),Mn=h(A),w(ne.$$.fragment,A),jn=h(A),se=s(A,"DIV",{class:!0});var yo=a(se);w($e.$$.fragment,yo),xn=h(yo),O=s(yo,"P",{});var vt=a(O);En=i(vt,"Serializes this instance to a Python dictionary. Override the default "),dt=s(vt,"A",{href:!0});var ma=a(dt);$n=i(ma,"to_dict()"),ma.forEach(o),kn=i(vt,`. Returns:
`),kt=s(vt,"CODE",{});var ha=a(kt);Cn=i(ha,"Dict[str, any]"),ha.forEach(o),In=i(vt,": Dictionary of all the attributes that make up this configuration instance,"),vt.forEach(o),yo.forEach(o),A.forEach(o),ro=h(t),V=s(t,"H2",{class:!0});var wo=a(V);ae=s(wo,"A",{id:!0,class:!0,href:!0});var pa=a(ae);Ct=s(pa,"SPAN",{});var fa=a(Ct);w(ke.$$.fragment,fa),fa.forEach(o),pa.forEach(o),zn=h(wo),It=s(wo,"SPAN",{});var ua=a(It);Pn=i(ua,"DetaImageProcessor"),ua.forEach(o),wo.forEach(o),io=h(t),k=s(t,"DIV",{class:!0});var fe=a(k);w(Ce.$$.fragment,fe),Nn=h(fe),zt=s(fe,"P",{});var ga=a(zt);Fn=i(ga,"Constructs a Deformable DETR image processor."),ga.forEach(o),An=h(fe),re=s(fe,"DIV",{class:!0});var To=a(re);w(Ie.$$.fragment,To),Un=h(To),Pt=s(To,"P",{});var _a=a(Pt);Jn=i(_a,"Preprocess an image or a batch of images so that it can be used by the model."),_a.forEach(o),To.forEach(o),Rn=h(fe),ie=s(fe,"DIV",{class:!0});var Do=a(ie);w(ze.$$.fragment,Do),qn=h(Do),Pe=s(Do,"P",{});var Mo=a(Pe);Zn=i(Mo,"Converts the output of "),ct=s(Mo,"A",{href:!0});var ba=a(ct);Wn=i(ba,"DetaForObjectDetection"),ba.forEach(o),Sn=i(Mo,` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Mo.forEach(o),Do.forEach(o),fe.forEach(o),lo=h(t),L=s(t,"H2",{class:!0});var jo=a(L);le=s(jo,"A",{id:!0,class:!0,href:!0});var va=a(le);Nt=s(va,"SPAN",{});var ya=a(Nt);w(Ne.$$.fragment,ya),ya.forEach(o),va.forEach(o),On=h(jo),Ft=s(jo,"SPAN",{});var wa=a(Ft);Vn=i(wa,"DetaModel"),wa.forEach(o),jo.forEach(o),co=h(t),E=s(t,"DIV",{class:!0});var U=a(E);w(Fe.$$.fragment,U),Ln=h(U),At=s(U,"P",{});var Ta=a(At);Bn=i(Ta,`The bare DETA Model (consisting of a backbone and encoder-decoder Transformer) outputting raw hidden-states without
any specific head on top.`),Ta.forEach(o),Gn=h(U),Ae=s(U,"P",{});var xo=a(Ae);Xn=i(xo,"This model inherits from "),mt=s(xo,"A",{href:!0});var Da=a(mt);Hn=i(Da,"PreTrainedModel"),Da.forEach(o),Yn=i(xo,`. 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.)`),xo.forEach(o),Qn=h(U),Ue=s(U,"P",{});var Eo=a(Ue);Kn=i(Eo,"This model is also a PyTorch "),Je=s(Eo,"A",{href:!0,rel:!0});var Ma=a(Je);es=i(Ma,"torch.nn.Module"),Ma.forEach(o),ts=i(Eo,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Eo.forEach(o),os=h(U),I=s(U,"DIV",{class:!0});var ue=a(I);w(Re.$$.fragment,ue),ns=h(ue),B=s(ue,"P",{});var yt=a(B);ss=i(yt,"The "),ht=s(yt,"A",{href:!0});var ja=a(ht);as=i(ja,"DetaModel"),ja.forEach(o),rs=i(yt," forward method, overrides the "),Ut=s(yt,"CODE",{});var xa=a(Ut);is=i(xa,"__call__"),xa.forEach(o),ls=i(yt," special method."),yt.forEach(o),ds=h(ue),w(de.$$.fragment,ue),cs=h(ue),w(ce.$$.fragment,ue),ue.forEach(o),U.forEach(o),mo=h(t),G=s(t,"H2",{class:!0});var $o=a(G);me=s($o,"A",{id:!0,class:!0,href:!0});var Ea=a(me);Jt=s(Ea,"SPAN",{});var $a=a(Jt);w(qe.$$.fragment,$a),$a.forEach(o),Ea.forEach(o),ms=h($o),Rt=s($o,"SPAN",{});var ka=a(Rt);hs=i(ka,"DetaForObjectDetection"),ka.forEach(o),$o.forEach(o),ho=h(t),$=s(t,"DIV",{class:!0});var J=a($);w(Ze.$$.fragment,J),ps=h(J),qt=s(J,"P",{});var Ca=a(qt);fs=i(Ca,`DETA Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on top, for tasks
such as COCO detection.`),Ca.forEach(o),us=h(J),We=s(J,"P",{});var ko=a(We);gs=i(ko,"This model inherits from "),pt=s(ko,"A",{href:!0});var Ia=a(pt);_s=i(Ia,"PreTrainedModel"),Ia.forEach(o),bs=i(ko,`. 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.)`),ko.forEach(o),vs=h(J),Se=s(J,"P",{});var Co=a(Se);ys=i(Co,"This model is also a PyTorch "),Oe=s(Co,"A",{href:!0,rel:!0});var za=a(Oe);ws=i(za,"torch.nn.Module"),za.forEach(o),Ts=i(Co,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Co.forEach(o),Ds=h(J),z=s(J,"DIV",{class:!0});var ge=a(z);w(Ve.$$.fragment,ge),Ms=h(ge),X=s(ge,"P",{});var wt=a(X);js=i(wt,"The "),ft=s(wt,"A",{href:!0});var Pa=a(ft);xs=i(Pa,"DetaForObjectDetection"),Pa.forEach(o),Es=i(wt," forward method, overrides the "),Zt=s(wt,"CODE",{});var Na=a(Zt);$s=i(Na,"__call__"),Na.forEach(o),ks=i(wt," special method."),wt.forEach(o),Cs=h(ge),w(he.$$.fragment,ge),Is=h(ge),w(pe.$$.fragment,ge),ge.forEach(o),J.forEach(o),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(Ga)),l(u,"id","deta"),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","#deta"),l(_,"class","relative group"),l(Y,"id","overview"),l(Y,"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(Y,"href","#overview"),l(R,"class","relative group"),l(be,"href","https://arxiv.org/abs/2212.06137"),l(be,"rel","nofollow"),l(Xe,"href","deformable_detr"),l(et,"href","/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaImageProcessor"),qa(Q.src,As="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/deta_architecture.jpg")||l(Q,"src",As),l(Q,"alt","drawing"),l(Q,"width","600"),l(tt,"href","https://arxiv.org/abs/2212.06137"),l(ye,"href","https://huggingface.co/nielsr"),l(ye,"rel","nofollow"),l(we,"href","https://github.com/jozhang97/DETA"),l(we,"rel","nofollow"),l(ee,"id","resources"),l(ee,"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(ee,"href","#resources"),l(q,"class","relative group"),l(Me,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DETA"),l(Me,"rel","nofollow"),l(st,"href","../tasks/object_detection"),l(oe,"id","transformers.DetaConfig"),l(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(oe,"href","#transformers.DetaConfig"),l(Z,"class","relative group"),l(rt,"href","/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaModel"),l(Ee,"href","https://huggingface.co/SenseTime/deformable-detr"),l(Ee,"rel","nofollow"),l(it,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(lt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(dt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(ae,"id","transformers.DetaImageProcessor"),l(ae,"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(ae,"href","#transformers.DetaImageProcessor"),l(V,"class","relative group"),l(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ct,"href","/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaForObjectDetection"),l(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(le,"id","transformers.DetaModel"),l(le,"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(le,"href","#transformers.DetaModel"),l(L,"class","relative group"),l(mt,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),l(Je,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Je,"rel","nofollow"),l(ht,"href","/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaModel"),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(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"id","transformers.DetaForObjectDetection"),l(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(me,"href","#transformers.DetaForObjectDetection"),l(G,"class","relative group"),l(pt,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),l(Oe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Oe,"rel","nofollow"),l(ft,"href","/docs/transformers/v4.30.0/en/model_doc/deta#transformers.DetaForObjectDetection"),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($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,c){e(document.head,f),p(t,v,c),p(t,_,c),e(_,u),e(u,b),T(d,b,null),e(_,g),e(_,P),e(P,Io),p(t,Vt,c),p(t,R,c),e(R,Y),e(Y,Tt),T(_e,Tt,null),e(R,zo),e(R,Dt),e(Dt,Po),p(t,Lt,c),p(t,N,c),e(N,No),e(N,be),e(be,Fo),e(N,Ao),e(N,Xe),e(Xe,Uo),e(N,Jo),p(t,Bt,c),p(t,He,c),e(He,Ro),p(t,Gt,c),p(t,Ye,c),e(Ye,Mt),e(Mt,qo),p(t,Xt,c),p(t,Qe,c),e(Qe,Zo),p(t,Ht,c),p(t,Ke,c),e(Ke,ve),e(ve,Wo),e(ve,et),e(et,So),e(ve,Oo),p(t,Yt,c),p(t,Q,c),p(t,Qt,c),p(t,K,c),e(K,Vo),e(K,tt),e(tt,Lo),e(K,Bo),p(t,Kt,c),p(t,F,c),e(F,Go),e(F,ye),e(ye,Xo),e(F,Ho),e(F,we),e(we,Yo),e(F,Qo),p(t,eo,c),p(t,q,c),e(q,ee),e(ee,jt),T(Te,jt,null),e(q,Ko),e(q,xt),e(xt,en),p(t,to,c),p(t,ot,c),e(ot,tn),p(t,oo,c),p(t,te,c),e(te,De),e(De,on),e(De,Me),e(Me,nn),e(De,sn),e(te,an),e(te,nt),e(nt,rn),e(nt,st),e(st,ln),p(t,no,c),p(t,at,c),e(at,dn),p(t,so,c),p(t,Z,c),e(Z,oe),e(oe,Et),T(je,Et,null),e(Z,cn),e(Z,$t),e($t,mn),p(t,ao,c),p(t,x,c),T(xe,x,null),e(x,hn),e(x,W),e(W,pn),e(W,rt),e(rt,fn),e(W,un),e(W,Ee),e(Ee,gn),e(W,_n),e(x,bn),e(x,S),e(S,vn),e(S,it),e(it,yn),e(S,wn),e(S,lt),e(lt,Tn),e(S,Dn),e(x,Mn),T(ne,x,null),e(x,jn),e(x,se),T($e,se,null),e(se,xn),e(se,O),e(O,En),e(O,dt),e(dt,$n),e(O,kn),e(O,kt),e(kt,Cn),e(O,In),p(t,ro,c),p(t,V,c),e(V,ae),e(ae,Ct),T(ke,Ct,null),e(V,zn),e(V,It),e(It,Pn),p(t,io,c),p(t,k,c),T(Ce,k,null),e(k,Nn),e(k,zt),e(zt,Fn),e(k,An),e(k,re),T(Ie,re,null),e(re,Un),e(re,Pt),e(Pt,Jn),e(k,Rn),e(k,ie),T(ze,ie,null),e(ie,qn),e(ie,Pe),e(Pe,Zn),e(Pe,ct),e(ct,Wn),e(Pe,Sn),p(t,lo,c),p(t,L,c),e(L,le),e(le,Nt),T(Ne,Nt,null),e(L,On),e(L,Ft),e(Ft,Vn),p(t,co,c),p(t,E,c),T(Fe,E,null),e(E,Ln),e(E,At),e(At,Bn),e(E,Gn),e(E,Ae),e(Ae,Xn),e(Ae,mt),e(mt,Hn),e(Ae,Yn),e(E,Qn),e(E,Ue),e(Ue,Kn),e(Ue,Je),e(Je,es),e(Ue,ts),e(E,os),e(E,I),T(Re,I,null),e(I,ns),e(I,B),e(B,ss),e(B,ht),e(ht,as),e(B,rs),e(B,Ut),e(Ut,is),e(B,ls),e(I,ds),T(de,I,null),e(I,cs),T(ce,I,null),p(t,mo,c),p(t,G,c),e(G,me),e(me,Jt),T(qe,Jt,null),e(G,ms),e(G,Rt),e(Rt,hs),p(t,ho,c),p(t,$,c),T(Ze,$,null),e($,ps),e($,qt),e(qt,fs),e($,us),e($,We),e(We,gs),e(We,pt),e(pt,_s),e(We,bs),e($,vs),e($,Se),e(Se,ys),e(Se,Oe),e(Oe,ws),e(Se,Ts),e($,Ds),e($,z),T(Ve,z,null),e(z,Ms),e(z,X),e(X,js),e(X,ft),e(ft,xs),e(X,Es),e(X,Zt),e(Zt,$s),e(X,ks),e(z,Cs),T(he,z,null),e(z,Is),T(pe,z,null),po=!0},p(t,[c]){const Le={};c&2&&(Le.$$scope={dirty:c,ctx:t}),ne.$set(Le);const Wt={};c&2&&(Wt.$$scope={dirty:c,ctx:t}),de.$set(Wt);const St={};c&2&&(St.$$scope={dirty:c,ctx:t}),ce.$set(St);const Ot={};c&2&&(Ot.$$scope={dirty:c,ctx:t}),he.$set(Ot);const Be={};c&2&&(Be.$$scope={dirty:c,ctx:t}),pe.$set(Be)},i(t){po||(D(d.$$.fragment,t),D(_e.$$.fragment,t),D(Te.$$.fragment,t),D(je.$$.fragment,t),D(xe.$$.fragment,t),D(ne.$$.fragment,t),D($e.$$.fragment,t),D(ke.$$.fragment,t),D(Ce.$$.fragment,t),D(Ie.$$.fragment,t),D(ze.$$.fragment,t),D(Ne.$$.fragment,t),D(Fe.$$.fragment,t),D(Re.$$.fragment,t),D(de.$$.fragment,t),D(ce.$$.fragment,t),D(qe.$$.fragment,t),D(Ze.$$.fragment,t),D(Ve.$$.fragment,t),D(he.$$.fragment,t),D(pe.$$.fragment,t),po=!0)},o(t){M(d.$$.fragment,t),M(_e.$$.fragment,t),M(Te.$$.fragment,t),M(je.$$.fragment,t),M(xe.$$.fragment,t),M(ne.$$.fragment,t),M($e.$$.fragment,t),M(ke.$$.fragment,t),M(Ce.$$.fragment,t),M(Ie.$$.fragment,t),M(ze.$$.fragment,t),M(Ne.$$.fragment,t),M(Fe.$$.fragment,t),M(Re.$$.fragment,t),M(de.$$.fragment,t),M(ce.$$.fragment,t),M(qe.$$.fragment,t),M(Ze.$$.fragment,t),M(Ve.$$.fragment,t),M(he.$$.fragment,t),M(pe.$$.fragment,t),po=!1},d(t){o(f),t&&o(v),t&&o(_),j(d),t&&o(Vt),t&&o(R),j(_e),t&&o(Lt),t&&o(N),t&&o(Bt),t&&o(He),t&&o(Gt),t&&o(Ye),t&&o(Xt),t&&o(Qe),t&&o(Ht),t&&o(Ke),t&&o(Yt),t&&o(Q),t&&o(Qt),t&&o(K),t&&o(Kt),t&&o(F),t&&o(eo),t&&o(q),j(Te),t&&o(to),t&&o(ot),t&&o(oo),t&&o(te),t&&o(no),t&&o(at),t&&o(so),t&&o(Z),j(je),t&&o(ao),t&&o(x),j(xe),j(ne),j($e),t&&o(ro),t&&o(V),j(ke),t&&o(io),t&&o(k),j(Ce),j(Ie),j(ze),t&&o(lo),t&&o(L),j(Ne),t&&o(co),t&&o(E),j(Fe),j(Re),j(de),j(ce),t&&o(mo),t&&o(G),j(qe),t&&o(ho),t&&o($),j(Ze),j(Ve),j(he),j(pe)}}}const Ga={local:"deta",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.DetaConfig",title:"DetaConfig"},{local:"transformers.DetaImageProcessor",title:"DetaImageProcessor"},{local:"transformers.DetaModel",title:"DetaModel"},{local:"transformers.DetaForObjectDetection",title:"DetaForObjectDetection"}],title:"DETA"};function Xa(C){return Za(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class or extends Aa{constructor(f){super();Ua(this,f,Xa,Ba,Ja,{})}}export{or as default,Ga as metadata};
