Buckets:
| import{s as Bo,A as Vo,o as Ho,n as Ne}from"../chunks/scheduler.01eeda35.js";import{S as Go,i as Lo,g as d,s,r as h,A as qo,h as c,f as o,c as a,j as P,u as g,x as T,k as M,y as l,a as i,v as f,d as u,t as _,w as b}from"../chunks/index.6dd51b66.js";import{T as fo}from"../chunks/Tip.de9bae2b.js";import{D as x}from"../chunks/Docstring.cb556860.js";import{C as rt}from"../chunks/CodeBlock.19ec9b8c.js";import{E as Et}from"../chunks/ExampleCodeBlock.69db56ad.js";import{H as R,E as Yo}from"../chunks/index.58fe8f9d.js";function Xo($){let n,v="Example:",m,p,y;return p=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQVE1vZGVsJTJDJTIwRFBUQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMERQVCUyMGRwdC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBEUFRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBkcHQtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMERQVE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPTModel, DPTConfig | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a DPT dpt-large style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = DPTConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a model from the dpt-large style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = DPTModel(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(){n=d("p"),n.textContent=v,m=s(),h(p.$$.fragment)},l(r){n=c(r,"P",{"data-svelte-h":!0}),T(n)!=="svelte-11lpom8"&&(n.textContent=v),m=a(r),g(p.$$.fragment,r)},m(r,w){i(r,n,w),i(r,m,w),f(p,r,w),y=!0},p:Ne,i(r){y||(u(p.$$.fragment,r),y=!0)},o(r){_(p.$$.fragment,r),y=!1},d(r){r&&(o(n),o(m)),b(p,r)}}}function Ao($){let n,v=`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(){n=d("p"),n.innerHTML=v},l(m){n=c(m,"P",{"data-svelte-h":!0}),T(n)!=="svelte-fincs2"&&(n.innerHTML=v)},m(m,p){i(m,n,p)},p:Ne,d(m){m&&o(n)}}}function Qo($){let n,v="Example:",m,p,y;return p=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMERQVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"Intel/dpt-large"</span>) | |
| <span class="hljs-meta">>>> </span>model = DPTModel.from_pretrained(<span class="hljs-string">"Intel/dpt-large"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> outputs = model(**inputs) | |
| <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">577</span>, <span class="hljs-number">1024</span>]`,wrap:!1}}),{c(){n=d("p"),n.textContent=v,m=s(),h(p.$$.fragment)},l(r){n=c(r,"P",{"data-svelte-h":!0}),T(n)!=="svelte-11lpom8"&&(n.textContent=v),m=a(r),g(p.$$.fragment,r)},m(r,w){i(r,n,w),i(r,m,w),f(p,r,w),y=!0},p:Ne,i(r){y||(u(p.$$.fragment,r),y=!0)},o(r){_(p.$$.fragment,r),y=!1},d(r){r&&(o(n),o(m)),b(p,r)}}}function Oo($){let n,v=`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(){n=d("p"),n.innerHTML=v},l(m){n=c(m,"P",{"data-svelte-h":!0}),T(n)!=="svelte-fincs2"&&(n.innerHTML=v)},m(m,p){i(m,n,p)},p:Ne,d(m){m&&o(n)}}}function Ko($){let n,v="Examples:",m,p,y;return p=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVEZvckRlcHRoRXN0aW1hdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMERQVEZvckRlcHRoRXN0aW1hdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZkcHQtbGFyZ2UlMjIpJTBBJTBBJTIzJTIwcHJlcGFyZSUyMGltYWdlJTIwZm9yJTIwdGhlJTIwbW9kZWwlMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwaW50ZXJwb2xhdGUlMjB0byUyMG9yaWdpbmFsJTIwc2l6ZSUwQXBvc3RfcHJvY2Vzc2VkX291dHB1dCUyMCUzRCUyMGltYWdlX3Byb2Nlc3Nvci5wb3N0X3Byb2Nlc3NfZGVwdGhfZXN0aW1hdGlvbiglMEElMjAlMjAlMjAlMjBvdXRwdXRzJTJDJTBBJTIwJTIwJTIwJTIwdGFyZ2V0X3NpemVzJTNEJTVCKGltYWdlLmhlaWdodCUyQyUyMGltYWdlLndpZHRoKSU1RCUyQyUwQSklMEElMEElMjMlMjB2aXN1YWxpemUlMjB0aGUlMjBwcmVkaWN0aW9uJTBBcHJlZGljdGVkX2RlcHRoJTIwJTNEJTIwcG9zdF9wcm9jZXNzZWRfb3V0cHV0JTVCMCU1RCU1QiUyMnByZWRpY3RlZF9kZXB0aCUyMiU1RCUwQWRlcHRoJTIwJTNEJTIwcHJlZGljdGVkX2RlcHRoJTIwKiUyMDI1NSUyMCUyRiUyMHByZWRpY3RlZF9kZXB0aC5tYXgoKSUwQWRlcHRoJTIwJTNEJTIwZGVwdGguZGV0YWNoKCkuY3B1KCkubnVtcHkoKSUwQWRlcHRoJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGRlcHRoLmFzdHlwZSglMjJ1aW50OCUyMikp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTForDepthEstimation | |
| <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-keyword">as</span> np | |
| <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">"Intel/dpt-large"</span>) | |
| <span class="hljs-meta">>>> </span>model = DPTForDepthEstimation.from_pretrained(<span class="hljs-string">"Intel/dpt-large"</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-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># interpolate to original size</span> | |
| <span class="hljs-meta">>>> </span>post_processed_output = image_processor.post_process_depth_estimation( | |
| <span class="hljs-meta">... </span> outputs, | |
| <span class="hljs-meta">... </span> target_sizes=[(image.height, image.width)], | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># visualize the prediction</span> | |
| <span class="hljs-meta">>>> </span>predicted_depth = post_processed_output[<span class="hljs-number">0</span>][<span class="hljs-string">"predicted_depth"</span>] | |
| <span class="hljs-meta">>>> </span>depth = predicted_depth * <span class="hljs-number">255</span> / predicted_depth.<span class="hljs-built_in">max</span>() | |
| <span class="hljs-meta">>>> </span>depth = depth.detach().cpu().numpy() | |
| <span class="hljs-meta">>>> </span>depth = Image.fromarray(depth.astype(<span class="hljs-string">"uint8"</span>))`,wrap:!1}}),{c(){n=d("p"),n.textContent=v,m=s(),h(p.$$.fragment)},l(r){n=c(r,"P",{"data-svelte-h":!0}),T(n)!=="svelte-kvfsh7"&&(n.textContent=v),m=a(r),g(p.$$.fragment,r)},m(r,w){i(r,n,w),i(r,m,w),f(p,r,w),y=!0},p:Ne,i(r){y||(u(p.$$.fragment,r),y=!0)},o(r){_(p.$$.fragment,r),y=!1},d(r){r&&(o(n),o(m)),b(p,r)}}}function en($){let n,v=`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(){n=d("p"),n.innerHTML=v},l(m){n=c(m,"P",{"data-svelte-h":!0}),T(n)!=="svelte-fincs2"&&(n.innerHTML=v)},m(m,p){i(m,n,p)},p:Ne,d(m){m&&o(n)}}}function tn($){let n,v="Examples:",m,p,y;return p=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVEZvclNlbWFudGljU2VnbWVudGF0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZS1hZGUlMjIpJTBBbW9kZWwlMjAlM0QlMjBEUFRGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZkcHQtbGFyZ2UtYWRlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTForSemanticSegmentation | |
| <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">"Intel/dpt-large-ade"</span>) | |
| <span class="hljs-meta">>>> </span>model = DPTForSemanticSegmentation.from_pretrained(<span class="hljs-string">"Intel/dpt-large-ade"</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>logits = outputs.logits`,wrap:!1}}),{c(){n=d("p"),n.textContent=v,m=s(),h(p.$$.fragment)},l(r){n=c(r,"P",{"data-svelte-h":!0}),T(n)!=="svelte-kvfsh7"&&(n.textContent=v),m=a(r),g(p.$$.fragment,r)},m(r,w){i(r,n,w),i(r,m,w),f(p,r,w),y=!0},p:Ne,i(r){y||(u(p.$$.fragment,r),y=!0)},o(r){_(p.$$.fragment,r),y=!1},d(r){r&&(o(n),o(m)),b(p,r)}}}function on($){let n,v,m,p,y,r,w,uo='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&logo=pytorch&logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&logo=pytorch&logoColor=white"/>',it,ne,lt,se,_o=`The DPT model was proposed in <a href="https://arxiv.org/abs/2103.13413" rel="nofollow">Vision Transformers for Dense Prediction</a> by René Ranftl, Alexey Bochkovskiy, Vladlen Koltun. | |
| DPT is a model that leverages the <a href="vit">Vision Transformer (ViT)</a> as backbone for dense prediction tasks like semantic segmentation and depth estimation.`,dt,ae,bo="The abstract from the paper is the following:",ct,re,To="<em>We introduce dense vision transformers, an architecture that leverages vision transformers in place of convolutional networks as a backbone for dense prediction tasks. We assemble tokens from various stages of the vision transformer into image-like representations at various resolutions and progressively combine them into full-resolution predictions using a convolutional decoder. The transformer backbone processes representations at a constant and relatively high resolution and has a global receptive field at every stage. These properties allow the dense vision transformer to provide finer-grained and more globally coherent predictions when compared to fully-convolutional networks. Our experiments show that this architecture yields substantial improvements on dense prediction tasks, especially when a large amount of training data is available. For monocular depth estimation, we observe an improvement of up to 28% in relative performance when compared to a state-of-the-art fully-convolutional network. When applied to semantic segmentation, dense vision transformers set a new state of the art on ADE20K with 49.02% mIoU. We further show that the architecture can be fine-tuned on smaller datasets such as NYUv2, KITTI, and Pascal Context where it also sets the new state of the art.</em>",mt,N,yo,pt,ie,vo='DPT architecture. Taken from the <a href="https://arxiv.org/abs/2103.13413" target="_blank">original paper</a>.',ht,le,wo='This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The original code can be found <a href="https://github.com/isl-org/DPT" rel="nofollow">here</a>.',gt,de,ft,ce,Mo='DPT is compatible with the <a href="/docs/transformers/pr_37155/en/main_classes/backbones#transformers.AutoBackbone">AutoBackbone</a> class. This allows to use the DPT framework with various computer vision backbones available in the library, such as <code>VitDetBackbone</code> or <code>Dinov2Backbone</code>. One can create it as follows:',ut,me,_t,pe,bt,he,$o="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with DPT.",Tt,ge,Po='<li><p>Demo notebooks for <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForDepthEstimation">DPTForDepthEstimation</a> can be found <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DPT" rel="nofollow">here</a>.</p></li> <li><p><a href="../tasks/semantic_segmentation">Semantic segmentation task guide</a></p></li> <li><p><a href="../tasks/monocular_depth_estimation">Monocular depth estimation task guide</a></p></li>',yt,fe,Do="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",vt,ue,wt,D,_e,Rt,Se,xo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTModel">DPTModel</a>. It is used to instantiate an DPT | |
| 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 DPT | |
| <a href="https://huggingface.co/Intel/dpt-large" rel="nofollow">Intel/dpt-large</a> architecture.`,Zt,Be,ko=`Configuration objects inherit from <a href="/docs/transformers/pr_37155/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_37155/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Nt,S,St,B,be,Bt,Ve,Co=`Serializes this instance to a Python dictionary. Override the default <a href="/docs/transformers/pr_37155/en/main_classes/configuration#transformers.PretrainedConfig.to_dict">to_dict()</a>. Returns: | |
| <code>Dict[str, any]</code>: Dictionary of all the attributes that make up this configuration instance,`,Mt,Te,$t,F,ye,Vt,He,ve,Ht,V,we,Gt,Ge,Io='Converts the output of <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',Pt,Me,Dt,k,$e,Lt,Le,jo="Constructs a DPT image processor.",qt,H,Pe,Yt,qe,zo="Preprocess an image or batch of images.",Xt,G,De,At,Ye,Uo='Converts the output of <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',xt,xe,kt,W,ke,Qt,Xe,Jo=`The bare DPT Model transformer outputting raw hidden-states without any specific head on top. | |
| This model is 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.`,Ot,z,Ce,Kt,Ae,Fo='The <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTModel">DPTModel</a> forward method, overrides the <code>__call__</code> special method.',eo,L,to,q,Ct,Ie,It,C,je,oo,Qe,Wo="DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.",no,Oe,Eo=`This model is 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.`,so,U,ze,ao,Ke,Ro='The <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForDepthEstimation">DPTForDepthEstimation</a> forward method, overrides the <code>__call__</code> special method.',ro,Y,io,X,jt,Ue,zt,I,Je,lo,et,Zo="DPT Model with a semantic segmentation head on top e.g. for ADE20k, CityScapes.",co,tt,No=`This model is 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.`,mo,J,Fe,po,ot,So='The <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',ho,A,go,Q,Ut,We,Jt,st,Ft;return y=new R({props:{title:"DPT",local:"dpt",headingTag:"h1"}}),ne=new R({props:{title:"Overview",local:"overview",headingTag:"h2"}}),de=new R({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),me=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpbm92MkNvbmZpZyUyQyUyMERQVENvbmZpZyUyQyUyMERQVEZvckRlcHRoRXN0aW1hdGlvbiUwQSUwQSUyMyUyMGluaXRpYWxpemUlMjB3aXRoJTIwYSUyMFRyYW5zZm9ybWVyLWJhc2VkJTIwYmFja2JvbmUlMjBzdWNoJTIwYXMlMjBESU5PdjIlMEElMjMlMjBpbiUyMHRoYXQlMjBjYXNlJTJDJTIwd2UlMjBhbHNvJTIwc3BlY2lmeSUyMCU2MHJlc2hhcGVfaGlkZGVuX3N0YXRlcyUzREZhbHNlJTYwJTIwdG8lMjBnZXQlMjBmZWF0dXJlJTIwbWFwcyUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9jaGFubmVscyUyQyUyMGhlaWdodCUyQyUyMHdpZHRoKSUwQWJhY2tib25lX2NvbmZpZyUyMCUzRCUyMERpbm92MkNvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkaW5vdjItYmFzZSUyMiUyQyUyMG91dF9mZWF0dXJlcyUzRCU1QiUyMnN0YWdlMSUyMiUyQyUyMCUyMnN0YWdlMiUyMiUyQyUyMCUyMnN0YWdlMyUyMiUyQyUyMCUyMnN0YWdlNCUyMiU1RCUyQyUyMHJlc2hhcGVfaGlkZGVuX3N0YXRlcyUzREZhbHNlKSUwQSUwQWNvbmZpZyUyMCUzRCUyMERQVENvbmZpZyhiYWNrYm9uZV9jb25maWclM0RiYWNrYm9uZV9jb25maWcpJTBBbW9kZWwlMjAlM0QlMjBEUFRGb3JEZXB0aEVzdGltYXRpb24oY29uZmlnJTNEY29uZmlnKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Dinov2Config, DPTConfig, DPTForDepthEstimation | |
| <span class="hljs-comment"># initialize with a Transformer-based backbone such as DINOv2</span> | |
| <span class="hljs-comment"># in that case, we also specify \`reshape_hidden_states=False\` to get feature maps of shape (batch_size, num_channels, height, width)</span> | |
| backbone_config = Dinov2Config.from_pretrained(<span class="hljs-string">"facebook/dinov2-base"</span>, out_features=[<span class="hljs-string">"stage1"</span>, <span class="hljs-string">"stage2"</span>, <span class="hljs-string">"stage3"</span>, <span class="hljs-string">"stage4"</span>], reshape_hidden_states=<span class="hljs-literal">False</span>) | |
| config = DPTConfig(backbone_config=backbone_config) | |
| model = DPTForDepthEstimation(config=config)`,wrap:!1}}),pe=new R({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ue=new R({props:{title:"DPTConfig",local:"transformers.DPTConfig",headingTag:"h2"}}),_e=new x({props:{name:"class transformers.DPTConfig",anchor:"transformers.DPTConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = 384"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"is_hybrid",val:" = False"},{name:"qkv_bias",val:" = True"},{name:"backbone_out_indices",val:" = [2, 5, 8, 11]"},{name:"readout_type",val:" = 'project'"},{name:"reassemble_factors",val:" = [4, 2, 1, 0.5]"},{name:"neck_hidden_sizes",val:" = [96, 192, 384, 768]"},{name:"fusion_hidden_size",val:" = 256"},{name:"head_in_index",val:" = -1"},{name:"use_batch_norm_in_fusion_residual",val:" = False"},{name:"use_bias_in_fusion_residual",val:" = None"},{name:"add_projection",val:" = False"},{name:"use_auxiliary_head",val:" = True"},{name:"auxiliary_loss_weight",val:" = 0.4"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"semantic_classifier_dropout",val:" = 0.1"},{name:"backbone_featmap_shape",val:" = [1, 1024, 24, 24]"},{name:"neck_ignore_stages",val:" = [0, 1]"},{name:"backbone_config",val:" = None"},{name:"backbone",val:" = None"},{name:"use_pretrained_backbone",val:" = False"},{name:"use_timm_backbone",val:" = False"},{name:"backbone_kwargs",val:" = None"},{name:"pooler_output_size",val:" = None"},{name:"pooler_act",val:" = 'tanh'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) — | |
| Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.DPTConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) — | |
| Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.DPTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) — | |
| Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.DPTConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) — | |
| Dimensionality of the “intermediate” (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.DPTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>"gelu"</code>) — | |
| The non-linear activation function (function or string) in the encoder and pooler. If string, <code>"gelu"</code>, | |
| <code>"relu"</code>, <code>"selu"</code> and <code>"gelu_new"</code> are supported.`,name:"hidden_act"},{anchor:"transformers.DPTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.DPTConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.DPTConfig.initializer_range",description:`<strong>initializer_range</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:"initializer_range"},{anchor:"transformers.DPTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) — | |
| The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.DPTConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 384) — | |
| The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.DPTConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — | |
| The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.DPTConfig.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.DPTConfig.is_hybrid",description:`<strong>is_hybrid</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use a hybrid backbone. Useful in the context of loading DPT-Hybrid models.`,name:"is_hybrid"},{anchor:"transformers.DPTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.DPTConfig.backbone_out_indices",description:`<strong>backbone_out_indices</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 5, 8, 11]</code>) — | |
| Indices of the intermediate hidden states to use from backbone.`,name:"backbone_out_indices"},{anchor:"transformers.DPTConfig.readout_type",description:`<strong>readout_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"project"</code>) — | |
| The readout type to use when processing the readout token (CLS token) of the intermediate hidden states of | |
| the ViT backbone. Can be one of [<code>"ignore"</code>, <code>"add"</code>, <code>"project"</code>].</p> | |
| <ul> | |
| <li>“ignore” simply ignores the CLS token.</li> | |
| <li>“add” passes the information from the CLS token to all other tokens by adding the representations.</li> | |
| <li>“project” passes information to the other tokens by concatenating the readout to all other tokens before | |
| projecting the | |
| representation to the original feature dimension D using a linear layer followed by a GELU non-linearity.</li> | |
| </ul>`,name:"readout_type"},{anchor:"transformers.DPTConfig.reassemble_factors",description:`<strong>reassemble_factors</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 1, 0.5]</code>) — | |
| The up/downsampling factors of the reassemble layers.`,name:"reassemble_factors"},{anchor:"transformers.DPTConfig.neck_hidden_sizes",description:`<strong>neck_hidden_sizes</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[96, 192, 384, 768]</code>) — | |
| The hidden sizes to project to for the feature maps of the backbone.`,name:"neck_hidden_sizes"},{anchor:"transformers.DPTConfig.fusion_hidden_size",description:`<strong>fusion_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) — | |
| The number of channels before fusion.`,name:"fusion_hidden_size"},{anchor:"transformers.DPTConfig.head_in_index",description:`<strong>head_in_index</strong> (<code>int</code>, <em>optional</em>, defaults to -1) — | |
| The index of the features to use in the heads.`,name:"head_in_index"},{anchor:"transformers.DPTConfig.use_batch_norm_in_fusion_residual",description:`<strong>use_batch_norm_in_fusion_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use batch normalization in the pre-activate residual units of the fusion blocks.`,name:"use_batch_norm_in_fusion_residual"},{anchor:"transformers.DPTConfig.use_bias_in_fusion_residual",description:`<strong>use_bias_in_fusion_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use bias in the pre-activate residual units of the fusion blocks.`,name:"use_bias_in_fusion_residual"},{anchor:"transformers.DPTConfig.add_projection",description:`<strong>add_projection</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to add a projection layer before the depth estimation head.`,name:"add_projection"},{anchor:"transformers.DPTConfig.use_auxiliary_head",description:`<strong>use_auxiliary_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use an auxiliary head during training.`,name:"use_auxiliary_head"},{anchor:"transformers.DPTConfig.auxiliary_loss_weight",description:`<strong>auxiliary_loss_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.4) — | |
| Weight of the cross-entropy loss of the auxiliary head.`,name:"auxiliary_loss_weight"},{anchor:"transformers.DPTConfig.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) — | |
| The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"},{anchor:"transformers.DPTConfig.semantic_classifier_dropout",description:`<strong>semantic_classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| The dropout ratio for the semantic classification head.`,name:"semantic_classifier_dropout"},{anchor:"transformers.DPTConfig.backbone_featmap_shape",description:`<strong>backbone_featmap_shape</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1024, 24, 24]</code>) — | |
| Used only for the <code>hybrid</code> embedding type. The shape of the feature maps of the backbone.`,name:"backbone_featmap_shape"},{anchor:"transformers.DPTConfig.neck_ignore_stages",description:`<strong>neck_ignore_stages</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0, 1]</code>) — | |
| Used only for the <code>hybrid</code> embedding type. The stages of the readout layers to ignore.`,name:"neck_ignore_stages"},{anchor:"transformers.DPTConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>Union[Dict[str, Any], PretrainedConfig]</code>, <em>optional</em>) — | |
| The configuration of the backbone model. Only used in case <code>is_hybrid</code> is <code>True</code> or in case you want to | |
| leverage the <a href="/docs/transformers/pr_37155/en/main_classes/backbones#transformers.AutoBackbone">AutoBackbone</a> API.`,name:"backbone_config"},{anchor:"transformers.DPTConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>) — | |
| 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.DPTConfig.use_pretrained_backbone",description:`<strong>use_pretrained_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use pretrained weights for the backbone.`,name:"use_pretrained_backbone"},{anchor:"transformers.DPTConfig.use_timm_backbone",description:`<strong>use_timm_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to load <code>backbone</code> from the timm library. If <code>False</code>, the backbone is loaded from the transformers | |
| library.`,name:"use_timm_backbone"},{anchor:"transformers.DPTConfig.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.DPTConfig.pooler_output_size",description:`<strong>pooler_output_size</strong> (<code>int</code>, <em>optional</em>) — | |
| Dimensionality of the pooler layer. If None, defaults to <code>hidden_size</code>.`,name:"pooler_output_size"},{anchor:"transformers.DPTConfig.pooler_act",description:`<strong>pooler_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"tanh"</code>) — | |
| The activation function to be used by the pooler. Keys of ACT2FN are supported for Flax and | |
| Pytorch, and elements of <a href="https://www.tensorflow.org/api_docs/python/tf/keras/activations" rel="nofollow">https://www.tensorflow.org/api_docs/python/tf/keras/activations</a> are | |
| supported for Tensorflow.`,name:"pooler_act"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/configuration_dpt.py#L29"}}),S=new Et({props:{anchor:"transformers.DPTConfig.example",$$slots:{default:[Xo]},$$scope:{ctx:$}}}),be=new x({props:{name:"to_dict",anchor:"transformers.DPTConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/configuration_dpt.py#L282"}}),Te=new R({props:{title:"DPTFeatureExtractor",local:"transformers.DPTFeatureExtractor",headingTag:"h2"}}),ye=new x({props:{name:"class transformers.DPTFeatureExtractor",anchor:"transformers.DPTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/feature_extraction_dpt.py#L26"}}),ve=new x({props:{name:"__call__",anchor:"transformers.DPTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/image_processing_dpt.py#L429"}}),we=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.DPTFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.DPTFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DPTFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) — | |
| List of tuples corresponding to the requested final size (height, width) of each prediction. If unset, | |
| predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/image_processing_dpt.py#L592",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[torch.Tensor]</code> 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>semantic_segmentation</p> | |
| `}}),Me=new R({props:{title:"DPTImageProcessor",local:"transformers.DPTImageProcessor",headingTag:"h2"}}),$e=new x({props:{name:"class transformers.DPTImageProcessor",anchor:"transformers.DPTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"keep_aspect_ratio",val:": bool = False"},{name:"ensure_multiple_of",val:": int = 1"},{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], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": bool = False"},{name:"size_divisor",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to resize the image’s (height, width) dimensions. Can be overidden by <code>do_resize</code> in <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.DPTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{"height" -- 384, "width": 384}</code>): | |
| Size of the image after resizing. Can be overidden by <code>size</code> in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.DPTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) — | |
| Defines the resampling filter to use if resizing the image. Can be overidden by <code>resample</code> in <code>preprocess</code>.`,name:"resample"},{anchor:"transformers.DPTImageProcessor.keep_aspect_ratio",description:`<strong>keep_aspect_ratio</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| If <code>True</code>, the image is resized to the largest possible size such that the aspect ratio is preserved. Can | |
| be overidden by <code>keep_aspect_ratio</code> in <code>preprocess</code>.`,name:"keep_aspect_ratio"},{anchor:"transformers.DPTImageProcessor.ensure_multiple_of",description:`<strong>ensure_multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| If <code>do_resize</code> is <code>True</code>, the image is resized to a size that is a multiple of this value. Can be overidden | |
| by <code>ensure_multiple_of</code> in <code>preprocess</code>.`,name:"ensure_multiple_of"},{anchor:"transformers.DPTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overidden by <code>do_rescale</code> in | |
| <code>preprocess</code>.`,name:"do_rescale"},{anchor:"transformers.DPTImageProcessor.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 overidden by <code>rescale_factor</code> in <code>preprocess</code>.`,name:"rescale_factor"},{anchor:"transformers.DPTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| 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.DPTImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) — | |
| Mean to use if normalizing the image. This is a float or list of floats the length of the number of | |
| channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.DPTImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) — | |
| Standard deviation to use if normalizing the image. This is a float or list of floats the length of the | |
| number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.DPTImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to apply center padding. This was introduced in the DINOv2 paper, which uses the model in | |
| combination with DPT.`,name:"do_pad"},{anchor:"transformers.DPTImageProcessor.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>) — | |
| If <code>do_pad</code> is <code>True</code>, pads the image dimensions to be divisible by this value. This was introduced in the | |
| DINOv2 paper, which uses the model in combination with DPT.`,name:"size_divisor"},{anchor:"transformers.DPTImageProcessor.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is | |
| used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). The | |
| background label will be replaced by 255. Can be overridden by the <code>do_reduce_labels</code> parameter in the | |
| <code>preprocess</code> method.`,name:"do_reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/image_processing_dpt.py#L105"}}),Pe=new x({props:{name:"preprocess",anchor:"transformers.DPTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor'], NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[int] = None"},{name:"keep_aspect_ratio",val:": typing.Optional[bool] = None"},{name:"ensure_multiple_of",val:": typing.Optional[int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"size_divisor",val:": typing.Optional[int] = None"},{name:"do_reduce_labels",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) — | |
| Image 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.DPTImageProcessor.preprocess.segmentation_maps",description:`<strong>segmentation_maps</strong> (<code>ImageInput</code>, <em>optional</em>) — | |
| Segmentation map to preprocess.`,name:"segmentation_maps"},{anchor:"transformers.DPTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) — | |
| Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.DPTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) — | |
| Size of the image after reszing. If <code>keep_aspect_ratio</code> is <code>True</code>, the image is resized to the largest | |
| possible size such that the aspect ratio is preserved. If <code>ensure_multiple_of</code> is set, the image is | |
| resized to a size that is a multiple of this value.`,name:"size"},{anchor:"transformers.DPTImageProcessor.preprocess.keep_aspect_ratio",description:`<strong>keep_aspect_ratio</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.keep_aspect_ratio</code>) — | |
| Whether to keep the aspect ratio of the image. If False, the image will be resized to (size, size). If | |
| True, the image will be resized to keep the aspect ratio and the size will be the maximum possible.`,name:"keep_aspect_ratio"},{anchor:"transformers.DPTImageProcessor.preprocess.ensure_multiple_of",description:`<strong>ensure_multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.ensure_multiple_of</code>) — | |
| Ensure that the image size is a multiple of this value.`,name:"ensure_multiple_of"},{anchor:"transformers.DPTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) — | |
| Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only | |
| has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.DPTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) — | |
| Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.DPTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) — | |
| Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.DPTImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) — | |
| Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.DPTImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) — | |
| Image mean.`,name:"image_mean"},{anchor:"transformers.DPTImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) — | |
| Image standard deviation.`,name:"image_std"},{anchor:"transformers.DPTImageProcessor.preprocess.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_reduce_labels</code>) — | |
| Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 | |
| is used for background, and background itself is not included in all classes of a dataset (e.g. | |
| ADE20k). The background label will be replaced by 255.`,name:"do_reduce_labels"},{anchor:"transformers.DPTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) — | |
| The type of tensors to return. Can be one of:<ul> | |
| <li>Unset: Return a list of <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.TENSORFLOW</code> or <code>'tf'</code>: Return a batch of type <code>tf.Tensor</code>.</li> | |
| <li><code>TensorType.PYTORCH</code> or <code>'pt'</code>: Return a batch of type <code>torch.Tensor</code>.</li> | |
| <li><code>TensorType.NUMPY</code> or <code>'np'</code>: Return a batch of type <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.JAX</code> or <code>'jax'</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li> | |
| </ul>`,name:"return_tensors"},{anchor:"transformers.DPTImageProcessor.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>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.DPTImageProcessor.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"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/image_processing_dpt.py#L434"}}),De=new x({props:{name:"post_process_semantic_segmentation",anchor:"transformers.DPTImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a>) — | |
| Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.DPTImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) — | |
| List of tuples corresponding to the requested final size (height, width) of each prediction. If unset, | |
| predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/image_processing_dpt.py#L592",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[torch.Tensor]</code> 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>semantic_segmentation</p> | |
| `}}),xe=new R({props:{title:"DPTModel",local:"transformers.DPTModel",headingTag:"h2"}}),ke=new x({props:{name:"class transformers.DPTModel",anchor:"transformers.DPTModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.DPTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37155/en/model_doc/vit#transformers.ViTConfig">ViTConfig</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_37155/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_37155/src/transformers/models/dpt/modeling_dpt.py#L897"}}),Ce=new x({props:{name:"forward",anchor:"transformers.DPTModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"head_mask",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.DPTModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_37155/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">DPTImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.DPTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.DPTModel.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.DPTModel.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.DPTModel.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_37155/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_37155/src/transformers/models/dpt/modeling_dpt.py#L933",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.dpt.modeling_dpt.BaseModelOutputWithPoolingAndIntermediateActivations</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_37155/en/model_doc/dpt#transformers.DPTConfig" | |
| >DPTConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><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 model.</p> | |
| </li> | |
| <li> | |
| <p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing | |
| through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns | |
| the classification token after processing through a linear layer and a tanh activation function. The linear | |
| layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p> | |
| </li> | |
| <li> | |
| <p><strong>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, if the model has an embedding layer, + | |
| one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p> | |
| <p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>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>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| <li> | |
| <p><strong>intermediate_activations</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>) — Intermediate activations that can be used to compute hidden states of the model at various layers.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.dpt.modeling_dpt.BaseModelOutputWithPoolingAndIntermediateActivations</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),L=new fo({props:{$$slots:{default:[Ao]},$$scope:{ctx:$}}}),q=new Et({props:{anchor:"transformers.DPTModel.forward.example",$$slots:{default:[Qo]},$$scope:{ctx:$}}}),Ie=new R({props:{title:"DPTForDepthEstimation",local:"transformers.DPTForDepthEstimation",headingTag:"h2"}}),je=new x({props:{name:"class transformers.DPTForDepthEstimation",anchor:"transformers.DPTForDepthEstimation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.DPTForDepthEstimation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37155/en/model_doc/vit#transformers.ViTConfig">ViTConfig</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_37155/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_37155/src/transformers/models/dpt/modeling_dpt.py#L1101"}}),ze=new x({props:{name:"forward",anchor:"transformers.DPTForDepthEstimation.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.DPTForDepthEstimation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_37155/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">DPTImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.DPTForDepthEstimation.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.DPTForDepthEstimation.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.DPTForDepthEstimation.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.DPTForDepthEstimation.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_37155/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DPTForDepthEstimation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) — | |
| Ground truth depth estimation maps for computing the loss.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/modeling_dpt.py#L1126",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37155/en/main_classes/output#transformers.modeling_outputs.DepthEstimatorOutput" | |
| >transformers.modeling_outputs.DepthEstimatorOutput</a> 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_37155/en/model_doc/dpt#transformers.DPTConfig" | |
| >DPTConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>predicted_depth</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, height, width)</code>) — Predicted depth for each pixel.</p> | |
| </li> | |
| <li> | |
| <p><strong>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, if the model has an embedding layer, + | |
| one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p> | |
| <p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>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, patch_size, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37155/en/main_classes/output#transformers.modeling_outputs.DepthEstimatorOutput" | |
| >transformers.modeling_outputs.DepthEstimatorOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),Y=new fo({props:{$$slots:{default:[Oo]},$$scope:{ctx:$}}}),X=new Et({props:{anchor:"transformers.DPTForDepthEstimation.forward.example",$$slots:{default:[Ko]},$$scope:{ctx:$}}}),Ue=new R({props:{title:"DPTForSemanticSegmentation",local:"transformers.DPTForSemanticSegmentation",headingTag:"h2"}}),Je=new x({props:{name:"class transformers.DPTForSemanticSegmentation",anchor:"transformers.DPTForSemanticSegmentation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.DPTForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37155/en/model_doc/vit#transformers.ViTConfig">ViTConfig</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_37155/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_37155/src/transformers/models/dpt/modeling_dpt.py#L1285"}}),Fe=new x({props:{name:"forward",anchor:"transformers.DPTForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.DPTForSemanticSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_37155/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_37155/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">DPTImageProcessor.<strong>call</strong>()</a> | |
| for details.`,name:"pixel_values"},{anchor:"transformers.DPTForSemanticSegmentation.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.DPTForSemanticSegmentation.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.DPTForSemanticSegmentation.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.DPTForSemanticSegmentation.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_37155/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DPTForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) — | |
| Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels > 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_37155/src/transformers/models/dpt/modeling_dpt.py#L1307",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37155/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput" | |
| >transformers.modeling_outputs.SemanticSegmenterOutput</a> 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_37155/en/model_doc/dpt#transformers.DPTConfig" | |
| >DPTConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) — Classification scores for each pixel.</p> | |
| <Tip warning={true}> | |
| <p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is | |
| to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the | |
| original image size as post-processing. You should always check your logits shape and resize as needed.</p> | |
| </Tip> | |
| </li> | |
| <li> | |
| <p><strong>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, if the model has an embedding layer, + | |
| one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p> | |
| <p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>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, patch_size, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37155/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput" | |
| >transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),A=new fo({props:{$$slots:{default:[en]},$$scope:{ctx:$}}}),Q=new Et({props:{anchor:"transformers.DPTForSemanticSegmentation.forward.example",$$slots:{default:[tn]},$$scope:{ctx:$}}}),We=new Yo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/dpt.md"}}),{c(){n=d("meta"),v=s(),m=d("p"),p=s(),h(y.$$.fragment),r=s(),w=d("div"),w.innerHTML=uo,it=s(),h(ne.$$.fragment),lt=s(),se=d("p"),se.innerHTML=_o,dt=s(),ae=d("p"),ae.textContent=bo,ct=s(),re=d("p"),re.innerHTML=To,mt=s(),N=d("img"),pt=s(),ie=d("small"),ie.innerHTML=vo,ht=s(),le=d("p"),le.innerHTML=wo,gt=s(),h(de.$$.fragment),ft=s(),ce=d("p"),ce.innerHTML=Mo,ut=s(),h(me.$$.fragment),_t=s(),h(pe.$$.fragment),bt=s(),he=d("p"),he.textContent=$o,Tt=s(),ge=d("ul"),ge.innerHTML=Po,yt=s(),fe=d("p"),fe.textContent=Do,vt=s(),h(ue.$$.fragment),wt=s(),D=d("div"),h(_e.$$.fragment),Rt=s(),Se=d("p"),Se.innerHTML=xo,Zt=s(),Be=d("p"),Be.innerHTML=ko,Nt=s(),h(S.$$.fragment),St=s(),B=d("div"),h(be.$$.fragment),Bt=s(),Ve=d("p"),Ve.innerHTML=Co,Mt=s(),h(Te.$$.fragment),$t=s(),F=d("div"),h(ye.$$.fragment),Vt=s(),He=d("div"),h(ve.$$.fragment),Ht=s(),V=d("div"),h(we.$$.fragment),Gt=s(),Ge=d("p"),Ge.innerHTML=Io,Pt=s(),h(Me.$$.fragment),Dt=s(),k=d("div"),h($e.$$.fragment),Lt=s(),Le=d("p"),Le.textContent=jo,qt=s(),H=d("div"),h(Pe.$$.fragment),Yt=s(),qe=d("p"),qe.textContent=zo,Xt=s(),G=d("div"),h(De.$$.fragment),At=s(),Ye=d("p"),Ye.innerHTML=Uo,xt=s(),h(xe.$$.fragment),kt=s(),W=d("div"),h(ke.$$.fragment),Qt=s(),Xe=d("p"),Xe.innerHTML=Jo,Ot=s(),z=d("div"),h(Ce.$$.fragment),Kt=s(),Ae=d("p"),Ae.innerHTML=Fo,eo=s(),h(L.$$.fragment),to=s(),h(q.$$.fragment),Ct=s(),h(Ie.$$.fragment),It=s(),C=d("div"),h(je.$$.fragment),oo=s(),Qe=d("p"),Qe.textContent=Wo,no=s(),Oe=d("p"),Oe.innerHTML=Eo,so=s(),U=d("div"),h(ze.$$.fragment),ao=s(),Ke=d("p"),Ke.innerHTML=Ro,ro=s(),h(Y.$$.fragment),io=s(),h(X.$$.fragment),jt=s(),h(Ue.$$.fragment),zt=s(),I=d("div"),h(Je.$$.fragment),lo=s(),et=d("p"),et.textContent=Zo,co=s(),tt=d("p"),tt.innerHTML=No,mo=s(),J=d("div"),h(Fe.$$.fragment),po=s(),ot=d("p"),ot.innerHTML=So,ho=s(),h(A.$$.fragment),go=s(),h(Q.$$.fragment),Ut=s(),h(We.$$.fragment),Jt=s(),st=d("p"),this.h()},l(e){const t=qo("svelte-u9bgzb",document.head);n=c(t,"META",{name:!0,content:!0}),t.forEach(o),v=a(e),m=c(e,"P",{}),P(m).forEach(o),p=a(e),g(y.$$.fragment,e),r=a(e),w=c(e,"DIV",{class:!0,"data-svelte-h":!0}),T(w)!=="svelte-b95w5j"&&(w.innerHTML=uo),it=a(e),g(ne.$$.fragment,e),lt=a(e),se=c(e,"P",{"data-svelte-h":!0}),T(se)!=="svelte-19gxegr"&&(se.innerHTML=_o),dt=a(e),ae=c(e,"P",{"data-svelte-h":!0}),T(ae)!=="svelte-vfdo9a"&&(ae.textContent=bo),ct=a(e),re=c(e,"P",{"data-svelte-h":!0}),T(re)!=="svelte-17tgro5"&&(re.innerHTML=To),mt=a(e),N=c(e,"IMG",{src:!0,alt:!0,width:!0}),pt=a(e),ie=c(e,"SMALL",{"data-svelte-h":!0}),T(ie)!=="svelte-6ly4vl"&&(ie.innerHTML=vo),ht=a(e),le=c(e,"P",{"data-svelte-h":!0}),T(le)!=="svelte-d1d7zy"&&(le.innerHTML=wo),gt=a(e),g(de.$$.fragment,e),ft=a(e),ce=c(e,"P",{"data-svelte-h":!0}),T(ce)!=="svelte-oqc63x"&&(ce.innerHTML=Mo),ut=a(e),g(me.$$.fragment,e),_t=a(e),g(pe.$$.fragment,e),bt=a(e),he=c(e,"P",{"data-svelte-h":!0}),T(he)!=="svelte-1b0rfkj"&&(he.textContent=$o),Tt=a(e),ge=c(e,"UL",{"data-svelte-h":!0}),T(ge)!=="svelte-wghqgw"&&(ge.innerHTML=Po),yt=a(e),fe=c(e,"P",{"data-svelte-h":!0}),T(fe)!=="svelte-1xesile"&&(fe.textContent=Do),vt=a(e),g(ue.$$.fragment,e),wt=a(e),D=c(e,"DIV",{class:!0});var j=P(D);g(_e.$$.fragment,j),Rt=a(j),Se=c(j,"P",{"data-svelte-h":!0}),T(Se)!=="svelte-dwlnvs"&&(Se.innerHTML=xo),Zt=a(j),Be=c(j,"P",{"data-svelte-h":!0}),T(Be)!=="svelte-xoz6un"&&(Be.innerHTML=ko),Nt=a(j),g(S.$$.fragment,j),St=a(j),B=c(j,"DIV",{class:!0});var Ee=P(B);g(be.$$.fragment,Ee),Bt=a(Ee),Ve=c(Ee,"P",{"data-svelte-h":!0}),T(Ve)!=="svelte-wzyecx"&&(Ve.innerHTML=Co),Ee.forEach(o),j.forEach(o),Mt=a(e),g(Te.$$.fragment,e),$t=a(e),F=c(e,"DIV",{class:!0});var Z=P(F);g(ye.$$.fragment,Z),Vt=a(Z),He=c(Z,"DIV",{class:!0});var at=P(He);g(ve.$$.fragment,at),at.forEach(o),Ht=a(Z),V=c(Z,"DIV",{class:!0});var Re=P(V);g(we.$$.fragment,Re),Gt=a(Re),Ge=c(Re,"P",{"data-svelte-h":!0}),T(Ge)!=="svelte-364i6x"&&(Ge.innerHTML=Io),Re.forEach(o),Z.forEach(o),Pt=a(e),g(Me.$$.fragment,e),Dt=a(e),k=c(e,"DIV",{class:!0});var E=P(k);g($e.$$.fragment,E),Lt=a(E),Le=c(E,"P",{"data-svelte-h":!0}),T(Le)!=="svelte-oc8yhy"&&(Le.textContent=jo),qt=a(E),H=c(E,"DIV",{class:!0});var Ze=P(H);g(Pe.$$.fragment,Ze),Yt=a(Ze),qe=c(Ze,"P",{"data-svelte-h":!0}),T(qe)!=="svelte-1x3yxsa"&&(qe.textContent=zo),Ze.forEach(o),Xt=a(E),G=c(E,"DIV",{class:!0});var Wt=P(G);g(De.$$.fragment,Wt),At=a(Wt),Ye=c(Wt,"P",{"data-svelte-h":!0}),T(Ye)!=="svelte-364i6x"&&(Ye.innerHTML=Uo),Wt.forEach(o),E.forEach(o),xt=a(e),g(xe.$$.fragment,e),kt=a(e),W=c(e,"DIV",{class:!0});var nt=P(W);g(ke.$$.fragment,nt),Qt=a(nt),Xe=c(nt,"P",{"data-svelte-h":!0}),T(Xe)!=="svelte-s1wkj9"&&(Xe.innerHTML=Jo),Ot=a(nt),z=c(nt,"DIV",{class:!0});var O=P(z);g(Ce.$$.fragment,O),Kt=a(O),Ae=c(O,"P",{"data-svelte-h":!0}),T(Ae)!=="svelte-16jotok"&&(Ae.innerHTML=Fo),eo=a(O),g(L.$$.fragment,O),to=a(O),g(q.$$.fragment,O),O.forEach(o),nt.forEach(o),Ct=a(e),g(Ie.$$.fragment,e),It=a(e),C=c(e,"DIV",{class:!0});var K=P(C);g(je.$$.fragment,K),oo=a(K),Qe=c(K,"P",{"data-svelte-h":!0}),T(Qe)!=="svelte-1w35xhv"&&(Qe.textContent=Wo),no=a(K),Oe=c(K,"P",{"data-svelte-h":!0}),T(Oe)!=="svelte-1gjh92c"&&(Oe.innerHTML=Eo),so=a(K),U=c(K,"DIV",{class:!0});var ee=P(U);g(ze.$$.fragment,ee),ao=a(ee),Ke=c(ee,"P",{"data-svelte-h":!0}),T(Ke)!=="svelte-13jftay"&&(Ke.innerHTML=Ro),ro=a(ee),g(Y.$$.fragment,ee),io=a(ee),g(X.$$.fragment,ee),ee.forEach(o),K.forEach(o),jt=a(e),g(Ue.$$.fragment,e),zt=a(e),I=c(e,"DIV",{class:!0});var te=P(I);g(Je.$$.fragment,te),lo=a(te),et=c(te,"P",{"data-svelte-h":!0}),T(et)!=="svelte-a7kv1k"&&(et.textContent=Zo),co=a(te),tt=c(te,"P",{"data-svelte-h":!0}),T(tt)!=="svelte-1gjh92c"&&(tt.innerHTML=No),mo=a(te),J=c(te,"DIV",{class:!0});var oe=P(J);g(Fe.$$.fragment,oe),po=a(oe),ot=c(oe,"P",{"data-svelte-h":!0}),T(ot)!=="svelte-46qz2w"&&(ot.innerHTML=So),ho=a(oe),g(A.$$.fragment,oe),go=a(oe),g(Q.$$.fragment,oe),oe.forEach(o),te.forEach(o),Ut=a(e),g(We.$$.fragment,e),Jt=a(e),st=c(e,"P",{}),P(st).forEach(o),this.h()},h(){M(n,"name","hf:doc:metadata"),M(n,"content",nn),M(w,"class","flex flex-wrap space-x-1"),Vo(N.src,yo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/dpt_architecture.jpg")||M(N,"src",yo),M(N,"alt","drawing"),M(N,"width","600"),M(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(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(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){l(document.head,n),i(e,v,t),i(e,m,t),i(e,p,t),f(y,e,t),i(e,r,t),i(e,w,t),i(e,it,t),f(ne,e,t),i(e,lt,t),i(e,se,t),i(e,dt,t),i(e,ae,t),i(e,ct,t),i(e,re,t),i(e,mt,t),i(e,N,t),i(e,pt,t),i(e,ie,t),i(e,ht,t),i(e,le,t),i(e,gt,t),f(de,e,t),i(e,ft,t),i(e,ce,t),i(e,ut,t),f(me,e,t),i(e,_t,t),f(pe,e,t),i(e,bt,t),i(e,he,t),i(e,Tt,t),i(e,ge,t),i(e,yt,t),i(e,fe,t),i(e,vt,t),f(ue,e,t),i(e,wt,t),i(e,D,t),f(_e,D,null),l(D,Rt),l(D,Se),l(D,Zt),l(D,Be),l(D,Nt),f(S,D,null),l(D,St),l(D,B),f(be,B,null),l(B,Bt),l(B,Ve),i(e,Mt,t),f(Te,e,t),i(e,$t,t),i(e,F,t),f(ye,F,null),l(F,Vt),l(F,He),f(ve,He,null),l(F,Ht),l(F,V),f(we,V,null),l(V,Gt),l(V,Ge),i(e,Pt,t),f(Me,e,t),i(e,Dt,t),i(e,k,t),f($e,k,null),l(k,Lt),l(k,Le),l(k,qt),l(k,H),f(Pe,H,null),l(H,Yt),l(H,qe),l(k,Xt),l(k,G),f(De,G,null),l(G,At),l(G,Ye),i(e,xt,t),f(xe,e,t),i(e,kt,t),i(e,W,t),f(ke,W,null),l(W,Qt),l(W,Xe),l(W,Ot),l(W,z),f(Ce,z,null),l(z,Kt),l(z,Ae),l(z,eo),f(L,z,null),l(z,to),f(q,z,null),i(e,Ct,t),f(Ie,e,t),i(e,It,t),i(e,C,t),f(je,C,null),l(C,oo),l(C,Qe),l(C,no),l(C,Oe),l(C,so),l(C,U),f(ze,U,null),l(U,ao),l(U,Ke),l(U,ro),f(Y,U,null),l(U,io),f(X,U,null),i(e,jt,t),f(Ue,e,t),i(e,zt,t),i(e,I,t),f(Je,I,null),l(I,lo),l(I,et),l(I,co),l(I,tt),l(I,mo),l(I,J),f(Fe,J,null),l(J,po),l(J,ot),l(J,ho),f(A,J,null),l(J,go),f(Q,J,null),i(e,Ut,t),f(We,e,t),i(e,Jt,t),i(e,st,t),Ft=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),S.$set(j);const Ee={};t&2&&(Ee.$$scope={dirty:t,ctx:e}),L.$set(Ee);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),q.$set(Z);const at={};t&2&&(at.$$scope={dirty:t,ctx:e}),Y.$set(at);const Re={};t&2&&(Re.$$scope={dirty:t,ctx:e}),X.$set(Re);const E={};t&2&&(E.$$scope={dirty:t,ctx:e}),A.$set(E);const Ze={};t&2&&(Ze.$$scope={dirty:t,ctx:e}),Q.$set(Ze)},i(e){Ft||(u(y.$$.fragment,e),u(ne.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(pe.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(S.$$.fragment,e),u(be.$$.fragment,e),u(Te.$$.fragment,e),u(ye.$$.fragment,e),u(ve.$$.fragment,e),u(we.$$.fragment,e),u(Me.$$.fragment,e),u($e.$$.fragment,e),u(Pe.$$.fragment,e),u(De.$$.fragment,e),u(xe.$$.fragment,e),u(ke.$$.fragment,e),u(Ce.$$.fragment,e),u(L.$$.fragment,e),u(q.$$.fragment,e),u(Ie.$$.fragment,e),u(je.$$.fragment,e),u(ze.$$.fragment,e),u(Y.$$.fragment,e),u(X.$$.fragment,e),u(Ue.$$.fragment,e),u(Je.$$.fragment,e),u(Fe.$$.fragment,e),u(A.$$.fragment,e),u(Q.$$.fragment,e),u(We.$$.fragment,e),Ft=!0)},o(e){_(y.$$.fragment,e),_(ne.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(S.$$.fragment,e),_(be.$$.fragment,e),_(Te.$$.fragment,e),_(ye.$$.fragment,e),_(ve.$$.fragment,e),_(we.$$.fragment,e),_(Me.$$.fragment,e),_($e.$$.fragment,e),_(Pe.$$.fragment,e),_(De.$$.fragment,e),_(xe.$$.fragment,e),_(ke.$$.fragment,e),_(Ce.$$.fragment,e),_(L.$$.fragment,e),_(q.$$.fragment,e),_(Ie.$$.fragment,e),_(je.$$.fragment,e),_(ze.$$.fragment,e),_(Y.$$.fragment,e),_(X.$$.fragment,e),_(Ue.$$.fragment,e),_(Je.$$.fragment,e),_(Fe.$$.fragment,e),_(A.$$.fragment,e),_(Q.$$.fragment,e),_(We.$$.fragment,e),Ft=!1},d(e){e&&(o(v),o(m),o(p),o(r),o(w),o(it),o(lt),o(se),o(dt),o(ae),o(ct),o(re),o(mt),o(N),o(pt),o(ie),o(ht),o(le),o(gt),o(ft),o(ce),o(ut),o(_t),o(bt),o(he),o(Tt),o(ge),o(yt),o(fe),o(vt),o(wt),o(D),o(Mt),o($t),o(F),o(Pt),o(Dt),o(k),o(xt),o(kt),o(W),o(Ct),o(It),o(C),o(jt),o(zt),o(I),o(Ut),o(Jt),o(st)),o(n),b(y,e),b(ne,e),b(de,e),b(me,e),b(pe,e),b(ue,e),b(_e),b(S),b(be),b(Te,e),b(ye),b(ve),b(we),b(Me,e),b($e),b(Pe),b(De),b(xe,e),b(ke),b(Ce),b(L),b(q),b(Ie,e),b(je),b(ze),b(Y),b(X),b(Ue,e),b(Je),b(Fe),b(A),b(Q),b(We,e)}}}const nn='{"title":"DPT","local":"dpt","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"DPTConfig","local":"transformers.DPTConfig","sections":[],"depth":2},{"title":"DPTFeatureExtractor","local":"transformers.DPTFeatureExtractor","sections":[],"depth":2},{"title":"DPTImageProcessor","local":"transformers.DPTImageProcessor","sections":[],"depth":2},{"title":"DPTModel","local":"transformers.DPTModel","sections":[],"depth":2},{"title":"DPTForDepthEstimation","local":"transformers.DPTForDepthEstimation","sections":[],"depth":2},{"title":"DPTForSemanticSegmentation","local":"transformers.DPTForSemanticSegmentation","sections":[],"depth":2}],"depth":1}';function sn($){return Ho(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hn extends Go{constructor(n){super(),Lo(this,n,sn,on,Bo,{})}}export{hn as component}; | |
Xet Storage Details
- Size:
- 87.1 kB
- Xet hash:
- d0fe2a4622be0ee427fc6fb5499dcbffac000d50b403c1e338ec7ba3387103e4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.