Buckets:
| import{s as Cn,f as xn,o as Dn,n as Ve}from"../chunks/scheduler.25b97de1.js";import{S as Mn,i as jn,g as d,s as o,r as h,A as $n,h as l,f as s,c as n,j as x,u as g,x as y,k as v,y as t,a as c,v as f,d as u,t as _,w as b}from"../chunks/index.d9030fc9.js";import{T as Bo}from"../chunks/Tip.baa67368.js";import{D as M}from"../chunks/Docstring.ffac8efa.js";import{C as At}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Xt}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as P,E as kn}from"../chunks/EditOnGithub.91d95064.js";function zn(k){let r,T="Examples:",m,p,w;return p=new At({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENvbmRpdGlvbmFsRGV0ckNvbmZpZyUyQyUyMENvbmRpdGlvbmFsRGV0ck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENvbmRpdGlvbmFsJTIwREVUUiUyMG1pY3Jvc29mdCUyRmNvbmRpdGlvbmFsLWRldHItcmVzbmV0LTUwJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMENvbmRpdGlvbmFsRGV0ckNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZjb25kaXRpb25hbC1kZXRyLXJlc25ldC01MCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ29uZGl0aW9uYWxEZXRyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ConditionalDetrConfig, ConditionalDetrModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a Conditional DETR microsoft/conditional-detr-resnet-50 style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = ConditionalDetrConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/conditional-detr-resnet-50 style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = ConditionalDetrModel(configuration) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Accessing the model configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = model.config`,wrap:!1}}),{c(){r=d("p"),r.textContent=T,m=o(),h(p.$$.fragment)},l(i){r=l(i,"P",{"data-svelte-h":!0}),y(r)!=="svelte-kvfsh7"&&(r.textContent=T),m=n(i),g(p.$$.fragment,i)},m(i,C){c(i,r,C),c(i,m,C),f(p,i,C),w=!0},p:Ve,i(i){w||(u(p.$$.fragment,i),w=!0)},o(i){_(p.$$.fragment,i),w=!1},d(i){i&&(s(r),s(m)),b(p,i)}}}function In(k){let r,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){r=d("p"),r.innerHTML=T},l(m){r=l(m,"P",{"data-svelte-h":!0}),y(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(m,p){c(m,r,p)},p:Ve,d(m){m&&s(r)}}}function Fn(k){let r,T="Examples:",m,p,w;return p=new At({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGY29uZGl0aW9uYWwtZGV0ci1yZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmNvbmRpdGlvbmFsLWRldHItcmVzbmV0LTUwJTIyKSUwQSUwQSUyMyUyMHByZXBhcmUlMjBpbWFnZSUyMGZvciUyMHRoZSUyMG1vZGVsJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBmb3J3YXJkJTIwcGFzcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEElMjMlMjB0aGUlMjBsYXN0JTIwaGlkZGVuJTIwc3RhdGVzJTIwYXJlJTIwdGhlJTIwZmluYWwlMjBxdWVyeSUyMGVtYmVkZGluZ3MlMjBvZiUyMHRoZSUyMFRyYW5zZm9ybWVyJTIwZGVjb2RlciUwQSUyMyUyMHRoZXNlJTIwYXJlJTIwb2YlMjBzaGFwZSUyMChiYXRjaF9zaXplJTJDJTIwbnVtX3F1ZXJpZXMlMkMlMjBoaWRkZW5fc2l6ZSklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, AutoModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"http://images.cocodataset.org/val2017/000000039769.jpg"</span> | |
| <span class="hljs-meta">>>> </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">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"microsoft/conditional-detr-resnet-50"</span>) | |
| <span class="hljs-meta">>>> </span>model = AutoModel.from_pretrained(<span class="hljs-string">"microsoft/conditional-detr-resnet-50"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># prepare image for the model</span> | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># forward pass</span> | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># the last hidden states are the final query embeddings of the Transformer decoder</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># these are of shape (batch_size, num_queries, hidden_size)</span> | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state | |
| <span class="hljs-meta">>>> </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>]`,wrap:!1}}),{c(){r=d("p"),r.textContent=T,m=o(),h(p.$$.fragment)},l(i){r=l(i,"P",{"data-svelte-h":!0}),y(r)!=="svelte-kvfsh7"&&(r.textContent=T),m=n(i),g(p.$$.fragment,i)},m(i,C){c(i,r,C),c(i,m,C),f(p,i,C),w=!0},p:Ve,i(i){w||(u(p.$$.fragment,i),w=!0)},o(i){_(p.$$.fragment,i),w=!1},d(i){i&&(s(r),s(m)),b(p,i)}}}function Jn(k){let r,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){r=d("p"),r.innerHTML=T},l(m){r=l(m,"P",{"data-svelte-h":!0}),y(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(m,p){c(m,r,p)},p:Ve,d(m){m&&s(r)}}}function Un(k){let r,T="Examples:",m,p,w;return p=new At({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbEZvck9iamVjdERldGVjdGlvbiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGY29uZGl0aW9uYWwtZGV0ci1yZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JPYmplY3REZXRlY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmNvbmRpdGlvbmFsLWRldHItcmVzbmV0LTUwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMGNvbnZlcnQlMjBvdXRwdXRzJTIwKGJvdW5kaW5nJTIwYm94ZXMlMjBhbmQlMjBjbGFzcyUyMGxvZ2l0cyklMjB0byUyMFBhc2NhbCUyMFZPQyUyMGZvcm1hdCUyMCh4bWluJTJDJTIweW1pbiUyQyUyMHhtYXglMkMlMjB5bWF4KSUwQXRhcmdldF9zaXplcyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUJpbWFnZS5zaXplJTVCJTNBJTNBLTElNUQlNUQpJTBBcmVzdWx0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3Nvci5wb3N0X3Byb2Nlc3Nfb2JqZWN0X2RldGVjdGlvbihvdXRwdXRzJTJDJTIwdGhyZXNob2xkJTNEMC41JTJDJTIwdGFyZ2V0X3NpemVzJTNEdGFyZ2V0X3NpemVzKSU1QiUwQSUyMCUyMCUyMCUyMDAlMEElNUQlMEFmb3IlMjBzY29yZSUyQyUyMGxhYmVsJTJDJTIwYm94JTIwaW4lMjB6aXAocmVzdWx0cyU1QiUyMnNjb3JlcyUyMiU1RCUyQyUyMHJlc3VsdHMlNUIlMjJsYWJlbHMlMjIlNUQlMkMlMjByZXN1bHRzJTVCJTIyYm94ZXMlMjIlNUQpJTNBJTBBJTIwJTIwJTIwJTIwYm94JTIwJTNEJTIwJTVCcm91bmQoaSUyQyUyMDIpJTIwZm9yJTIwaSUyMGluJTIwYm94LnRvbGlzdCgpJTVEJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkRldGVjdGVkJTIwJTdCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCbGFiZWwuaXRlbSgpJTVEJTdEJTIwd2l0aCUyMGNvbmZpZGVuY2UlMjAlMjIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmJTIyJTdCcm91bmQoc2NvcmUuaXRlbSgpJTJDJTIwMyklN0QlMjBhdCUyMGxvY2F0aW9uJTIwJTdCYm94JTdEJTIyJTBBJTIwJTIwJTIwJTIwKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, AutoModelForObjectDetection | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"http://images.cocodataset.org/val2017/000000039769.jpg"</span> | |
| <span class="hljs-meta">>>> </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">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"microsoft/conditional-detr-resnet-50"</span>) | |
| <span class="hljs-meta">>>> </span>model = AutoModelForObjectDetection.from_pretrained(<span class="hljs-string">"microsoft/conditional-detr-resnet-50"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># convert outputs (bounding boxes and class logits) to Pascal VOC format (xmin, ymin, xmax, ymax)</span> | |
| <span class="hljs-meta">>>> </span>target_sizes = torch.tensor([image.size[::-<span class="hljs-number">1</span>]]) | |
| <span class="hljs-meta">>>> </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">>>> </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">"scores"</span>], results[<span class="hljs-string">"labels"</span>], results[<span class="hljs-string">"boxes"</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"Detected <span class="hljs-subst">{model.config.id2label[label.item()]}</span> with confidence "</span> | |
| <span class="hljs-meta">... </span> <span class="hljs-string">f"<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>"</span> | |
| <span class="hljs-meta">... </span> ) | |
| Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.833</span> at location [<span class="hljs-number">38.31</span>, <span class="hljs-number">72.1</span>, <span class="hljs-number">177.63</span>, <span class="hljs-number">118.45</span>] | |
| Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.831</span> at location [<span class="hljs-number">9.2</span>, <span class="hljs-number">51.38</span>, <span class="hljs-number">321.13</span>, <span class="hljs-number">469.0</span>] | |
| Detected cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.804</span> at location [<span class="hljs-number">340.3</span>, <span class="hljs-number">16.85</span>, <span class="hljs-number">642.93</span>, <span class="hljs-number">370.95</span>] | |
| Detected remote <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.683</span> at location [<span class="hljs-number">334.48</span>, <span class="hljs-number">73.49</span>, <span class="hljs-number">366.37</span>, <span class="hljs-number">190.01</span>] | |
| Detected couch <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.535</span> at location [<span class="hljs-number">0.52</span>, <span class="hljs-number">1.19</span>, <span class="hljs-number">640.35</span>, <span class="hljs-number">475.1</span>]`,wrap:!1}}),{c(){r=d("p"),r.textContent=T,m=o(),h(p.$$.fragment)},l(i){r=l(i,"P",{"data-svelte-h":!0}),y(r)!=="svelte-kvfsh7"&&(r.textContent=T),m=n(i),g(p.$$.fragment,i)},m(i,C){c(i,r,C),c(i,m,C),f(p,i,C),w=!0},p:Ve,i(i){w||(u(p.$$.fragment,i),w=!0)},o(i){_(p.$$.fragment,i),w=!1},d(i){i&&(s(r),s(m)),b(p,i)}}}function Nn(k){let r,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){r=d("p"),r.innerHTML=T},l(m){r=l(m,"P",{"data-svelte-h":!0}),y(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(m,p){c(m,r,p)},p:Ve,d(m){m&&s(r)}}}function qn(k){let r,T="Examples:",m,p,w;return p=new At({props:{code:"aW1wb3J0JTIwaW8lMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUwQSUyMCUyMCUyMCUyMENvbmRpdGlvbmFsRGV0ckNvbmZpZyUyQyUwQSUyMCUyMCUyMCUyMENvbmRpdGlvbmFsRGV0ckZvclNlZ21lbnRhdGlvbiUyQyUwQSklMEFmcm9tJTIwdHJhbnNmb3JtZXJzLmltYWdlX3RyYW5zZm9ybXMlMjBpbXBvcnQlMjByZ2JfdG9faWQlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjb25kaXRpb25hbC1kZXRyLXJlc25ldC01MCUyMiklMEElMEElMjMlMjByYW5kb21seSUyMGluaXRpYWxpemUlMjBhbGwlMjB3ZWlnaHRzJTIwb2YlMjB0aGUlMjBtb2RlbCUwQWNvbmZpZyUyMCUzRCUyMENvbmRpdGlvbmFsRGV0ckNvbmZpZygpJTBBbW9kZWwlMjAlM0QlMjBDb25kaXRpb25hbERldHJGb3JTZWdtZW50YXRpb24oY29uZmlnKSUwQSUwQSUyMyUyMHByZXBhcmUlMjBpbWFnZSUyMGZvciUyMHRoZSUyMG1vZGVsJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBmb3J3YXJkJTIwcGFzcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEElMjMlMjBVc2UlMjB0aGUlMjAlNjBwb3N0X3Byb2Nlc3NfcGFub3B0aWNfc2VnbWVudGF0aW9uJTYwJTIwbWV0aG9kJTIwb2YlMjB0aGUlMjAlNjBpbWFnZV9wcm9jZXNzb3IlNjAlMjB0byUyMHJldHJpZXZlJTIwcG9zdC1wcm9jZXNzZWQlMjBwYW5vcHRpYyUyMHNlZ21lbnRhdGlvbiUyMG1hcHMlMEElMjMlMjBTZWdtZW50YXRpb24lMjByZXN1bHRzJTIwYXJlJTIwcmV0dXJuZWQlMjBhcyUyMGElMjBsaXN0JTIwb2YlMjBkaWN0aW9uYXJpZXMlMEFyZXN1bHQlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IucG9zdF9wcm9jZXNzX3Bhbm9wdGljX3NlZ21lbnRhdGlvbihvdXRwdXRzJTJDJTIwdGFyZ2V0X3NpemVzJTNEJTVCKDMwMCUyQyUyMDUwMCklNUQpJTBBJTIzJTIwQSUyMHRlbnNvciUyMG9mJTIwc2hhcGUlMjAoaGVpZ2h0JTJDJTIwd2lkdGgpJTIwd2hlcmUlMjBlYWNoJTIwdmFsdWUlMjBkZW5vdGVzJTIwYSUyMHNlZ21lbnQlMjBpZCUyQyUyMGZpbGxlZCUyMHdpdGglMjAtMSUyMGlmJTIwbm8lMjBzZWdtZW50JTIwaXMlMjBmb3VuZCUwQXBhbm9wdGljX3NlZyUyMCUzRCUyMHJlc3VsdCU1QjAlNUQlNUIlMjJzZWdtZW50YXRpb24lMjIlNUQlMEElMjMlMjBHZXQlMjBwcmVkaWN0aW9uJTIwc2NvcmUlMjBhbmQlMjBzZWdtZW50X2lkJTIwdG8lMjBjbGFzc19pZCUyMG1hcHBpbmclMjBvZiUyMGVhY2glMjBzZWdtZW50JTBBcGFub3B0aWNfc2VnbWVudHNfaW5mbyUyMCUzRCUyMHJlc3VsdCU1QjAlNUQlNUIlMjJzZWdtZW50c19pbmZvJTIyJTVE",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> io | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> numpy | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ( | |
| <span class="hljs-meta">... </span> AutoImageProcessor, | |
| <span class="hljs-meta">... </span> ConditionalDetrConfig, | |
| <span class="hljs-meta">... </span> ConditionalDetrForSegmentation, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers.image_transforms <span class="hljs-keyword">import</span> rgb_to_id | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"http://images.cocodataset.org/val2017/000000039769.jpg"</span> | |
| <span class="hljs-meta">>>> </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">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"microsoft/conditional-detr-resnet-50"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># randomly initialize all weights of the model</span> | |
| <span class="hljs-meta">>>> </span>config = ConditionalDetrConfig() | |
| <span class="hljs-meta">>>> </span>model = ConditionalDetrForSegmentation(config) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># prepare image for the model</span> | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># forward pass</span> | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Use the \`post_process_panoptic_segmentation\` method of the \`image_processor\` to retrieve post-processed panoptic segmentation maps</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Segmentation results are returned as a list of dictionaries</span> | |
| <span class="hljs-meta">>>> </span>result = image_processor.post_process_panoptic_segmentation(outputs, target_sizes=[(<span class="hljs-number">300</span>, <span class="hljs-number">500</span>)]) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># A tensor of shape (height, width) where each value denotes a segment id, filled with -1 if no segment is found</span> | |
| <span class="hljs-meta">>>> </span>panoptic_seg = result[<span class="hljs-number">0</span>][<span class="hljs-string">"segmentation"</span>] | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Get prediction score and segment_id to class_id mapping of each segment</span> | |
| <span class="hljs-meta">>>> </span>panoptic_segments_info = result[<span class="hljs-number">0</span>][<span class="hljs-string">"segments_info"</span>]`,wrap:!1}}),{c(){r=d("p"),r.textContent=T,m=o(),h(p.$$.fragment)},l(i){r=l(i,"P",{"data-svelte-h":!0}),y(r)!=="svelte-kvfsh7"&&(r.textContent=T),m=n(i),g(p.$$.fragment,i)},m(i,C){c(i,r,C),c(i,m,C),f(p,i,C),w=!0},p:Ve,i(i){w||(u(p.$$.fragment,i),w=!0)},o(i){_(p.$$.fragment,i),w=!1},d(i){i&&(s(r),s(m)),b(p,i)}}}function Zn(k){let r,T,m,p,w,i,C,Tt,ce,So='The Conditional DETR model was proposed in <a href="https://arxiv.org/abs/2108.06152" rel="nofollow">Conditional DETR for Fast Training Convergence</a> by Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, Jingdong Wang. Conditional DETR presents a conditional cross-attention mechanism for fast DETR training. Conditional DETR converges 6.7× to 10× faster than DETR.',vt,me,Go="The abstract from the paper is the following:",Ct,pe,Oo='<em>The recently-developed DETR approach applies the transformer encoder and decoder architecture to object detection and achieves promising performance. In this paper, we handle the critical issue, slow training convergence, and present a conditional cross-attention mechanism for fast DETR training. Our approach is motivated by that the cross-attention in DETR relies highly on the content embeddings for localizing the four extremities and predicting the box, which increases the need for high-quality content embeddings and thus the training difficulty. Our approach, named conditional DETR, learns a conditional spatial query from the decoder embedding for decoder multi-head cross-attention. The benefit is that through the conditional spatial query, each cross-attention head is able to attend to a band containing a distinct region, e.g., one object extremity or a region inside the object box. This narrows down the spatial range for localizing the distinct regions for object classification and box regression, thus relaxing the dependence on the content embeddings and easing the training. Empirical results show that conditional DETR converges 6.7× faster for the backbones R50 and R101 and 10× faster for stronger backbones DC5-R50 and DC5-R101. Code is available at <a href="https://github.com/Atten4Vis/ConditionalDETR" rel="nofollow">https://github.com/Atten4Vis/ConditionalDETR</a>.</em>',xt,B,Ho,Dt,he,Vo='Conditional DETR shows much faster convergence compared to the original DETR. Taken from the <a href="https://arxiv.org/abs/2108.06152">original paper</a>.',Mt,ge,Xo='This model was contributed by <a href="https://huggingface.co/DepuMeng" rel="nofollow">DepuMeng</a>. The original code can be found <a href="https://github.com/Atten4Vis/ConditionalDETR" rel="nofollow">here</a>.',jt,fe,$t,ue,Ao='<li>Scripts for finetuning <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForObjectDetection">ConditionalDetrForObjectDetection</a> with <a href="/docs/transformers/pr_35161/en/main_classes/trainer#transformers.Trainer">Trainer</a> or <a href="https://huggingface.co/docs/accelerate/index" rel="nofollow">Accelerate</a> can be found <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/object-detection" rel="nofollow">here</a>.</li> <li>See also: <a href="../tasks/object_detection">Object detection task guide</a>.</li>',kt,_e,zt,J,be,Qt,Xe,Qo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrModel">ConditionalDetrModel</a>. It is used to instantiate | |
| a Conditional 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 Conditional DETR | |
| <a href="https://huggingface.co/microsoft/conditional-detr-resnet-50" rel="nofollow">microsoft/conditional-detr-resnet-50</a> architecture.`,Yt,Ae,Yo=`Configuration objects inherit from <a href="/docs/transformers/pr_35161/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the | |
| documentation from <a href="/docs/transformers/pr_35161/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Kt,S,It,ye,Ft,D,we,eo,Qe,Ko="Constructs a Conditional Detr image processor.",to,G,Te,oo,Ye,en="Preprocess an image or a batch of images so that it can be used by the model.",no,O,ve,so,Ke,tn=`Converts the raw output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForObjectDetection">ConditionalDetrForObjectDetection</a> into final bounding boxes in (top_left_x, | |
| top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`,ao,H,Ce,ro,et,on='Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into instance segmentation predictions. Only supports PyTorch.',io,V,xe,lo,tt,nn='Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',co,X,De,mo,ot,sn=`Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into image panoptic segmentation predictions. Only supports | |
| PyTorch.`,Jt,Me,Ut,j,je,po,A,$e,ho,nt,an="Preprocess an image or a batch of images.",go,Q,ke,fo,st,rn=`Converts the raw output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForObjectDetection">ConditionalDetrForObjectDetection</a> into final bounding boxes in (top_left_x, | |
| top_left_y, bottom_right_x, bottom_right_y) format. Only supports PyTorch.`,uo,Y,ze,_o,at,dn='Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into instance segmentation predictions. Only supports PyTorch.',bo,K,Ie,yo,rt,ln='Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',wo,ee,Fe,To,it,cn=`Converts the output of <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> into image panoptic segmentation predictions. Only supports | |
| PyTorch.`,Nt,Je,qt,z,Ue,vo,dt,mn=`The bare Conditional DETR Model (consisting of a backbone and encoder-decoder Transformer) outputting raw | |
| hidden-states without any specific head on top.`,Co,lt,pn=`This model inherits from <a href="/docs/transformers/pr_35161/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the | |
| library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads | |
| etc.)`,xo,ct,hn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. | |
| Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage | |
| and behavior.`,Do,U,Ne,Mo,mt,gn='The <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrModel">ConditionalDetrModel</a> forward method, overrides the <code>__call__</code> special method.',jo,te,$o,oe,Zt,qe,Et,I,Ze,ko,pt,fn=`CONDITIONAL_DETR Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on | |
| top, for tasks such as COCO detection.`,zo,ht,un=`This model inherits from <a href="/docs/transformers/pr_35161/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Io,gt,_n=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. | |
| Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage | |
| and behavior.`,Fo,N,Ee,Jo,ft,bn='The <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForObjectDetection">ConditionalDetrForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',Uo,ne,No,se,Lt,Le,Rt,F,Re,qo,ut,yn=`CONDITIONAL_DETR Model (consisting of a backbone and encoder-decoder Transformer) with a segmentation head on top, | |
| for tasks such as COCO panoptic.`,Zo,_t,wn=`This model inherits from <a href="/docs/transformers/pr_35161/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Eo,bt,Tn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. | |
| Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage | |
| and behavior.`,Lo,q,We,Ro,yt,vn='The <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a> forward method, overrides the <code>__call__</code> special method.',Wo,ae,Po,re,Wt,Pe,Pt,wt,Bt;return w=new P({props:{title:"Conditional DETR",local:"conditional-detr",headingTag:"h1"}}),C=new P({props:{title:"Overview",local:"overview",headingTag:"h2"}}),fe=new P({props:{title:"Resources",local:"resources",headingTag:"h2"}}),_e=new P({props:{title:"ConditionalDetrConfig",local:"transformers.ConditionalDetrConfig",headingTag:"h2"}}),be=new M({props:{name:"class transformers.ConditionalDetrConfig",anchor:"transformers.ConditionalDetrConfig",parameters:[{name:"use_timm_backbone",val:" = True"},{name:"backbone_config",val:" = None"},{name:"num_channels",val:" = 3"},{name:"num_queries",val:" = 300"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 2048"},{name:"encoder_attention_heads",val:" = 8"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 2048"},{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:"auxiliary_loss",val:" = False"},{name:"position_embedding_type",val:" = 'sine'"},{name:"backbone",val:" = 'resnet50'"},{name:"use_pretrained_backbone",val:" = True"},{name:"backbone_kwargs",val:" = None"},{name:"dilation",val:" = False"},{name:"class_cost",val:" = 2"},{name:"bbox_cost",val:" = 5"},{name:"giou_cost",val:" = 2"},{name:"mask_loss_coefficient",val:" = 1"},{name:"dice_loss_coefficient",val:" = 1"},{name:"cls_loss_coefficient",val:" = 2"},{name:"bbox_loss_coefficient",val:" = 5"},{name:"giou_loss_coefficient",val:" = 2"},{name:"focal_alpha",val:" = 0.25"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConditionalDetrConfig.use_timm_backbone",description:`<strong>use_timm_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to use the <code>timm</code> library for the backbone. If set to <code>False</code>, will use the <a href="/docs/transformers/pr_35161/en/main_classes/backbones#transformers.AutoBackbone">AutoBackbone</a> | |
| API.`,name:"use_timm_backbone"},{anchor:"transformers.ConditionalDetrConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>) — | |
| The configuration of the backbone model. Only used in case <code>use_timm_backbone</code> is set to <code>False</code> in which | |
| case it will default to <code>ResNetConfig()</code>.`,name:"backbone_config"},{anchor:"transformers.ConditionalDetrConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| The number of input channels.`,name:"num_channels"},{anchor:"transformers.ConditionalDetrConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 100) — | |
| Number of object queries, i.e. detection slots. This is the maximal number of objects | |
| <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrModel">ConditionalDetrModel</a> can detect in a single image. For COCO, we recommend 100 queries.`,name:"num_queries"},{anchor:"transformers.ConditionalDetrConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 256) — | |
| Dimension of the layers.`,name:"d_model"},{anchor:"transformers.ConditionalDetrConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) — | |
| Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.ConditionalDetrConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) — | |
| Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.ConditionalDetrConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) — | |
| Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.ConditionalDetrConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) — | |
| Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.ConditionalDetrConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) — | |
| Dimension of the “intermediate” (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.ConditionalDetrConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) — | |
| Dimension of the “intermediate” (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.ConditionalDetrConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>"relu"</code>) — | |
| The non-linear activation function (function or string) in the encoder and pooler. If string, <code>"gelu"</code>, | |
| <code>"relu"</code>, <code>"silu"</code> and <code>"gelu_new"</code> are supported.`,name:"activation_function"},{anchor:"transformers.ConditionalDetrConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.ConditionalDetrConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.ConditionalDetrConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.ConditionalDetrConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) — | |
| The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.ConditionalDetrConfig.init_xavier_std",description:`<strong>init_xavier_std</strong> (<code>float</code>, <em>optional</em>, defaults to 1) — | |
| The scaling factor used for the Xavier initialization gain in the HM Attention map module.`,name:"init_xavier_std"},{anchor:"transformers.ConditionalDetrConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>) | |
| for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.ConditionalDetrConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<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:"decoder_layerdrop"},{anchor:"transformers.ConditionalDetrConfig.auxiliary_loss",description:`<strong>auxiliary_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether auxiliary decoding losses (loss at each decoder layer) are to be used.`,name:"auxiliary_loss"},{anchor:"transformers.ConditionalDetrConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"sine"</code>) — | |
| Type of position embeddings to be used on top of the image features. One of <code>"sine"</code> or <code>"learned"</code>.`,name:"position_embedding_type"},{anchor:"transformers.ConditionalDetrConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"resnet50"</code>) — | |
| Name of backbone to use when <code>backbone_config</code> is <code>None</code>. If <code>use_pretrained_backbone</code> is <code>True</code>, this | |
| will load the corresponding pretrained weights from the timm or transformers library. If <code>use_pretrained_backbone</code> | |
| is <code>False</code>, this loads the backbone’s config and uses that to initialize the backbone with random weights.`,name:"backbone"},{anchor:"transformers.ConditionalDetrConfig.use_pretrained_backbone",description:`<strong>use_pretrained_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use pretrained weights for the backbone.`,name:"use_pretrained_backbone"},{anchor:"transformers.ConditionalDetrConfig.backbone_kwargs",description:`<strong>backbone_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| Keyword arguments to be passed to AutoBackbone when loading from a checkpoint | |
| e.g. <code>{'out_indices': (0, 1, 2, 3)}</code>. Cannot be specified if <code>backbone_config</code> is set.`,name:"backbone_kwargs"},{anchor:"transformers.ConditionalDetrConfig.dilation",description:`<strong>dilation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to replace stride with dilation in the last convolutional block (DC5). Only supported when | |
| <code>use_timm_backbone</code> = <code>True</code>.`,name:"dilation"},{anchor:"transformers.ConditionalDetrConfig.class_cost",description:`<strong>class_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 1) — | |
| Relative weight of the classification error in the Hungarian matching cost.`,name:"class_cost"},{anchor:"transformers.ConditionalDetrConfig.bbox_cost",description:`<strong>bbox_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 5) — | |
| Relative weight of the L1 error of the bounding box coordinates in the Hungarian matching cost.`,name:"bbox_cost"},{anchor:"transformers.ConditionalDetrConfig.giou_cost",description:`<strong>giou_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 2) — | |
| Relative weight of the generalized IoU loss of the bounding box in the Hungarian matching cost.`,name:"giou_cost"},{anchor:"transformers.ConditionalDetrConfig.mask_loss_coefficient",description:`<strong>mask_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) — | |
| Relative weight of the Focal loss in the panoptic segmentation loss.`,name:"mask_loss_coefficient"},{anchor:"transformers.ConditionalDetrConfig.dice_loss_coefficient",description:`<strong>dice_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) — | |
| Relative weight of the DICE/F-1 loss in the panoptic segmentation loss.`,name:"dice_loss_coefficient"},{anchor:"transformers.ConditionalDetrConfig.bbox_loss_coefficient",description:`<strong>bbox_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 5) — | |
| Relative weight of the L1 bounding box loss in the object detection loss.`,name:"bbox_loss_coefficient"},{anchor:"transformers.ConditionalDetrConfig.giou_loss_coefficient",description:`<strong>giou_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 2) — | |
| Relative weight of the generalized IoU loss in the object detection loss.`,name:"giou_loss_coefficient"},{anchor:"transformers.ConditionalDetrConfig.eos_coefficient",description:`<strong>eos_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| Relative classification weight of the ‘no-object’ class in the object detection loss.`,name:"eos_coefficient"},{anchor:"transformers.ConditionalDetrConfig.focal_alpha",description:`<strong>focal_alpha</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) — | |
| Alpha parameter in the focal loss.`,name:"focal_alpha"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/configuration_conditional_detr.py#L32"}}),S=new Xt({props:{anchor:"transformers.ConditionalDetrConfig.example",$$slots:{default:[zn]},$$scope:{ctx:k}}}),ye=new P({props:{title:"ConditionalDetrImageProcessor",local:"transformers.ConditionalDetrImageProcessor",headingTag:"h2"}}),we=new M({props:{name:"class transformers.ConditionalDetrImageProcessor",anchor:"transformers.ConditionalDetrImageProcessor",parameters:[{name:"format",val:": typing.Union[str, transformers.image_utils.AnnotationFormat] = <AnnotationFormat.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_convert_annotations",val:": typing.Optional[bool] = None"},{name:"do_pad",val:": bool = True"},{name:"pad_size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.format",description:`<strong>format</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"coco_detection"</code>) — | |
| Data format of the annotations. One of “coco_detection” or “coco_panoptic”.`,name:"format"},{anchor:"transformers.ConditionalDetrImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Controls whether to resize the image’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.ConditionalDetrImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{"shortest_edge" -- 800, "longest_edge": 1333}</code>): | |
| Size of the image’s <code>(height, width)</code> dimensions after resizing. Can be overridden by the <code>size</code> parameter | |
| in the <code>preprocess</code> method. Available options are:<ul> | |
| <li><code>{"height": int, "width": int}</code>: The image will be resized to the exact size <code>(height, width)</code>. | |
| Do NOT keep the aspect ratio.</li> | |
| <li><code>{"shortest_edge": int, "longest_edge": int}</code>: The image will be resized to a maximum size respecting | |
| the aspect ratio and keeping the shortest edge less or equal to <code>shortest_edge</code> and the longest edge | |
| less or equal to <code>longest_edge</code>.</li> | |
| <li><code>{"max_height": int, "max_width": int}</code>: The image will be resized to the maximum size respecting the | |
| aspect ratio and keeping the height less or equal to <code>max_height</code> and the width less or equal to | |
| <code>max_width</code>.</li> | |
| </ul>`,name:"size"},{anchor:"transformers.ConditionalDetrImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) — | |
| Resampling filter to use if resizing the image.`,name:"resample"},{anchor:"transformers.ConditionalDetrImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| 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.ConditionalDetrImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) — | |
| Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the | |
| <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ConditionalDetrImageProcessor.do_normalize",description:`<strong>do_normalize</strong> — | |
| Controls whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the | |
| <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.ConditionalDetrImageProcessor.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>) — | |
| 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.ConditionalDetrImageProcessor.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>) — | |
| 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.ConditionalDetrImageProcessor.do_convert_annotations",description:`<strong>do_convert_annotations</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Controls whether to convert the annotations to the format expected by the DETR model. Converts the | |
| bounding boxes to the format <code>(center_x, center_y, width, height)</code> and in the range <code>[0, 1]</code>. | |
| Can be overridden by the <code>do_convert_annotations</code> parameter in the <code>preprocess</code> method.`,name:"do_convert_annotations"},{anchor:"transformers.ConditionalDetrImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Controls whether to pad the image. Can be overridden by the <code>do_pad</code> parameter in the <code>preprocess</code> | |
| method. If <code>True</code>, padding will be applied to the bottom and right of the image with zeros. | |
| If <code>pad_size</code> is provided, the image will be padded to the specified dimensions. | |
| Otherwise, the image will be padded to the maximum height and width of the batch.`,name:"do_pad"},{anchor:"transformers.ConditionalDetrImageProcessor.pad_size",description:`<strong>pad_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>) — | |
| The size <code>{"height": int, "width" int}</code> to pad the images to. Must be larger than any image size | |
| provided for preprocessing. If <code>pad_size</code> is not provided, images will be padded to the largest | |
| height and width in the batch.`,name:"pad_size"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L804"}}),Te=new M({props:{name:"preprocess",anchor:"transformers.ConditionalDetrImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"annotations",val:": typing.Union[typing.Dict[str, typing.Union[int, str, typing.List[typing.Dict]]], typing.List[typing.Dict[str, typing.Union[int, str, typing.List[typing.Dict]]]], NoneType] = None"},{name:"return_segmentation_masks",val:": bool = None"},{name:"masks_path",val:": typing.Union[str, pathlib.Path, NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = 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:"do_convert_annotations",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.image_utils.AnnotationFormat, 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:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"pad_size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) — | |
| Image or batch of images to preprocess. Expects a single or batch of images with pixel values ranging | |
| from 0 to 255. If passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.annotations",description:`<strong>annotations</strong> (<code>AnnotationType</code> or <code>List[AnnotationType]</code>, <em>optional</em>) — | |
| List of annotations associated with the image or batch of images. If annotation is for object | |
| detection, the annotations should be a dictionary with the following keys:<ul> | |
| <li>“image_id” (<code>int</code>): The image id.</li> | |
| <li>“annotations” (<code>List[Dict]</code>): List of annotations for an image. Each annotation should be a | |
| dictionary. An image can have no annotations, in which case the list should be empty. | |
| If annotation is for segmentation, the annotations should be a dictionary with the following keys:</li> | |
| <li>“image_id” (<code>int</code>): The image id.</li> | |
| <li>“segments_info” (<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>“file_name” (<code>str</code>): The file name of the image.</li> | |
| </ul>`,name:"annotations"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.return_segmentation_masks",description:`<strong>return_segmentation_masks</strong> (<code>bool</code>, <em>optional</em>, defaults to self.return_segmentation_masks) — | |
| Whether to return segmentation masks.`,name:"return_segmentation_masks"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.masks_path",description:`<strong>masks_path</strong> (<code>str</code> or <code>pathlib.Path</code>, <em>optional</em>) — | |
| Path to the directory containing the segmentation masks.`,name:"masks_path"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_resize) — | |
| Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to self.size) — | |
| Size of the image’s <code>(height, width)</code> dimensions after resizing. Available options are:<ul> | |
| <li><code>{"height": int, "width": int}</code>: The image will be resized to the exact size <code>(height, width)</code>. | |
| Do NOT keep the aspect ratio.</li> | |
| <li><code>{"shortest_edge": int, "longest_edge": int}</code>: The image will be resized to a maximum size respecting | |
| the aspect ratio and keeping the shortest edge less or equal to <code>shortest_edge</code> and the longest edge | |
| less or equal to <code>longest_edge</code>.</li> | |
| <li><code>{"max_height": int, "max_width": int}</code>: The image will be resized to the maximum size respecting the | |
| aspect ratio and keeping the height less or equal to <code>max_height</code> and the width less or equal to | |
| <code>max_width</code>.</li> | |
| </ul>`,name:"size"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to self.resample) — | |
| Resampling filter to use when resizing the image.`,name:"resample"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_rescale) — | |
| Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to self.rescale_factor) — | |
| Rescale factor to use when rescaling the image.`,name:"rescale_factor"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_normalize) — | |
| Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.do_convert_annotations",description:`<strong>do_convert_annotations</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_convert_annotations) — | |
| Whether to convert the annotations to the format expected by the model. Converts the bounding | |
| boxes from the format <code>(top_left_x, top_left_y, width, height)</code> to <code>(center_x, center_y, width, height)</code> | |
| and in relative coordinates.`,name:"do_convert_annotations"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to self.image_mean) — | |
| Mean to use when normalizing the image.`,name:"image_mean"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to self.image_std) — | |
| Standard deviation to use when normalizing the image.`,name:"image_std"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to self.do_pad) — | |
| Whether to pad the image. If <code>True</code>, padding will be applied to the bottom and right of | |
| the image with zeros. If <code>pad_size</code> is provided, the image will be padded to the specified | |
| dimensions. Otherwise, the image will be padded to the maximum height and width of the batch.`,name:"do_pad"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.format",description:`<strong>format</strong> (<code>str</code> or <code>AnnotationFormat</code>, <em>optional</em>, defaults to self.format) — | |
| Format of the annotations.`,name:"format"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to self.return_tensors) — | |
| Type of tensors to return. If <code>None</code>, will return the list of images.`,name:"return_tensors"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) — | |
| The channel dimension format for the output image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| <li>Unset: Use the channel dimension format of the input image.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) — | |
| The channel dimension format for the input image. If unset, the channel dimension format is inferred | |
| from the input image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| <li><code>"none"</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li> | |
| </ul>`,name:"input_data_format"},{anchor:"transformers.ConditionalDetrImageProcessor.preprocess.pad_size",description:`<strong>pad_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>) — | |
| The size <code>{"height": int, "width" int}</code> to pad the images to. Must be larger than any image size | |
| provided for preprocessing. If <code>pad_size</code> is not provided, images will be padded to the largest | |
| height and width in the batch.`,name:"pad_size"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1263"}}),ve=new M({props:{name:"post_process_object_detection",anchor:"transformers.ConditionalDetrImageProcessor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"},{name:"top_k",val:": int = 100"}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) — | |
| Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.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>) — | |
| Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size | |
| (height, width) of each image in the batch. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_object_detection.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 100) — | |
| Keep only top k bounding boxes before filtering by thresholding.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1575",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),Ce=new M({props:{name:"post_process_instance_segmentation",anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Optional[typing.List[typing.Tuple[int, int]]] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) — | |
| The overlap mask area threshold to merge or discard small disconnected parts within each binary | |
| instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) — | |
| List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested | |
| final size (height, width) of each prediction. If unset, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>) — | |
| Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE) | |
| format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1683",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of dictionaries, one per image, each dictionary containing two keys:</p> | |
| <ul> | |
| <li><strong>segmentation</strong> — A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or | |
| <code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to | |
| <code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li> | |
| <li><strong>segments_info</strong> — A dictionary that contains additional information on each segment.<ul> | |
| <li><strong>id</strong> — An integer representing the <code>segment_id</code>.</li> | |
| <li><strong>label_id</strong> — An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li> | |
| <li><strong>score</strong> — Prediction score of segment with <code>segment_id</code>.</li> | |
| </ul></li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),xe=new M({props:{name:"post_process_semantic_segmentation",anchor:"transformers.ConditionalDetrImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple[int, int]] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) — | |
| A list of tuples (<code>Tuple[int, int]</code>) containing the target size (height, width) of each image in the | |
| batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1635",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width) | |
| corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each | |
| <code>torch.Tensor</code> correspond to a semantic class id.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[torch.Tensor]</code></p> | |
| `}}),De=new M({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = None"},{name:"target_sizes",val:": typing.Optional[typing.List[typing.Tuple[int, int]]] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| The outputs from <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>.`,name:"outputs"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) — | |
| The overlap mask area threshold to merge or discard small disconnected parts within each binary | |
| instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.label_ids_to_fuse",description:`<strong>label_ids_to_fuse</strong> (<code>Set[int]</code>, <em>optional</em>) — | |
| The labels in this state will have all their instances be fused together. For instance we could say | |
| there can only be one sky in an image, but several persons, so the label ID for sky would be in that | |
| set, but not the one for person.`,name:"label_ids_to_fuse"},{anchor:"transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) — | |
| List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested | |
| final size (height, width) of each prediction in batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1767",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of dictionaries, one per image, each dictionary containing two keys:</p> | |
| <ul> | |
| <li><strong>segmentation</strong> — a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or | |
| <code>None</code> if no mask if found above <code>threshold</code>. If <code>target_sizes</code> is specified, segmentation is resized to | |
| the corresponding <code>target_sizes</code> entry.</li> | |
| <li><strong>segments_info</strong> — A dictionary that contains additional information on each segment.<ul> | |
| <li><strong>id</strong> — an integer representing the <code>segment_id</code>.</li> | |
| <li><strong>label_id</strong> — An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li> | |
| <li><strong>was_fused</strong> — a boolean, <code>True</code> if <code>label_id</code> was in <code>label_ids_to_fuse</code>, <code>False</code> otherwise. | |
| Multiple instances of the same class / label were fused and assigned a single <code>segment_id</code>.</li> | |
| <li><strong>score</strong> — Prediction score of segment with <code>segment_id</code>.</li> | |
| </ul></li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),Me=new P({props:{title:"ConditionalDetrFeatureExtractor",local:"transformers.ConditionalDetrFeatureExtractor",headingTag:"h2"}}),je=new M({props:{name:"class transformers.ConditionalDetrFeatureExtractor",anchor:"transformers.ConditionalDetrFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/feature_extraction_conditional_detr.py#L36"}}),$e=new M({props:{name:"__call__",anchor:"transformers.ConditionalDetrFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/image_processing_utils.py#L39"}}),ke=new M({props:{name:"post_process_object_detection",anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"},{name:"top_k",val:": int = 100"}],parametersDescription:[{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) — | |
| Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.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>) — | |
| Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size | |
| (height, width) of each image in the batch. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_object_detection.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 100) — | |
| Keep only top k bounding boxes before filtering by thresholding.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1575",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),ze=new M({props:{name:"post_process_instance_segmentation",anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"target_sizes",val:": typing.Optional[typing.List[typing.Tuple[int, int]]] = None"},{name:"return_coco_annotation",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) — | |
| The overlap mask area threshold to merge or discard small disconnected parts within each binary | |
| instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) — | |
| List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested | |
| final size (height, width) of each prediction. If unset, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_instance_segmentation.return_coco_annotation",description:`<strong>return_coco_annotation</strong> (<code>bool</code>, <em>optional</em>) — | |
| Defaults to <code>False</code>. If set to <code>True</code>, segmentation maps are returned in COCO run-length encoding (RLE) | |
| format.`,name:"return_coco_annotation"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1683",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of dictionaries, one per image, each dictionary containing two keys:</p> | |
| <ul> | |
| <li><strong>segmentation</strong> — A tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or | |
| <code>List[List]</code> run-length encoding (RLE) of the segmentation map if return_coco_annotation is set to | |
| <code>True</code>. Set to <code>None</code> if no mask if found above <code>threshold</code>.</li> | |
| <li><strong>segments_info</strong> — A dictionary that contains additional information on each segment.<ul> | |
| <li><strong>id</strong> — An integer representing the <code>segment_id</code>.</li> | |
| <li><strong>label_id</strong> — An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li> | |
| <li><strong>score</strong> — Prediction score of segment with <code>segment_id</code>.</li> | |
| </ul></li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),Ie=new M({props:{name:"post_process_semantic_segmentation",anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple[int, int]] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) — | |
| A list of tuples (<code>Tuple[int, int]</code>) containing the target size (height, width) of each image in the | |
| batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1635",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width) | |
| corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each | |
| <code>torch.Tensor</code> correspond to a semantic class id.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[torch.Tensor]</code></p> | |
| `}}),Fe=new M({props:{name:"post_process_panoptic_segmentation",anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.5"},{name:"mask_threshold",val:": float = 0.5"},{name:"overlap_mask_area_threshold",val:": float = 0.8"},{name:"label_ids_to_fuse",val:": typing.Optional[typing.Set[int]] = None"},{name:"target_sizes",val:": typing.Optional[typing.List[typing.Tuple[int, int]]] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>) — | |
| The outputs from <a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrForSegmentation">ConditionalDetrForSegmentation</a>.`,name:"outputs"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| The probability score threshold to keep predicted instance masks.`,name:"threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) — | |
| Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) — | |
| The overlap mask area threshold to merge or discard small disconnected parts within each binary | |
| instance mask.`,name:"overlap_mask_area_threshold"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.label_ids_to_fuse",description:`<strong>label_ids_to_fuse</strong> (<code>Set[int]</code>, <em>optional</em>) — | |
| The labels in this state will have all their instances be fused together. For instance we could say | |
| there can only be one sky in an image, but several persons, so the label ID for sky would be in that | |
| set, but not the one for person.`,name:"label_ids_to_fuse"},{anchor:"transformers.ConditionalDetrFeatureExtractor.post_process_panoptic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) — | |
| List of length (batch_size), where each list item (<code>Tuple[int, int]]</code>) corresponds to the requested | |
| final size (height, width) of each prediction in batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/image_processing_conditional_detr.py#L1767",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of dictionaries, one per image, each dictionary containing two keys:</p> | |
| <ul> | |
| <li><strong>segmentation</strong> — a tensor of shape <code>(height, width)</code> where each pixel represents a <code>segment_id</code> or | |
| <code>None</code> if no mask if found above <code>threshold</code>. If <code>target_sizes</code> is specified, segmentation is resized to | |
| the corresponding <code>target_sizes</code> entry.</li> | |
| <li><strong>segments_info</strong> — A dictionary that contains additional information on each segment.<ul> | |
| <li><strong>id</strong> — an integer representing the <code>segment_id</code>.</li> | |
| <li><strong>label_id</strong> — An integer representing the label / semantic class id corresponding to <code>segment_id</code>.</li> | |
| <li><strong>was_fused</strong> — a boolean, <code>True</code> if <code>label_id</code> was in <code>label_ids_to_fuse</code>, <code>False</code> otherwise. | |
| Multiple instances of the same class / label were fused and assigned a single <code>segment_id</code>.</li> | |
| <li><strong>score</strong> — Prediction score of segment with <code>segment_id</code>.</li> | |
| </ul></li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[Dict]</code></p> | |
| `}}),Je=new P({props:{title:"ConditionalDetrModel",local:"transformers.ConditionalDetrModel",headingTag:"h2"}}),Ue=new M({props:{name:"class transformers.ConditionalDetrModel",anchor:"transformers.ConditionalDetrModel",parameters:[{name:"config",val:": ConditionalDetrConfig"}],parametersDescription:[{anchor:"transformers.ConditionalDetrModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig">ConditionalDetrConfig</a>) — | |
| 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/pr_35161/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/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1432"}}),Ne=new M({props:{name:"forward",anchor:"transformers.ConditionalDetrModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Padding will be ignored by default should you provide it.</p> | |
| <p>Pixel values can be obtained using <a href="/docs/transformers/pr_35161/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_35161/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">ConditionalDetrImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.ConditionalDetrModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) — | |
| Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.ConditionalDetrModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrModel.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>) — | |
| 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.ConditionalDetrModel.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>) — | |
| 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.ConditionalDetrModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35161/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1473",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrModelOutput</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/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig" | |
| >ConditionalDetrConfig</a>) and inputs.</p> | |
| <ul> | |
| <li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — 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 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder’s 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</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>(config.decoder_layers, batch_size, sequence_length, hidden_size)</code>, <em>optional</em>, returned when <code>config.auxiliary_loss=True</code>) — Intermediate decoder activations, i.e. the output of each decoder layer, each of them gone through a | |
| layernorm.</li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),te=new Bo({props:{$$slots:{default:[In]},$$scope:{ctx:k}}}),oe=new Xt({props:{anchor:"transformers.ConditionalDetrModel.forward.example",$$slots:{default:[Fn]},$$scope:{ctx:k}}}),qe=new P({props:{title:"ConditionalDetrForObjectDetection",local:"transformers.ConditionalDetrForObjectDetection",headingTag:"h2"}}),Ze=new M({props:{name:"class transformers.ConditionalDetrForObjectDetection",anchor:"transformers.ConditionalDetrForObjectDetection",parameters:[{name:"config",val:": ConditionalDetrConfig"}],parametersDescription:[{anchor:"transformers.ConditionalDetrForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig">ConditionalDetrConfig</a>) — | |
| 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/pr_35161/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/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1623"}}),Ee=new M({props:{name:"forward",anchor:"transformers.ConditionalDetrForObjectDetection.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[typing.List[dict]] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrForObjectDetection.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Padding will be ignored by default should you provide it.</p> | |
| <p>Pixel values can be obtained using <a href="/docs/transformers/pr_35161/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_35161/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">ConditionalDetrImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.ConditionalDetrForObjectDetection.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForObjectDetection.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) — | |
| Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.ConditionalDetrForObjectDetection.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForObjectDetection.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>) — | |
| 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.ConditionalDetrForObjectDetection.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>) — | |
| 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.ConditionalDetrForObjectDetection.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForObjectDetection.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForObjectDetection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35161/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ConditionalDetrForObjectDetection.forward.labels",description:`<strong>labels</strong> (<code>List[Dict]</code> of len <code>(batch_size,)</code>, <em>optional</em>) — | |
| Labels for computing the bipartite matching loss. List of dicts, each dictionary containing at least the | |
| following 2 keys: ‘class_labels’ and ‘boxes’ (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/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1656",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrObjectDetectionOutput</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/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig" | |
| >ConditionalDetrConfig</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)) — 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>) — 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>) — 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>) — 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 <a | |
| href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrImageProcessor.post_process_object_detection" | |
| >post_process_object_detection()</a> to retrieve the | |
| unnormalized bounding boxes.</li> | |
| <li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) — 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, sequence_length, hidden_size)</code>, <em>optional</em>) — 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>) — 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 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder’s 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the | |
| weighted average in the self-attention heads.</li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ne=new Bo({props:{$$slots:{default:[Jn]},$$scope:{ctx:k}}}),se=new Xt({props:{anchor:"transformers.ConditionalDetrForObjectDetection.forward.example",$$slots:{default:[Un]},$$scope:{ctx:k}}}),Le=new P({props:{title:"ConditionalDetrForSegmentation",local:"transformers.ConditionalDetrForSegmentation",headingTag:"h2"}}),Re=new M({props:{name:"class transformers.ConditionalDetrForSegmentation",anchor:"transformers.ConditionalDetrForSegmentation",parameters:[{name:"config",val:": ConditionalDetrConfig"}],parametersDescription:[{anchor:"transformers.ConditionalDetrForSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig">ConditionalDetrConfig</a>) — | |
| 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/pr_35161/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/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1783"}}),We=new M({props:{name:"forward",anchor:"transformers.ConditionalDetrForSegmentation.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[typing.List[dict]] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ConditionalDetrForSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Padding will be ignored by default should you provide it.</p> | |
| <p>Pixel values can be obtained using <a href="/docs/transformers/pr_35161/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_35161/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">ConditionalDetrImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.ConditionalDetrForSegmentation.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForSegmentation.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) — | |
| Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.ConditionalDetrForSegmentation.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForSegmentation.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>) — | |
| 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.ConditionalDetrForSegmentation.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>) — | |
| 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.ConditionalDetrForSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.ConditionalDetrForSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35161/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ConditionalDetrForSegmentation.forward.labels",description:`<strong>labels</strong> (<code>List[Dict]</code> of len <code>(batch_size,)</code>, <em>optional</em>) — | |
| Labels for computing the bipartite matching loss, DICE/F-1 loss and Focal loss. List of dicts, each | |
| dictionary containing at least the following 3 keys: ‘class_labels’, ‘boxes’ and ‘masks’ (the class labels, | |
| bounding boxes and segmentation masks 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>, the boxes a | |
| <code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, 4)</code> and the masks a | |
| <code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, height, width)</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_35161/src/transformers/models/conditional_detr/modeling_conditional_detr.py#L1813",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrSegmentationOutput</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/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig" | |
| >ConditionalDetrConfig</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)) — 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>) — 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>) — 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>) — 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 <a | |
| href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrImageProcessor.post_process_object_detection" | |
| >post_process_object_detection()</a> to retrieve the | |
| unnormalized bounding boxes.</li> | |
| <li><strong>pred_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, height/4, width/4)</code>) — Segmentation masks logits for all queries. See also | |
| <a | |
| href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrImageProcessor.post_process_semantic_segmentation" | |
| >post_process_semantic_segmentation()</a> or | |
| <a | |
| href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrImageProcessor.post_process_instance_segmentation" | |
| >post_process_instance_segmentation()</a> | |
| <a | |
| href="/docs/transformers/pr_35161/en/model_doc/conditional_detr#transformers.ConditionalDetrImageProcessor.post_process_panoptic_segmentation" | |
| >post_process_panoptic_segmentation()</a> to evaluate semantic, instance and panoptic | |
| segmentation masks respectively.</li> | |
| <li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) — Optional, only returned when auxiliary 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, sequence_length, hidden_size)</code>, <em>optional</em>) — 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>) — 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 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder’s 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the encoder, after the attention softmax, used to compute the | |
| weighted average in the self-attention heads.</li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.conditional_detr.modeling_conditional_detr.ConditionalDetrSegmentationOutput</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ae=new Bo({props:{$$slots:{default:[Nn]},$$scope:{ctx:k}}}),re=new Xt({props:{anchor:"transformers.ConditionalDetrForSegmentation.forward.example",$$slots:{default:[qn]},$$scope:{ctx:k}}}),Pe=new kn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/conditional_detr.md"}}),{c(){r=d("meta"),T=o(),m=d("p"),p=o(),h(w.$$.fragment),i=o(),h(C.$$.fragment),Tt=o(),ce=d("p"),ce.innerHTML=So,vt=o(),me=d("p"),me.textContent=Go,Ct=o(),pe=d("p"),pe.innerHTML=Oo,xt=o(),B=d("img"),Dt=o(),he=d("small"),he.innerHTML=Vo,Mt=o(),ge=d("p"),ge.innerHTML=Xo,jt=o(),h(fe.$$.fragment),$t=o(),ue=d("ul"),ue.innerHTML=Ao,kt=o(),h(_e.$$.fragment),zt=o(),J=d("div"),h(be.$$.fragment),Qt=o(),Xe=d("p"),Xe.innerHTML=Qo,Yt=o(),Ae=d("p"),Ae.innerHTML=Yo,Kt=o(),h(S.$$.fragment),It=o(),h(ye.$$.fragment),Ft=o(),D=d("div"),h(we.$$.fragment),eo=o(),Qe=d("p"),Qe.textContent=Ko,to=o(),G=d("div"),h(Te.$$.fragment),oo=o(),Ye=d("p"),Ye.textContent=en,no=o(),O=d("div"),h(ve.$$.fragment),so=o(),Ke=d("p"),Ke.innerHTML=tn,ao=o(),H=d("div"),h(Ce.$$.fragment),ro=o(),et=d("p"),et.innerHTML=on,io=o(),V=d("div"),h(xe.$$.fragment),lo=o(),tt=d("p"),tt.innerHTML=nn,co=o(),X=d("div"),h(De.$$.fragment),mo=o(),ot=d("p"),ot.innerHTML=sn,Jt=o(),h(Me.$$.fragment),Ut=o(),j=d("div"),h(je.$$.fragment),po=o(),A=d("div"),h($e.$$.fragment),ho=o(),nt=d("p"),nt.textContent=an,go=o(),Q=d("div"),h(ke.$$.fragment),fo=o(),st=d("p"),st.innerHTML=rn,uo=o(),Y=d("div"),h(ze.$$.fragment),_o=o(),at=d("p"),at.innerHTML=dn,bo=o(),K=d("div"),h(Ie.$$.fragment),yo=o(),rt=d("p"),rt.innerHTML=ln,wo=o(),ee=d("div"),h(Fe.$$.fragment),To=o(),it=d("p"),it.innerHTML=cn,Nt=o(),h(Je.$$.fragment),qt=o(),z=d("div"),h(Ue.$$.fragment),vo=o(),dt=d("p"),dt.textContent=mn,Co=o(),lt=d("p"),lt.innerHTML=pn,xo=o(),ct=d("p"),ct.innerHTML=hn,Do=o(),U=d("div"),h(Ne.$$.fragment),Mo=o(),mt=d("p"),mt.innerHTML=gn,jo=o(),h(te.$$.fragment),$o=o(),h(oe.$$.fragment),Zt=o(),h(qe.$$.fragment),Et=o(),I=d("div"),h(Ze.$$.fragment),ko=o(),pt=d("p"),pt.textContent=fn,zo=o(),ht=d("p"),ht.innerHTML=un,Io=o(),gt=d("p"),gt.innerHTML=_n,Fo=o(),N=d("div"),h(Ee.$$.fragment),Jo=o(),ft=d("p"),ft.innerHTML=bn,Uo=o(),h(ne.$$.fragment),No=o(),h(se.$$.fragment),Lt=o(),h(Le.$$.fragment),Rt=o(),F=d("div"),h(Re.$$.fragment),qo=o(),ut=d("p"),ut.textContent=yn,Zo=o(),_t=d("p"),_t.innerHTML=wn,Eo=o(),bt=d("p"),bt.innerHTML=Tn,Lo=o(),q=d("div"),h(We.$$.fragment),Ro=o(),yt=d("p"),yt.innerHTML=vn,Wo=o(),h(ae.$$.fragment),Po=o(),h(re.$$.fragment),Wt=o(),h(Pe.$$.fragment),Pt=o(),wt=d("p"),this.h()},l(e){const a=$n("svelte-u9bgzb",document.head);r=l(a,"META",{name:!0,content:!0}),a.forEach(s),T=n(e),m=l(e,"P",{}),x(m).forEach(s),p=n(e),g(w.$$.fragment,e),i=n(e),g(C.$$.fragment,e),Tt=n(e),ce=l(e,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-p6b5zw"&&(ce.innerHTML=So),vt=n(e),me=l(e,"P",{"data-svelte-h":!0}),y(me)!=="svelte-vfdo9a"&&(me.textContent=Go),Ct=n(e),pe=l(e,"P",{"data-svelte-h":!0}),y(pe)!=="svelte-jvp4bn"&&(pe.innerHTML=Oo),xt=n(e),B=l(e,"IMG",{src:!0,alt:!0,width:!0}),Dt=n(e),he=l(e,"SMALL",{"data-svelte-h":!0}),y(he)!=="svelte-w9m4kj"&&(he.innerHTML=Vo),Mt=n(e),ge=l(e,"P",{"data-svelte-h":!0}),y(ge)!=="svelte-7exlsi"&&(ge.innerHTML=Xo),jt=n(e),g(fe.$$.fragment,e),$t=n(e),ue=l(e,"UL",{"data-svelte-h":!0}),y(ue)!=="svelte-2irag1"&&(ue.innerHTML=Ao),kt=n(e),g(_e.$$.fragment,e),zt=n(e),J=l(e,"DIV",{class:!0});var E=x(J);g(be.$$.fragment,E),Qt=n(E),Xe=l(E,"P",{"data-svelte-h":!0}),y(Xe)!=="svelte-14xq4fr"&&(Xe.innerHTML=Qo),Yt=n(E),Ae=l(E,"P",{"data-svelte-h":!0}),y(Ae)!=="svelte-mw58qj"&&(Ae.innerHTML=Yo),Kt=n(E),g(S.$$.fragment,E),E.forEach(s),It=n(e),g(ye.$$.fragment,e),Ft=n(e),D=l(e,"DIV",{class:!0});var $=x(D);g(we.$$.fragment,$),eo=n($),Qe=l($,"P",{"data-svelte-h":!0}),y(Qe)!=="svelte-17j4jp9"&&(Qe.textContent=Ko),to=n($),G=l($,"DIV",{class:!0});var Be=x(G);g(Te.$$.fragment,Be),oo=n(Be),Ye=l(Be,"P",{"data-svelte-h":!0}),y(Ye)!=="svelte-jgz2ra"&&(Ye.textContent=en),Be.forEach(s),no=n($),O=l($,"DIV",{class:!0});var Se=x(O);g(ve.$$.fragment,Se),so=n(Se),Ke=l(Se,"P",{"data-svelte-h":!0}),y(Ke)!=="svelte-sgc8wr"&&(Ke.innerHTML=tn),Se.forEach(s),ao=n($),H=l($,"DIV",{class:!0});var Ge=x(H);g(Ce.$$.fragment,Ge),ro=n(Ge),et=l(Ge,"P",{"data-svelte-h":!0}),y(et)!=="svelte-12q3wc8"&&(et.innerHTML=on),Ge.forEach(s),io=n($),V=l($,"DIV",{class:!0});var Oe=x(V);g(xe.$$.fragment,Oe),lo=n(Oe),tt=l(Oe,"P",{"data-svelte-h":!0}),y(tt)!=="svelte-b0cc20"&&(tt.innerHTML=nn),Oe.forEach(s),co=n($),X=l($,"DIV",{class:!0});var He=x(X);g(De.$$.fragment,He),mo=n(He),ot=l(He,"P",{"data-svelte-h":!0}),y(ot)!=="svelte-1kxubhi"&&(ot.innerHTML=sn),He.forEach(s),$.forEach(s),Jt=n(e),g(Me.$$.fragment,e),Ut=n(e),j=l(e,"DIV",{class:!0});var Z=x(j);g(je.$$.fragment,Z),po=n(Z),A=l(Z,"DIV",{class:!0});var St=x(A);g($e.$$.fragment,St),ho=n(St),nt=l(St,"P",{"data-svelte-h":!0}),y(nt)!=="svelte-khengj"&&(nt.textContent=an),St.forEach(s),go=n(Z),Q=l(Z,"DIV",{class:!0});var Gt=x(Q);g(ke.$$.fragment,Gt),fo=n(Gt),st=l(Gt,"P",{"data-svelte-h":!0}),y(st)!=="svelte-sgc8wr"&&(st.innerHTML=rn),Gt.forEach(s),uo=n(Z),Y=l(Z,"DIV",{class:!0});var Ot=x(Y);g(ze.$$.fragment,Ot),_o=n(Ot),at=l(Ot,"P",{"data-svelte-h":!0}),y(at)!=="svelte-12q3wc8"&&(at.innerHTML=dn),Ot.forEach(s),bo=n(Z),K=l(Z,"DIV",{class:!0});var Ht=x(K);g(Ie.$$.fragment,Ht),yo=n(Ht),rt=l(Ht,"P",{"data-svelte-h":!0}),y(rt)!=="svelte-b0cc20"&&(rt.innerHTML=ln),Ht.forEach(s),wo=n(Z),ee=l(Z,"DIV",{class:!0});var Vt=x(ee);g(Fe.$$.fragment,Vt),To=n(Vt),it=l(Vt,"P",{"data-svelte-h":!0}),y(it)!=="svelte-1kxubhi"&&(it.innerHTML=cn),Vt.forEach(s),Z.forEach(s),Nt=n(e),g(Je.$$.fragment,e),qt=n(e),z=l(e,"DIV",{class:!0});var L=x(z);g(Ue.$$.fragment,L),vo=n(L),dt=l(L,"P",{"data-svelte-h":!0}),y(dt)!=="svelte-1lwpr2z"&&(dt.textContent=mn),Co=n(L),lt=l(L,"P",{"data-svelte-h":!0}),y(lt)!=="svelte-1mxr5iq"&&(lt.innerHTML=pn),xo=n(L),ct=l(L,"P",{"data-svelte-h":!0}),y(ct)!=="svelte-hswkmf"&&(ct.innerHTML=hn),Do=n(L),U=l(L,"DIV",{class:!0});var ie=x(U);g(Ne.$$.fragment,ie),Mo=n(ie),mt=l(ie,"P",{"data-svelte-h":!0}),y(mt)!=="svelte-74nu71"&&(mt.innerHTML=gn),jo=n(ie),g(te.$$.fragment,ie),$o=n(ie),g(oe.$$.fragment,ie),ie.forEach(s),L.forEach(s),Zt=n(e),g(qe.$$.fragment,e),Et=n(e),I=l(e,"DIV",{class:!0});var R=x(I);g(Ze.$$.fragment,R),ko=n(R),pt=l(R,"P",{"data-svelte-h":!0}),y(pt)!=="svelte-1b6ijwv"&&(pt.textContent=fn),zo=n(R),ht=l(R,"P",{"data-svelte-h":!0}),y(ht)!=="svelte-1mxr5iq"&&(ht.innerHTML=un),Io=n(R),gt=l(R,"P",{"data-svelte-h":!0}),y(gt)!=="svelte-hswkmf"&&(gt.innerHTML=_n),Fo=n(R),N=l(R,"DIV",{class:!0});var de=x(N);g(Ee.$$.fragment,de),Jo=n(de),ft=l(de,"P",{"data-svelte-h":!0}),y(ft)!=="svelte-1y2h6rh"&&(ft.innerHTML=bn),Uo=n(de),g(ne.$$.fragment,de),No=n(de),g(se.$$.fragment,de),de.forEach(s),R.forEach(s),Lt=n(e),g(Le.$$.fragment,e),Rt=n(e),F=l(e,"DIV",{class:!0});var W=x(F);g(Re.$$.fragment,W),qo=n(W),ut=l(W,"P",{"data-svelte-h":!0}),y(ut)!=="svelte-1qyfet8"&&(ut.textContent=yn),Zo=n(W),_t=l(W,"P",{"data-svelte-h":!0}),y(_t)!=="svelte-1mxr5iq"&&(_t.innerHTML=wn),Eo=n(W),bt=l(W,"P",{"data-svelte-h":!0}),y(bt)!=="svelte-hswkmf"&&(bt.innerHTML=Tn),Lo=n(W),q=l(W,"DIV",{class:!0});var le=x(q);g(We.$$.fragment,le),Ro=n(le),yt=l(le,"P",{"data-svelte-h":!0}),y(yt)!=="svelte-14m0rm9"&&(yt.innerHTML=vn),Wo=n(le),g(ae.$$.fragment,le),Po=n(le),g(re.$$.fragment,le),le.forEach(s),W.forEach(s),Wt=n(e),g(Pe.$$.fragment,e),Pt=n(e),wt=l(e,"P",{}),x(wt).forEach(s),this.h()},h(){v(r,"name","hf:doc:metadata"),v(r,"content",En),xn(B.src,Ho="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/conditional_detr_curve.jpg")||v(B,"src",Ho),v(B,"alt","drawing"),v(B,"width","600"),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){t(document.head,r),c(e,T,a),c(e,m,a),c(e,p,a),f(w,e,a),c(e,i,a),f(C,e,a),c(e,Tt,a),c(e,ce,a),c(e,vt,a),c(e,me,a),c(e,Ct,a),c(e,pe,a),c(e,xt,a),c(e,B,a),c(e,Dt,a),c(e,he,a),c(e,Mt,a),c(e,ge,a),c(e,jt,a),f(fe,e,a),c(e,$t,a),c(e,ue,a),c(e,kt,a),f(_e,e,a),c(e,zt,a),c(e,J,a),f(be,J,null),t(J,Qt),t(J,Xe),t(J,Yt),t(J,Ae),t(J,Kt),f(S,J,null),c(e,It,a),f(ye,e,a),c(e,Ft,a),c(e,D,a),f(we,D,null),t(D,eo),t(D,Qe),t(D,to),t(D,G),f(Te,G,null),t(G,oo),t(G,Ye),t(D,no),t(D,O),f(ve,O,null),t(O,so),t(O,Ke),t(D,ao),t(D,H),f(Ce,H,null),t(H,ro),t(H,et),t(D,io),t(D,V),f(xe,V,null),t(V,lo),t(V,tt),t(D,co),t(D,X),f(De,X,null),t(X,mo),t(X,ot),c(e,Jt,a),f(Me,e,a),c(e,Ut,a),c(e,j,a),f(je,j,null),t(j,po),t(j,A),f($e,A,null),t(A,ho),t(A,nt),t(j,go),t(j,Q),f(ke,Q,null),t(Q,fo),t(Q,st),t(j,uo),t(j,Y),f(ze,Y,null),t(Y,_o),t(Y,at),t(j,bo),t(j,K),f(Ie,K,null),t(K,yo),t(K,rt),t(j,wo),t(j,ee),f(Fe,ee,null),t(ee,To),t(ee,it),c(e,Nt,a),f(Je,e,a),c(e,qt,a),c(e,z,a),f(Ue,z,null),t(z,vo),t(z,dt),t(z,Co),t(z,lt),t(z,xo),t(z,ct),t(z,Do),t(z,U),f(Ne,U,null),t(U,Mo),t(U,mt),t(U,jo),f(te,U,null),t(U,$o),f(oe,U,null),c(e,Zt,a),f(qe,e,a),c(e,Et,a),c(e,I,a),f(Ze,I,null),t(I,ko),t(I,pt),t(I,zo),t(I,ht),t(I,Io),t(I,gt),t(I,Fo),t(I,N),f(Ee,N,null),t(N,Jo),t(N,ft),t(N,Uo),f(ne,N,null),t(N,No),f(se,N,null),c(e,Lt,a),f(Le,e,a),c(e,Rt,a),c(e,F,a),f(Re,F,null),t(F,qo),t(F,ut),t(F,Zo),t(F,_t),t(F,Eo),t(F,bt),t(F,Lo),t(F,q),f(We,q,null),t(q,Ro),t(q,yt),t(q,Wo),f(ae,q,null),t(q,Po),f(re,q,null),c(e,Wt,a),f(Pe,e,a),c(e,Pt,a),c(e,wt,a),Bt=!0},p(e,[a]){const E={};a&2&&(E.$$scope={dirty:a,ctx:e}),S.$set(E);const $={};a&2&&($.$$scope={dirty:a,ctx:e}),te.$set($);const Be={};a&2&&(Be.$$scope={dirty:a,ctx:e}),oe.$set(Be);const Se={};a&2&&(Se.$$scope={dirty:a,ctx:e}),ne.$set(Se);const Ge={};a&2&&(Ge.$$scope={dirty:a,ctx:e}),se.$set(Ge);const Oe={};a&2&&(Oe.$$scope={dirty:a,ctx:e}),ae.$set(Oe);const He={};a&2&&(He.$$scope={dirty:a,ctx:e}),re.$set(He)},i(e){Bt||(u(w.$$.fragment,e),u(C.$$.fragment,e),u(fe.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(S.$$.fragment,e),u(ye.$$.fragment,e),u(we.$$.fragment,e),u(Te.$$.fragment,e),u(ve.$$.fragment,e),u(Ce.$$.fragment,e),u(xe.$$.fragment,e),u(De.$$.fragment,e),u(Me.$$.fragment,e),u(je.$$.fragment,e),u($e.$$.fragment,e),u(ke.$$.fragment,e),u(ze.$$.fragment,e),u(Ie.$$.fragment,e),u(Fe.$$.fragment,e),u(Je.$$.fragment,e),u(Ue.$$.fragment,e),u(Ne.$$.fragment,e),u(te.$$.fragment,e),u(oe.$$.fragment,e),u(qe.$$.fragment,e),u(Ze.$$.fragment,e),u(Ee.$$.fragment,e),u(ne.$$.fragment,e),u(se.$$.fragment,e),u(Le.$$.fragment,e),u(Re.$$.fragment,e),u(We.$$.fragment,e),u(ae.$$.fragment,e),u(re.$$.fragment,e),u(Pe.$$.fragment,e),Bt=!0)},o(e){_(w.$$.fragment,e),_(C.$$.fragment,e),_(fe.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(S.$$.fragment,e),_(ye.$$.fragment,e),_(we.$$.fragment,e),_(Te.$$.fragment,e),_(ve.$$.fragment,e),_(Ce.$$.fragment,e),_(xe.$$.fragment,e),_(De.$$.fragment,e),_(Me.$$.fragment,e),_(je.$$.fragment,e),_($e.$$.fragment,e),_(ke.$$.fragment,e),_(ze.$$.fragment,e),_(Ie.$$.fragment,e),_(Fe.$$.fragment,e),_(Je.$$.fragment,e),_(Ue.$$.fragment,e),_(Ne.$$.fragment,e),_(te.$$.fragment,e),_(oe.$$.fragment,e),_(qe.$$.fragment,e),_(Ze.$$.fragment,e),_(Ee.$$.fragment,e),_(ne.$$.fragment,e),_(se.$$.fragment,e),_(Le.$$.fragment,e),_(Re.$$.fragment,e),_(We.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(Pe.$$.fragment,e),Bt=!1},d(e){e&&(s(T),s(m),s(p),s(i),s(Tt),s(ce),s(vt),s(me),s(Ct),s(pe),s(xt),s(B),s(Dt),s(he),s(Mt),s(ge),s(jt),s($t),s(ue),s(kt),s(zt),s(J),s(It),s(Ft),s(D),s(Jt),s(Ut),s(j),s(Nt),s(qt),s(z),s(Zt),s(Et),s(I),s(Lt),s(Rt),s(F),s(Wt),s(Pt),s(wt)),s(r),b(w,e),b(C,e),b(fe,e),b(_e,e),b(be),b(S),b(ye,e),b(we),b(Te),b(ve),b(Ce),b(xe),b(De),b(Me,e),b(je),b($e),b(ke),b(ze),b(Ie),b(Fe),b(Je,e),b(Ue),b(Ne),b(te),b(oe),b(qe,e),b(Ze),b(Ee),b(ne),b(se),b(Le,e),b(Re),b(We),b(ae),b(re),b(Pe,e)}}}const En='{"title":"Conditional DETR","local":"conditional-detr","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"ConditionalDetrConfig","local":"transformers.ConditionalDetrConfig","sections":[],"depth":2},{"title":"ConditionalDetrImageProcessor","local":"transformers.ConditionalDetrImageProcessor","sections":[],"depth":2},{"title":"ConditionalDetrFeatureExtractor","local":"transformers.ConditionalDetrFeatureExtractor","sections":[],"depth":2},{"title":"ConditionalDetrModel","local":"transformers.ConditionalDetrModel","sections":[],"depth":2},{"title":"ConditionalDetrForObjectDetection","local":"transformers.ConditionalDetrForObjectDetection","sections":[],"depth":2},{"title":"ConditionalDetrForSegmentation","local":"transformers.ConditionalDetrForSegmentation","sections":[],"depth":2}],"depth":1}';function Ln(k){return Dn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Hn extends Mn{constructor(r){super(),jn(this,r,Ln,Zn,Cn,{})}}export{Hn as component}; | |
Xet Storage Details
- Size:
- 136 kB
- Xet hash:
- 95fc8ed9a15643d4c7e328ffece1a3ea1cb665ff97dd60ad987af695e47d5b1e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.