import{S as vs,i as ws,s as Ts,e as r,k as m,w as D,t as s,M as xs,c as n,d as t,m as f,a,x as y,h as i,b as l,N as Ms,G as o,g as p,y as v,q as w,o as T,B as x,v as js,L as ha}from"../../chunks/vendor-hf-doc-builder.js";import{T as ys}from"../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ua}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Te}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as pa}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as $s}from"../../chunks/PipelineTag-hf-doc-builder.js";function Es(C){let h,M,_,u,b;return u=new ua({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlZm9ybWFibGVEZXRyQ29uZmlnJTJDJTIwRGVmb3JtYWJsZURldHJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBEZWZvcm1hYmxlJTIwREVUUiUyMFNlbnNlVGltZSUyRmRlZm9ybWFibGUtZGV0ciUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBEZWZvcm1hYmxlRGV0ckNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBTZW5zZVRpbWUlMkZkZWZvcm1hYmxlLWRldHIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMERlZm9ybWFibGVEZXRyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DeformableDetrConfig, DeformableDetrModel

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

<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 = DeformableDetrModel(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(){h=r("p"),M=s("Examples:"),_=m(),D(u.$$.fragment)},l(c){h=n(c,"P",{});var g=a(h);M=i(g,"Examples:"),g.forEach(t),_=f(c),y(u.$$.fragment,c)},m(c,g){p(c,h,g),o(h,M),p(c,_,g),v(u,c,g),b=!0},p:ha,i(c){b||(w(u.$$.fragment,c),b=!0)},o(c){T(u.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),x(u,c)}}}function ks(C){let h,M,_,u,b;return{c(){h=r("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),b=s(`
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(c){h=n(c,"P",{});var g=a(h);M=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var F=a(_);u=i(F,"Module"),F.forEach(t),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(t)},m(c,g){p(c,h,g),o(h,M),o(h,_),o(_,u),o(h,b)},d(c){c&&t(h)}}}function Cs(C){let h,M,_,u,b;return u=new ua({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERlZm9ybWFibGVEZXRyTW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNlbnNlVGltZSUyRmRlZm9ybWFibGUtZGV0ciUyMiklMEFtb2RlbCUyMCUzRCUyMERlZm9ybWFibGVEZXRyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMlNlbnNlVGltZSUyRmRlZm9ybWFibGUtZGV0ciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeformableDetrModel
<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;SenseTime/deformable-detr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeformableDetrModel.from_pretrained(<span class="hljs-string">&quot;SenseTime/deformable-detr&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>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">300</span>, <span class="hljs-number">256</span>]`}}),{c(){h=r("p"),M=s("Examples:"),_=m(),D(u.$$.fragment)},l(c){h=n(c,"P",{});var g=a(h);M=i(g,"Examples:"),g.forEach(t),_=f(c),y(u.$$.fragment,c)},m(c,g){p(c,h,g),o(h,M),p(c,_,g),v(u,c,g),b=!0},p:ha,i(c){b||(w(u.$$.fragment,c),b=!0)},o(c){T(u.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),x(u,c)}}}function Us(C){let h,M,_,u,b;return{c(){h=r("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),b=s(`
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(c){h=n(c,"P",{});var g=a(h);M=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var F=a(_);u=i(F,"Module"),F.forEach(t),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(t)},m(c,g){p(c,h,g),o(h,M),o(h,_),o(_,u),o(h,b)},d(c){c&&t(h)}}}function zs(C){let h,M,_,u,b;return u=new ua({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERlZm9ybWFibGVEZXRyRm9yT2JqZWN0RGV0ZWN0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTZW5zZVRpbWUlMkZkZWZvcm1hYmxlLWRldHIlMjIpJTBBbW9kZWwlMjAlM0QlMjBEZWZvcm1hYmxlRGV0ckZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyU2Vuc2VUaW1lJTJGZGVmb3JtYWJsZS1kZXRyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMGNvbnZlcnQlMjBvdXRwdXRzJTIwKGJvdW5kaW5nJTIwYm94ZXMlMjBhbmQlMjBjbGFzcyUyMGxvZ2l0cyklMjB0byUyMENPQ08lMjBBUEklMEF0YXJnZXRfc2l6ZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCaW1hZ2Uuc2l6ZSU1QiUzQSUzQS0xJTVEJTVEKSUwQXJlc3VsdHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IucG9zdF9wcm9jZXNzX29iamVjdF9kZXRlY3Rpb24ob3V0cHV0cyUyQyUyMHRocmVzaG9sZCUzRDAuNSUyQyUyMHRhcmdldF9zaXplcyUzRHRhcmdldF9zaXplcyklNUIlMEElMjAlMjAlMjAlMjAwJTBBJTVEJTBBZm9yJTIwc2NvcmUlMkMlMjBsYWJlbCUyQyUyMGJveCUyMGluJTIwemlwKHJlc3VsdHMlNUIlMjJzY29yZXMlMjIlNUQlMkMlMjByZXN1bHRzJTVCJTIybGFiZWxzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QiUyMmJveGVzJTIyJTVEKSUzQSUwQSUyMCUyMCUyMCUyMGJveCUyMCUzRCUyMCU1QnJvdW5kKGklMkMlMjAyKSUyMGZvciUyMGklMjBpbiUyMGJveC50b2xpc3QoKSU1RCUwQSUyMCUyMCUyMCUyMHByaW50KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGYlMjJEZXRlY3RlZCUyMCU3Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmxhYmVsLml0ZW0oKSU1RCU3RCUyMHdpdGglMjBjb25maWRlbmNlJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMiU3QnJvdW5kKHNjb3JlLml0ZW0oKSUyQyUyMDMpJTdEJTIwYXQlMjBsb2NhdGlvbiUyMCU3QmJveCU3RCUyMiUwQSUyMCUyMCUyMCUyMCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeformableDetrForObjectDetection
<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;SenseTime/deformable-detr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeformableDetrForObjectDetection.from_pretrained(<span class="hljs-string">&quot;SenseTime/deformable-detr&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.8</span> at location [<span class="hljs-number">16.5</span>, <span class="hljs-number">52.84</span>, <span class="hljs-number">318.25</span>, <span class="hljs-number">470.78</span>]
Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.789</span> at location [<span class="hljs-number">342.19</span>, <span class="hljs-number">24.3</span>, <span class="hljs-number">640.02</span>, <span class="hljs-number">372.25</span>]
Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.633</span> at location [<span class="hljs-number">40.79</span>, <span class="hljs-number">72.78</span>, <span class="hljs-number">176.76</span>, <span class="hljs-number">117.25</span>]`}}),{c(){h=r("p"),M=s("Examples:"),_=m(),D(u.$$.fragment)},l(c){h=n(c,"P",{});var g=a(h);M=i(g,"Examples:"),g.forEach(t),_=f(c),y(u.$$.fragment,c)},m(c,g){p(c,h,g),o(h,M),p(c,_,g),v(u,c,g),b=!0},p:ha,i(c){b||(w(u.$$.fragment,c),b=!0)},o(c){T(u.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),x(u,c)}}}function Fs(C){let h,M,_,u,b,c,g,F,er,lt,q,K,No,xe,or,Zo,tr,ct,P,rr,Me,nr,ar,so,sr,ir,dt,io,lr,mt,lo,Jo,cr,ft,co,dr,pt,ee,je,mr,mo,fr,pr,hr,A,ur,fo,gr,_r,po,br,Dr,ht,oe,ga,ut,te,yr,ho,vr,wr,gt,N,Tr,$e,xr,Mr,Ee,jr,$r,_t,W,re,qo,ke,Er,Ao,kr,bt,uo,Cr,Dt,Ce,yt,ne,S,Ur,go,zr,Fr,Ue,Ir,Rr,Pr,ze,Nr,_o,Zr,Jr,vt,bo,qr,wt,O,ae,Wo,Fe,Ar,So,Wr,Tt,E,Ie,Sr,Oo,Or,Vr,se,Re,Lr,Vo,Gr,Br,ie,Pe,Xr,Ne,Hr,Do,Qr,Yr,xt,V,le,Lo,Ze,Kr,Go,en,Mt,I,Je,on,ce,qe,tn,Bo,rn,nn,de,Ae,an,We,sn,yo,ln,cn,jt,L,me,Xo,Se,dn,Ho,mn,$t,k,Oe,fn,G,pn,vo,hn,un,Ve,gn,_n,bn,B,Dn,wo,yn,vn,To,wn,Tn,xn,fe,Et,X,pe,Qo,Le,Mn,Yo,jn,kt,j,Ge,$n,Ko,En,kn,Be,Cn,xo,Un,zn,Fn,Xe,In,He,Rn,Pn,Nn,U,Qe,Zn,H,Jn,Mo,qn,An,et,Wn,Sn,On,he,Vn,ue,Ct,Q,ge,ot,Ye,Ln,tt,Gn,Ut,$,Ke,Bn,rt,Xn,Hn,eo,Qn,jo,Yn,Kn,ea,oo,oa,to,ta,ra,na,z,ro,aa,Y,sa,$o,ia,la,nt,ca,da,ma,_e,fa,be,zt;return c=new Te({}),xe=new Te({}),ke=new Te({}),Ce=new $s({props:{pipeline:"object-detection"}}),Fe=new Te({}),Ie=new R({props:{name:"class transformers.DeformableDetrImageProcessor",anchor:"transformers.DeformableDetrImageProcessor",parameters:[{name:"format",val:": typing.Union[str, transformers.models.deformable_detr.image_processing_deformable_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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L760"}}),Re=new R({props:{name:"preprocess",anchor:"transformers.DeformableDetrImageProcessor.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.deformable_detr.image_processing_deformable_detr.AnnotionFormat, NoneType] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeformableDetrImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image or batch of images to preprocess.`,name:"images"},{anchor:"transformers.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.DeformableDetrImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1101"}}),Pe=new R({props:{name:"post_process_object_detection",anchor:"transformers.DeformableDetrImageProcessor.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:"top_k",val:": int = 100"}],parametersDescription:[{anchor:"transformers.DeformableDetrImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.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.DeformableDetrImageProcessor.post_process_object_detection.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Keep only top k bounding boxes before filtering by thresholding.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1387",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>
`}}),Ze=new Te({}),Je=new R({props:{name:"class transformers.DeformableDetrFeatureExtractor",anchor:"transformers.DeformableDetrFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/feature_extraction_deformable_detr.py#L26"}}),qe=new R({props:{name:"__call__",anchor:"transformers.DeformableDetrFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L544"}}),Ae=new R({props:{name:"post_process_object_detection",anchor:"transformers.DeformableDetrFeatureExtractor.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:"top_k",val:": int = 100"}],parametersDescription:[{anchor:"transformers.DeformableDetrFeatureExtractor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DeformableDetrFeatureExtractor.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.DeformableDetrFeatureExtractor.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.DeformableDetrFeatureExtractor.post_process_object_detection.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Keep only top k bounding boxes before filtering by thresholding.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1387",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>
`}}),Se=new Te({}),Oe=new R({props:{name:"class transformers.DeformableDetrConfig",anchor:"transformers.DeformableDetrConfig",parameters:[{name:"use_timm_backbone",val:" = True"},{name:"backbone_config",val:" = None"},{name:"num_channels",val:" = 3"},{name:"num_queries",val:" = 300"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 1024"},{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:"backbone",val:" = 'resnet50'"},{name:"use_pretrained_backbone",val:" = True"},{name:"dilation",val:" = False"},{name:"num_feature_levels",val:" = 4"},{name:"encoder_n_points",val:" = 4"},{name:"decoder_n_points",val:" = 4"},{name:"two_stage",val:" = False"},{name:"two_stage_num_proposals",val:" = 300"},{name:"with_box_refine",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:"focal_alpha",val:" = 0.25"},{name:"disable_custom_kernels",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 300) &#x2014;
Number of object queries, i.e. detection slots. This is the maximal number of objects
<a href="/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrModel">DeformableDetrModel</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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.DeformableDetrConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.num_feature_levels",description:`<strong>num_feature_levels</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of input feature levels.`,name:"num_feature_levels"},{anchor:"transformers.DeformableDetrConfig.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.DeformableDetrConfig.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.DeformableDetrConfig.two_stage",description:`<strong>two_stage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply a two-stage deformable DETR, where the region proposals are also generated by a variant of
Deformable DETR, which are further fed into the decoder for iterative bounding box refinement.`,name:"two_stage"},{anchor:"transformers.DeformableDetrConfig.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.DeformableDetrConfig.with_box_refine",description:`<strong>with_box_refine</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</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.DeformableDetrConfig.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"},{anchor:"transformers.DeformableDetrConfig.disable_custom_kernels",description:`<strong>disable_custom_kernels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Disable the use of custom CUDA and CPU kernels. This option is necessary for the ONNX export, as custom
kernels are not supported by PyTorch ONNX export.`,name:"disable_custom_kernels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/configuration_deformable_detr.py#L30"}}),fe=new pa({props:{anchor:"transformers.DeformableDetrConfig.example",$$slots:{default:[Es]},$$scope:{ctx:C}}}),Le=new Te({}),Ge=new R({props:{name:"class transformers.DeformableDetrModel",anchor:"transformers.DeformableDetrModel",parameters:[{name:"config",val:": DeformableDetrConfig"}],parametersDescription:[{anchor:"transformers.DeformableDetrModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrConfig">DeformableDetrConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1475"}}),Qe=new R({props:{name:"forward",anchor:"transformers.DeformableDetrModel.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.DeformableDetrModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">DeformableDetrImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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.DeformableDetrModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1624",returnDescription:`
<p>A <code>transformers.models.deformable_detr.modeling_deformable_detr.DeformableDetrModelOutput</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/main/en/model_doc/deformable_detr#transformers.DeformableDetrConfig"
>DeformableDetrConfig</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.deformable_detr.modeling_deformable_detr.DeformableDetrModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new ys({props:{$$slots:{default:[ks]},$$scope:{ctx:C}}}),ue=new pa({props:{anchor:"transformers.DeformableDetrModel.forward.example",$$slots:{default:[Cs]},$$scope:{ctx:C}}}),Ye=new Te({}),Ke=new R({props:{name:"class transformers.DeformableDetrForObjectDetection",anchor:"transformers.DeformableDetrForObjectDetection",parameters:[{name:"config",val:": DeformableDetrConfig"}],parametersDescription:[{anchor:"transformers.DeformableDetrForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrConfig">DeformableDetrConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1832"}}),ro=new R({props:{name:"forward",anchor:"transformers.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">DeformableDetrImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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.DeformableDetrForObjectDetection.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeformableDetrForObjectDetection.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/main/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1884",returnDescription:`
<p>A <code>transformers.models.deformable_detr.modeling_deformable_detr.DeformableDetrObjectDetectionOutput</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/main/en/model_doc/deformable_detr#transformers.DeformableDetrConfig"
>DeformableDetrConfig</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>~DeformableDetrProcessor.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.deformable_detr.modeling_deformable_detr.DeformableDetrObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new ys({props:{$$slots:{default:[Us]},$$scope:{ctx:C}}}),be=new pa({props:{anchor:"transformers.DeformableDetrForObjectDetection.forward.example",$$slots:{default:[zs]},$$scope:{ctx:C}}}),{c(){h=r("meta"),M=m(),_=r("h1"),u=r("a"),b=r("span"),D(c.$$.fragment),g=m(),F=r("span"),er=s("Deformable DETR"),lt=m(),q=r("h2"),K=r("a"),No=r("span"),D(xe.$$.fragment),or=m(),Zo=r("span"),tr=s("Overview"),ct=m(),P=r("p"),rr=s("The Deformable DETR model was proposed in "),Me=r("a"),nr=s("Deformable DETR: Deformable Transformers for End-to-End Object Detection"),ar=s(` by Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, Jifeng Dai.
Deformable DETR mitigates the slow convergence issues and limited feature spatial resolution of the original `),so=r("a"),sr=s("DETR"),ir=s(" by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),dt=m(),io=r("p"),lr=s("The abstract from the paper is the following:"),mt=m(),lo=r("p"),Jo=r("em"),cr=s("DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance. However, it suffers from slow convergence and limited feature spatial resolution, due to the limitation of Transformer attention modules in processing image feature maps. To mitigate these issues, we proposed Deformable DETR, whose attention modules only attend to a small set of key sampling points around a reference. Deformable DETR can achieve better performance than DETR (especially on small objects) with 10 times less training epochs. Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach."),ft=m(),co=r("p"),dr=s("Tips:"),pt=m(),ee=r("ul"),je=r("li"),mr=s("One can use "),mo=r("a"),fr=s("DeformableDetrImageProcessor"),pr=s(" to prepare images (and optional targets) for the model."),hr=m(),A=r("li"),ur=s("Training Deformable DETR is equivalent to training the original "),fo=r("a"),gr=s("DETR"),_r=s(" model. See the "),po=r("a"),br=s("resources"),Dr=s(" section below for demo notebooks."),ht=m(),oe=r("img"),ut=m(),te=r("small"),yr=s("Deformable DETR architecture. Taken from the "),ho=r("a"),vr=s("original paper"),wr=s("."),gt=m(),N=r("p"),Tr=s("This model was contributed by "),$e=r("a"),xr=s("nielsr"),Mr=s(". The original code can be found "),Ee=r("a"),jr=s("here"),$r=s("."),_t=m(),W=r("h2"),re=r("a"),qo=r("span"),D(ke.$$.fragment),Er=m(),Ao=r("span"),kr=s("Resources"),bt=m(),uo=r("p"),Cr=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Deformable DETR."),Dt=m(),D(Ce.$$.fragment),yt=m(),ne=r("ul"),S=r("li"),Ur=s("Demo notebooks regarding inference + fine-tuning on a custom dataset for "),go=r("a"),zr=s("DeformableDetrForObjectDetection"),Fr=s(" can be found "),Ue=r("a"),Ir=s("here"),Rr=s("."),Pr=m(),ze=r("li"),Nr=s("See also: "),_o=r("a"),Zr=s("Object detection task guide"),Jr=s("."),vt=m(),bo=r("p"),qr=s("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."),wt=m(),O=r("h2"),ae=r("a"),Wo=r("span"),D(Fe.$$.fragment),Ar=m(),So=r("span"),Wr=s("DeformableDetrImageProcessor"),Tt=m(),E=r("div"),D(Ie.$$.fragment),Sr=m(),Oo=r("p"),Or=s("Constructs a Deformable DETR image processor."),Vr=m(),se=r("div"),D(Re.$$.fragment),Lr=m(),Vo=r("p"),Gr=s("Preprocess an image or a batch of images so that it can be used by the model."),Br=m(),ie=r("div"),D(Pe.$$.fragment),Xr=m(),Ne=r("p"),Hr=s("Converts the raw output of "),Do=r("a"),Qr=s("DeformableDetrForObjectDetection"),Yr=s(` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),xt=m(),V=r("h2"),le=r("a"),Lo=r("span"),D(Ze.$$.fragment),Kr=m(),Go=r("span"),en=s("DeformableDetrFeatureExtractor"),Mt=m(),I=r("div"),D(Je.$$.fragment),on=m(),ce=r("div"),D(qe.$$.fragment),tn=m(),Bo=r("p"),rn=s("Preprocess an image or a batch of images."),nn=m(),de=r("div"),D(Ae.$$.fragment),an=m(),We=r("p"),sn=s("Converts the raw output of "),yo=r("a"),ln=s("DeformableDetrForObjectDetection"),cn=s(` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),jt=m(),L=r("h2"),me=r("a"),Xo=r("span"),D(Se.$$.fragment),dn=m(),Ho=r("span"),mn=s("DeformableDetrConfig"),$t=m(),k=r("div"),D(Oe.$$.fragment),fn=m(),G=r("p"),pn=s("This is the configuration class to store the configuration of a "),vo=r("a"),hn=s("DeformableDetrModel"),un=s(`. It is used to instantiate
a Deformable 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 Deformable DETR
`),Ve=r("a"),gn=s("SenseTime/deformable-detr"),_n=s(" architecture."),bn=m(),B=r("p"),Dn=s("Configuration objects inherit from "),wo=r("a"),yn=s("PretrainedConfig"),vn=s(` and can be used to control the model outputs. Read the
documentation from `),To=r("a"),wn=s("PretrainedConfig"),Tn=s(" for more information."),xn=m(),D(fe.$$.fragment),Et=m(),X=r("h2"),pe=r("a"),Qo=r("span"),D(Le.$$.fragment),Mn=m(),Yo=r("span"),jn=s("DeformableDetrModel"),kt=m(),j=r("div"),D(Ge.$$.fragment),$n=m(),Ko=r("p"),En=s(`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),kn=m(),Be=r("p"),Cn=s("This model inherits from "),xo=r("a"),Un=s("PreTrainedModel"),zn=s(`. 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.)`),Fn=m(),Xe=r("p"),In=s("This model is also a PyTorch "),He=r("a"),Rn=s("torch.nn.Module"),Pn=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nn=m(),U=r("div"),D(Qe.$$.fragment),Zn=m(),H=r("p"),Jn=s("The "),Mo=r("a"),qn=s("DeformableDetrModel"),An=s(" forward method, overrides the "),et=r("code"),Wn=s("__call__"),Sn=s(" special method."),On=m(),D(he.$$.fragment),Vn=m(),D(ue.$$.fragment),Ct=m(),Q=r("h2"),ge=r("a"),ot=r("span"),D(Ye.$$.fragment),Ln=m(),tt=r("span"),Gn=s("DeformableDetrForObjectDetection"),Ut=m(),$=r("div"),D(Ke.$$.fragment),Bn=m(),rt=r("p"),Xn=s(`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Hn=m(),eo=r("p"),Qn=s("This model inherits from "),jo=r("a"),Yn=s("PreTrainedModel"),Kn=s(`. 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.)`),ea=m(),oo=r("p"),oa=s("This model is also a PyTorch "),to=r("a"),ta=s("torch.nn.Module"),ra=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),na=m(),z=r("div"),D(ro.$$.fragment),aa=m(),Y=r("p"),sa=s("The "),$o=r("a"),ia=s("DeformableDetrForObjectDetection"),la=s(" forward method, overrides the "),nt=r("code"),ca=s("__call__"),da=s(" special method."),ma=m(),D(_e.$$.fragment),fa=m(),D(be.$$.fragment),this.h()},l(e){const d=xs('[data-svelte="svelte-1phssyn"]',document.head);h=n(d,"META",{name:!0,content:!0}),d.forEach(t),M=f(e),_=n(e,"H1",{class:!0});var no=a(_);u=n(no,"A",{id:!0,class:!0,href:!0});var at=a(u);b=n(at,"SPAN",{});var st=a(b);y(c.$$.fragment,st),st.forEach(t),at.forEach(t),g=f(no),F=n(no,"SPAN",{});var it=a(F);er=i(it,"Deformable DETR"),it.forEach(t),no.forEach(t),lt=f(e),q=n(e,"H2",{class:!0});var ao=a(q);K=n(ao,"A",{id:!0,class:!0,href:!0});var _a=a(K);No=n(_a,"SPAN",{});var ba=a(No);y(xe.$$.fragment,ba),ba.forEach(t),_a.forEach(t),or=f(ao),Zo=n(ao,"SPAN",{});var Da=a(Zo);tr=i(Da,"Overview"),Da.forEach(t),ao.forEach(t),ct=f(e),P=n(e,"P",{});var Eo=a(P);rr=i(Eo,"The Deformable DETR model was proposed in "),Me=n(Eo,"A",{href:!0,rel:!0});var ya=a(Me);nr=i(ya,"Deformable DETR: Deformable Transformers for End-to-End Object Detection"),ya.forEach(t),ar=i(Eo,` by Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, Jifeng Dai.
Deformable DETR mitigates the slow convergence issues and limited feature spatial resolution of the original `),so=n(Eo,"A",{href:!0});var va=a(so);sr=i(va,"DETR"),va.forEach(t),ir=i(Eo," by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),Eo.forEach(t),dt=f(e),io=n(e,"P",{});var wa=a(io);lr=i(wa,"The abstract from the paper is the following:"),wa.forEach(t),mt=f(e),lo=n(e,"P",{});var Ta=a(lo);Jo=n(Ta,"EM",{});var xa=a(Jo);cr=i(xa,"DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance. However, it suffers from slow convergence and limited feature spatial resolution, due to the limitation of Transformer attention modules in processing image feature maps. To mitigate these issues, we proposed Deformable DETR, whose attention modules only attend to a small set of key sampling points around a reference. Deformable DETR can achieve better performance than DETR (especially on small objects) with 10 times less training epochs. Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach."),xa.forEach(t),Ta.forEach(t),ft=f(e),co=n(e,"P",{});var Ma=a(co);dr=i(Ma,"Tips:"),Ma.forEach(t),pt=f(e),ee=n(e,"UL",{});var Ft=a(ee);je=n(Ft,"LI",{});var It=a(je);mr=i(It,"One can use "),mo=n(It,"A",{href:!0});var ja=a(mo);fr=i(ja,"DeformableDetrImageProcessor"),ja.forEach(t),pr=i(It," to prepare images (and optional targets) for the model."),It.forEach(t),hr=f(Ft),A=n(Ft,"LI",{});var ko=a(A);ur=i(ko,"Training Deformable DETR is equivalent to training the original "),fo=n(ko,"A",{href:!0});var $a=a(fo);gr=i($a,"DETR"),$a.forEach(t),_r=i(ko," model. See the "),po=n(ko,"A",{href:!0});var Ea=a(po);br=i(Ea,"resources"),Ea.forEach(t),Dr=i(ko," section below for demo notebooks."),ko.forEach(t),Ft.forEach(t),ht=f(e),oe=n(e,"IMG",{src:!0,alt:!0,width:!0}),ut=f(e),te=n(e,"SMALL",{});var Rt=a(te);yr=i(Rt,"Deformable DETR architecture. Taken from the "),ho=n(Rt,"A",{href:!0});var ka=a(ho);vr=i(ka,"original paper"),ka.forEach(t),wr=i(Rt,"."),Rt.forEach(t),gt=f(e),N=n(e,"P",{});var Co=a(N);Tr=i(Co,"This model was contributed by "),$e=n(Co,"A",{href:!0,rel:!0});var Ca=a($e);xr=i(Ca,"nielsr"),Ca.forEach(t),Mr=i(Co,". The original code can be found "),Ee=n(Co,"A",{href:!0,rel:!0});var Ua=a(Ee);jr=i(Ua,"here"),Ua.forEach(t),$r=i(Co,"."),Co.forEach(t),_t=f(e),W=n(e,"H2",{class:!0});var Pt=a(W);re=n(Pt,"A",{id:!0,class:!0,href:!0});var za=a(re);qo=n(za,"SPAN",{});var Fa=a(qo);y(ke.$$.fragment,Fa),Fa.forEach(t),za.forEach(t),Er=f(Pt),Ao=n(Pt,"SPAN",{});var Ia=a(Ao);kr=i(Ia,"Resources"),Ia.forEach(t),Pt.forEach(t),bt=f(e),uo=n(e,"P",{});var Ra=a(uo);Cr=i(Ra,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Deformable DETR."),Ra.forEach(t),Dt=f(e),y(Ce.$$.fragment,e),yt=f(e),ne=n(e,"UL",{});var Nt=a(ne);S=n(Nt,"LI",{});var Uo=a(S);Ur=i(Uo,"Demo notebooks regarding inference + fine-tuning on a custom dataset for "),go=n(Uo,"A",{href:!0});var Pa=a(go);zr=i(Pa,"DeformableDetrForObjectDetection"),Pa.forEach(t),Fr=i(Uo," can be found "),Ue=n(Uo,"A",{href:!0,rel:!0});var Na=a(Ue);Ir=i(Na,"here"),Na.forEach(t),Rr=i(Uo,"."),Uo.forEach(t),Pr=f(Nt),ze=n(Nt,"LI",{});var Zt=a(ze);Nr=i(Zt,"See also: "),_o=n(Zt,"A",{href:!0});var Za=a(_o);Zr=i(Za,"Object detection task guide"),Za.forEach(t),Jr=i(Zt,"."),Zt.forEach(t),Nt.forEach(t),vt=f(e),bo=n(e,"P",{});var Ja=a(bo);qr=i(Ja,"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."),Ja.forEach(t),wt=f(e),O=n(e,"H2",{class:!0});var Jt=a(O);ae=n(Jt,"A",{id:!0,class:!0,href:!0});var qa=a(ae);Wo=n(qa,"SPAN",{});var Aa=a(Wo);y(Fe.$$.fragment,Aa),Aa.forEach(t),qa.forEach(t),Ar=f(Jt),So=n(Jt,"SPAN",{});var Wa=a(So);Wr=i(Wa,"DeformableDetrImageProcessor"),Wa.forEach(t),Jt.forEach(t),Tt=f(e),E=n(e,"DIV",{class:!0});var De=a(E);y(Ie.$$.fragment,De),Sr=f(De),Oo=n(De,"P",{});var Sa=a(Oo);Or=i(Sa,"Constructs a Deformable DETR image processor."),Sa.forEach(t),Vr=f(De),se=n(De,"DIV",{class:!0});var qt=a(se);y(Re.$$.fragment,qt),Lr=f(qt),Vo=n(qt,"P",{});var Oa=a(Vo);Gr=i(Oa,"Preprocess an image or a batch of images so that it can be used by the model."),Oa.forEach(t),qt.forEach(t),Br=f(De),ie=n(De,"DIV",{class:!0});var At=a(ie);y(Pe.$$.fragment,At),Xr=f(At),Ne=n(At,"P",{});var Wt=a(Ne);Hr=i(Wt,"Converts the raw output of "),Do=n(Wt,"A",{href:!0});var Va=a(Do);Qr=i(Va,"DeformableDetrForObjectDetection"),Va.forEach(t),Yr=i(Wt,` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Wt.forEach(t),At.forEach(t),De.forEach(t),xt=f(e),V=n(e,"H2",{class:!0});var St=a(V);le=n(St,"A",{id:!0,class:!0,href:!0});var La=a(le);Lo=n(La,"SPAN",{});var Ga=a(Lo);y(Ze.$$.fragment,Ga),Ga.forEach(t),La.forEach(t),Kr=f(St),Go=n(St,"SPAN",{});var Ba=a(Go);en=i(Ba,"DeformableDetrFeatureExtractor"),Ba.forEach(t),St.forEach(t),Mt=f(e),I=n(e,"DIV",{class:!0});var zo=a(I);y(Je.$$.fragment,zo),on=f(zo),ce=n(zo,"DIV",{class:!0});var Ot=a(ce);y(qe.$$.fragment,Ot),tn=f(Ot),Bo=n(Ot,"P",{});var Xa=a(Bo);rn=i(Xa,"Preprocess an image or a batch of images."),Xa.forEach(t),Ot.forEach(t),nn=f(zo),de=n(zo,"DIV",{class:!0});var Vt=a(de);y(Ae.$$.fragment,Vt),an=f(Vt),We=n(Vt,"P",{});var Lt=a(We);sn=i(Lt,"Converts the raw output of "),yo=n(Lt,"A",{href:!0});var Ha=a(yo);ln=i(Ha,"DeformableDetrForObjectDetection"),Ha.forEach(t),cn=i(Lt,` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Lt.forEach(t),Vt.forEach(t),zo.forEach(t),jt=f(e),L=n(e,"H2",{class:!0});var Gt=a(L);me=n(Gt,"A",{id:!0,class:!0,href:!0});var Qa=a(me);Xo=n(Qa,"SPAN",{});var Ya=a(Xo);y(Se.$$.fragment,Ya),Ya.forEach(t),Qa.forEach(t),dn=f(Gt),Ho=n(Gt,"SPAN",{});var Ka=a(Ho);mn=i(Ka,"DeformableDetrConfig"),Ka.forEach(t),Gt.forEach(t),$t=f(e),k=n(e,"DIV",{class:!0});var ye=a(k);y(Oe.$$.fragment,ye),fn=f(ye),G=n(ye,"P",{});var Fo=a(G);pn=i(Fo,"This is the configuration class to store the configuration of a "),vo=n(Fo,"A",{href:!0});var es=a(vo);hn=i(es,"DeformableDetrModel"),es.forEach(t),un=i(Fo,`. It is used to instantiate
a Deformable 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 Deformable DETR
`),Ve=n(Fo,"A",{href:!0,rel:!0});var os=a(Ve);gn=i(os,"SenseTime/deformable-detr"),os.forEach(t),_n=i(Fo," architecture."),Fo.forEach(t),bn=f(ye),B=n(ye,"P",{});var Io=a(B);Dn=i(Io,"Configuration objects inherit from "),wo=n(Io,"A",{href:!0});var ts=a(wo);yn=i(ts,"PretrainedConfig"),ts.forEach(t),vn=i(Io,` and can be used to control the model outputs. Read the
documentation from `),To=n(Io,"A",{href:!0});var rs=a(To);wn=i(rs,"PretrainedConfig"),rs.forEach(t),Tn=i(Io," for more information."),Io.forEach(t),xn=f(ye),y(fe.$$.fragment,ye),ye.forEach(t),Et=f(e),X=n(e,"H2",{class:!0});var Bt=a(X);pe=n(Bt,"A",{id:!0,class:!0,href:!0});var ns=a(pe);Qo=n(ns,"SPAN",{});var as=a(Qo);y(Le.$$.fragment,as),as.forEach(t),ns.forEach(t),Mn=f(Bt),Yo=n(Bt,"SPAN",{});var ss=a(Yo);jn=i(ss,"DeformableDetrModel"),ss.forEach(t),Bt.forEach(t),kt=f(e),j=n(e,"DIV",{class:!0});var Z=a(j);y(Ge.$$.fragment,Z),$n=f(Z),Ko=n(Z,"P",{});var is=a(Ko);En=i(is,`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),is.forEach(t),kn=f(Z),Be=n(Z,"P",{});var Xt=a(Be);Cn=i(Xt,"This model inherits from "),xo=n(Xt,"A",{href:!0});var ls=a(xo);Un=i(ls,"PreTrainedModel"),ls.forEach(t),zn=i(Xt,`. 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.)`),Xt.forEach(t),Fn=f(Z),Xe=n(Z,"P",{});var Ht=a(Xe);In=i(Ht,"This model is also a PyTorch "),He=n(Ht,"A",{href:!0,rel:!0});var cs=a(He);Rn=i(cs,"torch.nn.Module"),cs.forEach(t),Pn=i(Ht,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ht.forEach(t),Nn=f(Z),U=n(Z,"DIV",{class:!0});var ve=a(U);y(Qe.$$.fragment,ve),Zn=f(ve),H=n(ve,"P",{});var Ro=a(H);Jn=i(Ro,"The "),Mo=n(Ro,"A",{href:!0});var ds=a(Mo);qn=i(ds,"DeformableDetrModel"),ds.forEach(t),An=i(Ro," forward method, overrides the "),et=n(Ro,"CODE",{});var ms=a(et);Wn=i(ms,"__call__"),ms.forEach(t),Sn=i(Ro," special method."),Ro.forEach(t),On=f(ve),y(he.$$.fragment,ve),Vn=f(ve),y(ue.$$.fragment,ve),ve.forEach(t),Z.forEach(t),Ct=f(e),Q=n(e,"H2",{class:!0});var Qt=a(Q);ge=n(Qt,"A",{id:!0,class:!0,href:!0});var fs=a(ge);ot=n(fs,"SPAN",{});var ps=a(ot);y(Ye.$$.fragment,ps),ps.forEach(t),fs.forEach(t),Ln=f(Qt),tt=n(Qt,"SPAN",{});var hs=a(tt);Gn=i(hs,"DeformableDetrForObjectDetection"),hs.forEach(t),Qt.forEach(t),Ut=f(e),$=n(e,"DIV",{class:!0});var J=a($);y(Ke.$$.fragment,J),Bn=f(J),rt=n(J,"P",{});var us=a(rt);Xn=i(us,`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),us.forEach(t),Hn=f(J),eo=n(J,"P",{});var Yt=a(eo);Qn=i(Yt,"This model inherits from "),jo=n(Yt,"A",{href:!0});var gs=a(jo);Yn=i(gs,"PreTrainedModel"),gs.forEach(t),Kn=i(Yt,`. 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.)`),Yt.forEach(t),ea=f(J),oo=n(J,"P",{});var Kt=a(oo);oa=i(Kt,"This model is also a PyTorch "),to=n(Kt,"A",{href:!0,rel:!0});var _s=a(to);ta=i(_s,"torch.nn.Module"),_s.forEach(t),ra=i(Kt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kt.forEach(t),na=f(J),z=n(J,"DIV",{class:!0});var we=a(z);y(ro.$$.fragment,we),aa=f(we),Y=n(we,"P",{});var Po=a(Y);sa=i(Po,"The "),$o=n(Po,"A",{href:!0});var bs=a($o);ia=i(bs,"DeformableDetrForObjectDetection"),bs.forEach(t),la=i(Po," forward method, overrides the "),nt=n(Po,"CODE",{});var Ds=a(nt);ca=i(Ds,"__call__"),Ds.forEach(t),da=i(Po," special method."),Po.forEach(t),ma=f(we),y(_e.$$.fragment,we),fa=f(we),y(be.$$.fragment,we),we.forEach(t),J.forEach(t),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(Is)),l(u,"id","deformable-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","#deformable-detr"),l(_,"class","relative group"),l(K,"id","overview"),l(K,"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(K,"href","#overview"),l(q,"class","relative group"),l(Me,"href","https://arxiv.org/abs/2010.04159"),l(Me,"rel","nofollow"),l(so,"href","detr"),l(mo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrImageProcessor"),l(fo,"href","detr"),l(po,"href","#resources"),Ms(oe.src,ga="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/deformable_detr_architecture.png")||l(oe,"src",ga),l(oe,"alt","drawing"),l(oe,"width","600"),l(ho,"href","https://arxiv.org/abs/2010.04159"),l($e,"href","https://huggingface.co/nielsr"),l($e,"rel","nofollow"),l(Ee,"href","https://github.com/fundamentalvision/Deformable-DETR"),l(Ee,"rel","nofollow"),l(re,"id","resources"),l(re,"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(re,"href","#resources"),l(W,"class","relative group"),l(go,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(Ue,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Deformable-DETR"),l(Ue,"rel","nofollow"),l(_o,"href","../tasks/object_detection"),l(ae,"id","transformers.DeformableDetrImageProcessor"),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.DeformableDetrImageProcessor"),l(O,"class","relative group"),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(Do,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),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(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(le,"id","transformers.DeformableDetrFeatureExtractor"),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.DeformableDetrFeatureExtractor"),l(V,"class","relative group"),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(yo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(de,"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(me,"id","transformers.DeformableDetrConfig"),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.DeformableDetrConfig"),l(L,"class","relative group"),l(vo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),l(Ve,"href","https://huggingface.co/SenseTime/deformable-detr"),l(Ve,"rel","nofollow"),l(wo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(To,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(pe,"id","transformers.DeformableDetrModel"),l(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(pe,"href","#transformers.DeformableDetrModel"),l(X,"class","relative group"),l(xo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(He,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(He,"rel","nofollow"),l(Mo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),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(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"id","transformers.DeformableDetrForObjectDetection"),l(ge,"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(ge,"href","#transformers.DeformableDetrForObjectDetection"),l(Q,"class","relative group"),l(jo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(to,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(to,"rel","nofollow"),l($o,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),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(e,d){o(document.head,h),p(e,M,d),p(e,_,d),o(_,u),o(u,b),v(c,b,null),o(_,g),o(_,F),o(F,er),p(e,lt,d),p(e,q,d),o(q,K),o(K,No),v(xe,No,null),o(q,or),o(q,Zo),o(Zo,tr),p(e,ct,d),p(e,P,d),o(P,rr),o(P,Me),o(Me,nr),o(P,ar),o(P,so),o(so,sr),o(P,ir),p(e,dt,d),p(e,io,d),o(io,lr),p(e,mt,d),p(e,lo,d),o(lo,Jo),o(Jo,cr),p(e,ft,d),p(e,co,d),o(co,dr),p(e,pt,d),p(e,ee,d),o(ee,je),o(je,mr),o(je,mo),o(mo,fr),o(je,pr),o(ee,hr),o(ee,A),o(A,ur),o(A,fo),o(fo,gr),o(A,_r),o(A,po),o(po,br),o(A,Dr),p(e,ht,d),p(e,oe,d),p(e,ut,d),p(e,te,d),o(te,yr),o(te,ho),o(ho,vr),o(te,wr),p(e,gt,d),p(e,N,d),o(N,Tr),o(N,$e),o($e,xr),o(N,Mr),o(N,Ee),o(Ee,jr),o(N,$r),p(e,_t,d),p(e,W,d),o(W,re),o(re,qo),v(ke,qo,null),o(W,Er),o(W,Ao),o(Ao,kr),p(e,bt,d),p(e,uo,d),o(uo,Cr),p(e,Dt,d),v(Ce,e,d),p(e,yt,d),p(e,ne,d),o(ne,S),o(S,Ur),o(S,go),o(go,zr),o(S,Fr),o(S,Ue),o(Ue,Ir),o(S,Rr),o(ne,Pr),o(ne,ze),o(ze,Nr),o(ze,_o),o(_o,Zr),o(ze,Jr),p(e,vt,d),p(e,bo,d),o(bo,qr),p(e,wt,d),p(e,O,d),o(O,ae),o(ae,Wo),v(Fe,Wo,null),o(O,Ar),o(O,So),o(So,Wr),p(e,Tt,d),p(e,E,d),v(Ie,E,null),o(E,Sr),o(E,Oo),o(Oo,Or),o(E,Vr),o(E,se),v(Re,se,null),o(se,Lr),o(se,Vo),o(Vo,Gr),o(E,Br),o(E,ie),v(Pe,ie,null),o(ie,Xr),o(ie,Ne),o(Ne,Hr),o(Ne,Do),o(Do,Qr),o(Ne,Yr),p(e,xt,d),p(e,V,d),o(V,le),o(le,Lo),v(Ze,Lo,null),o(V,Kr),o(V,Go),o(Go,en),p(e,Mt,d),p(e,I,d),v(Je,I,null),o(I,on),o(I,ce),v(qe,ce,null),o(ce,tn),o(ce,Bo),o(Bo,rn),o(I,nn),o(I,de),v(Ae,de,null),o(de,an),o(de,We),o(We,sn),o(We,yo),o(yo,ln),o(We,cn),p(e,jt,d),p(e,L,d),o(L,me),o(me,Xo),v(Se,Xo,null),o(L,dn),o(L,Ho),o(Ho,mn),p(e,$t,d),p(e,k,d),v(Oe,k,null),o(k,fn),o(k,G),o(G,pn),o(G,vo),o(vo,hn),o(G,un),o(G,Ve),o(Ve,gn),o(G,_n),o(k,bn),o(k,B),o(B,Dn),o(B,wo),o(wo,yn),o(B,vn),o(B,To),o(To,wn),o(B,Tn),o(k,xn),v(fe,k,null),p(e,Et,d),p(e,X,d),o(X,pe),o(pe,Qo),v(Le,Qo,null),o(X,Mn),o(X,Yo),o(Yo,jn),p(e,kt,d),p(e,j,d),v(Ge,j,null),o(j,$n),o(j,Ko),o(Ko,En),o(j,kn),o(j,Be),o(Be,Cn),o(Be,xo),o(xo,Un),o(Be,zn),o(j,Fn),o(j,Xe),o(Xe,In),o(Xe,He),o(He,Rn),o(Xe,Pn),o(j,Nn),o(j,U),v(Qe,U,null),o(U,Zn),o(U,H),o(H,Jn),o(H,Mo),o(Mo,qn),o(H,An),o(H,et),o(et,Wn),o(H,Sn),o(U,On),v(he,U,null),o(U,Vn),v(ue,U,null),p(e,Ct,d),p(e,Q,d),o(Q,ge),o(ge,ot),v(Ye,ot,null),o(Q,Ln),o(Q,tt),o(tt,Gn),p(e,Ut,d),p(e,$,d),v(Ke,$,null),o($,Bn),o($,rt),o(rt,Xn),o($,Hn),o($,eo),o(eo,Qn),o(eo,jo),o(jo,Yn),o(eo,Kn),o($,ea),o($,oo),o(oo,oa),o(oo,to),o(to,ta),o(oo,ra),o($,na),o($,z),v(ro,z,null),o(z,aa),o(z,Y),o(Y,sa),o(Y,$o),o($o,ia),o(Y,la),o(Y,nt),o(nt,ca),o(Y,da),o(z,ma),v(_e,z,null),o(z,fa),v(be,z,null),zt=!0},p(e,[d]){const no={};d&2&&(no.$$scope={dirty:d,ctx:e}),fe.$set(no);const at={};d&2&&(at.$$scope={dirty:d,ctx:e}),he.$set(at);const st={};d&2&&(st.$$scope={dirty:d,ctx:e}),ue.$set(st);const it={};d&2&&(it.$$scope={dirty:d,ctx:e}),_e.$set(it);const ao={};d&2&&(ao.$$scope={dirty:d,ctx:e}),be.$set(ao)},i(e){zt||(w(c.$$.fragment,e),w(xe.$$.fragment,e),w(ke.$$.fragment,e),w(Ce.$$.fragment,e),w(Fe.$$.fragment,e),w(Ie.$$.fragment,e),w(Re.$$.fragment,e),w(Pe.$$.fragment,e),w(Ze.$$.fragment,e),w(Je.$$.fragment,e),w(qe.$$.fragment,e),w(Ae.$$.fragment,e),w(Se.$$.fragment,e),w(Oe.$$.fragment,e),w(fe.$$.fragment,e),w(Le.$$.fragment,e),w(Ge.$$.fragment,e),w(Qe.$$.fragment,e),w(he.$$.fragment,e),w(ue.$$.fragment,e),w(Ye.$$.fragment,e),w(Ke.$$.fragment,e),w(ro.$$.fragment,e),w(_e.$$.fragment,e),w(be.$$.fragment,e),zt=!0)},o(e){T(c.$$.fragment,e),T(xe.$$.fragment,e),T(ke.$$.fragment,e),T(Ce.$$.fragment,e),T(Fe.$$.fragment,e),T(Ie.$$.fragment,e),T(Re.$$.fragment,e),T(Pe.$$.fragment,e),T(Ze.$$.fragment,e),T(Je.$$.fragment,e),T(qe.$$.fragment,e),T(Ae.$$.fragment,e),T(Se.$$.fragment,e),T(Oe.$$.fragment,e),T(fe.$$.fragment,e),T(Le.$$.fragment,e),T(Ge.$$.fragment,e),T(Qe.$$.fragment,e),T(he.$$.fragment,e),T(ue.$$.fragment,e),T(Ye.$$.fragment,e),T(Ke.$$.fragment,e),T(ro.$$.fragment,e),T(_e.$$.fragment,e),T(be.$$.fragment,e),zt=!1},d(e){t(h),e&&t(M),e&&t(_),x(c),e&&t(lt),e&&t(q),x(xe),e&&t(ct),e&&t(P),e&&t(dt),e&&t(io),e&&t(mt),e&&t(lo),e&&t(ft),e&&t(co),e&&t(pt),e&&t(ee),e&&t(ht),e&&t(oe),e&&t(ut),e&&t(te),e&&t(gt),e&&t(N),e&&t(_t),e&&t(W),x(ke),e&&t(bt),e&&t(uo),e&&t(Dt),x(Ce,e),e&&t(yt),e&&t(ne),e&&t(vt),e&&t(bo),e&&t(wt),e&&t(O),x(Fe),e&&t(Tt),e&&t(E),x(Ie),x(Re),x(Pe),e&&t(xt),e&&t(V),x(Ze),e&&t(Mt),e&&t(I),x(Je),x(qe),x(Ae),e&&t(jt),e&&t(L),x(Se),e&&t($t),e&&t(k),x(Oe),x(fe),e&&t(Et),e&&t(X),x(Le),e&&t(kt),e&&t(j),x(Ge),x(Qe),x(he),x(ue),e&&t(Ct),e&&t(Q),x(Ye),e&&t(Ut),e&&t($),x(Ke),x(ro),x(_e),x(be)}}}const Is={local:"deformable-detr",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.DeformableDetrImageProcessor",title:"DeformableDetrImageProcessor"},{local:"transformers.DeformableDetrFeatureExtractor",title:"DeformableDetrFeatureExtractor"},{local:"transformers.DeformableDetrConfig",title:"DeformableDetrConfig"},{local:"transformers.DeformableDetrModel",title:"DeformableDetrModel"},{local:"transformers.DeformableDetrForObjectDetection",title:"DeformableDetrForObjectDetection"}],title:"Deformable DETR"};function Rs(C){return js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ss extends vs{constructor(h){super();ws(this,h,Rs,Fs,Ts,{})}}export{Ss as default,Is as metadata};
