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