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