import{S as Ps,i as Is,s as zs,e as r,k as c,w as b,t as s,M as Fs,c as n,d as t,m,a,x as D,h as i,b as l,N as Cs,G as o,g as p,y as v,q as y,o as w,B as T,v as qs,L as va}from"../../chunks/vendor-hf-doc-builder.js";import{T as ks}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ya}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as $e}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Da}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Os}from"../../chunks/PipelineTag-hf-doc-builder.js";function As(F){let h,$,_,u,x;return u=new ya({props:{code:`from transformers import DeformableDetrConfig, DeformableDetrModel

# Initializing a Deformable DETR SenseTime/deformable-detr style configuration
configuration = DeformableDetrConfig()

# Initializing a model (with random weights) from the SenseTime/deformable-detr style configuration
model = DeformableDetrModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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"),$=s("Examples:"),_=c(),b(u.$$.fragment)},l(d){h=n(d,"P",{});var g=a(h);$=i(g,"Examples:"),g.forEach(t),_=m(d),D(u.$$.fragment,d)},m(d,g){p(d,h,g),o(h,$),p(d,_,g),v(u,d,g),x=!0},p:va,i(d){x||(y(u.$$.fragment,d),x=!0)},o(d){w(u.$$.fragment,d),x=!1},d(d){d&&t(h),d&&t(_),T(u,d)}}}function Ls(F){let h,$,_,u,x;return{c(){h=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),x=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(d){h=n(d,"P",{});var g=a(h);$=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var O=a(_);u=i(O,"Module"),O.forEach(t),x=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(d,g){p(d,h,g),o(h,$),o(h,_),o(_,u),o(h,x)},d(d){d&&t(h)}}}function Rs(F){let h,$,_,u,x;return u=new ya({props:{code:`from transformers import AutoImageProcessor, DeformableDetrModel
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("SenseTime/deformable-detr")
model = DeformableDetrModel.from_pretrained("SenseTime/deformable-detr")

inputs = image_processor(images=image, return_tensors="pt")

outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, 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"),$=s("Examples:"),_=c(),b(u.$$.fragment)},l(d){h=n(d,"P",{});var g=a(h);$=i(g,"Examples:"),g.forEach(t),_=m(d),D(u.$$.fragment,d)},m(d,g){p(d,h,g),o(h,$),p(d,_,g),v(u,d,g),x=!0},p:va,i(d){x||(y(u.$$.fragment,d),x=!0)},o(d){w(u.$$.fragment,d),x=!1},d(d){d&&t(h),d&&t(_),T(u,d)}}}function Ns(F){let h,$,_,u,x;return{c(){h=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),x=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(d){h=n(d,"P",{});var g=a(h);$=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var O=a(_);u=i(O,"Module"),O.forEach(t),x=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(d,g){p(d,h,g),o(h,$),o(h,_),o(_,u),o(h,x)},d(d){d&&t(h)}}}function Ms(F){let h,$,_,u,x;return u=new ya({props:{code:`from transformers import AutoImageProcessor, DeformableDetrForObjectDetection
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("SenseTime/deformable-detr")
model = DeformableDetrForObjectDetection.from_pretrained("SenseTime/deformable-detr")

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

# convert outputs (bounding boxes and class logits) to COCO API
target_sizes = torch.tensor([image.size[::-1]])
results = image_processor.post_process_object_detection(outputs, threshold=0.5, target_sizes=target_sizes)[
    0
]
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    box = [round(i, 2) for i in box.tolist()]
    print(
        f"Detected {model.config.id2label[label.item()]} with confidence "
        f"{round(score.item(), 3)} at location {box}"
    )`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, 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"),$=s("Examples:"),_=c(),b(u.$$.fragment)},l(d){h=n(d,"P",{});var g=a(h);$=i(g,"Examples:"),g.forEach(t),_=m(d),D(u.$$.fragment,d)},m(d,g){p(d,h,g),o(h,$),p(d,_,g),v(u,d,g),x=!0},p:va,i(d){x||(y(u.$$.fragment,d),x=!0)},o(d){w(u.$$.fragment,d),x=!1},d(d){d&&t(h),d&&t(_),T(u,d)}}}function Ss(F){let h,$,_,u,x,d,g,O,nr,ft,S,ee,No,Ee,ar,Mo,sr,pt,A,ir,je,lr,dr,co,cr,mr,ht,mo,fr,ut,fo,So,pr,gt,po,hr,_t,oe,ke,ur,ho,gr,_r,br,U,Dr,uo,vr,yr,go,wr,Tr,bt,te,wa,Dt,re,xr,_o,$r,Er,vt,L,jr,Pe,kr,Pr,Ie,Ir,zr,yt,W,ne,Uo,ze,Fr,Wo,Cr,wt,bo,qr,Tt,Fe,xt,Do,H,Or,vo,Ar,Lr,Ce,Rr,Nr,$t,yo,Mr,Et,V,ae,Ho,qe,Sr,Vo,Ur,jt,E,Oe,Wr,Bo,Hr,Vr,se,Ae,Br,Xo,Xr,Jr,ie,Le,Yr,Jo,Gr,Zr,le,Re,Kr,Ne,Qr,wo,en,on,kt,B,de,Yo,Me,tn,Go,rn,Pt,P,Se,nn,ce,Ue,an,Zo,sn,ln,me,We,dn,Ko,cn,mn,fe,He,fn,Ve,pn,To,hn,un,It,X,pe,Qo,Be,gn,et,_n,zt,I,Xe,bn,J,Dn,xo,vn,yn,Je,wn,Tn,xn,Y,$n,$o,En,jn,Eo,kn,Pn,In,he,Ft,G,ue,ot,Ye,zn,tt,Fn,Ct,j,Ge,Cn,rt,qn,On,Ze,An,jo,Ln,Rn,Nn,Ke,Mn,Qe,Sn,Un,Wn,C,eo,Hn,Z,Vn,ko,Bn,Xn,nt,Jn,Yn,Gn,ge,Zn,_e,qt,K,be,at,oo,Kn,st,Qn,Ot,k,to,ea,it,oa,ta,ro,ra,Po,na,aa,sa,no,ia,ao,la,da,ca,q,so,ma,Q,fa,Io,pa,ha,lt,ua,ga,_a,De,ba,ve,At;return d=new $e({}),Ee=new $e({}),ze=new $e({}),Fe=new Os({props:{pipeline:"object-detection"}}),qe=new $e({}),Oe=new z({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#L739"}}),Ae=new z({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[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.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 annotionation is for object
detection, the annotations should be a dictionary with the following keys:<ul>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;annotations&#x201D; (<code>List[Dict]</code>): List of annotations for an image. Each annotation should be a
dictionary. An image can have no annotations, in which case the list should be empty.
If annotionation is for segmentation, the annotations should be a dictionary with the following keys:</li>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;segments_info&#x201D; (<code>List[Dict]</code>): List of segments for an image. Each segment should be a dictionary.
An image can have no segments, in which case the list should be empty.</li>
<li>&#x201C;file_name&#x201D; (<code>str</code>): The file name of the image.</li>
</ul>`,name:"annotations"},{anchor:"transformers.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>str</code> or <code>ChannelDimension</code>, <em>optional</em>, defaults to self.data_format) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1072"}}),Le=new z({props:{name:"pad_and_create_pixel_mask",anchor:"transformers.DeformableDetrImageProcessor.pad_and_create_pixel_mask",parameters:[{name:"pixel_values_list",val:": typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]]"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"}],parametersDescription:[{anchor:"transformers.DeformableDetrImageProcessor.pad_and_create_pixel_mask.images",description:`<strong>images</strong> (<code>List[np.ndarray]</code>) &#x2014;
Batch of images to pad.`,name:"images"},{anchor:"transformers.DeformableDetrImageProcessor.pad_and_create_pixel_mask.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DeformableDetrImageProcessor.pad_and_create_pixel_mask.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L975"}}),Re=new z({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"}],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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1326",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>
`}}),Me=new $e({}),Se=new z({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"}}),Ue=new z({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#L448"}}),We=new z({props:{name:"pad_and_create_pixel_mask",anchor:"transformers.DeformableDetrFeatureExtractor.pad_and_create_pixel_mask",parameters:[{name:"pixel_values_list",val:": typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]]"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"}],parametersDescription:[{anchor:"transformers.DeformableDetrFeatureExtractor.pad_and_create_pixel_mask.images",description:`<strong>images</strong> (<code>List[np.ndarray]</code>) &#x2014;
Batch of images to pad.`,name:"images"},{anchor:"transformers.DeformableDetrFeatureExtractor.pad_and_create_pixel_mask.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DeformableDetrFeatureExtractor.pad_and_create_pixel_mask.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L975"}}),He=new z({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"}],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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1326",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>
`}}),Be=new $e({}),Xe=new z({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:"decoder_layerdrop",val:" = 0.0"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 256"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"init_xavier_std",val:" = 1.0"},{name:"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:"**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.
encoder_layerdrop &#x2014; (<code>float</code>, <em>optional</em>, defaults to 0.0):
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.
decoder_layerdrop &#x2014; (<code>float</code>, <em>optional</em>, defaults to 0.0):
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"init_xavier_std"},{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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deformable_detr/configuration_deformable_detr.py#L30"}}),he=new Da({props:{anchor:"transformers.DeformableDetrConfig.example",$$slots:{default:[As]},$$scope:{ctx:F}}}),Ye=new $e({}),Ge=new z({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#L1465"}}),eo=new z({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/poolformer#transformers.PoolFormerFeatureExtractor.__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#L1614",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>
`}}),ge=new ks({props:{$$slots:{default:[Ls]},$$scope:{ctx:F}}}),_e=new Da({props:{anchor:"transformers.DeformableDetrModel.forward.example",$$slots:{default:[Rs]},$$scope:{ctx:F}}}),oo=new $e({}),to=new z({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#L1822"}}),so=new z({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/poolformer#transformers.PoolFormerFeatureExtractor.__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#L1874",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>
`}}),De=new ks({props:{$$slots:{default:[Ns]},$$scope:{ctx:F}}}),ve=new Da({props:{anchor:"transformers.DeformableDetrForObjectDetection.forward.example",$$slots:{default:[Ms]},$$scope:{ctx:F}}}),{c(){h=r("meta"),$=c(),_=r("h1"),u=r("a"),x=r("span"),b(d.$$.fragment),g=c(),O=r("span"),nr=s("Deformable DETR"),ft=c(),S=r("h2"),ee=r("a"),No=r("span"),b(Ee.$$.fragment),ar=c(),Mo=r("span"),sr=s("Overview"),pt=c(),A=r("p"),ir=s("The Deformable DETR model was proposed in "),je=r("a"),lr=s("Deformable DETR: Deformable Transformers for End-to-End Object Detection"),dr=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 `),co=r("a"),cr=s("DETR"),mr=s(" by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),ht=c(),mo=r("p"),fr=s("The abstract from the paper is the following:"),ut=c(),fo=r("p"),So=r("em"),pr=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."),gt=c(),po=r("p"),hr=s("Tips:"),_t=c(),oe=r("ul"),ke=r("li"),ur=s("One can use "),ho=r("a"),gr=s("DeformableDetrImageProcessor"),_r=s(" to prepare images (and optional targets) for the model."),br=c(),U=r("li"),Dr=s("Training Deformable DETR is equivalent to training the original "),uo=r("a"),vr=s("DETR"),yr=s(" model. See the "),go=r("a"),wr=s("resources"),Tr=s(" section below for demo notebooks."),bt=c(),te=r("img"),Dt=c(),re=r("small"),xr=s("Deformable DETR architecture. Taken from the "),_o=r("a"),$r=s("original paper"),Er=s("."),vt=c(),L=r("p"),jr=s("This model was contributed by "),Pe=r("a"),kr=s("nielsr"),Pr=s(". The original code can be found "),Ie=r("a"),Ir=s("here"),zr=s("."),yt=c(),W=r("h2"),ne=r("a"),Uo=r("span"),b(ze.$$.fragment),Fr=c(),Wo=r("span"),Cr=s("Resources"),wt=c(),bo=r("p"),qr=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Deformable DETR."),Tt=c(),b(Fe.$$.fragment),xt=c(),Do=r("ul"),H=r("li"),Or=s("Demo notebooks regarding inference + fine-tuning on a custom dataset for "),vo=r("a"),Ar=s("DeformableDetrForObjectDetection"),Lr=s(" can be found "),Ce=r("a"),Rr=s("here"),Nr=s("."),$t=c(),yo=r("p"),Mr=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."),Et=c(),V=r("h2"),ae=r("a"),Ho=r("span"),b(qe.$$.fragment),Sr=c(),Vo=r("span"),Ur=s("DeformableDetrImageProcessor"),jt=c(),E=r("div"),b(Oe.$$.fragment),Wr=c(),Bo=r("p"),Hr=s("Constructs a Deformable DETR image processor."),Vr=c(),se=r("div"),b(Ae.$$.fragment),Br=c(),Xo=r("p"),Xr=s("Preprocess an image or a batch of images so that it can be used by the model."),Jr=c(),ie=r("div"),b(Le.$$.fragment),Yr=c(),Jo=r("p"),Gr=s(`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),Zr=c(),le=r("div"),b(Re.$$.fragment),Kr=c(),Ne=r("p"),Qr=s("Converts the raw output of "),wo=r("a"),en=s("DeformableDetrForObjectDetection"),on=s(` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),kt=c(),B=r("h2"),de=r("a"),Yo=r("span"),b(Me.$$.fragment),tn=c(),Go=r("span"),rn=s("DeformableDetrFeatureExtractor"),Pt=c(),P=r("div"),b(Se.$$.fragment),nn=c(),ce=r("div"),b(Ue.$$.fragment),an=c(),Zo=r("p"),sn=s("Preprocess an image or a batch of images."),ln=c(),me=r("div"),b(We.$$.fragment),dn=c(),Ko=r("p"),cn=s(`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),mn=c(),fe=r("div"),b(He.$$.fragment),fn=c(),Ve=r("p"),pn=s("Converts the raw output of "),To=r("a"),hn=s("DeformableDetrForObjectDetection"),un=s(` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),It=c(),X=r("h2"),pe=r("a"),Qo=r("span"),b(Be.$$.fragment),gn=c(),et=r("span"),_n=s("DeformableDetrConfig"),zt=c(),I=r("div"),b(Xe.$$.fragment),bn=c(),J=r("p"),Dn=s("This is the configuration class to store the configuration of a "),xo=r("a"),vn=s("DeformableDetrModel"),yn=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
`),Je=r("a"),wn=s("SenseTime/deformable-detr"),Tn=s(" architecture."),xn=c(),Y=r("p"),$n=s("Configuration objects inherit from "),$o=r("a"),En=s("PretrainedConfig"),jn=s(` and can be used to control the model outputs. Read the
documentation from `),Eo=r("a"),kn=s("PretrainedConfig"),Pn=s(" for more information."),In=c(),b(he.$$.fragment),Ft=c(),G=r("h2"),ue=r("a"),ot=r("span"),b(Ye.$$.fragment),zn=c(),tt=r("span"),Fn=s("DeformableDetrModel"),Ct=c(),j=r("div"),b(Ge.$$.fragment),Cn=c(),rt=r("p"),qn=s(`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),On=c(),Ze=r("p"),An=s("This model inherits from "),jo=r("a"),Ln=s("PreTrainedModel"),Rn=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.)`),Nn=c(),Ke=r("p"),Mn=s("This model is also a PyTorch "),Qe=r("a"),Sn=s("torch.nn.Module"),Un=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wn=c(),C=r("div"),b(eo.$$.fragment),Hn=c(),Z=r("p"),Vn=s("The "),ko=r("a"),Bn=s("DeformableDetrModel"),Xn=s(" forward method, overrides the "),nt=r("code"),Jn=s("__call__"),Yn=s(" special method."),Gn=c(),b(ge.$$.fragment),Zn=c(),b(_e.$$.fragment),qt=c(),K=r("h2"),be=r("a"),at=r("span"),b(oo.$$.fragment),Kn=c(),st=r("span"),Qn=s("DeformableDetrForObjectDetection"),Ot=c(),k=r("div"),b(to.$$.fragment),ea=c(),it=r("p"),oa=s(`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),ta=c(),ro=r("p"),ra=s("This model inherits from "),Po=r("a"),na=s("PreTrainedModel"),aa=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.)`),sa=c(),no=r("p"),ia=s("This model is also a PyTorch "),ao=r("a"),la=s("torch.nn.Module"),da=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ca=c(),q=r("div"),b(so.$$.fragment),ma=c(),Q=r("p"),fa=s("The "),Io=r("a"),pa=s("DeformableDetrForObjectDetection"),ha=s(" forward method, overrides the "),lt=r("code"),ua=s("__call__"),ga=s(" special method."),_a=c(),b(De.$$.fragment),ba=c(),b(ve.$$.fragment),this.h()},l(e){const f=Fs('[data-svelte="svelte-1phssyn"]',document.head);h=n(f,"META",{name:!0,content:!0}),f.forEach(t),$=m(e),_=n(e,"H1",{class:!0});var io=a(_);u=n(io,"A",{id:!0,class:!0,href:!0});var dt=a(u);x=n(dt,"SPAN",{});var ct=a(x);D(d.$$.fragment,ct),ct.forEach(t),dt.forEach(t),g=m(io),O=n(io,"SPAN",{});var mt=a(O);nr=i(mt,"Deformable DETR"),mt.forEach(t),io.forEach(t),ft=m(e),S=n(e,"H2",{class:!0});var lo=a(S);ee=n(lo,"A",{id:!0,class:!0,href:!0});var Ta=a(ee);No=n(Ta,"SPAN",{});var xa=a(No);D(Ee.$$.fragment,xa),xa.forEach(t),Ta.forEach(t),ar=m(lo),Mo=n(lo,"SPAN",{});var $a=a(Mo);sr=i($a,"Overview"),$a.forEach(t),lo.forEach(t),pt=m(e),A=n(e,"P",{});var zo=a(A);ir=i(zo,"The Deformable DETR model was proposed in "),je=n(zo,"A",{href:!0,rel:!0});var Ea=a(je);lr=i(Ea,"Deformable DETR: Deformable Transformers for End-to-End Object Detection"),Ea.forEach(t),dr=i(zo,` 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 `),co=n(zo,"A",{href:!0});var ja=a(co);cr=i(ja,"DETR"),ja.forEach(t),mr=i(zo," by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),zo.forEach(t),ht=m(e),mo=n(e,"P",{});var ka=a(mo);fr=i(ka,"The abstract from the paper is the following:"),ka.forEach(t),ut=m(e),fo=n(e,"P",{});var Pa=a(fo);So=n(Pa,"EM",{});var Ia=a(So);pr=i(Ia,"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."),Ia.forEach(t),Pa.forEach(t),gt=m(e),po=n(e,"P",{});var za=a(po);hr=i(za,"Tips:"),za.forEach(t),_t=m(e),oe=n(e,"UL",{});var Lt=a(oe);ke=n(Lt,"LI",{});var Rt=a(ke);ur=i(Rt,"One can use "),ho=n(Rt,"A",{href:!0});var Fa=a(ho);gr=i(Fa,"DeformableDetrImageProcessor"),Fa.forEach(t),_r=i(Rt," to prepare images (and optional targets) for the model."),Rt.forEach(t),br=m(Lt),U=n(Lt,"LI",{});var Fo=a(U);Dr=i(Fo,"Training Deformable DETR is equivalent to training the original "),uo=n(Fo,"A",{href:!0});var Ca=a(uo);vr=i(Ca,"DETR"),Ca.forEach(t),yr=i(Fo," model. See the "),go=n(Fo,"A",{href:!0});var qa=a(go);wr=i(qa,"resources"),qa.forEach(t),Tr=i(Fo," section below for demo notebooks."),Fo.forEach(t),Lt.forEach(t),bt=m(e),te=n(e,"IMG",{src:!0,alt:!0,width:!0}),Dt=m(e),re=n(e,"SMALL",{});var Nt=a(re);xr=i(Nt,"Deformable DETR architecture. Taken from the "),_o=n(Nt,"A",{href:!0});var Oa=a(_o);$r=i(Oa,"original paper"),Oa.forEach(t),Er=i(Nt,"."),Nt.forEach(t),vt=m(e),L=n(e,"P",{});var Co=a(L);jr=i(Co,"This model was contributed by "),Pe=n(Co,"A",{href:!0,rel:!0});var Aa=a(Pe);kr=i(Aa,"nielsr"),Aa.forEach(t),Pr=i(Co,". The original code can be found "),Ie=n(Co,"A",{href:!0,rel:!0});var La=a(Ie);Ir=i(La,"here"),La.forEach(t),zr=i(Co,"."),Co.forEach(t),yt=m(e),W=n(e,"H2",{class:!0});var Mt=a(W);ne=n(Mt,"A",{id:!0,class:!0,href:!0});var Ra=a(ne);Uo=n(Ra,"SPAN",{});var Na=a(Uo);D(ze.$$.fragment,Na),Na.forEach(t),Ra.forEach(t),Fr=m(Mt),Wo=n(Mt,"SPAN",{});var Ma=a(Wo);Cr=i(Ma,"Resources"),Ma.forEach(t),Mt.forEach(t),wt=m(e),bo=n(e,"P",{});var Sa=a(bo);qr=i(Sa,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Deformable DETR."),Sa.forEach(t),Tt=m(e),D(Fe.$$.fragment,e),xt=m(e),Do=n(e,"UL",{});var Ua=a(Do);H=n(Ua,"LI",{});var qo=a(H);Or=i(qo,"Demo notebooks regarding inference + fine-tuning on a custom dataset for "),vo=n(qo,"A",{href:!0});var Wa=a(vo);Ar=i(Wa,"DeformableDetrForObjectDetection"),Wa.forEach(t),Lr=i(qo," can be found "),Ce=n(qo,"A",{href:!0,rel:!0});var Ha=a(Ce);Rr=i(Ha,"here"),Ha.forEach(t),Nr=i(qo,"."),qo.forEach(t),Ua.forEach(t),$t=m(e),yo=n(e,"P",{});var Va=a(yo);Mr=i(Va,"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."),Va.forEach(t),Et=m(e),V=n(e,"H2",{class:!0});var St=a(V);ae=n(St,"A",{id:!0,class:!0,href:!0});var Ba=a(ae);Ho=n(Ba,"SPAN",{});var Xa=a(Ho);D(qe.$$.fragment,Xa),Xa.forEach(t),Ba.forEach(t),Sr=m(St),Vo=n(St,"SPAN",{});var Ja=a(Vo);Ur=i(Ja,"DeformableDetrImageProcessor"),Ja.forEach(t),St.forEach(t),jt=m(e),E=n(e,"DIV",{class:!0});var R=a(E);D(Oe.$$.fragment,R),Wr=m(R),Bo=n(R,"P",{});var Ya=a(Bo);Hr=i(Ya,"Constructs a Deformable DETR image processor."),Ya.forEach(t),Vr=m(R),se=n(R,"DIV",{class:!0});var Ut=a(se);D(Ae.$$.fragment,Ut),Br=m(Ut),Xo=n(Ut,"P",{});var Ga=a(Xo);Xr=i(Ga,"Preprocess an image or a batch of images so that it can be used by the model."),Ga.forEach(t),Ut.forEach(t),Jr=m(R),ie=n(R,"DIV",{class:!0});var Wt=a(ie);D(Le.$$.fragment,Wt),Yr=m(Wt),Jo=n(Wt,"P",{});var Za=a(Jo);Gr=i(Za,`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),Za.forEach(t),Wt.forEach(t),Zr=m(R),le=n(R,"DIV",{class:!0});var Ht=a(le);D(Re.$$.fragment,Ht),Kr=m(Ht),Ne=n(Ht,"P",{});var Vt=a(Ne);Qr=i(Vt,"Converts the raw output of "),wo=n(Vt,"A",{href:!0});var Ka=a(wo);en=i(Ka,"DeformableDetrForObjectDetection"),Ka.forEach(t),on=i(Vt,` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Vt.forEach(t),Ht.forEach(t),R.forEach(t),kt=m(e),B=n(e,"H2",{class:!0});var Bt=a(B);de=n(Bt,"A",{id:!0,class:!0,href:!0});var Qa=a(de);Yo=n(Qa,"SPAN",{});var es=a(Yo);D(Me.$$.fragment,es),es.forEach(t),Qa.forEach(t),tn=m(Bt),Go=n(Bt,"SPAN",{});var os=a(Go);rn=i(os,"DeformableDetrFeatureExtractor"),os.forEach(t),Bt.forEach(t),Pt=m(e),P=n(e,"DIV",{class:!0});var ye=a(P);D(Se.$$.fragment,ye),nn=m(ye),ce=n(ye,"DIV",{class:!0});var Xt=a(ce);D(Ue.$$.fragment,Xt),an=m(Xt),Zo=n(Xt,"P",{});var ts=a(Zo);sn=i(ts,"Preprocess an image or a batch of images."),ts.forEach(t),Xt.forEach(t),ln=m(ye),me=n(ye,"DIV",{class:!0});var Jt=a(me);D(We.$$.fragment,Jt),dn=m(Jt),Ko=n(Jt,"P",{});var rs=a(Ko);cn=i(rs,`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),rs.forEach(t),Jt.forEach(t),mn=m(ye),fe=n(ye,"DIV",{class:!0});var Yt=a(fe);D(He.$$.fragment,Yt),fn=m(Yt),Ve=n(Yt,"P",{});var Gt=a(Ve);pn=i(Gt,"Converts the raw output of "),To=n(Gt,"A",{href:!0});var ns=a(To);hn=i(ns,"DeformableDetrForObjectDetection"),ns.forEach(t),un=i(Gt,` into final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`),Gt.forEach(t),Yt.forEach(t),ye.forEach(t),It=m(e),X=n(e,"H2",{class:!0});var Zt=a(X);pe=n(Zt,"A",{id:!0,class:!0,href:!0});var as=a(pe);Qo=n(as,"SPAN",{});var ss=a(Qo);D(Be.$$.fragment,ss),ss.forEach(t),as.forEach(t),gn=m(Zt),et=n(Zt,"SPAN",{});var is=a(et);_n=i(is,"DeformableDetrConfig"),is.forEach(t),Zt.forEach(t),zt=m(e),I=n(e,"DIV",{class:!0});var we=a(I);D(Xe.$$.fragment,we),bn=m(we),J=n(we,"P",{});var Oo=a(J);Dn=i(Oo,"This is the configuration class to store the configuration of a "),xo=n(Oo,"A",{href:!0});var ls=a(xo);vn=i(ls,"DeformableDetrModel"),ls.forEach(t),yn=i(Oo,`. 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
`),Je=n(Oo,"A",{href:!0,rel:!0});var ds=a(Je);wn=i(ds,"SenseTime/deformable-detr"),ds.forEach(t),Tn=i(Oo," architecture."),Oo.forEach(t),xn=m(we),Y=n(we,"P",{});var Ao=a(Y);$n=i(Ao,"Configuration objects inherit from "),$o=n(Ao,"A",{href:!0});var cs=a($o);En=i(cs,"PretrainedConfig"),cs.forEach(t),jn=i(Ao,` and can be used to control the model outputs. Read the
documentation from `),Eo=n(Ao,"A",{href:!0});var ms=a(Eo);kn=i(ms,"PretrainedConfig"),ms.forEach(t),Pn=i(Ao," for more information."),Ao.forEach(t),In=m(we),D(he.$$.fragment,we),we.forEach(t),Ft=m(e),G=n(e,"H2",{class:!0});var Kt=a(G);ue=n(Kt,"A",{id:!0,class:!0,href:!0});var fs=a(ue);ot=n(fs,"SPAN",{});var ps=a(ot);D(Ye.$$.fragment,ps),ps.forEach(t),fs.forEach(t),zn=m(Kt),tt=n(Kt,"SPAN",{});var hs=a(tt);Fn=i(hs,"DeformableDetrModel"),hs.forEach(t),Kt.forEach(t),Ct=m(e),j=n(e,"DIV",{class:!0});var N=a(j);D(Ge.$$.fragment,N),Cn=m(N),rt=n(N,"P",{});var us=a(rt);qn=i(us,`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),us.forEach(t),On=m(N),Ze=n(N,"P",{});var Qt=a(Ze);An=i(Qt,"This model inherits from "),jo=n(Qt,"A",{href:!0});var gs=a(jo);Ln=i(gs,"PreTrainedModel"),gs.forEach(t),Rn=i(Qt,`. 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.)`),Qt.forEach(t),Nn=m(N),Ke=n(N,"P",{});var er=a(Ke);Mn=i(er,"This model is also a PyTorch "),Qe=n(er,"A",{href:!0,rel:!0});var _s=a(Qe);Sn=i(_s,"torch.nn.Module"),_s.forEach(t),Un=i(er,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),er.forEach(t),Wn=m(N),C=n(N,"DIV",{class:!0});var Te=a(C);D(eo.$$.fragment,Te),Hn=m(Te),Z=n(Te,"P",{});var Lo=a(Z);Vn=i(Lo,"The "),ko=n(Lo,"A",{href:!0});var bs=a(ko);Bn=i(bs,"DeformableDetrModel"),bs.forEach(t),Xn=i(Lo," forward method, overrides the "),nt=n(Lo,"CODE",{});var Ds=a(nt);Jn=i(Ds,"__call__"),Ds.forEach(t),Yn=i(Lo," special method."),Lo.forEach(t),Gn=m(Te),D(ge.$$.fragment,Te),Zn=m(Te),D(_e.$$.fragment,Te),Te.forEach(t),N.forEach(t),qt=m(e),K=n(e,"H2",{class:!0});var or=a(K);be=n(or,"A",{id:!0,class:!0,href:!0});var vs=a(be);at=n(vs,"SPAN",{});var ys=a(at);D(oo.$$.fragment,ys),ys.forEach(t),vs.forEach(t),Kn=m(or),st=n(or,"SPAN",{});var ws=a(st);Qn=i(ws,"DeformableDetrForObjectDetection"),ws.forEach(t),or.forEach(t),Ot=m(e),k=n(e,"DIV",{class:!0});var M=a(k);D(to.$$.fragment,M),ea=m(M),it=n(M,"P",{});var Ts=a(it);oa=i(Ts,`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Ts.forEach(t),ta=m(M),ro=n(M,"P",{});var tr=a(ro);ra=i(tr,"This model inherits from "),Po=n(tr,"A",{href:!0});var xs=a(Po);na=i(xs,"PreTrainedModel"),xs.forEach(t),aa=i(tr,`. 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.)`),tr.forEach(t),sa=m(M),no=n(M,"P",{});var rr=a(no);ia=i(rr,"This model is also a PyTorch "),ao=n(rr,"A",{href:!0,rel:!0});var $s=a(ao);la=i($s,"torch.nn.Module"),$s.forEach(t),da=i(rr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rr.forEach(t),ca=m(M),q=n(M,"DIV",{class:!0});var xe=a(q);D(so.$$.fragment,xe),ma=m(xe),Q=n(xe,"P",{});var Ro=a(Q);fa=i(Ro,"The "),Io=n(Ro,"A",{href:!0});var Es=a(Io);pa=i(Es,"DeformableDetrForObjectDetection"),Es.forEach(t),ha=i(Ro," forward method, overrides the "),lt=n(Ro,"CODE",{});var js=a(lt);ua=i(js,"__call__"),js.forEach(t),ga=i(Ro," special method."),Ro.forEach(t),_a=m(xe),D(De.$$.fragment,xe),ba=m(xe),D(ve.$$.fragment,xe),xe.forEach(t),M.forEach(t),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(Us)),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(ee,"id","overview"),l(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ee,"href","#overview"),l(S,"class","relative group"),l(je,"href","https://arxiv.org/abs/2010.04159"),l(je,"rel","nofollow"),l(co,"href","detr"),l(ho,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrImageProcessor"),l(uo,"href","detr"),l(go,"href","#resources"),Cs(te.src,wa="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/deformable_detr_architecture.png")||l(te,"src",wa),l(te,"alt","drawing"),l(te,"width","600"),l(_o,"href","https://arxiv.org/abs/2010.04159"),l(Pe,"href","https://huggingface.co/nielsr"),l(Pe,"rel","nofollow"),l(Ie,"href","https://github.com/fundamentalvision/Deformable-DETR"),l(Ie,"rel","nofollow"),l(ne,"id","resources"),l(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ne,"href","#resources"),l(W,"class","relative group"),l(vo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(Ce,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Deformable-DETR"),l(Ce,"rel","nofollow"),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(V,"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(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(wo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(le,"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(de,"id","transformers.DeformableDetrFeatureExtractor"),l(de,"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(de,"href","#transformers.DeformableDetrFeatureExtractor"),l(B,"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(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(To,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"id","transformers.DeformableDetrConfig"),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.DeformableDetrConfig"),l(X,"class","relative group"),l(xo,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),l(Je,"href","https://huggingface.co/SenseTime/deformable-detr"),l(Je,"rel","nofollow"),l($o,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(Eo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"id","transformers.DeformableDetrModel"),l(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ue,"href","#transformers.DeformableDetrModel"),l(G,"class","relative group"),l(jo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(Qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Qe,"rel","nofollow"),l(ko,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(be,"id","transformers.DeformableDetrForObjectDetection"),l(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(be,"href","#transformers.DeformableDetrForObjectDetection"),l(K,"class","relative group"),l(Po,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ao,"rel","nofollow"),l(Io,"href","/docs/transformers/main/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,f){o(document.head,h),p(e,$,f),p(e,_,f),o(_,u),o(u,x),v(d,x,null),o(_,g),o(_,O),o(O,nr),p(e,ft,f),p(e,S,f),o(S,ee),o(ee,No),v(Ee,No,null),o(S,ar),o(S,Mo),o(Mo,sr),p(e,pt,f),p(e,A,f),o(A,ir),o(A,je),o(je,lr),o(A,dr),o(A,co),o(co,cr),o(A,mr),p(e,ht,f),p(e,mo,f),o(mo,fr),p(e,ut,f),p(e,fo,f),o(fo,So),o(So,pr),p(e,gt,f),p(e,po,f),o(po,hr),p(e,_t,f),p(e,oe,f),o(oe,ke),o(ke,ur),o(ke,ho),o(ho,gr),o(ke,_r),o(oe,br),o(oe,U),o(U,Dr),o(U,uo),o(uo,vr),o(U,yr),o(U,go),o(go,wr),o(U,Tr),p(e,bt,f),p(e,te,f),p(e,Dt,f),p(e,re,f),o(re,xr),o(re,_o),o(_o,$r),o(re,Er),p(e,vt,f),p(e,L,f),o(L,jr),o(L,Pe),o(Pe,kr),o(L,Pr),o(L,Ie),o(Ie,Ir),o(L,zr),p(e,yt,f),p(e,W,f),o(W,ne),o(ne,Uo),v(ze,Uo,null),o(W,Fr),o(W,Wo),o(Wo,Cr),p(e,wt,f),p(e,bo,f),o(bo,qr),p(e,Tt,f),v(Fe,e,f),p(e,xt,f),p(e,Do,f),o(Do,H),o(H,Or),o(H,vo),o(vo,Ar),o(H,Lr),o(H,Ce),o(Ce,Rr),o(H,Nr),p(e,$t,f),p(e,yo,f),o(yo,Mr),p(e,Et,f),p(e,V,f),o(V,ae),o(ae,Ho),v(qe,Ho,null),o(V,Sr),o(V,Vo),o(Vo,Ur),p(e,jt,f),p(e,E,f),v(Oe,E,null),o(E,Wr),o(E,Bo),o(Bo,Hr),o(E,Vr),o(E,se),v(Ae,se,null),o(se,Br),o(se,Xo),o(Xo,Xr),o(E,Jr),o(E,ie),v(Le,ie,null),o(ie,Yr),o(ie,Jo),o(Jo,Gr),o(E,Zr),o(E,le),v(Re,le,null),o(le,Kr),o(le,Ne),o(Ne,Qr),o(Ne,wo),o(wo,en),o(Ne,on),p(e,kt,f),p(e,B,f),o(B,de),o(de,Yo),v(Me,Yo,null),o(B,tn),o(B,Go),o(Go,rn),p(e,Pt,f),p(e,P,f),v(Se,P,null),o(P,nn),o(P,ce),v(Ue,ce,null),o(ce,an),o(ce,Zo),o(Zo,sn),o(P,ln),o(P,me),v(We,me,null),o(me,dn),o(me,Ko),o(Ko,cn),o(P,mn),o(P,fe),v(He,fe,null),o(fe,fn),o(fe,Ve),o(Ve,pn),o(Ve,To),o(To,hn),o(Ve,un),p(e,It,f),p(e,X,f),o(X,pe),o(pe,Qo),v(Be,Qo,null),o(X,gn),o(X,et),o(et,_n),p(e,zt,f),p(e,I,f),v(Xe,I,null),o(I,bn),o(I,J),o(J,Dn),o(J,xo),o(xo,vn),o(J,yn),o(J,Je),o(Je,wn),o(J,Tn),o(I,xn),o(I,Y),o(Y,$n),o(Y,$o),o($o,En),o(Y,jn),o(Y,Eo),o(Eo,kn),o(Y,Pn),o(I,In),v(he,I,null),p(e,Ft,f),p(e,G,f),o(G,ue),o(ue,ot),v(Ye,ot,null),o(G,zn),o(G,tt),o(tt,Fn),p(e,Ct,f),p(e,j,f),v(Ge,j,null),o(j,Cn),o(j,rt),o(rt,qn),o(j,On),o(j,Ze),o(Ze,An),o(Ze,jo),o(jo,Ln),o(Ze,Rn),o(j,Nn),o(j,Ke),o(Ke,Mn),o(Ke,Qe),o(Qe,Sn),o(Ke,Un),o(j,Wn),o(j,C),v(eo,C,null),o(C,Hn),o(C,Z),o(Z,Vn),o(Z,ko),o(ko,Bn),o(Z,Xn),o(Z,nt),o(nt,Jn),o(Z,Yn),o(C,Gn),v(ge,C,null),o(C,Zn),v(_e,C,null),p(e,qt,f),p(e,K,f),o(K,be),o(be,at),v(oo,at,null),o(K,Kn),o(K,st),o(st,Qn),p(e,Ot,f),p(e,k,f),v(to,k,null),o(k,ea),o(k,it),o(it,oa),o(k,ta),o(k,ro),o(ro,ra),o(ro,Po),o(Po,na),o(ro,aa),o(k,sa),o(k,no),o(no,ia),o(no,ao),o(ao,la),o(no,da),o(k,ca),o(k,q),v(so,q,null),o(q,ma),o(q,Q),o(Q,fa),o(Q,Io),o(Io,pa),o(Q,ha),o(Q,lt),o(lt,ua),o(Q,ga),o(q,_a),v(De,q,null),o(q,ba),v(ve,q,null),At=!0},p(e,[f]){const io={};f&2&&(io.$$scope={dirty:f,ctx:e}),he.$set(io);const dt={};f&2&&(dt.$$scope={dirty:f,ctx:e}),ge.$set(dt);const ct={};f&2&&(ct.$$scope={dirty:f,ctx:e}),_e.$set(ct);const mt={};f&2&&(mt.$$scope={dirty:f,ctx:e}),De.$set(mt);const lo={};f&2&&(lo.$$scope={dirty:f,ctx:e}),ve.$set(lo)},i(e){At||(y(d.$$.fragment,e),y(Ee.$$.fragment,e),y(ze.$$.fragment,e),y(Fe.$$.fragment,e),y(qe.$$.fragment,e),y(Oe.$$.fragment,e),y(Ae.$$.fragment,e),y(Le.$$.fragment,e),y(Re.$$.fragment,e),y(Me.$$.fragment,e),y(Se.$$.fragment,e),y(Ue.$$.fragment,e),y(We.$$.fragment,e),y(He.$$.fragment,e),y(Be.$$.fragment,e),y(Xe.$$.fragment,e),y(he.$$.fragment,e),y(Ye.$$.fragment,e),y(Ge.$$.fragment,e),y(eo.$$.fragment,e),y(ge.$$.fragment,e),y(_e.$$.fragment,e),y(oo.$$.fragment,e),y(to.$$.fragment,e),y(so.$$.fragment,e),y(De.$$.fragment,e),y(ve.$$.fragment,e),At=!0)},o(e){w(d.$$.fragment,e),w(Ee.$$.fragment,e),w(ze.$$.fragment,e),w(Fe.$$.fragment,e),w(qe.$$.fragment,e),w(Oe.$$.fragment,e),w(Ae.$$.fragment,e),w(Le.$$.fragment,e),w(Re.$$.fragment,e),w(Me.$$.fragment,e),w(Se.$$.fragment,e),w(Ue.$$.fragment,e),w(We.$$.fragment,e),w(He.$$.fragment,e),w(Be.$$.fragment,e),w(Xe.$$.fragment,e),w(he.$$.fragment,e),w(Ye.$$.fragment,e),w(Ge.$$.fragment,e),w(eo.$$.fragment,e),w(ge.$$.fragment,e),w(_e.$$.fragment,e),w(oo.$$.fragment,e),w(to.$$.fragment,e),w(so.$$.fragment,e),w(De.$$.fragment,e),w(ve.$$.fragment,e),At=!1},d(e){t(h),e&&t($),e&&t(_),T(d),e&&t(ft),e&&t(S),T(Ee),e&&t(pt),e&&t(A),e&&t(ht),e&&t(mo),e&&t(ut),e&&t(fo),e&&t(gt),e&&t(po),e&&t(_t),e&&t(oe),e&&t(bt),e&&t(te),e&&t(Dt),e&&t(re),e&&t(vt),e&&t(L),e&&t(yt),e&&t(W),T(ze),e&&t(wt),e&&t(bo),e&&t(Tt),T(Fe,e),e&&t(xt),e&&t(Do),e&&t($t),e&&t(yo),e&&t(Et),e&&t(V),T(qe),e&&t(jt),e&&t(E),T(Oe),T(Ae),T(Le),T(Re),e&&t(kt),e&&t(B),T(Me),e&&t(Pt),e&&t(P),T(Se),T(Ue),T(We),T(He),e&&t(It),e&&t(X),T(Be),e&&t(zt),e&&t(I),T(Xe),T(he),e&&t(Ft),e&&t(G),T(Ye),e&&t(Ct),e&&t(j),T(Ge),T(eo),T(ge),T(_e),e&&t(qt),e&&t(K),T(oo),e&&t(Ot),e&&t(k),T(to),T(so),T(De),T(ve)}}}const Us={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 Ws(F){return qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zs extends Ps{constructor(h){super();Is(this,h,Ws,Ss,zs,{})}}export{Zs as default,Us as metadata};
