import{S as Zn,i as Kn,s as Qn,e as r,k as c,w as D,t as s,M as es,c as a,d as t,m,a as n,x as v,h as i,b as d,N as os,G as e,g as h,y,q as w,o as T,B as x,v as ts,L as Ga}from"../../chunks/vendor-hf-doc-builder.js";import{T as Yn}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ja}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ro}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xa}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function rs(C){let p,$,_,g,b;return g=new Ja({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(){p=r("p"),$=s("Examples:"),_=c(),D(g.$$.fragment)},l(l){p=a(l,"P",{});var u=n(p);$=i(u,"Examples:"),u.forEach(t),_=m(l),v(g.$$.fragment,l)},m(l,u){h(l,p,u),e(p,$),h(l,_,u),y(g,l,u),b=!0},p:Ga,i(l){b||(w(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&t(p),l&&t(_),x(g,l)}}}function as(C){let p,$,_,g,b;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=a(l,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var O=n(_);g=i(O,"Module"),O.forEach(t),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){h(l,p,u),e(p,$),e(p,_),e(_,g),e(p,b)},d(l){l&&t(p)}}}function ns(C){let p,$,_,g,b;return g=new Ja({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(){p=r("p"),$=s("Examples:"),_=c(),D(g.$$.fragment)},l(l){p=a(l,"P",{});var u=n(p);$=i(u,"Examples:"),u.forEach(t),_=m(l),v(g.$$.fragment,l)},m(l,u){h(l,p,u),e(p,$),h(l,_,u),y(g,l,u),b=!0},p:Ga,i(l){b||(w(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&t(p),l&&t(_),x(g,l)}}}function ss(C){let p,$,_,g,b;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=a(l,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var O=n(_);g=i(O,"Module"),O.forEach(t),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){h(l,p,u),e(p,$),e(p,_),e(_,g),e(p,b)},d(l){l&&t(p)}}}function is(C){let p,$,_,g,b;return g=new Ja({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(){p=r("p"),$=s("Examples:"),_=c(),D(g.$$.fragment)},l(l){p=a(l,"P",{});var u=n(p);$=i(u,"Examples:"),u.forEach(t),_=m(l),v(g.$$.fragment,l)},m(l,u){h(l,p,u),e(p,$),h(l,_,u),y(g,l,u),b=!0},p:Ga,i(l){b||(w(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&t(p),l&&t(_),x(g,l)}}}function ds(C){let p,$,_,g,b,l,u,O,Mt,et,U,Q,Eo,we,St,Io,Ut,ot,L,Wt,Te,Ht,Vt,ao,Bt,Xt,tt,no,Gt,rt,so,zo,Jt,at,io,Yt,nt,ee,xe,Zt,lo,Kt,Qt,er,W,or,co,tr,rr,$e,ar,nr,st,oe,Ya,it,te,sr,mo,ir,dr,dt,A,lr,Pe,cr,mr,je,fr,pr,lt,H,re,ko,Ee,hr,Co,gr,ct,P,Ie,ur,Fo,_r,br,ae,ze,Dr,qo,vr,yr,ne,ke,wr,Oo,Tr,xr,se,Ce,$r,Fe,Pr,fo,jr,Er,mt,V,ie,Lo,qe,Ir,Ao,zr,ft,j,Oe,kr,Ro,Cr,Fr,de,Le,qr,No,Or,Lr,le,Ae,Ar,Mo,Rr,Nr,ce,Re,Mr,Ne,Sr,po,Ur,Wr,pt,B,me,So,Me,Hr,Uo,Vr,ht,z,Se,Br,X,Xr,ho,Gr,Jr,Ue,Yr,Zr,Kr,G,Qr,go,ea,oa,uo,ta,ra,aa,fe,gt,J,pe,Wo,We,na,Ho,sa,ut,E,He,ia,Vo,da,la,Ve,ca,_o,ma,fa,pa,Be,ha,Xe,ga,ua,_a,F,Ge,ba,Y,Da,bo,va,ya,Bo,wa,Ta,xa,he,$a,ge,_t,Z,ue,Xo,Je,Pa,Go,ja,bt,I,Ye,Ea,Jo,Ia,za,Ze,ka,Do,Ca,Fa,qa,Ke,Oa,Qe,La,Aa,Ra,q,eo,Na,K,Ma,vo,Sa,Ua,Yo,Wa,Ha,Va,_e,Ba,be,Dt;return l=new ro({}),we=new ro({}),Ee=new ro({}),Ie=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L736"}}),ze=new k({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.List[typing.Dict], typing.List[typing.List[typing.Dict]], NoneType] = None"},{name:"return_segmentation_masks",val:": bool = None"},{name:"masks_path",val:": typing.Union[str, pathlib.Path, NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:" = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Union[int, float, NoneType] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"format",val:": typing.Union[str, transformers.models.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>List[Dict]</code> or <code>List[List[Dict]]</code>, <em>optional</em>) &#x2014;
List of annotations associated with the image or batch of images. If annotionation is for object
detection, the annotations should be a dictionary with the following keys:<ul>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;annotations&#x201D; (<code>List[Dict]</code>): List of annotations for an image. Each annotation should be a
dictionary. An image can have no annotations, in which case the list should be empty.
If annotionation is for segmentation, the annotations should be a dictionary with the following keys:</li>
<li>&#x201C;image_id&#x201D; (<code>int</code>): The image id.</li>
<li>&#x201C;segments_info&#x201D; (<code>List[Dict]</code>): List of segments for an image. Each segment should be a dictionary.
An image can have no segments, in which case the list should be empty.</li>
<li>&#x201C;file_name&#x201D; (<code>str</code>): The file name of the image.</li>
</ul>`,name:"annotations"},{anchor:"transformers.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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1044"}}),ke=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L947"}}),Ce=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1298",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>
`}}),qe=new ro({}),Oe=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L736"}}),Le=new k({props:{name:"__call__",anchor:"transformers.DeformableDetrImageProcessor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/image_processing_utils.py#L435"}}),Ae=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L947"}}),Re=new k({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.25.1/src/transformers/models/deformable_detr/image_processing_deformable_detr.py#L1298",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Me=new ro({}),Se=new k({props:{name:"class transformers.DeformableDetrConfig",anchor:"transformers.DeformableDetrConfig",parameters:[{name:"num_queries",val:" = 300"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 1024"},{name:"encoder_attention_heads",val:" = 8"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 1024"},{name:"decoder_attention_heads",val:" = 8"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 256"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"init_xavier_std",val:" = 1.0"},{name:"return_intermediate",val:" = True"},{name:"auxiliary_loss",val:" = False"},{name:"position_embedding_type",val:" = 'sine'"},{name:"backbone",val:" = 'resnet50'"},{name:"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.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.25.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.
decoder_layerdrop &#x2014; (<code>float</code>, <em>optional</em>, defaults to 0.0):
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"init_xavier_std"},{anchor:"transformers.DeformableDetrConfig.auxiliary_loss",description:`<strong>auxiliary_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether auxiliary decoding losses (loss at each decoder layer) are to be used.`,name:"auxiliary_loss"},{anchor:"transformers.DeformableDetrConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sine&quot;</code>) &#x2014;
Type of position embeddings to be used on top of the image features. One of <code>&quot;sine&quot;</code> or <code>&quot;learned&quot;</code>.`,name:"position_embedding_type"},{anchor:"transformers.DeformableDetrConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;resnet50&quot;</code>) &#x2014;
Name of convolutional backbone to use. 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.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).`,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.25.1/src/transformers/models/deformable_detr/configuration_deformable_detr.py#L29"}}),fe=new Xa({props:{anchor:"transformers.DeformableDetrConfig.example",$$slots:{default:[rs]},$$scope:{ctx:C}}}),We=new ro({}),He=new k({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.25.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.25.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.25.1/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1436"}}),Ge=new k({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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code> 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.25.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.25.1/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1585",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.25.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>
`}}),he=new Yn({props:{$$slots:{default:[as]},$$scope:{ctx:C}}}),ge=new Xa({props:{anchor:"transformers.DeformableDetrModel.forward.example",$$slots:{default:[ns]},$$scope:{ctx:C}}}),Je=new ro({}),Ye=new k({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.25.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.25.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.25.1/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1796"}}),eo=new k({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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code> 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.25.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.25.1/src/transformers/models/deformable_detr/modeling_deformable_detr.py#L1848",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.25.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>~AutoImageProcessor.post_process_object_detection</code> to retrieve the
unnormalized bounding boxes.</li>
<li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) \u2014 Optional, only returned when auxilary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.</li>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, num_queries, hidden_size)</code>. Hidden-states of the decoder at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, num_queries, num_queries)</code>. Attentions weights of the decoder, after the attention softmax, used to compute the weighted
average in the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_queries, num_heads, 4, 4)</code>.
Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</li>
<li><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</li>
<li><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_heads, 4, 4)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the weighted average
in the self-attention heads.</li>
<li><strong>intermediate_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.decoder_layers, num_queries, hidden_size)</code>) \u2014 Stacked intermediate hidden states (output of each layer of the decoder).</li>
<li><strong>intermediate_reference_points</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.decoder_layers, num_queries, 4)</code>) \u2014 Stacked intermediate reference points (reference points of each layer of the decoder).</li>
<li><strong>init_reference_points</strong> (<code>torch.FloatTensor</code> of shape  <code>(batch_size, num_queries, 4)</code>) \u2014 Initial reference points sent through the Transformer decoder.</li>
<li><strong>enc_outputs_class</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Predicted bounding boxes scores where the top <code>config.two_stage_num_proposals</code> scoring bounding boxes are
picked as region proposals in the first stage. Output of bounding box binary classification (i.e.
foreground and background).</li>
<li><strong>enc_outputs_coord_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>, returned when <code>config.with_box_refine=True</code> and <code>config.two_stage=True</code>) \u2014 Logits of predicted bounding boxes coordinates in the first stage.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deformable_detr.modeling_deformable_detr.DeformableDetrObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new Yn({props:{$$slots:{default:[ss]},$$scope:{ctx:C}}}),be=new Xa({props:{anchor:"transformers.DeformableDetrForObjectDetection.forward.example",$$slots:{default:[is]},$$scope:{ctx:C}}}),{c(){p=r("meta"),$=c(),_=r("h1"),g=r("a"),b=r("span"),D(l.$$.fragment),u=c(),O=r("span"),Mt=s("Deformable DETR"),et=c(),U=r("h2"),Q=r("a"),Eo=r("span"),D(we.$$.fragment),St=c(),Io=r("span"),Ut=s("Overview"),ot=c(),L=r("p"),Wt=s("The Deformable DETR model was proposed in "),Te=r("a"),Ht=s("Deformable DETR: Deformable Transformers for End-to-End Object Detection"),Vt=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 `),ao=r("a"),Bt=s("DETR"),Xt=s(" by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),tt=c(),no=r("p"),Gt=s("The abstract from the paper is the following:"),rt=c(),so=r("p"),zo=r("em"),Jt=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."),at=c(),io=r("p"),Yt=s("Tips:"),nt=c(),ee=r("ul"),xe=r("li"),Zt=s("One can use "),lo=r("a"),Kt=s("DeformableDetrImageProcessor"),Qt=s(" to prepare images (and optional targets) for the model."),er=c(),W=r("li"),or=s("Training Deformable DETR is equivalent to training the original "),co=r("a"),tr=s("DETR"),rr=s(" model. Demo notebooks can be found "),$e=r("a"),ar=s("here"),nr=s("."),st=c(),oe=r("img"),it=c(),te=r("small"),sr=s("Deformable DETR architecture. Taken from the "),mo=r("a"),ir=s("original paper"),dr=s("."),dt=c(),A=r("p"),lr=s("This model was contributed by "),Pe=r("a"),cr=s("nielsr"),mr=s(". The original code can be found "),je=r("a"),fr=s("here"),pr=s("."),lt=c(),H=r("h2"),re=r("a"),ko=r("span"),D(Ee.$$.fragment),hr=c(),Co=r("span"),gr=s("DeformableDetrImageProcessor"),ct=c(),P=r("div"),D(Ie.$$.fragment),ur=c(),Fo=r("p"),_r=s("Constructs a Deformable DETR image processor."),br=c(),ae=r("div"),D(ze.$$.fragment),Dr=c(),qo=r("p"),vr=s("Preprocess an image or a batch of images so that it can be used by the model."),yr=c(),ne=r("div"),D(ke.$$.fragment),wr=c(),Oo=r("p"),Tr=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.`),xr=c(),se=r("div"),D(Ce.$$.fragment),$r=c(),Fe=r("p"),Pr=s("Converts the output of "),fo=r("a"),jr=s("DeformableDetrForObjectDetection"),Er=s(` into the format expected by the COCO api. Only
supports PyTorch.`),mt=c(),V=r("h2"),ie=r("a"),Lo=r("span"),D(qe.$$.fragment),Ir=c(),Ao=r("span"),zr=s("DeformableDetrFeatureExtractor"),ft=c(),j=r("div"),D(Oe.$$.fragment),kr=c(),Ro=r("p"),Cr=s("Constructs a Deformable DETR image processor."),Fr=c(),de=r("div"),D(Le.$$.fragment),qr=c(),No=r("p"),Or=s("Preprocess an image or a batch of images."),Lr=c(),le=r("div"),D(Ae.$$.fragment),Ar=c(),Mo=r("p"),Rr=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.`),Nr=c(),ce=r("div"),D(Re.$$.fragment),Mr=c(),Ne=r("p"),Sr=s("Converts the output of "),po=r("a"),Ur=s("DeformableDetrForObjectDetection"),Wr=s(` into the format expected by the COCO api. Only
supports PyTorch.`),pt=c(),B=r("h2"),me=r("a"),So=r("span"),D(Me.$$.fragment),Hr=c(),Uo=r("span"),Vr=s("DeformableDetrConfig"),ht=c(),z=r("div"),D(Se.$$.fragment),Br=c(),X=r("p"),Xr=s("This is the configuration class to store the configuration of a "),ho=r("a"),Gr=s("DeformableDetrModel"),Jr=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
`),Ue=r("a"),Yr=s("SenseTime/deformable-detr"),Zr=s(" architecture."),Kr=c(),G=r("p"),Qr=s("Configuration objects inherit from "),go=r("a"),ea=s("PretrainedConfig"),oa=s(` and can be used to control the model outputs. Read the
documentation from `),uo=r("a"),ta=s("PretrainedConfig"),ra=s(" for more information."),aa=c(),D(fe.$$.fragment),gt=c(),J=r("h2"),pe=r("a"),Wo=r("span"),D(We.$$.fragment),na=c(),Ho=r("span"),sa=s("DeformableDetrModel"),ut=c(),E=r("div"),D(He.$$.fragment),ia=c(),Vo=r("p"),da=s(`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),la=c(),Ve=r("p"),ca=s("This model inherits from "),_o=r("a"),ma=s("PreTrainedModel"),fa=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.)`),pa=c(),Be=r("p"),ha=s("This model is also a PyTorch "),Xe=r("a"),ga=s("torch.nn.Module"),ua=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_a=c(),F=r("div"),D(Ge.$$.fragment),ba=c(),Y=r("p"),Da=s("The "),bo=r("a"),va=s("DeformableDetrModel"),ya=s(" forward method, overrides the "),Bo=r("code"),wa=s("__call__"),Ta=s(" special method."),xa=c(),D(he.$$.fragment),$a=c(),D(ge.$$.fragment),_t=c(),Z=r("h2"),ue=r("a"),Xo=r("span"),D(Je.$$.fragment),Pa=c(),Go=r("span"),ja=s("DeformableDetrForObjectDetection"),bt=c(),I=r("div"),D(Ye.$$.fragment),Ea=c(),Jo=r("p"),Ia=s(`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),za=c(),Ze=r("p"),ka=s("This model inherits from "),Do=r("a"),Ca=s("PreTrainedModel"),Fa=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.)`),qa=c(),Ke=r("p"),Oa=s("This model is also a PyTorch "),Qe=r("a"),La=s("torch.nn.Module"),Aa=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ra=c(),q=r("div"),D(eo.$$.fragment),Na=c(),K=r("p"),Ma=s("The "),vo=r("a"),Sa=s("DeformableDetrForObjectDetection"),Ua=s(" forward method, overrides the "),Yo=r("code"),Wa=s("__call__"),Ha=s(" special method."),Va=c(),D(_e.$$.fragment),Ba=c(),D(be.$$.fragment),this.h()},l(o){const f=es('[data-svelte="svelte-1phssyn"]',document.head);p=a(f,"META",{name:!0,content:!0}),f.forEach(t),$=m(o),_=a(o,"H1",{class:!0});var oo=n(_);g=a(oo,"A",{id:!0,class:!0,href:!0});var Zo=n(g);b=a(Zo,"SPAN",{});var Ko=n(b);v(l.$$.fragment,Ko),Ko.forEach(t),Zo.forEach(t),u=m(oo),O=a(oo,"SPAN",{});var Qo=n(O);Mt=i(Qo,"Deformable DETR"),Qo.forEach(t),oo.forEach(t),et=m(o),U=a(o,"H2",{class:!0});var to=n(U);Q=a(to,"A",{id:!0,class:!0,href:!0});var Za=n(Q);Eo=a(Za,"SPAN",{});var Ka=n(Eo);v(we.$$.fragment,Ka),Ka.forEach(t),Za.forEach(t),St=m(to),Io=a(to,"SPAN",{});var Qa=n(Io);Ut=i(Qa,"Overview"),Qa.forEach(t),to.forEach(t),ot=m(o),L=a(o,"P",{});var yo=n(L);Wt=i(yo,"The Deformable DETR model was proposed in "),Te=a(yo,"A",{href:!0,rel:!0});var en=n(Te);Ht=i(en,"Deformable DETR: Deformable Transformers for End-to-End Object Detection"),en.forEach(t),Vt=i(yo,` 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 `),ao=a(yo,"A",{href:!0});var on=n(ao);Bt=i(on,"DETR"),on.forEach(t),Xt=i(yo," by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference."),yo.forEach(t),tt=m(o),no=a(o,"P",{});var tn=n(no);Gt=i(tn,"The abstract from the paper is the following:"),tn.forEach(t),rt=m(o),so=a(o,"P",{});var rn=n(so);zo=a(rn,"EM",{});var an=n(zo);Jt=i(an,"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."),an.forEach(t),rn.forEach(t),at=m(o),io=a(o,"P",{});var nn=n(io);Yt=i(nn,"Tips:"),nn.forEach(t),nt=m(o),ee=a(o,"UL",{});var vt=n(ee);xe=a(vt,"LI",{});var yt=n(xe);Zt=i(yt,"One can use "),lo=a(yt,"A",{href:!0});var sn=n(lo);Kt=i(sn,"DeformableDetrImageProcessor"),sn.forEach(t),Qt=i(yt," to prepare images (and optional targets) for the model."),yt.forEach(t),er=m(vt),W=a(vt,"LI",{});var wo=n(W);or=i(wo,"Training Deformable DETR is equivalent to training the original "),co=a(wo,"A",{href:!0});var dn=n(co);tr=i(dn,"DETR"),dn.forEach(t),rr=i(wo," model. Demo notebooks can be found "),$e=a(wo,"A",{href:!0,rel:!0});var ln=n($e);ar=i(ln,"here"),ln.forEach(t),nr=i(wo,"."),wo.forEach(t),vt.forEach(t),st=m(o),oe=a(o,"IMG",{src:!0,alt:!0,width:!0}),it=m(o),te=a(o,"SMALL",{});var wt=n(te);sr=i(wt,"Deformable DETR architecture. Taken from the "),mo=a(wt,"A",{href:!0});var cn=n(mo);ir=i(cn,"original paper"),cn.forEach(t),dr=i(wt,"."),wt.forEach(t),dt=m(o),A=a(o,"P",{});var To=n(A);lr=i(To,"This model was contributed by "),Pe=a(To,"A",{href:!0,rel:!0});var mn=n(Pe);cr=i(mn,"nielsr"),mn.forEach(t),mr=i(To,". The original code can be found "),je=a(To,"A",{href:!0,rel:!0});var fn=n(je);fr=i(fn,"here"),fn.forEach(t),pr=i(To,"."),To.forEach(t),lt=m(o),H=a(o,"H2",{class:!0});var Tt=n(H);re=a(Tt,"A",{id:!0,class:!0,href:!0});var pn=n(re);ko=a(pn,"SPAN",{});var hn=n(ko);v(Ee.$$.fragment,hn),hn.forEach(t),pn.forEach(t),hr=m(Tt),Co=a(Tt,"SPAN",{});var gn=n(Co);gr=i(gn,"DeformableDetrImageProcessor"),gn.forEach(t),Tt.forEach(t),ct=m(o),P=a(o,"DIV",{class:!0});var R=n(P);v(Ie.$$.fragment,R),ur=m(R),Fo=a(R,"P",{});var un=n(Fo);_r=i(un,"Constructs a Deformable DETR image processor."),un.forEach(t),br=m(R),ae=a(R,"DIV",{class:!0});var xt=n(ae);v(ze.$$.fragment,xt),Dr=m(xt),qo=a(xt,"P",{});var _n=n(qo);vr=i(_n,"Preprocess an image or a batch of images so that it can be used by the model."),_n.forEach(t),xt.forEach(t),yr=m(R),ne=a(R,"DIV",{class:!0});var $t=n(ne);v(ke.$$.fragment,$t),wr=m($t),Oo=a($t,"P",{});var bn=n(Oo);Tr=i(bn,`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),bn.forEach(t),$t.forEach(t),xr=m(R),se=a(R,"DIV",{class:!0});var Pt=n(se);v(Ce.$$.fragment,Pt),$r=m(Pt),Fe=a(Pt,"P",{});var jt=n(Fe);Pr=i(jt,"Converts the output of "),fo=a(jt,"A",{href:!0});var Dn=n(fo);jr=i(Dn,"DeformableDetrForObjectDetection"),Dn.forEach(t),Er=i(jt,` into the format expected by the COCO api. Only
supports PyTorch.`),jt.forEach(t),Pt.forEach(t),R.forEach(t),mt=m(o),V=a(o,"H2",{class:!0});var Et=n(V);ie=a(Et,"A",{id:!0,class:!0,href:!0});var vn=n(ie);Lo=a(vn,"SPAN",{});var yn=n(Lo);v(qe.$$.fragment,yn),yn.forEach(t),vn.forEach(t),Ir=m(Et),Ao=a(Et,"SPAN",{});var wn=n(Ao);zr=i(wn,"DeformableDetrFeatureExtractor"),wn.forEach(t),Et.forEach(t),ft=m(o),j=a(o,"DIV",{class:!0});var N=n(j);v(Oe.$$.fragment,N),kr=m(N),Ro=a(N,"P",{});var Tn=n(Ro);Cr=i(Tn,"Constructs a Deformable DETR image processor."),Tn.forEach(t),Fr=m(N),de=a(N,"DIV",{class:!0});var It=n(de);v(Le.$$.fragment,It),qr=m(It),No=a(It,"P",{});var xn=n(No);Or=i(xn,"Preprocess an image or a batch of images."),xn.forEach(t),It.forEach(t),Lr=m(N),le=a(N,"DIV",{class:!0});var zt=n(le);v(Ae.$$.fragment,zt),Ar=m(zt),Mo=a(zt,"P",{});var $n=n(Mo);Rr=i($n,`Pads a batch of images with zeros to the size of largest height and width in the batch and returns their
corresponding pixel mask.`),$n.forEach(t),zt.forEach(t),Nr=m(N),ce=a(N,"DIV",{class:!0});var kt=n(ce);v(Re.$$.fragment,kt),Mr=m(kt),Ne=a(kt,"P",{});var Ct=n(Ne);Sr=i(Ct,"Converts the output of "),po=a(Ct,"A",{href:!0});var Pn=n(po);Ur=i(Pn,"DeformableDetrForObjectDetection"),Pn.forEach(t),Wr=i(Ct,` into the format expected by the COCO api. Only
supports PyTorch.`),Ct.forEach(t),kt.forEach(t),N.forEach(t),pt=m(o),B=a(o,"H2",{class:!0});var Ft=n(B);me=a(Ft,"A",{id:!0,class:!0,href:!0});var jn=n(me);So=a(jn,"SPAN",{});var En=n(So);v(Me.$$.fragment,En),En.forEach(t),jn.forEach(t),Hr=m(Ft),Uo=a(Ft,"SPAN",{});var In=n(Uo);Vr=i(In,"DeformableDetrConfig"),In.forEach(t),Ft.forEach(t),ht=m(o),z=a(o,"DIV",{class:!0});var De=n(z);v(Se.$$.fragment,De),Br=m(De),X=a(De,"P",{});var xo=n(X);Xr=i(xo,"This is the configuration class to store the configuration of a "),ho=a(xo,"A",{href:!0});var zn=n(ho);Gr=i(zn,"DeformableDetrModel"),zn.forEach(t),Jr=i(xo,`. 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
`),Ue=a(xo,"A",{href:!0,rel:!0});var kn=n(Ue);Yr=i(kn,"SenseTime/deformable-detr"),kn.forEach(t),Zr=i(xo," architecture."),xo.forEach(t),Kr=m(De),G=a(De,"P",{});var $o=n(G);Qr=i($o,"Configuration objects inherit from "),go=a($o,"A",{href:!0});var Cn=n(go);ea=i(Cn,"PretrainedConfig"),Cn.forEach(t),oa=i($o,` and can be used to control the model outputs. Read the
documentation from `),uo=a($o,"A",{href:!0});var Fn=n(uo);ta=i(Fn,"PretrainedConfig"),Fn.forEach(t),ra=i($o," for more information."),$o.forEach(t),aa=m(De),v(fe.$$.fragment,De),De.forEach(t),gt=m(o),J=a(o,"H2",{class:!0});var qt=n(J);pe=a(qt,"A",{id:!0,class:!0,href:!0});var qn=n(pe);Wo=a(qn,"SPAN",{});var On=n(Wo);v(We.$$.fragment,On),On.forEach(t),qn.forEach(t),na=m(qt),Ho=a(qt,"SPAN",{});var Ln=n(Ho);sa=i(Ln,"DeformableDetrModel"),Ln.forEach(t),qt.forEach(t),ut=m(o),E=a(o,"DIV",{class:!0});var M=n(E);v(He.$$.fragment,M),ia=m(M),Vo=a(M,"P",{});var An=n(Vo);da=i(An,`The bare Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),An.forEach(t),la=m(M),Ve=a(M,"P",{});var Ot=n(Ve);ca=i(Ot,"This model inherits from "),_o=a(Ot,"A",{href:!0});var Rn=n(_o);ma=i(Rn,"PreTrainedModel"),Rn.forEach(t),fa=i(Ot,`. 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.)`),Ot.forEach(t),pa=m(M),Be=a(M,"P",{});var Lt=n(Be);ha=i(Lt,"This model is also a PyTorch "),Xe=a(Lt,"A",{href:!0,rel:!0});var Nn=n(Xe);ga=i(Nn,"torch.nn.Module"),Nn.forEach(t),ua=i(Lt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lt.forEach(t),_a=m(M),F=a(M,"DIV",{class:!0});var ve=n(F);v(Ge.$$.fragment,ve),ba=m(ve),Y=a(ve,"P",{});var Po=n(Y);Da=i(Po,"The "),bo=a(Po,"A",{href:!0});var Mn=n(bo);va=i(Mn,"DeformableDetrModel"),Mn.forEach(t),ya=i(Po," forward method, overrides the "),Bo=a(Po,"CODE",{});var Sn=n(Bo);wa=i(Sn,"__call__"),Sn.forEach(t),Ta=i(Po," special method."),Po.forEach(t),xa=m(ve),v(he.$$.fragment,ve),$a=m(ve),v(ge.$$.fragment,ve),ve.forEach(t),M.forEach(t),_t=m(o),Z=a(o,"H2",{class:!0});var At=n(Z);ue=a(At,"A",{id:!0,class:!0,href:!0});var Un=n(ue);Xo=a(Un,"SPAN",{});var Wn=n(Xo);v(Je.$$.fragment,Wn),Wn.forEach(t),Un.forEach(t),Pa=m(At),Go=a(At,"SPAN",{});var Hn=n(Go);ja=i(Hn,"DeformableDetrForObjectDetection"),Hn.forEach(t),At.forEach(t),bt=m(o),I=a(o,"DIV",{class:!0});var S=n(I);v(Ye.$$.fragment,S),Ea=m(S),Jo=a(S,"P",{});var Vn=n(Jo);Ia=i(Vn,`Deformable DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Vn.forEach(t),za=m(S),Ze=a(S,"P",{});var Rt=n(Ze);ka=i(Rt,"This model inherits from "),Do=a(Rt,"A",{href:!0});var Bn=n(Do);Ca=i(Bn,"PreTrainedModel"),Bn.forEach(t),Fa=i(Rt,`. 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.)`),Rt.forEach(t),qa=m(S),Ke=a(S,"P",{});var Nt=n(Ke);Oa=i(Nt,"This model is also a PyTorch "),Qe=a(Nt,"A",{href:!0,rel:!0});var Xn=n(Qe);La=i(Xn,"torch.nn.Module"),Xn.forEach(t),Aa=i(Nt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nt.forEach(t),Ra=m(S),q=a(S,"DIV",{class:!0});var ye=n(q);v(eo.$$.fragment,ye),Na=m(ye),K=a(ye,"P",{});var jo=n(K);Ma=i(jo,"The "),vo=a(jo,"A",{href:!0});var Gn=n(vo);Sa=i(Gn,"DeformableDetrForObjectDetection"),Gn.forEach(t),Ua=i(jo," forward method, overrides the "),Yo=a(jo,"CODE",{});var Jn=n(Yo);Wa=i(Jn,"__call__"),Jn.forEach(t),Ha=i(jo," special method."),jo.forEach(t),Va=m(ye),v(_e.$$.fragment,ye),Ba=m(ye),v(be.$$.fragment,ye),ye.forEach(t),S.forEach(t),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(ls)),d(g,"id","deformable-detr"),d(g,"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"),d(g,"href","#deformable-detr"),d(_,"class","relative group"),d(Q,"id","overview"),d(Q,"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"),d(Q,"href","#overview"),d(U,"class","relative group"),d(Te,"href","https://arxiv.org/abs/2010.04159"),d(Te,"rel","nofollow"),d(ao,"href","detr"),d(lo,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrImageProcessor"),d(co,"href","detr"),d($e,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DETR"),d($e,"rel","nofollow"),os(oe.src,Ya="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/deformable_detr_architecture.png")||d(oe,"src",Ya),d(oe,"alt","drawing"),d(oe,"width","600"),d(mo,"href","https://arxiv.org/abs/2010.04159"),d(Pe,"href","https://huggingface.co/nielsr"),d(Pe,"rel","nofollow"),d(je,"href","https://github.com/fundamentalvision/Deformable-DETR"),d(je,"rel","nofollow"),d(re,"id","transformers.DeformableDetrImageProcessor"),d(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(re,"href","#transformers.DeformableDetrImageProcessor"),d(H,"class","relative group"),d(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fo,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),d(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"id","transformers.DeformableDetrImageProcessor"),d(ie,"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"),d(ie,"href","#transformers.DeformableDetrImageProcessor"),d(V,"class","relative group"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(po,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),d(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(me,"id","transformers.DeformableDetrConfig"),d(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(me,"href","#transformers.DeformableDetrConfig"),d(B,"class","relative group"),d(ho,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),d(Ue,"href","https://huggingface.co/SenseTime/deformable-detr"),d(Ue,"rel","nofollow"),d(go,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(uo,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"id","transformers.DeformableDetrModel"),d(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(pe,"href","#transformers.DeformableDetrModel"),d(J,"class","relative group"),d(_o,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),d(Xe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Xe,"rel","nofollow"),d(bo,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrModel"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"id","transformers.DeformableDetrForObjectDetection"),d(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ue,"href","#transformers.DeformableDetrForObjectDetection"),d(Z,"class","relative group"),d(Do,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),d(Qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Qe,"rel","nofollow"),d(vo,"href","/docs/transformers/v4.25.1/en/model_doc/deformable_detr#transformers.DeformableDetrForObjectDetection"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"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,p),h(o,$,f),h(o,_,f),e(_,g),e(g,b),y(l,b,null),e(_,u),e(_,O),e(O,Mt),h(o,et,f),h(o,U,f),e(U,Q),e(Q,Eo),y(we,Eo,null),e(U,St),e(U,Io),e(Io,Ut),h(o,ot,f),h(o,L,f),e(L,Wt),e(L,Te),e(Te,Ht),e(L,Vt),e(L,ao),e(ao,Bt),e(L,Xt),h(o,tt,f),h(o,no,f),e(no,Gt),h(o,rt,f),h(o,so,f),e(so,zo),e(zo,Jt),h(o,at,f),h(o,io,f),e(io,Yt),h(o,nt,f),h(o,ee,f),e(ee,xe),e(xe,Zt),e(xe,lo),e(lo,Kt),e(xe,Qt),e(ee,er),e(ee,W),e(W,or),e(W,co),e(co,tr),e(W,rr),e(W,$e),e($e,ar),e(W,nr),h(o,st,f),h(o,oe,f),h(o,it,f),h(o,te,f),e(te,sr),e(te,mo),e(mo,ir),e(te,dr),h(o,dt,f),h(o,A,f),e(A,lr),e(A,Pe),e(Pe,cr),e(A,mr),e(A,je),e(je,fr),e(A,pr),h(o,lt,f),h(o,H,f),e(H,re),e(re,ko),y(Ee,ko,null),e(H,hr),e(H,Co),e(Co,gr),h(o,ct,f),h(o,P,f),y(Ie,P,null),e(P,ur),e(P,Fo),e(Fo,_r),e(P,br),e(P,ae),y(ze,ae,null),e(ae,Dr),e(ae,qo),e(qo,vr),e(P,yr),e(P,ne),y(ke,ne,null),e(ne,wr),e(ne,Oo),e(Oo,Tr),e(P,xr),e(P,se),y(Ce,se,null),e(se,$r),e(se,Fe),e(Fe,Pr),e(Fe,fo),e(fo,jr),e(Fe,Er),h(o,mt,f),h(o,V,f),e(V,ie),e(ie,Lo),y(qe,Lo,null),e(V,Ir),e(V,Ao),e(Ao,zr),h(o,ft,f),h(o,j,f),y(Oe,j,null),e(j,kr),e(j,Ro),e(Ro,Cr),e(j,Fr),e(j,de),y(Le,de,null),e(de,qr),e(de,No),e(No,Or),e(j,Lr),e(j,le),y(Ae,le,null),e(le,Ar),e(le,Mo),e(Mo,Rr),e(j,Nr),e(j,ce),y(Re,ce,null),e(ce,Mr),e(ce,Ne),e(Ne,Sr),e(Ne,po),e(po,Ur),e(Ne,Wr),h(o,pt,f),h(o,B,f),e(B,me),e(me,So),y(Me,So,null),e(B,Hr),e(B,Uo),e(Uo,Vr),h(o,ht,f),h(o,z,f),y(Se,z,null),e(z,Br),e(z,X),e(X,Xr),e(X,ho),e(ho,Gr),e(X,Jr),e(X,Ue),e(Ue,Yr),e(X,Zr),e(z,Kr),e(z,G),e(G,Qr),e(G,go),e(go,ea),e(G,oa),e(G,uo),e(uo,ta),e(G,ra),e(z,aa),y(fe,z,null),h(o,gt,f),h(o,J,f),e(J,pe),e(pe,Wo),y(We,Wo,null),e(J,na),e(J,Ho),e(Ho,sa),h(o,ut,f),h(o,E,f),y(He,E,null),e(E,ia),e(E,Vo),e(Vo,da),e(E,la),e(E,Ve),e(Ve,ca),e(Ve,_o),e(_o,ma),e(Ve,fa),e(E,pa),e(E,Be),e(Be,ha),e(Be,Xe),e(Xe,ga),e(Be,ua),e(E,_a),e(E,F),y(Ge,F,null),e(F,ba),e(F,Y),e(Y,Da),e(Y,bo),e(bo,va),e(Y,ya),e(Y,Bo),e(Bo,wa),e(Y,Ta),e(F,xa),y(he,F,null),e(F,$a),y(ge,F,null),h(o,_t,f),h(o,Z,f),e(Z,ue),e(ue,Xo),y(Je,Xo,null),e(Z,Pa),e(Z,Go),e(Go,ja),h(o,bt,f),h(o,I,f),y(Ye,I,null),e(I,Ea),e(I,Jo),e(Jo,Ia),e(I,za),e(I,Ze),e(Ze,ka),e(Ze,Do),e(Do,Ca),e(Ze,Fa),e(I,qa),e(I,Ke),e(Ke,Oa),e(Ke,Qe),e(Qe,La),e(Ke,Aa),e(I,Ra),e(I,q),y(eo,q,null),e(q,Na),e(q,K),e(K,Ma),e(K,vo),e(vo,Sa),e(K,Ua),e(K,Yo),e(Yo,Wa),e(K,Ha),e(q,Va),y(_e,q,null),e(q,Ba),y(be,q,null),Dt=!0},p(o,[f]){const oo={};f&2&&(oo.$$scope={dirty:f,ctx:o}),fe.$set(oo);const Zo={};f&2&&(Zo.$$scope={dirty:f,ctx:o}),he.$set(Zo);const Ko={};f&2&&(Ko.$$scope={dirty:f,ctx:o}),ge.$set(Ko);const Qo={};f&2&&(Qo.$$scope={dirty:f,ctx:o}),_e.$set(Qo);const to={};f&2&&(to.$$scope={dirty:f,ctx:o}),be.$set(to)},i(o){Dt||(w(l.$$.fragment,o),w(we.$$.fragment,o),w(Ee.$$.fragment,o),w(Ie.$$.fragment,o),w(ze.$$.fragment,o),w(ke.$$.fragment,o),w(Ce.$$.fragment,o),w(qe.$$.fragment,o),w(Oe.$$.fragment,o),w(Le.$$.fragment,o),w(Ae.$$.fragment,o),w(Re.$$.fragment,o),w(Me.$$.fragment,o),w(Se.$$.fragment,o),w(fe.$$.fragment,o),w(We.$$.fragment,o),w(He.$$.fragment,o),w(Ge.$$.fragment,o),w(he.$$.fragment,o),w(ge.$$.fragment,o),w(Je.$$.fragment,o),w(Ye.$$.fragment,o),w(eo.$$.fragment,o),w(_e.$$.fragment,o),w(be.$$.fragment,o),Dt=!0)},o(o){T(l.$$.fragment,o),T(we.$$.fragment,o),T(Ee.$$.fragment,o),T(Ie.$$.fragment,o),T(ze.$$.fragment,o),T(ke.$$.fragment,o),T(Ce.$$.fragment,o),T(qe.$$.fragment,o),T(Oe.$$.fragment,o),T(Le.$$.fragment,o),T(Ae.$$.fragment,o),T(Re.$$.fragment,o),T(Me.$$.fragment,o),T(Se.$$.fragment,o),T(fe.$$.fragment,o),T(We.$$.fragment,o),T(He.$$.fragment,o),T(Ge.$$.fragment,o),T(he.$$.fragment,o),T(ge.$$.fragment,o),T(Je.$$.fragment,o),T(Ye.$$.fragment,o),T(eo.$$.fragment,o),T(_e.$$.fragment,o),T(be.$$.fragment,o),Dt=!1},d(o){t(p),o&&t($),o&&t(_),x(l),o&&t(et),o&&t(U),x(we),o&&t(ot),o&&t(L),o&&t(tt),o&&t(no),o&&t(rt),o&&t(so),o&&t(at),o&&t(io),o&&t(nt),o&&t(ee),o&&t(st),o&&t(oe),o&&t(it),o&&t(te),o&&t(dt),o&&t(A),o&&t(lt),o&&t(H),x(Ee),o&&t(ct),o&&t(P),x(Ie),x(ze),x(ke),x(Ce),o&&t(mt),o&&t(V),x(qe),o&&t(ft),o&&t(j),x(Oe),x(Le),x(Ae),x(Re),o&&t(pt),o&&t(B),x(Me),o&&t(ht),o&&t(z),x(Se),x(fe),o&&t(gt),o&&t(J),x(We),o&&t(ut),o&&t(E),x(He),x(Ge),x(he),x(ge),o&&t(_t),o&&t(Z),x(Je),o&&t(bt),o&&t(I),x(Ye),x(eo),x(_e),x(be)}}}const ls={local:"deformable-detr",sections:[{local:"overview",title:"Overview"},{local:"transformers.DeformableDetrImageProcessor",title:"DeformableDetrImageProcessor"},{local:"transformers.DeformableDetrImageProcessor",title:"DeformableDetrFeatureExtractor"},{local:"transformers.DeformableDetrConfig",title:"DeformableDetrConfig"},{local:"transformers.DeformableDetrModel",title:"DeformableDetrModel"},{local:"transformers.DeformableDetrForObjectDetection",title:"DeformableDetrForObjectDetection"}],title:"Deformable DETR"};function cs(C){return ts(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _s extends Zn{constructor(p){super();Kn(this,p,cs,ds,Qn,{})}}export{_s as default,ls as metadata};
