import{S as qr,i as Hr,s as Yr,e as s,k as d,w as b,t as r,M as Xr,c as n,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 $,v as Or,L as _s}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 vs}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as se}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as gs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Kr(M){let h,D,_,u,v;return u=new vs({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=s("p"),D=r("Example:"),_=d(),b(u.$$.fragment)},l(l){h=n(l,"P",{});var g=a(h);D=i(g,"Example:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,D),f(l,_,g),y(u,l,g),v=!0},p:_s,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),$(u,l)}}}function ei(M){let h,D,_,u,v;return{c(){h=s("p"),D=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("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=n(l,"P",{});var g=a(h);D=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(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,D),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function ti(M){let h,D,_,u,v;return u=new vs({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=s("p"),D=r("Example:"),_=d(),b(u.$$.fragment)},l(l){h=n(l,"P",{});var g=a(h);D=i(g,"Example:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,D),f(l,_,g),y(u,l,g),v=!0},p:_s,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),$(u,l)}}}function oi(M){let h,D,_,u,v;return{c(){h=s("p"),D=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("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=n(l,"P",{});var g=a(h);D=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(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,D),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function si(M){let h,D,_,u,v;return u=new vs({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=s("p"),D=r("Examples:"),_=d(),b(u.$$.fragment)},l(l){h=n(l,"P",{});var g=a(h);D=i(g,"Examples:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,D),f(l,_,g),y(u,l,g),v=!0},p:_s,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),$(u,l)}}}function ni(M){let h,D,_,u,v;return{c(){h=s("p"),D=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("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=n(l,"P",{});var g=a(h);D=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(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,D),e(h,_),e(_,u),e(h,v)},d(l){l&&o(h)}}}function ai(M){let h,D,_,u,v;return u=new vs({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=s("p"),D=r("Examples:"),_=d(),b(u.$$.fragment)},l(l){h=n(l,"P",{});var g=a(h);D=i(g,"Examples:"),g.forEach(o),_=m(l),T(u.$$.fragment,l)},m(l,g){f(l,h,g),e(h,D),f(l,_,g),y(u,l,g),v=!0},p:_s,i(l){v||(w(u.$$.fragment,l),v=!0)},o(l){P(u.$$.fragment,l),v=!1},d(l){l&&o(h),l&&o(_),$(u,l)}}}function ri(M){let h,D,_,u,v,l,g,k,bs,ko,B,ne,Gt,je,Ts,Lt,ys,Io,R,ws,Je,Ps,$s,gt,Ds,Ms,xo,_t,Es,zo,vt,qt,ks,jo,ae,Ua,Jo,re,Is,Ce,xs,zs,Co,W,js,Fe,Js,Cs,Se,Fs,Ss,Fo,A,ie,Ht,Ue,Us,Yt,Rs,So,bt,Ws,Uo,N,Xt,V,Ns,Tt,Zs,Bs,Re,As,Vs,Gs,Qt,Ot,yt,Ls,qs,Kt,eo,wt,Hs,Ro,Pt,Ys,Wo,G,le,to,We,Xs,oo,Qs,No,E,Ne,Os,L,Ks,$t,en,tn,Ze,on,sn,nn,q,an,Dt,rn,ln,Mt,cn,dn,mn,ce,pn,de,Be,hn,H,fn,Et,un,gn,so,_n,vn,Zo,Y,me,no,Ae,bn,ao,Tn,Bo,S,Ve,yn,pe,Ge,wn,ro,Pn,$n,he,Le,Dn,qe,Mn,kt,En,kn,Ao,X,fe,io,He,In,lo,xn,Vo,x,Ye,zn,co,jn,Jn,ue,Xe,Cn,mo,Fn,Sn,ge,Qe,Un,Oe,Rn,It,Wn,Nn,Go,Q,_e,po,Ke,Zn,ho,Bn,Lo,U,et,An,tt,Vn,ot,Gn,Ln,qn,J,st,Hn,O,Yn,xt,Xn,Qn,fo,On,Kn,ea,ve,ta,be,qo,K,Te,uo,nt,oa,go,sa,Ho,z,at,na,_o,aa,ra,rt,ia,it,la,ca,da,C,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,$a,pt,Da,Ma,Ea,F,ht,ka,oe,Ia,jt,xa,za,wo,ja,Ja,Ca,$e,Fa,De,Qo;return l=new se({}),je=new se({}),Ue=new se({}),We=new se({}),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.30.0/src/transformers/models/dpt/configuration_dpt.py#L32"}}),ce=new gs({props:{anchor:"transformers.DPTConfig.example",$$slots:{default:[Kr]},$$scope:{ctx:M}}}),Be=new I({props:{name:"to_dict",anchor:"transformers.DPTConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/dpt/configuration_dpt.py#L220"}}),Ae=new se({}),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.30.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.30.0/src/transformers/image_processing_utils.py#L462"}}),Le=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.30.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.30.0/src/transformers/models/dpt/image_processing_dpt.py#L342",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 se({}),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 <code>1</code>) &#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.30.0/src/transformers/models/dpt/image_processing_dpt.py#L88"}}),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[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,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"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/dpt/image_processing_dpt.py#L237"}}),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.30.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.30.0/src/transformers/models/dpt/image_processing_dpt.py#L342",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 se({}),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.30.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.30.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.30.0/src/transformers/models/dpt/modeling_dpt.py#L864"}}),st=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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.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.30.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 gs({props:{anchor:"transformers.DPTModel.forward.example",$$slots:{default:[ti]},$$scope:{ctx:M}}}),nt=new se({}),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.30.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.30.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.30.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/dpt/modeling_dpt.py#L1067",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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.30.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 gs({props:{anchor:"transformers.DPTForDepthEstimation.forward.example",$$slots:{default:[si]},$$scope:{ctx:M}}}),ct=new se({}),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.30.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.30.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.30.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/dpt/modeling_dpt.py#L1236",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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.30.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Sa({props:{$$slots:{default:[ni]},$$scope:{ctx:M}}}),De=new gs({props:{anchor:"transformers.DPTForSemanticSegmentation.forward.example",$$slots:{default:[ai]},$$scope:{ctx:M}}}),{c(){h=s("meta"),D=d(),_=s("h1"),u=s("a"),v=s("span"),b(l.$$.fragment),g=d(),k=s("span"),bs=r("DPT"),ko=d(),B=s("h2"),ne=s("a"),Gt=s("span"),b(je.$$.fragment),Ts=d(),Lt=s("span"),ys=r("Overview"),Io=d(),R=s("p"),ws=r("The DPT model was proposed in "),Je=s("a"),Ps=r("Vision Transformers for Dense Prediction"),$s=r(` by Ren\xE9 Ranftl, Alexey Bochkovskiy, Vladlen Koltun.
DPT is a model that leverages the `),gt=s("a"),Ds=r("Vision Transformer (ViT)"),Ms=r(" as backbone for dense prediction tasks like semantic segmentation and depth estimation."),xo=d(),_t=s("p"),Es=r("The abstract from the paper is the following:"),zo=d(),vt=s("p"),qt=s("em"),ks=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=s("img"),Jo=d(),re=s("small"),Is=r("DPT architecture. Taken from the "),Ce=s("a"),xs=r("original paper"),zs=r("."),Co=d(),W=s("p"),js=r("This model was contributed by "),Fe=s("a"),Js=r("nielsr"),Cs=r(". The original code can be found "),Se=s("a"),Fs=r("here"),Ss=r("."),Fo=d(),A=s("h2"),ie=s("a"),Ht=s("span"),b(Ue.$$.fragment),Us=d(),Yt=s("span"),Rs=r("Resources"),So=d(),bt=s("p"),Ws=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DPT."),Uo=d(),N=s("ul"),Xt=s("li"),V=s("p"),Ns=r("Demo notebooks for "),Tt=s("a"),Zs=r("DPTForDepthEstimation"),Bs=r(" can be found "),Re=s("a"),As=r("here"),Vs=r("."),Gs=d(),Qt=s("li"),Ot=s("p"),yt=s("a"),Ls=r("Semantic segmentation task guide"),qs=d(),Kt=s("li"),eo=s("p"),wt=s("a"),Hs=r("Monocular depth estimation task guide"),Ro=d(),Pt=s("p"),Ys=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=s("h2"),le=s("a"),to=s("span"),b(We.$$.fragment),Xs=d(),oo=s("span"),Qs=r("DPTConfig"),No=d(),E=s("div"),b(Ne.$$.fragment),Os=d(),L=s("p"),Ks=r("This is the configuration class to store the configuration of a "),$t=s("a"),en=r("DPTModel"),tn=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=s("a"),on=r("Intel/dpt-large"),sn=r(" architecture."),nn=d(),q=s("p"),an=r("Configuration objects inherit from "),Dt=s("a"),rn=r("PretrainedConfig"),ln=r(` and can be used to control the model outputs. Read the
documentation from `),Mt=s("a"),cn=r("PretrainedConfig"),dn=r(" for more information."),mn=d(),b(ce.$$.fragment),pn=d(),de=s("div"),b(Be.$$.fragment),hn=d(),H=s("p"),fn=r("Serializes this instance to a Python dictionary. Override the default "),Et=s("a"),un=r("to_dict()"),gn=r(`. Returns:
`),so=s("code"),_n=r("Dict[str, any]"),vn=r(": Dictionary of all the attributes that make up this configuration instance,"),Zo=d(),Y=s("h2"),me=s("a"),no=s("span"),b(Ae.$$.fragment),bn=d(),ao=s("span"),Tn=r("DPTFeatureExtractor"),Bo=d(),S=s("div"),b(Ve.$$.fragment),yn=d(),pe=s("div"),b(Ge.$$.fragment),wn=d(),ro=s("p"),Pn=r("Preprocess an image or a batch of images."),$n=d(),he=s("div"),b(Le.$$.fragment),Dn=d(),qe=s("p"),Mn=r("Converts the output of "),kt=s("a"),En=r("DPTForSemanticSegmentation"),kn=r(" into semantic segmentation maps. Only supports PyTorch."),Ao=d(),X=s("h2"),fe=s("a"),io=s("span"),b(He.$$.fragment),In=d(),lo=s("span"),xn=r("DPTImageProcessor"),Vo=d(),x=s("div"),b(Ye.$$.fragment),zn=d(),co=s("p"),jn=r("Constructs a DPT image processor."),Jn=d(),ue=s("div"),b(Xe.$$.fragment),Cn=d(),mo=s("p"),Fn=r("Preprocess an image or batch of images."),Sn=d(),ge=s("div"),b(Qe.$$.fragment),Un=d(),Oe=s("p"),Rn=r("Converts the output of "),It=s("a"),Wn=r("DPTForSemanticSegmentation"),Nn=r(" into semantic segmentation maps. Only supports PyTorch."),Go=d(),Q=s("h2"),_e=s("a"),po=s("span"),b(Ke.$$.fragment),Zn=d(),ho=s("span"),Bn=r("DPTModel"),Lo=d(),U=s("div"),b(et.$$.fragment),An=d(),tt=s("p"),Vn=r(`The bare DPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ot=s("a"),Gn=r("torch.nn.Module"),Ln=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qn=d(),J=s("div"),b(st.$$.fragment),Hn=d(),O=s("p"),Yn=r("The "),xt=s("a"),Xn=r("DPTModel"),Qn=r(" forward method, overrides the "),fo=s("code"),On=r("__call__"),Kn=r(" special method."),ea=d(),b(ve.$$.fragment),ta=d(),b(be.$$.fragment),qo=d(),K=s("h2"),Te=s("a"),uo=s("span"),b(nt.$$.fragment),oa=d(),go=s("span"),sa=r("DPTForDepthEstimation"),Ho=d(),z=s("div"),b(at.$$.fragment),na=d(),_o=s("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=s("p"),ia=r("This model is a PyTorch "),it=s("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(),C=s("div"),b(lt.$$.fragment),ma=d(),ee=s("p"),pa=r("The "),zt=s("a"),ha=r("DPTForDepthEstimation"),fa=r(" forward method, overrides the "),vo=s("code"),ua=r("__call__"),ga=r(" special method."),_a=d(),b(ye.$$.fragment),va=d(),b(we.$$.fragment),Yo=d(),te=s("h2"),Pe=s("a"),bo=s("span"),b(ct.$$.fragment),ba=d(),To=s("span"),Ta=r("DPTForSemanticSegmentation"),Xo=d(),j=s("div"),b(dt.$$.fragment),ya=d(),yo=s("p"),wa=r("DPT Model with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Pa=d(),mt=s("p"),$a=r("This model is a PyTorch "),pt=s("a"),Da=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=s("div"),b(ht.$$.fragment),ka=d(),oe=s("p"),Ia=r("The "),jt=s("a"),xa=r("DPTForSemanticSegmentation"),za=r(" forward method, overrides the "),wo=s("code"),ja=r("__call__"),Ja=r(" special method."),Ca=d(),b($e.$$.fragment),Fa=d(),b(De.$$.fragment),this.h()},l(t){const p=Xr('[data-svelte="svelte-1phssyn"]',document.head);h=n(p,"META",{name:!0,content:!0}),p.forEach(o),D=m(t),_=n(t,"H1",{class:!0});var ft=a(_);u=n(ft,"A",{id:!0,class:!0,href:!0});var Po=a(u);v=n(Po,"SPAN",{});var $o=a(v);T(l.$$.fragment,$o),$o.forEach(o),Po.forEach(o),g=m(ft),k=n(ft,"SPAN",{});var Do=a(k);bs=i(Do,"DPT"),Do.forEach(o),ft.forEach(o),ko=m(t),B=n(t,"H2",{class:!0});var ut=a(B);ne=n(ut,"A",{id:!0,class:!0,href:!0});var Mo=a(ne);Gt=n(Mo,"SPAN",{});var Eo=a(Gt);T(je.$$.fragment,Eo),Eo.forEach(o),Mo.forEach(o),Ts=m(ut),Lt=n(ut,"SPAN",{});var Ra=a(Lt);ys=i(Ra,"Overview"),Ra.forEach(o),ut.forEach(o),Io=m(t),R=n(t,"P",{});var Jt=a(R);ws=i(Jt,"The DPT model was proposed in "),Je=n(Jt,"A",{href:!0,rel:!0});var Wa=a(Je);Ps=i(Wa,"Vision Transformers for Dense Prediction"),Wa.forEach(o),$s=i(Jt,` by Ren\xE9 Ranftl, Alexey Bochkovskiy, Vladlen Koltun.
DPT is a model that leverages the `),gt=n(Jt,"A",{href:!0});var Na=a(gt);Ds=i(Na,"Vision Transformer (ViT)"),Na.forEach(o),Ms=i(Jt," as backbone for dense prediction tasks like semantic segmentation and depth estimation."),Jt.forEach(o),xo=m(t),_t=n(t,"P",{});var Za=a(_t);Es=i(Za,"The abstract from the paper is the following:"),Za.forEach(o),zo=m(t),vt=n(t,"P",{});var Ba=a(vt);qt=n(Ba,"EM",{});var Aa=a(qt);ks=i(Aa,"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."),Aa.forEach(o),Ba.forEach(o),jo=m(t),ae=n(t,"IMG",{src:!0,alt:!0,width:!0}),Jo=m(t),re=n(t,"SMALL",{});var Oo=a(re);Is=i(Oo,"DPT architecture. Taken from the "),Ce=n(Oo,"A",{href:!0,target:!0});var Va=a(Ce);xs=i(Va,"original paper"),Va.forEach(o),zs=i(Oo,"."),Oo.forEach(o),Co=m(t),W=n(t,"P",{});var Ct=a(W);js=i(Ct,"This model was contributed by "),Fe=n(Ct,"A",{href:!0,rel:!0});var Ga=a(Fe);Js=i(Ga,"nielsr"),Ga.forEach(o),Cs=i(Ct,". The original code can be found "),Se=n(Ct,"A",{href:!0,rel:!0});var La=a(Se);Fs=i(La,"here"),La.forEach(o),Ss=i(Ct,"."),Ct.forEach(o),Fo=m(t),A=n(t,"H2",{class:!0});var Ko=a(A);ie=n(Ko,"A",{id:!0,class:!0,href:!0});var qa=a(ie);Ht=n(qa,"SPAN",{});var Ha=a(Ht);T(Ue.$$.fragment,Ha),Ha.forEach(o),qa.forEach(o),Us=m(Ko),Yt=n(Ko,"SPAN",{});var Ya=a(Yt);Rs=i(Ya,"Resources"),Ya.forEach(o),Ko.forEach(o),So=m(t),bt=n(t,"P",{});var Xa=a(bt);Ws=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=n(t,"UL",{});var Ft=a(N);Xt=n(Ft,"LI",{});var Qa=a(Xt);V=n(Qa,"P",{});var St=a(V);Ns=i(St,"Demo notebooks for "),Tt=n(St,"A",{href:!0});var Oa=a(Tt);Zs=i(Oa,"DPTForDepthEstimation"),Oa.forEach(o),Bs=i(St," can be found "),Re=n(St,"A",{href:!0,rel:!0});var Ka=a(Re);As=i(Ka,"here"),Ka.forEach(o),Vs=i(St,"."),St.forEach(o),Qa.forEach(o),Gs=m(Ft),Qt=n(Ft,"LI",{});var er=a(Qt);Ot=n(er,"P",{});var tr=a(Ot);yt=n(tr,"A",{href:!0});var or=a(yt);Ls=i(or,"Semantic segmentation task guide"),or.forEach(o),tr.forEach(o),er.forEach(o),qs=m(Ft),Kt=n(Ft,"LI",{});var sr=a(Kt);eo=n(sr,"P",{});var nr=a(eo);wt=n(nr,"A",{href:!0});var ar=a(wt);Hs=i(ar,"Monocular depth estimation task guide"),ar.forEach(o),nr.forEach(o),sr.forEach(o),Ft.forEach(o),Ro=m(t),Pt=n(t,"P",{});var rr=a(Pt);Ys=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=n(t,"H2",{class:!0});var es=a(G);le=n(es,"A",{id:!0,class:!0,href:!0});var ir=a(le);to=n(ir,"SPAN",{});var lr=a(to);T(We.$$.fragment,lr),lr.forEach(o),ir.forEach(o),Xs=m(es),oo=n(es,"SPAN",{});var cr=a(oo);Qs=i(cr,"DPTConfig"),cr.forEach(o),es.forEach(o),No=m(t),E=n(t,"DIV",{class:!0});var Z=a(E);T(Ne.$$.fragment,Z),Os=m(Z),L=n(Z,"P",{});var Ut=a(L);Ks=i(Ut,"This is the configuration class to store the configuration of a "),$t=n(Ut,"A",{href:!0});var dr=a($t);en=i(dr,"DPTModel"),dr.forEach(o),tn=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=n(Ut,"A",{href:!0,rel:!0});var mr=a(Ze);on=i(mr,"Intel/dpt-large"),mr.forEach(o),sn=i(Ut," architecture."),Ut.forEach(o),nn=m(Z),q=n(Z,"P",{});var Rt=a(q);an=i(Rt,"Configuration objects inherit from "),Dt=n(Rt,"A",{href:!0});var pr=a(Dt);rn=i(pr,"PretrainedConfig"),pr.forEach(o),ln=i(Rt,` and can be used to control the model outputs. Read the
documentation from `),Mt=n(Rt,"A",{href:!0});var hr=a(Mt);cn=i(hr,"PretrainedConfig"),hr.forEach(o),dn=i(Rt," for more information."),Rt.forEach(o),mn=m(Z),T(ce.$$.fragment,Z),pn=m(Z),de=n(Z,"DIV",{class:!0});var ts=a(de);T(Be.$$.fragment,ts),hn=m(ts),H=n(ts,"P",{});var Wt=a(H);fn=i(Wt,"Serializes this instance to a Python dictionary. Override the default "),Et=n(Wt,"A",{href:!0});var fr=a(Et);un=i(fr,"to_dict()"),fr.forEach(o),gn=i(Wt,`. Returns:
`),so=n(Wt,"CODE",{});var ur=a(so);_n=i(ur,"Dict[str, any]"),ur.forEach(o),vn=i(Wt,": Dictionary of all the attributes that make up this configuration instance,"),Wt.forEach(o),ts.forEach(o),Z.forEach(o),Zo=m(t),Y=n(t,"H2",{class:!0});var os=a(Y);me=n(os,"A",{id:!0,class:!0,href:!0});var gr=a(me);no=n(gr,"SPAN",{});var _r=a(no);T(Ae.$$.fragment,_r),_r.forEach(o),gr.forEach(o),bn=m(os),ao=n(os,"SPAN",{});var vr=a(ao);Tn=i(vr,"DPTFeatureExtractor"),vr.forEach(o),os.forEach(o),Bo=m(t),S=n(t,"DIV",{class:!0});var Nt=a(S);T(Ve.$$.fragment,Nt),yn=m(Nt),pe=n(Nt,"DIV",{class:!0});var ss=a(pe);T(Ge.$$.fragment,ss),wn=m(ss),ro=n(ss,"P",{});var br=a(ro);Pn=i(br,"Preprocess an image or a batch of images."),br.forEach(o),ss.forEach(o),$n=m(Nt),he=n(Nt,"DIV",{class:!0});var ns=a(he);T(Le.$$.fragment,ns),Dn=m(ns),qe=n(ns,"P",{});var as=a(qe);Mn=i(as,"Converts the output of "),kt=n(as,"A",{href:!0});var Tr=a(kt);En=i(Tr,"DPTForSemanticSegmentation"),Tr.forEach(o),kn=i(as," into semantic segmentation maps. Only supports PyTorch."),as.forEach(o),ns.forEach(o),Nt.forEach(o),Ao=m(t),X=n(t,"H2",{class:!0});var rs=a(X);fe=n(rs,"A",{id:!0,class:!0,href:!0});var yr=a(fe);io=n(yr,"SPAN",{});var wr=a(io);T(He.$$.fragment,wr),wr.forEach(o),yr.forEach(o),In=m(rs),lo=n(rs,"SPAN",{});var Pr=a(lo);xn=i(Pr,"DPTImageProcessor"),Pr.forEach(o),rs.forEach(o),Vo=m(t),x=n(t,"DIV",{class:!0});var Me=a(x);T(Ye.$$.fragment,Me),zn=m(Me),co=n(Me,"P",{});var $r=a(co);jn=i($r,"Constructs a DPT image processor."),$r.forEach(o),Jn=m(Me),ue=n(Me,"DIV",{class:!0});var is=a(ue);T(Xe.$$.fragment,is),Cn=m(is),mo=n(is,"P",{});var Dr=a(mo);Fn=i(Dr,"Preprocess an image or batch of images."),Dr.forEach(o),is.forEach(o),Sn=m(Me),ge=n(Me,"DIV",{class:!0});var ls=a(ge);T(Qe.$$.fragment,ls),Un=m(ls),Oe=n(ls,"P",{});var cs=a(Oe);Rn=i(cs,"Converts the output of "),It=n(cs,"A",{href:!0});var Mr=a(It);Wn=i(Mr,"DPTForSemanticSegmentation"),Mr.forEach(o),Nn=i(cs," into semantic segmentation maps. Only supports PyTorch."),cs.forEach(o),ls.forEach(o),Me.forEach(o),Go=m(t),Q=n(t,"H2",{class:!0});var ds=a(Q);_e=n(ds,"A",{id:!0,class:!0,href:!0});var Er=a(_e);po=n(Er,"SPAN",{});var kr=a(po);T(Ke.$$.fragment,kr),kr.forEach(o),Er.forEach(o),Zn=m(ds),ho=n(ds,"SPAN",{});var Ir=a(ho);Bn=i(Ir,"DPTModel"),Ir.forEach(o),ds.forEach(o),Lo=m(t),U=n(t,"DIV",{class:!0});var Zt=a(U);T(et.$$.fragment,Zt),An=m(Zt),tt=n(Zt,"P",{});var ms=a(tt);Vn=i(ms,`The bare DPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ot=n(ms,"A",{href:!0,rel:!0});var xr=a(ot);Gn=i(xr,"torch.nn.Module"),xr.forEach(o),Ln=i(ms,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ms.forEach(o),qn=m(Zt),J=n(Zt,"DIV",{class:!0});var Ee=a(J);T(st.$$.fragment,Ee),Hn=m(Ee),O=n(Ee,"P",{});var Bt=a(O);Yn=i(Bt,"The "),xt=n(Bt,"A",{href:!0});var zr=a(xt);Xn=i(zr,"DPTModel"),zr.forEach(o),Qn=i(Bt," forward method, overrides the "),fo=n(Bt,"CODE",{});var jr=a(fo);On=i(jr,"__call__"),jr.forEach(o),Kn=i(Bt," special method."),Bt.forEach(o),ea=m(Ee),T(ve.$$.fragment,Ee),ta=m(Ee),T(be.$$.fragment,Ee),Ee.forEach(o),Zt.forEach(o),qo=m(t),K=n(t,"H2",{class:!0});var ps=a(K);Te=n(ps,"A",{id:!0,class:!0,href:!0});var Jr=a(Te);uo=n(Jr,"SPAN",{});var Cr=a(uo);T(nt.$$.fragment,Cr),Cr.forEach(o),Jr.forEach(o),oa=m(ps),go=n(ps,"SPAN",{});var Fr=a(go);sa=i(Fr,"DPTForDepthEstimation"),Fr.forEach(o),ps.forEach(o),Ho=m(t),z=n(t,"DIV",{class:!0});var ke=a(z);T(at.$$.fragment,ke),na=m(ke),_o=n(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=n(ke,"P",{});var hs=a(rt);ia=i(hs,"This model is a PyTorch "),it=n(hs,"A",{href:!0,rel:!0});var Ur=a(it);la=i(Ur,"torch.nn.Module"),Ur.forEach(o),ca=i(hs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hs.forEach(o),da=m(ke),C=n(ke,"DIV",{class:!0});var Ie=a(C);T(lt.$$.fragment,Ie),ma=m(Ie),ee=n(Ie,"P",{});var At=a(ee);pa=i(At,"The "),zt=n(At,"A",{href:!0});var Rr=a(zt);ha=i(Rr,"DPTForDepthEstimation"),Rr.forEach(o),fa=i(At," forward method, overrides the "),vo=n(At,"CODE",{});var Wr=a(vo);ua=i(Wr,"__call__"),Wr.forEach(o),ga=i(At," special method."),At.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=n(t,"H2",{class:!0});var fs=a(te);Pe=n(fs,"A",{id:!0,class:!0,href:!0});var Nr=a(Pe);bo=n(Nr,"SPAN",{});var Zr=a(bo);T(ct.$$.fragment,Zr),Zr.forEach(o),Nr.forEach(o),ba=m(fs),To=n(fs,"SPAN",{});var Br=a(To);Ta=i(Br,"DPTForSemanticSegmentation"),Br.forEach(o),fs.forEach(o),Xo=m(t),j=n(t,"DIV",{class:!0});var xe=a(j);T(dt.$$.fragment,xe),ya=m(xe),yo=n(xe,"P",{});var Ar=a(yo);wa=i(Ar,"DPT Model with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Ar.forEach(o),Pa=m(xe),mt=n(xe,"P",{});var us=a(mt);$a=i(us,"This model is a PyTorch "),pt=n(us,"A",{href:!0,rel:!0});var Vr=a(pt);Da=i(Vr,"torch.nn.Module"),Vr.forEach(o),Ma=i(us,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),us.forEach(o),Ea=m(xe),F=n(xe,"DIV",{class:!0});var ze=a(F);T(ht.$$.fragment,ze),ka=m(ze),oe=n(ze,"P",{});var Vt=a(oe);Ia=i(Vt,"The "),jt=n(Vt,"A",{href:!0});var Gr=a(jt);xa=i(Gr,"DPTForSemanticSegmentation"),Gr.forEach(o),za=i(Vt," forward method, overrides the "),wo=n(Vt,"CODE",{});var Lr=a(wo);ja=i(Lr,"__call__"),Lr.forEach(o),Ja=i(Vt," special method."),Vt.forEach(o),Ca=m(ze),T($e.$$.fragment,ze),Fa=m(ze),T(De.$$.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(ne,"id","overview"),c(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ne,"href","#overview"),c(B,"class","relative group"),c(Je,"href","https://arxiv.org/abs/2103.13413"),c(Je,"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(Ce,"href","https://arxiv.org/abs/2103.13413"),c(Ce,"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(A,"class","relative group"),c(Tt,"href","/docs/transformers/v4.30.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($t,"href","/docs/transformers/v4.30.0/en/model_doc/dpt#transformers.DPTModel"),c(Ze,"href","https://huggingface.co/Intel/dpt-large"),c(Ze,"rel","nofollow"),c(Dt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Mt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Et,"href","/docs/transformers/v4.30.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.30.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.30.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.30.0/en/model_doc/dpt#transformers.DPTModel"),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(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.30.0/en/model_doc/dpt#transformers.DPTForDepthEstimation"),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(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.30.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,D,p),f(t,_,p),e(_,u),e(u,v),y(l,v,null),e(_,g),e(_,k),e(k,bs),f(t,ko,p),f(t,B,p),e(B,ne),e(ne,Gt),y(je,Gt,null),e(B,Ts),e(B,Lt),e(Lt,ys),f(t,Io,p),f(t,R,p),e(R,ws),e(R,Je),e(Je,Ps),e(R,$s),e(R,gt),e(gt,Ds),e(R,Ms),f(t,xo,p),f(t,_t,p),e(_t,Es),f(t,zo,p),f(t,vt,p),e(vt,qt),e(qt,ks),f(t,jo,p),f(t,ae,p),f(t,Jo,p),f(t,re,p),e(re,Is),e(re,Ce),e(Ce,xs),e(re,zs),f(t,Co,p),f(t,W,p),e(W,js),e(W,Fe),e(Fe,Js),e(W,Cs),e(W,Se),e(Se,Fs),e(W,Ss),f(t,Fo,p),f(t,A,p),e(A,ie),e(ie,Ht),y(Ue,Ht,null),e(A,Us),e(A,Yt),e(Yt,Rs),f(t,So,p),f(t,bt,p),e(bt,Ws),f(t,Uo,p),f(t,N,p),e(N,Xt),e(Xt,V),e(V,Ns),e(V,Tt),e(Tt,Zs),e(V,Bs),e(V,Re),e(Re,As),e(V,Vs),e(N,Gs),e(N,Qt),e(Qt,Ot),e(Ot,yt),e(yt,Ls),e(N,qs),e(N,Kt),e(Kt,eo),e(eo,wt),e(wt,Hs),f(t,Ro,p),f(t,Pt,p),e(Pt,Ys),f(t,Wo,p),f(t,G,p),e(G,le),e(le,to),y(We,to,null),e(G,Xs),e(G,oo),e(oo,Qs),f(t,No,p),f(t,E,p),y(Ne,E,null),e(E,Os),e(E,L),e(L,Ks),e(L,$t),e($t,en),e(L,tn),e(L,Ze),e(Ze,on),e(L,sn),e(E,nn),e(E,q),e(q,an),e(q,Dt),e(Dt,rn),e(q,ln),e(q,Mt),e(Mt,cn),e(q,dn),e(E,mn),y(ce,E,null),e(E,pn),e(E,de),y(Be,de,null),e(de,hn),e(de,H),e(H,fn),e(H,Et),e(Et,un),e(H,gn),e(H,so),e(so,_n),e(H,vn),f(t,Zo,p),f(t,Y,p),e(Y,me),e(me,no),y(Ae,no,null),e(Y,bn),e(Y,ao),e(ao,Tn),f(t,Bo,p),f(t,S,p),y(Ve,S,null),e(S,yn),e(S,pe),y(Ge,pe,null),e(pe,wn),e(pe,ro),e(ro,Pn),e(S,$n),e(S,he),y(Le,he,null),e(he,Dn),e(he,qe),e(qe,Mn),e(qe,kt),e(kt,En),e(qe,kn),f(t,Ao,p),f(t,X,p),e(X,fe),e(fe,io),y(He,io,null),e(X,In),e(X,lo),e(lo,xn),f(t,Vo,p),f(t,x,p),y(Ye,x,null),e(x,zn),e(x,co),e(co,jn),e(x,Jn),e(x,ue),y(Xe,ue,null),e(ue,Cn),e(ue,mo),e(mo,Fn),e(x,Sn),e(x,ge),y(Qe,ge,null),e(ge,Un),e(ge,Oe),e(Oe,Rn),e(Oe,It),e(It,Wn),e(Oe,Nn),f(t,Go,p),f(t,Q,p),e(Q,_e),e(_e,po),y(Ke,po,null),e(Q,Zn),e(Q,ho),e(ho,Bn),f(t,Lo,p),f(t,U,p),y(et,U,null),e(U,An),e(U,tt),e(tt,Vn),e(tt,ot),e(ot,Gn),e(tt,Ln),e(U,qn),e(U,J),y(st,J,null),e(J,Hn),e(J,O),e(O,Yn),e(O,xt),e(xt,Xn),e(O,Qn),e(O,fo),e(fo,On),e(O,Kn),e(J,ea),y(ve,J,null),e(J,ta),y(be,J,null),f(t,qo,p),f(t,K,p),e(K,Te),e(Te,uo),y(nt,uo,null),e(K,oa),e(K,go),e(go,sa),f(t,Ho,p),f(t,z,p),y(at,z,null),e(z,na),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,C),y(lt,C,null),e(C,ma),e(C,ee),e(ee,pa),e(ee,zt),e(zt,ha),e(ee,fa),e(ee,vo),e(vo,ua),e(ee,ga),e(C,_a),y(ye,C,null),e(C,va),y(we,C,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,$a),e(mt,pt),e(pt,Da),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,Ja),e(F,Ca),y($e,F,null),e(F,Fa),y(De,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 $o={};p&2&&($o.$$scope={dirty:p,ctx:t}),be.$set($o);const Do={};p&2&&(Do.$$scope={dirty:p,ctx:t}),ye.$set(Do);const ut={};p&2&&(ut.$$scope={dirty:p,ctx:t}),we.$set(ut);const Mo={};p&2&&(Mo.$$scope={dirty:p,ctx:t}),$e.$set(Mo);const Eo={};p&2&&(Eo.$$scope={dirty:p,ctx:t}),De.$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(Be.$$.fragment,t),w(Ae.$$.fragment,t),w(Ve.$$.fragment,t),w(Ge.$$.fragment,t),w(Le.$$.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(st.$$.fragment,t),w(ve.$$.fragment,t),w(be.$$.fragment,t),w(nt.$$.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($e.$$.fragment,t),w(De.$$.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(Be.$$.fragment,t),P(Ae.$$.fragment,t),P(Ve.$$.fragment,t),P(Ge.$$.fragment,t),P(Le.$$.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(st.$$.fragment,t),P(ve.$$.fragment,t),P(be.$$.fragment,t),P(nt.$$.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($e.$$.fragment,t),P(De.$$.fragment,t),Qo=!1},d(t){o(h),t&&o(D),t&&o(_),$(l),t&&o(ko),t&&o(B),$(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(Jo),t&&o(re),t&&o(Co),t&&o(W),t&&o(Fo),t&&o(A),$(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),$(We),t&&o(No),t&&o(E),$(Ne),$(ce),$(Be),t&&o(Zo),t&&o(Y),$(Ae),t&&o(Bo),t&&o(S),$(Ve),$(Ge),$(Le),t&&o(Ao),t&&o(X),$(He),t&&o(Vo),t&&o(x),$(Ye),$(Xe),$(Qe),t&&o(Go),t&&o(Q),$(Ke),t&&o(Lo),t&&o(U),$(et),$(st),$(ve),$(be),t&&o(qo),t&&o(K),$(nt),t&&o(Ho),t&&o(z),$(at),$(lt),$(ye),$(we),t&&o(Yo),t&&o(te),$(ct),t&&o(Xo),t&&o(j),$(dt),$(ht),$($e),$(De)}}}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 qr{constructor(h){super();Hr(this,h,li,ri,Yr,{})}}export{ui as default,ii as metadata};
