import{S as Lr,i as Hr,s as Yr,e as n,k as d,w as b,t as r,M as Xr,c as s,d as o,m,a,x as T,h as i,b as c,N as Qr,G as e,g as f,y,q as w,o as P,B as D,v as Or,L as vn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Sa}from"../../chunks/Tip-hf-doc-builder.js";import{D as I}from"../../chunks/Docstring-hf-doc-builder.js";import{C as bn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _n}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Kr(M){let h,$,_,u,v;return u=new bn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQVE1vZGVsJTJDJTIwRFBUQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMERQVCUyMGRwdC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBEUFRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBkcHQtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMERQVE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPTModel, DPTConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DPT dpt-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DPTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the dpt-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPTModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=n("p"),$=r("Example:"),_=d(),b(u.$$.fragment)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Example:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,$),f(l,_,g),y(u,l,g),v=!0},p:vn,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),D(u,l)}}}function ei(M){let h,$,_,u,v;return{c(){h=n("p"),$=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),u=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var k=a(_);u=i(k,"Module"),k.forEach(o),v=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){f(l,h,g),e(h,$),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function ti(M){let h,$,_,u,v;return u=new bn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMERQVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPTModel.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">577</span>, <span class="hljs-number">1024</span>]`}}),{c(){h=n("p"),$=r("Example:"),_=d(),b(u.$$.fragment)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Example:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,$),f(l,_,g),y(u,l,g),v=!0},p:vn,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),D(u,l)}}}function oi(M){let h,$,_,u,v;return{c(){h=n("p"),$=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),u=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var k=a(_);u=i(k,"Module"),k.forEach(o),v=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){f(l,h,g),e(h,$),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function ni(M){let h,$,_,u,v;return u=new bn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVEZvckRlcHRoRXN0aW1hdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMERQVEZvckRlcHRoRXN0aW1hdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZkcHQtbGFyZ2UlMjIpJTBBJTBBJTIzJTIwcHJlcGFyZSUyMGltYWdlJTIwZm9yJTIwdGhlJTIwbW9kZWwlMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTIwJTIwJTIwJTIwcHJlZGljdGVkX2RlcHRoJTIwJTNEJTIwb3V0cHV0cy5wcmVkaWN0ZWRfZGVwdGglMEElMEElMjMlMjBpbnRlcnBvbGF0ZSUyMHRvJTIwb3JpZ2luYWwlMjBzaXplJTBBcHJlZGljdGlvbiUyMCUzRCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwuaW50ZXJwb2xhdGUoJTBBJTIwJTIwJTIwJTIwcHJlZGljdGVkX2RlcHRoLnVuc3F1ZWV6ZSgxKSUyQyUwQSUyMCUyMCUyMCUyMHNpemUlM0RpbWFnZS5zaXplJTVCJTNBJTNBLTElNUQlMkMlMEElMjAlMjAlMjAlMjBtb2RlJTNEJTIyYmljdWJpYyUyMiUyQyUwQSUyMCUyMCUyMCUyMGFsaWduX2Nvcm5lcnMlM0RGYWxzZSUyQyUwQSklMEElMEElMjMlMjB2aXN1YWxpemUlMjB0aGUlMjBwcmVkaWN0aW9uJTBBb3V0cHV0JTIwJTNEJTIwcHJlZGljdGlvbi5zcXVlZXplKCkuY3B1KCkubnVtcHkoKSUwQWZvcm1hdHRlZCUyMCUzRCUyMChvdXRwdXQlMjAqJTIwMjU1JTIwJTJGJTIwbnAubWF4KG91dHB1dCkpLmFzdHlwZSglMjJ1aW50OCUyMiklMEFkZXB0aCUyMCUzRCUyMEltYWdlLmZyb21hcnJheShmb3JtYXR0ZWQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTForDepthEstimation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPTForDepthEstimation.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">... </span>    predicted_depth = outputs.predicted_depth

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># interpolate to original size</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prediction = torch.nn.functional.interpolate(
<span class="hljs-meta">... </span>    predicted_depth.unsqueeze(<span class="hljs-number">1</span>),
<span class="hljs-meta">... </span>    size=image.size[::-<span class="hljs-number">1</span>],
<span class="hljs-meta">... </span>    mode=<span class="hljs-string">&quot;bicubic&quot;</span>,
<span class="hljs-meta">... </span>    align_corners=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># visualize the prediction</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output = prediction.squeeze().cpu().numpy()
<span class="hljs-meta">&gt;&gt;&gt; </span>formatted = (output * <span class="hljs-number">255</span> / np.<span class="hljs-built_in">max</span>(output)).astype(<span class="hljs-string">&quot;uint8&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>depth = Image.fromarray(formatted)`}}),{c(){h=n("p"),$=r("Examples:"),_=d(),b(u.$$.fragment)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Examples:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,$),f(l,_,g),y(u,l,g),v=!0},p:vn,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),D(u,l)}}}function si(M){let h,$,_,u,v;return{c(){h=n("p"),$=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),u=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var k=a(_);u=i(k,"Module"),k.forEach(o),v=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){f(l,h,g),e(h,$),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function ai(M){let h,$,_,u,v;return u=new bn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERQVEZvclNlbWFudGljU2VnbWVudGF0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJJbnRlbCUyRmRwdC1sYXJnZS1hZGUlMjIpJTBBbW9kZWwlMjAlM0QlMjBEUFRGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZkcHQtbGFyZ2UtYWRlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DPTForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large-ade&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPTForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;Intel/dpt-large-ade&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){h=n("p"),$=r("Examples:"),_=d(),b(u.$$.fragment)},l(l){h=s(l,"P",{});var g=a(h);$=i(g,"Examples:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,$),f(l,_,g),y(u,l,g),v=!0},p:vn,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),D(u,l)}}}function ri(M){let h,$,_,u,v,l,g,k,Tn,ko,A,se,Gt,je,yn,qt,wn,Io,R,Pn,Ce,Dn,$n,gt,Mn,En,xo,_t,kn,zo,vt,Lt,In,jo,ae,Ua,Co,re,xn,Je,zn,jn,Jo,W,Cn,Fe,Jn,Fn,Se,Sn,Un,Fo,B,ie,Ht,Ue,Rn,Yt,Wn,So,bt,Nn,Uo,N,Xt,V,Zn,Tt,An,Bn,Re,Vn,Gn,qn,Qt,Ot,yt,Ln,Hn,Kt,eo,wt,Yn,Ro,Pt,Xn,Wo,G,le,to,We,Qn,oo,On,No,E,Ne,Kn,q,es,Dt,ts,os,Ze,ns,ss,as,L,rs,$t,is,ls,Mt,cs,ds,ms,ce,ps,de,Ae,hs,H,fs,Et,us,gs,no,_s,vs,Zo,Y,me,so,Be,bs,ao,Ts,Ao,S,Ve,ys,pe,Ge,ws,ro,Ps,Ds,he,qe,$s,Le,Ms,kt,Es,ks,Bo,X,fe,io,He,Is,lo,xs,Vo,x,Ye,zs,co,js,Cs,ue,Xe,Js,mo,Fs,Ss,ge,Qe,Us,Oe,Rs,It,Ws,Ns,Go,Q,_e,po,Ke,Zs,ho,As,qo,U,et,Bs,tt,Vs,ot,Gs,qs,Ls,C,nt,Hs,O,Ys,xt,Xs,Qs,fo,Os,Ks,ea,ve,ta,be,Lo,K,Te,uo,st,oa,go,na,Ho,z,at,sa,_o,aa,ra,rt,ia,it,la,ca,da,J,lt,ma,ee,pa,zt,ha,fa,vo,ua,ga,_a,ye,va,we,Yo,te,Pe,bo,ct,ba,To,Ta,Xo,j,dt,ya,yo,wa,Pa,mt,Da,pt,$a,Ma,Ea,F,ht,ka,oe,Ia,jt,xa,za,wo,ja,Ca,Ja,De,Fa,$e,Qo;return l=new ne({}),je=new ne({}),Ue=new ne({}),We=new ne({}),Ne=new I({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_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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
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) &#x2014;
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) &#x2014;
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) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (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>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</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.1) &#x2014;
The dropout probabilitiy 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.1) &#x2014;
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) &#x2014;
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) &#x2014;
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) &#x2014;
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) &#x2014;
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) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.DPTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
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>) &#x2014;
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>&quot;project&quot;</code>) &#x2014;
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>&quot;ignore&quot;</code>, <code>&quot;add&quot;</code>, <code>&quot;project&quot;</code>].</p>
<ul>
<li>&#x201C;ignore&#x201D; simply ignores the CLS token.</li>
<li>&#x201C;add&#x201D; passes the information from the CLS token to all other tokens by adding the representations.</li>
<li>&#x201C;project&#x201D; 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.is_hybrid",description:`<strong>is_hybrid</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a hybrid backbone. Useful in the context of loading DPT-Hybrid models.`,name:"is_hybrid"},{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>) &#x2014;
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 [96, 192, 384, 768]) &#x2014;
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) &#x2014;
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) &#x2014;
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>) &#x2014;
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_auxiliary_head",description:`<strong>use_auxiliary_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
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) &#x2014;
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) &#x2014;
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) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
Used only for the <code>hybrid</code> embedding type. The configuration of the backbone in a dictionary.`,name:"backbone_config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/configuration_dpt.py#L32"}}),ce=new _n({props:{anchor:"transformers.DPTConfig.example",$$slots:{default:[Kr]},$$scope:{ctx:M}}}),Ae=new I({props:{name:"to_dict",anchor:"transformers.DPTConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/configuration_dpt.py#L220"}}),Be=new ne({}),Ve=new I({props:{name:"class transformers.DPTFeatureExtractor",anchor:"transformers.DPTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/feature_extraction_dpt.py#L26"}}),Ge=new I({props:{name:"__call__",anchor:"transformers.DPTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/image_processing_utils.py#L544"}}),qe=new I({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/v4.33.0/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a>) &#x2014;
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>) &#x2014;
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/v4.33.0/src/transformers/models/dpt/image_processing_dpt.py#L346",returnDescription:`
<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:`
<p>semantic_segmentation</p>
`}}),He=new ne({}),Ye=new I({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.BILINEAR: 2>"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;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>{&quot;height&quot; -- 384, &quot;width&quot;: 384}</code>):
Size of the image after resizing. Can be overidden by <code>size</code> in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.DPTImageProcessor.keep_aspect_ratio",description:`<strong>keep_aspect_ratio</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
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) &#x2014;
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.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
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.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/image_processing_dpt.py#L94"}}),Xe=new I({props:{name:"preprocess",anchor:"transformers.DPTImageProcessor.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:"do_resize",val:": bool = None"},{name:"size",val:": int = None"},{name:"keep_aspect_ratio",val:": bool = None"},{name:"ensure_multiple_of",val:": int = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": 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:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
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.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.DPTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.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>) &#x2014;
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>) &#x2014;
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>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/image_processing_dpt.py#L211"}}),Qe=new I({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/v4.33.0/en/model_doc/dpt#transformers.DPTForSemanticSegmentation">DPTForSemanticSegmentation</a>) &#x2014;
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>) &#x2014;
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/v4.33.0/src/transformers/models/dpt/image_processing_dpt.py#L346",returnDescription:`
<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:`
<p>semantic_segmentation</p>
`}}),Ke=new ne({}),et=new I({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/v4.33.0/en/model_doc/vit#transformers.ViTConfig">ViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L864"}}),nt=new I({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>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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>) &#x2014;
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>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DPTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DPTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L896",returnDescription:`
<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/v4.33.0/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 Intermediate activations that can be used to compute hidden states of the model at various layers.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpt.modeling_dpt.BaseModelOutputWithPoolingAndIntermediateActivations</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new Sa({props:{$$slots:{default:[ei]},$$scope:{ctx:M}}}),be=new _n({props:{anchor:"transformers.DPTModel.forward.example",$$slots:{default:[ti]},$$scope:{ctx:M}}}),st=new ne({}),at=new I({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/v4.33.0/en/model_doc/vit#transformers.ViTConfig">ViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L1052"}}),lt=new I({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>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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>) &#x2014;
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>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DPTForDepthEstimation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DPTForDepthEstimation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/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>) &#x2014;
Ground truth depth estimation maps for computing the loss.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L1067",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/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/v4.33.0/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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.DepthEstimatorOutput"
>transformers.modeling_outputs.DepthEstimatorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new Sa({props:{$$slots:{default:[oi]},$$scope:{ctx:M}}}),we=new _n({props:{anchor:"transformers.DPTForDepthEstimation.forward.example",$$slots:{default:[ni]},$$scope:{ctx:M}}}),ct=new ne({}),dt=new I({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/v4.33.0/en/model_doc/vit#transformers.ViTConfig">ViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L1220"}}),ht=new I({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>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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>) &#x2014;
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>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DPTForSemanticSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DPTForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/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>) &#x2014;
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 &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/dpt/modeling_dpt.py#L1236",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/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/v4.33.0/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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new Sa({props:{$$slots:{default:[si]},$$scope:{ctx:M}}}),$e=new _n({props:{anchor:"transformers.DPTForSemanticSegmentation.forward.example",$$slots:{default:[ai]},$$scope:{ctx:M}}}),{c(){h=n("meta"),$=d(),_=n("h1"),u=n("a"),v=n("span"),b(l.$$.fragment),g=d(),k=n("span"),Tn=r("DPT"),ko=d(),A=n("h2"),se=n("a"),Gt=n("span"),b(je.$$.fragment),yn=d(),qt=n("span"),wn=r("Overview"),Io=d(),R=n("p"),Pn=r("The DPT model was proposed in "),Ce=n("a"),Dn=r("Vision Transformers for Dense Prediction"),$n=r(` by Ren\xE9 Ranftl, Alexey Bochkovskiy, Vladlen Koltun.
DPT is a model that leverages the `),gt=n("a"),Mn=r("Vision Transformer (ViT)"),En=r(" as backbone for dense prediction tasks like semantic segmentation and depth estimation."),xo=d(),_t=n("p"),kn=r("The abstract from the paper is the following:"),zo=d(),vt=n("p"),Lt=n("em"),In=r("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."),jo=d(),ae=n("img"),Co=d(),re=n("small"),xn=r("DPT architecture. Taken from the "),Je=n("a"),zn=r("original paper"),jn=r("."),Jo=d(),W=n("p"),Cn=r("This model was contributed by "),Fe=n("a"),Jn=r("nielsr"),Fn=r(". The original code can be found "),Se=n("a"),Sn=r("here"),Un=r("."),Fo=d(),B=n("h2"),ie=n("a"),Ht=n("span"),b(Ue.$$.fragment),Rn=d(),Yt=n("span"),Wn=r("Resources"),So=d(),bt=n("p"),Nn=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DPT."),Uo=d(),N=n("ul"),Xt=n("li"),V=n("p"),Zn=r("Demo notebooks for "),Tt=n("a"),An=r("DPTForDepthEstimation"),Bn=r(" can be found "),Re=n("a"),Vn=r("here"),Gn=r("."),qn=d(),Qt=n("li"),Ot=n("p"),yt=n("a"),Ln=r("Semantic segmentation task guide"),Hn=d(),Kt=n("li"),eo=n("p"),wt=n("a"),Yn=r("Monocular depth estimation task guide"),Ro=d(),Pt=n("p"),Xn=r("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Wo=d(),G=n("h2"),le=n("a"),to=n("span"),b(We.$$.fragment),Qn=d(),oo=n("span"),On=r("DPTConfig"),No=d(),E=n("div"),b(Ne.$$.fragment),Kn=d(),q=n("p"),es=r("This is the configuration class to store the configuration of a "),Dt=n("a"),ts=r("DPTModel"),os=r(`. 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
`),Ze=n("a"),ns=r("Intel/dpt-large"),ss=r(" architecture."),as=d(),L=n("p"),rs=r("Configuration objects inherit from "),$t=n("a"),is=r("PretrainedConfig"),ls=r(` and can be used to control the model outputs. Read the
documentation from `),Mt=n("a"),cs=r("PretrainedConfig"),ds=r(" for more information."),ms=d(),b(ce.$$.fragment),ps=d(),de=n("div"),b(Ae.$$.fragment),hs=d(),H=n("p"),fs=r("Serializes this instance to a Python dictionary. Override the default "),Et=n("a"),us=r("to_dict()"),gs=r(`. Returns:
`),no=n("code"),_s=r("Dict[str, any]"),vs=r(": Dictionary of all the attributes that make up this configuration instance,"),Zo=d(),Y=n("h2"),me=n("a"),so=n("span"),b(Be.$$.fragment),bs=d(),ao=n("span"),Ts=r("DPTFeatureExtractor"),Ao=d(),S=n("div"),b(Ve.$$.fragment),ys=d(),pe=n("div"),b(Ge.$$.fragment),ws=d(),ro=n("p"),Ps=r("Preprocess an image or a batch of images."),Ds=d(),he=n("div"),b(qe.$$.fragment),$s=d(),Le=n("p"),Ms=r("Converts the output of "),kt=n("a"),Es=r("DPTForSemanticSegmentation"),ks=r(" into semantic segmentation maps. Only supports PyTorch."),Bo=d(),X=n("h2"),fe=n("a"),io=n("span"),b(He.$$.fragment),Is=d(),lo=n("span"),xs=r("DPTImageProcessor"),Vo=d(),x=n("div"),b(Ye.$$.fragment),zs=d(),co=n("p"),js=r("Constructs a DPT image processor."),Cs=d(),ue=n("div"),b(Xe.$$.fragment),Js=d(),mo=n("p"),Fs=r("Preprocess an image or batch of images."),Ss=d(),ge=n("div"),b(Qe.$$.fragment),Us=d(),Oe=n("p"),Rs=r("Converts the output of "),It=n("a"),Ws=r("DPTForSemanticSegmentation"),Ns=r(" into semantic segmentation maps. Only supports PyTorch."),Go=d(),Q=n("h2"),_e=n("a"),po=n("span"),b(Ke.$$.fragment),Zs=d(),ho=n("span"),As=r("DPTModel"),qo=d(),U=n("div"),b(et.$$.fragment),Bs=d(),tt=n("p"),Vs=r(`The bare DPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ot=n("a"),Gs=r("torch.nn.Module"),qs=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls=d(),C=n("div"),b(nt.$$.fragment),Hs=d(),O=n("p"),Ys=r("The "),xt=n("a"),Xs=r("DPTModel"),Qs=r(" forward method, overrides the "),fo=n("code"),Os=r("__call__"),Ks=r(" special method."),ea=d(),b(ve.$$.fragment),ta=d(),b(be.$$.fragment),Lo=d(),K=n("h2"),Te=n("a"),uo=n("span"),b(st.$$.fragment),oa=d(),go=n("span"),na=r("DPTForDepthEstimation"),Ho=d(),z=n("div"),b(at.$$.fragment),sa=d(),_o=n("p"),aa=r("DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2."),ra=d(),rt=n("p"),ia=r("This model is a PyTorch "),it=n("a"),la=r("torch.nn.Module"),ca=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),da=d(),J=n("div"),b(lt.$$.fragment),ma=d(),ee=n("p"),pa=r("The "),zt=n("a"),ha=r("DPTForDepthEstimation"),fa=r(" forward method, overrides the "),vo=n("code"),ua=r("__call__"),ga=r(" special method."),_a=d(),b(ye.$$.fragment),va=d(),b(we.$$.fragment),Yo=d(),te=n("h2"),Pe=n("a"),bo=n("span"),b(ct.$$.fragment),ba=d(),To=n("span"),Ta=r("DPTForSemanticSegmentation"),Xo=d(),j=n("div"),b(dt.$$.fragment),ya=d(),yo=n("p"),wa=r("DPT Model with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Pa=d(),mt=n("p"),Da=r("This model is a PyTorch "),pt=n("a"),$a=r("torch.nn.Module"),Ma=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ea=d(),F=n("div"),b(ht.$$.fragment),ka=d(),oe=n("p"),Ia=r("The "),jt=n("a"),xa=r("DPTForSemanticSegmentation"),za=r(" forward method, overrides the "),wo=n("code"),ja=r("__call__"),Ca=r(" special method."),Ja=d(),b(De.$$.fragment),Fa=d(),b($e.$$.fragment),this.h()},l(t){const p=Xr('[data-svelte="svelte-1phssyn"]',document.head);h=s(p,"META",{name:!0,content:!0}),p.forEach(o),$=m(t),_=s(t,"H1",{class:!0});var ft=a(_);u=s(ft,"A",{id:!0,class:!0,href:!0});var Po=a(u);v=s(Po,"SPAN",{});var Do=a(v);T(l.$$.fragment,Do),Do.forEach(o),Po.forEach(o),g=m(ft),k=s(ft,"SPAN",{});var $o=a(k);Tn=i($o,"DPT"),$o.forEach(o),ft.forEach(o),ko=m(t),A=s(t,"H2",{class:!0});var ut=a(A);se=s(ut,"A",{id:!0,class:!0,href:!0});var Mo=a(se);Gt=s(Mo,"SPAN",{});var Eo=a(Gt);T(je.$$.fragment,Eo),Eo.forEach(o),Mo.forEach(o),yn=m(ut),qt=s(ut,"SPAN",{});var Ra=a(qt);wn=i(Ra,"Overview"),Ra.forEach(o),ut.forEach(o),Io=m(t),R=s(t,"P",{});var Ct=a(R);Pn=i(Ct,"The DPT model was proposed in "),Ce=s(Ct,"A",{href:!0,rel:!0});var Wa=a(Ce);Dn=i(Wa,"Vision Transformers for Dense Prediction"),Wa.forEach(o),$n=i(Ct,` by Ren\xE9 Ranftl, Alexey Bochkovskiy, Vladlen Koltun.
DPT is a model that leverages the `),gt=s(Ct,"A",{href:!0});var Na=a(gt);Mn=i(Na,"Vision Transformer (ViT)"),Na.forEach(o),En=i(Ct," as backbone for dense prediction tasks like semantic segmentation and depth estimation."),Ct.forEach(o),xo=m(t),_t=s(t,"P",{});var Za=a(_t);kn=i(Za,"The abstract from the paper is the following:"),Za.forEach(o),zo=m(t),vt=s(t,"P",{});var Aa=a(vt);Lt=s(Aa,"EM",{});var Ba=a(Lt);In=i(Ba,"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."),Ba.forEach(o),Aa.forEach(o),jo=m(t),ae=s(t,"IMG",{src:!0,alt:!0,width:!0}),Co=m(t),re=s(t,"SMALL",{});var Oo=a(re);xn=i(Oo,"DPT architecture. Taken from the "),Je=s(Oo,"A",{href:!0,target:!0});var Va=a(Je);zn=i(Va,"original paper"),Va.forEach(o),jn=i(Oo,"."),Oo.forEach(o),Jo=m(t),W=s(t,"P",{});var Jt=a(W);Cn=i(Jt,"This model was contributed by "),Fe=s(Jt,"A",{href:!0,rel:!0});var Ga=a(Fe);Jn=i(Ga,"nielsr"),Ga.forEach(o),Fn=i(Jt,". The original code can be found "),Se=s(Jt,"A",{href:!0,rel:!0});var qa=a(Se);Sn=i(qa,"here"),qa.forEach(o),Un=i(Jt,"."),Jt.forEach(o),Fo=m(t),B=s(t,"H2",{class:!0});var Ko=a(B);ie=s(Ko,"A",{id:!0,class:!0,href:!0});var La=a(ie);Ht=s(La,"SPAN",{});var Ha=a(Ht);T(Ue.$$.fragment,Ha),Ha.forEach(o),La.forEach(o),Rn=m(Ko),Yt=s(Ko,"SPAN",{});var Ya=a(Yt);Wn=i(Ya,"Resources"),Ya.forEach(o),Ko.forEach(o),So=m(t),bt=s(t,"P",{});var Xa=a(bt);Nn=i(Xa,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DPT."),Xa.forEach(o),Uo=m(t),N=s(t,"UL",{});var Ft=a(N);Xt=s(Ft,"LI",{});var Qa=a(Xt);V=s(Qa,"P",{});var St=a(V);Zn=i(St,"Demo notebooks for "),Tt=s(St,"A",{href:!0});var Oa=a(Tt);An=i(Oa,"DPTForDepthEstimation"),Oa.forEach(o),Bn=i(St," can be found "),Re=s(St,"A",{href:!0,rel:!0});var Ka=a(Re);Vn=i(Ka,"here"),Ka.forEach(o),Gn=i(St,"."),St.forEach(o),Qa.forEach(o),qn=m(Ft),Qt=s(Ft,"LI",{});var er=a(Qt);Ot=s(er,"P",{});var tr=a(Ot);yt=s(tr,"A",{href:!0});var or=a(yt);Ln=i(or,"Semantic segmentation task guide"),or.forEach(o),tr.forEach(o),er.forEach(o),Hn=m(Ft),Kt=s(Ft,"LI",{});var nr=a(Kt);eo=s(nr,"P",{});var sr=a(eo);wt=s(sr,"A",{href:!0});var ar=a(wt);Yn=i(ar,"Monocular depth estimation task guide"),ar.forEach(o),sr.forEach(o),nr.forEach(o),Ft.forEach(o),Ro=m(t),Pt=s(t,"P",{});var rr=a(Pt);Xn=i(rr,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),rr.forEach(o),Wo=m(t),G=s(t,"H2",{class:!0});var en=a(G);le=s(en,"A",{id:!0,class:!0,href:!0});var ir=a(le);to=s(ir,"SPAN",{});var lr=a(to);T(We.$$.fragment,lr),lr.forEach(o),ir.forEach(o),Qn=m(en),oo=s(en,"SPAN",{});var cr=a(oo);On=i(cr,"DPTConfig"),cr.forEach(o),en.forEach(o),No=m(t),E=s(t,"DIV",{class:!0});var Z=a(E);T(Ne.$$.fragment,Z),Kn=m(Z),q=s(Z,"P",{});var Ut=a(q);es=i(Ut,"This is the configuration class to store the configuration of a "),Dt=s(Ut,"A",{href:!0});var dr=a(Dt);ts=i(dr,"DPTModel"),dr.forEach(o),os=i(Ut,`. 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
`),Ze=s(Ut,"A",{href:!0,rel:!0});var mr=a(Ze);ns=i(mr,"Intel/dpt-large"),mr.forEach(o),ss=i(Ut," architecture."),Ut.forEach(o),as=m(Z),L=s(Z,"P",{});var Rt=a(L);rs=i(Rt,"Configuration objects inherit from "),$t=s(Rt,"A",{href:!0});var pr=a($t);is=i(pr,"PretrainedConfig"),pr.forEach(o),ls=i(Rt,` and can be used to control the model outputs. Read the
documentation from `),Mt=s(Rt,"A",{href:!0});var hr=a(Mt);cs=i(hr,"PretrainedConfig"),hr.forEach(o),ds=i(Rt," for more information."),Rt.forEach(o),ms=m(Z),T(ce.$$.fragment,Z),ps=m(Z),de=s(Z,"DIV",{class:!0});var tn=a(de);T(Ae.$$.fragment,tn),hs=m(tn),H=s(tn,"P",{});var Wt=a(H);fs=i(Wt,"Serializes this instance to a Python dictionary. Override the default "),Et=s(Wt,"A",{href:!0});var fr=a(Et);us=i(fr,"to_dict()"),fr.forEach(o),gs=i(Wt,`. Returns:
`),no=s(Wt,"CODE",{});var ur=a(no);_s=i(ur,"Dict[str, any]"),ur.forEach(o),vs=i(Wt,": Dictionary of all the attributes that make up this configuration instance,"),Wt.forEach(o),tn.forEach(o),Z.forEach(o),Zo=m(t),Y=s(t,"H2",{class:!0});var on=a(Y);me=s(on,"A",{id:!0,class:!0,href:!0});var gr=a(me);so=s(gr,"SPAN",{});var _r=a(so);T(Be.$$.fragment,_r),_r.forEach(o),gr.forEach(o),bs=m(on),ao=s(on,"SPAN",{});var vr=a(ao);Ts=i(vr,"DPTFeatureExtractor"),vr.forEach(o),on.forEach(o),Ao=m(t),S=s(t,"DIV",{class:!0});var Nt=a(S);T(Ve.$$.fragment,Nt),ys=m(Nt),pe=s(Nt,"DIV",{class:!0});var nn=a(pe);T(Ge.$$.fragment,nn),ws=m(nn),ro=s(nn,"P",{});var br=a(ro);Ps=i(br,"Preprocess an image or a batch of images."),br.forEach(o),nn.forEach(o),Ds=m(Nt),he=s(Nt,"DIV",{class:!0});var sn=a(he);T(qe.$$.fragment,sn),$s=m(sn),Le=s(sn,"P",{});var an=a(Le);Ms=i(an,"Converts the output of "),kt=s(an,"A",{href:!0});var Tr=a(kt);Es=i(Tr,"DPTForSemanticSegmentation"),Tr.forEach(o),ks=i(an," into semantic segmentation maps. Only supports PyTorch."),an.forEach(o),sn.forEach(o),Nt.forEach(o),Bo=m(t),X=s(t,"H2",{class:!0});var rn=a(X);fe=s(rn,"A",{id:!0,class:!0,href:!0});var yr=a(fe);io=s(yr,"SPAN",{});var wr=a(io);T(He.$$.fragment,wr),wr.forEach(o),yr.forEach(o),Is=m(rn),lo=s(rn,"SPAN",{});var Pr=a(lo);xs=i(Pr,"DPTImageProcessor"),Pr.forEach(o),rn.forEach(o),Vo=m(t),x=s(t,"DIV",{class:!0});var Me=a(x);T(Ye.$$.fragment,Me),zs=m(Me),co=s(Me,"P",{});var Dr=a(co);js=i(Dr,"Constructs a DPT image processor."),Dr.forEach(o),Cs=m(Me),ue=s(Me,"DIV",{class:!0});var ln=a(ue);T(Xe.$$.fragment,ln),Js=m(ln),mo=s(ln,"P",{});var $r=a(mo);Fs=i($r,"Preprocess an image or batch of images."),$r.forEach(o),ln.forEach(o),Ss=m(Me),ge=s(Me,"DIV",{class:!0});var cn=a(ge);T(Qe.$$.fragment,cn),Us=m(cn),Oe=s(cn,"P",{});var dn=a(Oe);Rs=i(dn,"Converts the output of "),It=s(dn,"A",{href:!0});var Mr=a(It);Ws=i(Mr,"DPTForSemanticSegmentation"),Mr.forEach(o),Ns=i(dn," into semantic segmentation maps. Only supports PyTorch."),dn.forEach(o),cn.forEach(o),Me.forEach(o),Go=m(t),Q=s(t,"H2",{class:!0});var mn=a(Q);_e=s(mn,"A",{id:!0,class:!0,href:!0});var Er=a(_e);po=s(Er,"SPAN",{});var kr=a(po);T(Ke.$$.fragment,kr),kr.forEach(o),Er.forEach(o),Zs=m(mn),ho=s(mn,"SPAN",{});var Ir=a(ho);As=i(Ir,"DPTModel"),Ir.forEach(o),mn.forEach(o),qo=m(t),U=s(t,"DIV",{class:!0});var Zt=a(U);T(et.$$.fragment,Zt),Bs=m(Zt),tt=s(Zt,"P",{});var pn=a(tt);Vs=i(pn,`The bare DPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ot=s(pn,"A",{href:!0,rel:!0});var xr=a(ot);Gs=i(xr,"torch.nn.Module"),xr.forEach(o),qs=i(pn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pn.forEach(o),Ls=m(Zt),C=s(Zt,"DIV",{class:!0});var Ee=a(C);T(nt.$$.fragment,Ee),Hs=m(Ee),O=s(Ee,"P",{});var At=a(O);Ys=i(At,"The "),xt=s(At,"A",{href:!0});var zr=a(xt);Xs=i(zr,"DPTModel"),zr.forEach(o),Qs=i(At," forward method, overrides the "),fo=s(At,"CODE",{});var jr=a(fo);Os=i(jr,"__call__"),jr.forEach(o),Ks=i(At," special method."),At.forEach(o),ea=m(Ee),T(ve.$$.fragment,Ee),ta=m(Ee),T(be.$$.fragment,Ee),Ee.forEach(o),Zt.forEach(o),Lo=m(t),K=s(t,"H2",{class:!0});var hn=a(K);Te=s(hn,"A",{id:!0,class:!0,href:!0});var Cr=a(Te);uo=s(Cr,"SPAN",{});var Jr=a(uo);T(st.$$.fragment,Jr),Jr.forEach(o),Cr.forEach(o),oa=m(hn),go=s(hn,"SPAN",{});var Fr=a(go);na=i(Fr,"DPTForDepthEstimation"),Fr.forEach(o),hn.forEach(o),Ho=m(t),z=s(t,"DIV",{class:!0});var ke=a(z);T(at.$$.fragment,ke),sa=m(ke),_o=s(ke,"P",{});var Sr=a(_o);aa=i(Sr,"DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2."),Sr.forEach(o),ra=m(ke),rt=s(ke,"P",{});var fn=a(rt);ia=i(fn,"This model is a PyTorch "),it=s(fn,"A",{href:!0,rel:!0});var Ur=a(it);la=i(Ur,"torch.nn.Module"),Ur.forEach(o),ca=i(fn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fn.forEach(o),da=m(ke),J=s(ke,"DIV",{class:!0});var Ie=a(J);T(lt.$$.fragment,Ie),ma=m(Ie),ee=s(Ie,"P",{});var Bt=a(ee);pa=i(Bt,"The "),zt=s(Bt,"A",{href:!0});var Rr=a(zt);ha=i(Rr,"DPTForDepthEstimation"),Rr.forEach(o),fa=i(Bt," forward method, overrides the "),vo=s(Bt,"CODE",{});var Wr=a(vo);ua=i(Wr,"__call__"),Wr.forEach(o),ga=i(Bt," special method."),Bt.forEach(o),_a=m(Ie),T(ye.$$.fragment,Ie),va=m(Ie),T(we.$$.fragment,Ie),Ie.forEach(o),ke.forEach(o),Yo=m(t),te=s(t,"H2",{class:!0});var un=a(te);Pe=s(un,"A",{id:!0,class:!0,href:!0});var Nr=a(Pe);bo=s(Nr,"SPAN",{});var Zr=a(bo);T(ct.$$.fragment,Zr),Zr.forEach(o),Nr.forEach(o),ba=m(un),To=s(un,"SPAN",{});var Ar=a(To);Ta=i(Ar,"DPTForSemanticSegmentation"),Ar.forEach(o),un.forEach(o),Xo=m(t),j=s(t,"DIV",{class:!0});var xe=a(j);T(dt.$$.fragment,xe),ya=m(xe),yo=s(xe,"P",{});var Br=a(yo);wa=i(Br,"DPT Model with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Br.forEach(o),Pa=m(xe),mt=s(xe,"P",{});var gn=a(mt);Da=i(gn,"This model is a PyTorch "),pt=s(gn,"A",{href:!0,rel:!0});var Vr=a(pt);$a=i(Vr,"torch.nn.Module"),Vr.forEach(o),Ma=i(gn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gn.forEach(o),Ea=m(xe),F=s(xe,"DIV",{class:!0});var ze=a(F);T(ht.$$.fragment,ze),ka=m(ze),oe=s(ze,"P",{});var Vt=a(oe);Ia=i(Vt,"The "),jt=s(Vt,"A",{href:!0});var Gr=a(jt);xa=i(Gr,"DPTForSemanticSegmentation"),Gr.forEach(o),za=i(Vt," forward method, overrides the "),wo=s(Vt,"CODE",{});var qr=a(wo);ja=i(qr,"__call__"),qr.forEach(o),Ca=i(Vt," special method."),Vt.forEach(o),Ja=m(ze),T(De.$$.fragment,ze),Fa=m(ze),T($e.$$.fragment,ze),ze.forEach(o),xe.forEach(o),this.h()},h(){c(h,"name","hf:doc:metadata"),c(h,"content",JSON.stringify(ii)),c(u,"id","dpt"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#dpt"),c(_,"class","relative group"),c(se,"id","overview"),c(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(se,"href","#overview"),c(A,"class","relative group"),c(Ce,"href","https://arxiv.org/abs/2103.13413"),c(Ce,"rel","nofollow"),c(gt,"href","vit"),Qr(ae.src,Ua="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/dpt_architecture.jpg")||c(ae,"src",Ua),c(ae,"alt","drawing"),c(ae,"width","600"),c(Je,"href","https://arxiv.org/abs/2103.13413"),c(Je,"target","_blank"),c(Fe,"href","https://huggingface.co/nielsr"),c(Fe,"rel","nofollow"),c(Se,"href","https://github.com/isl-org/DPT"),c(Se,"rel","nofollow"),c(ie,"id","resources"),c(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ie,"href","#resources"),c(B,"class","relative group"),c(Tt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTForDepthEstimation"),c(Re,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DPT"),c(Re,"rel","nofollow"),c(yt,"href","../tasks/semantic_segmentation"),c(wt,"href","../tasks/monocular_depth_estimation"),c(le,"id","transformers.DPTConfig"),c(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(le,"href","#transformers.DPTConfig"),c(G,"class","relative group"),c(Dt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTModel"),c(Ze,"href","https://huggingface.co/Intel/dpt-large"),c(Ze,"rel","nofollow"),c($t,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Mt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Et,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),c(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"id","transformers.DPTFeatureExtractor"),c(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(me,"href","#transformers.DPTFeatureExtractor"),c(Y,"class","relative group"),c(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(kt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTForSemanticSegmentation"),c(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fe,"id","transformers.DPTImageProcessor"),c(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(fe,"href","#transformers.DPTImageProcessor"),c(X,"class","relative group"),c(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(It,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTForSemanticSegmentation"),c(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_e,"id","transformers.DPTModel"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#transformers.DPTModel"),c(Q,"class","relative group"),c(ot,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ot,"rel","nofollow"),c(xt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTModel"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Te,"id","transformers.DPTForDepthEstimation"),c(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Te,"href","#transformers.DPTForDepthEstimation"),c(K,"class","relative group"),c(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(it,"rel","nofollow"),c(zt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTForDepthEstimation"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pe,"id","transformers.DPTForSemanticSegmentation"),c(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pe,"href","#transformers.DPTForSemanticSegmentation"),c(te,"class","relative group"),c(pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(pt,"rel","nofollow"),c(jt,"href","/docs/transformers/v4.33.0/en/model_doc/dpt#transformers.DPTForSemanticSegmentation"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(t,p){e(document.head,h),f(t,$,p),f(t,_,p),e(_,u),e(u,v),y(l,v,null),e(_,g),e(_,k),e(k,Tn),f(t,ko,p),f(t,A,p),e(A,se),e(se,Gt),y(je,Gt,null),e(A,yn),e(A,qt),e(qt,wn),f(t,Io,p),f(t,R,p),e(R,Pn),e(R,Ce),e(Ce,Dn),e(R,$n),e(R,gt),e(gt,Mn),e(R,En),f(t,xo,p),f(t,_t,p),e(_t,kn),f(t,zo,p),f(t,vt,p),e(vt,Lt),e(Lt,In),f(t,jo,p),f(t,ae,p),f(t,Co,p),f(t,re,p),e(re,xn),e(re,Je),e(Je,zn),e(re,jn),f(t,Jo,p),f(t,W,p),e(W,Cn),e(W,Fe),e(Fe,Jn),e(W,Fn),e(W,Se),e(Se,Sn),e(W,Un),f(t,Fo,p),f(t,B,p),e(B,ie),e(ie,Ht),y(Ue,Ht,null),e(B,Rn),e(B,Yt),e(Yt,Wn),f(t,So,p),f(t,bt,p),e(bt,Nn),f(t,Uo,p),f(t,N,p),e(N,Xt),e(Xt,V),e(V,Zn),e(V,Tt),e(Tt,An),e(V,Bn),e(V,Re),e(Re,Vn),e(V,Gn),e(N,qn),e(N,Qt),e(Qt,Ot),e(Ot,yt),e(yt,Ln),e(N,Hn),e(N,Kt),e(Kt,eo),e(eo,wt),e(wt,Yn),f(t,Ro,p),f(t,Pt,p),e(Pt,Xn),f(t,Wo,p),f(t,G,p),e(G,le),e(le,to),y(We,to,null),e(G,Qn),e(G,oo),e(oo,On),f(t,No,p),f(t,E,p),y(Ne,E,null),e(E,Kn),e(E,q),e(q,es),e(q,Dt),e(Dt,ts),e(q,os),e(q,Ze),e(Ze,ns),e(q,ss),e(E,as),e(E,L),e(L,rs),e(L,$t),e($t,is),e(L,ls),e(L,Mt),e(Mt,cs),e(L,ds),e(E,ms),y(ce,E,null),e(E,ps),e(E,de),y(Ae,de,null),e(de,hs),e(de,H),e(H,fs),e(H,Et),e(Et,us),e(H,gs),e(H,no),e(no,_s),e(H,vs),f(t,Zo,p),f(t,Y,p),e(Y,me),e(me,so),y(Be,so,null),e(Y,bs),e(Y,ao),e(ao,Ts),f(t,Ao,p),f(t,S,p),y(Ve,S,null),e(S,ys),e(S,pe),y(Ge,pe,null),e(pe,ws),e(pe,ro),e(ro,Ps),e(S,Ds),e(S,he),y(qe,he,null),e(he,$s),e(he,Le),e(Le,Ms),e(Le,kt),e(kt,Es),e(Le,ks),f(t,Bo,p),f(t,X,p),e(X,fe),e(fe,io),y(He,io,null),e(X,Is),e(X,lo),e(lo,xs),f(t,Vo,p),f(t,x,p),y(Ye,x,null),e(x,zs),e(x,co),e(co,js),e(x,Cs),e(x,ue),y(Xe,ue,null),e(ue,Js),e(ue,mo),e(mo,Fs),e(x,Ss),e(x,ge),y(Qe,ge,null),e(ge,Us),e(ge,Oe),e(Oe,Rs),e(Oe,It),e(It,Ws),e(Oe,Ns),f(t,Go,p),f(t,Q,p),e(Q,_e),e(_e,po),y(Ke,po,null),e(Q,Zs),e(Q,ho),e(ho,As),f(t,qo,p),f(t,U,p),y(et,U,null),e(U,Bs),e(U,tt),e(tt,Vs),e(tt,ot),e(ot,Gs),e(tt,qs),e(U,Ls),e(U,C),y(nt,C,null),e(C,Hs),e(C,O),e(O,Ys),e(O,xt),e(xt,Xs),e(O,Qs),e(O,fo),e(fo,Os),e(O,Ks),e(C,ea),y(ve,C,null),e(C,ta),y(be,C,null),f(t,Lo,p),f(t,K,p),e(K,Te),e(Te,uo),y(st,uo,null),e(K,oa),e(K,go),e(go,na),f(t,Ho,p),f(t,z,p),y(at,z,null),e(z,sa),e(z,_o),e(_o,aa),e(z,ra),e(z,rt),e(rt,ia),e(rt,it),e(it,la),e(rt,ca),e(z,da),e(z,J),y(lt,J,null),e(J,ma),e(J,ee),e(ee,pa),e(ee,zt),e(zt,ha),e(ee,fa),e(ee,vo),e(vo,ua),e(ee,ga),e(J,_a),y(ye,J,null),e(J,va),y(we,J,null),f(t,Yo,p),f(t,te,p),e(te,Pe),e(Pe,bo),y(ct,bo,null),e(te,ba),e(te,To),e(To,Ta),f(t,Xo,p),f(t,j,p),y(dt,j,null),e(j,ya),e(j,yo),e(yo,wa),e(j,Pa),e(j,mt),e(mt,Da),e(mt,pt),e(pt,$a),e(mt,Ma),e(j,Ea),e(j,F),y(ht,F,null),e(F,ka),e(F,oe),e(oe,Ia),e(oe,jt),e(jt,xa),e(oe,za),e(oe,wo),e(wo,ja),e(oe,Ca),e(F,Ja),y(De,F,null),e(F,Fa),y($e,F,null),Qo=!0},p(t,[p]){const ft={};p&2&&(ft.$$scope={dirty:p,ctx:t}),ce.$set(ft);const Po={};p&2&&(Po.$$scope={dirty:p,ctx:t}),ve.$set(Po);const Do={};p&2&&(Do.$$scope={dirty:p,ctx:t}),be.$set(Do);const $o={};p&2&&($o.$$scope={dirty:p,ctx:t}),ye.$set($o);const ut={};p&2&&(ut.$$scope={dirty:p,ctx:t}),we.$set(ut);const Mo={};p&2&&(Mo.$$scope={dirty:p,ctx:t}),De.$set(Mo);const Eo={};p&2&&(Eo.$$scope={dirty:p,ctx:t}),$e.$set(Eo)},i(t){Qo||(w(l.$$.fragment,t),w(je.$$.fragment,t),w(Ue.$$.fragment,t),w(We.$$.fragment,t),w(Ne.$$.fragment,t),w(ce.$$.fragment,t),w(Ae.$$.fragment,t),w(Be.$$.fragment,t),w(Ve.$$.fragment,t),w(Ge.$$.fragment,t),w(qe.$$.fragment,t),w(He.$$.fragment,t),w(Ye.$$.fragment,t),w(Xe.$$.fragment,t),w(Qe.$$.fragment,t),w(Ke.$$.fragment,t),w(et.$$.fragment,t),w(nt.$$.fragment,t),w(ve.$$.fragment,t),w(be.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(lt.$$.fragment,t),w(ye.$$.fragment,t),w(we.$$.fragment,t),w(ct.$$.fragment,t),w(dt.$$.fragment,t),w(ht.$$.fragment,t),w(De.$$.fragment,t),w($e.$$.fragment,t),Qo=!0)},o(t){P(l.$$.fragment,t),P(je.$$.fragment,t),P(Ue.$$.fragment,t),P(We.$$.fragment,t),P(Ne.$$.fragment,t),P(ce.$$.fragment,t),P(Ae.$$.fragment,t),P(Be.$$.fragment,t),P(Ve.$$.fragment,t),P(Ge.$$.fragment,t),P(qe.$$.fragment,t),P(He.$$.fragment,t),P(Ye.$$.fragment,t),P(Xe.$$.fragment,t),P(Qe.$$.fragment,t),P(Ke.$$.fragment,t),P(et.$$.fragment,t),P(nt.$$.fragment,t),P(ve.$$.fragment,t),P(be.$$.fragment,t),P(st.$$.fragment,t),P(at.$$.fragment,t),P(lt.$$.fragment,t),P(ye.$$.fragment,t),P(we.$$.fragment,t),P(ct.$$.fragment,t),P(dt.$$.fragment,t),P(ht.$$.fragment,t),P(De.$$.fragment,t),P($e.$$.fragment,t),Qo=!1},d(t){o(h),t&&o($),t&&o(_),D(l),t&&o(ko),t&&o(A),D(je),t&&o(Io),t&&o(R),t&&o(xo),t&&o(_t),t&&o(zo),t&&o(vt),t&&o(jo),t&&o(ae),t&&o(Co),t&&o(re),t&&o(Jo),t&&o(W),t&&o(Fo),t&&o(B),D(Ue),t&&o(So),t&&o(bt),t&&o(Uo),t&&o(N),t&&o(Ro),t&&o(Pt),t&&o(Wo),t&&o(G),D(We),t&&o(No),t&&o(E),D(Ne),D(ce),D(Ae),t&&o(Zo),t&&o(Y),D(Be),t&&o(Ao),t&&o(S),D(Ve),D(Ge),D(qe),t&&o(Bo),t&&o(X),D(He),t&&o(Vo),t&&o(x),D(Ye),D(Xe),D(Qe),t&&o(Go),t&&o(Q),D(Ke),t&&o(qo),t&&o(U),D(et),D(nt),D(ve),D(be),t&&o(Lo),t&&o(K),D(st),t&&o(Ho),t&&o(z),D(at),D(lt),D(ye),D(we),t&&o(Yo),t&&o(te),D(ct),t&&o(Xo),t&&o(j),D(dt),D(ht),D(De),D($e)}}}const ii={local:"dpt",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.DPTConfig",title:"DPTConfig"},{local:"transformers.DPTFeatureExtractor",title:"DPTFeatureExtractor"},{local:"transformers.DPTImageProcessor",title:"DPTImageProcessor"},{local:"transformers.DPTModel",title:"DPTModel"},{local:"transformers.DPTForDepthEstimation",title:"DPTForDepthEstimation"},{local:"transformers.DPTForSemanticSegmentation",title:"DPTForSemanticSegmentation"}],title:"DPT"};function li(M){return Or(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ui extends Lr{constructor(h){super();Hr(this,h,li,ri,Yr,{})}}export{ui as default,ii as metadata};
