import{S as cn,i as hn,s as mn,e as r,k as g,w,t as i,M as fn,c as n,d as o,m as _,a as s,x as P,h as l,b as d,N as un,G as t,g as h,y as $,q as N,o as L,B as y,v as gn,L as Nr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Pr}from"../../chunks/Tip-hf-doc-builder.js";import{D as Me}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as rt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as $r}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function _n(G){let p,b,f,u,v;return{c(){p=r("p"),b=i(`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),f=r("a"),u=i("Github Issue"),v=i("."),this.h()},l(a){p=n(a,"P",{});var m=s(p);b=l(m,`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),f=n(m,"A",{href:!0,rel:!0});var E=s(f);u=l(E,"Github Issue"),E.forEach(o),v=l(m,"."),m.forEach(o),this.h()},h(){d(f,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),d(f,"rel","nofollow")},m(a,m){h(a,p,m),t(p,b),t(p,f),t(f,u),t(p,v)},d(a){a&&o(p)}}}function vn(G){let p,b,f,u,v;return u=new Lr({props:{code:`from transformers import GLPNModel, GLPNConfig

# Initializing a GLPN vinvino02/glpn-kitti style configuration
configuration = GLPNConfig()

# Initializing a model from the vinvino02/glpn-kitti style configuration
model = GLPNModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GLPNModel, GLPNConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GLPN vinvino02/glpn-kitti style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GLPNConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the vinvino02/glpn-kitti style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GLPNModel(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(){p=r("p"),b=i("Example:"),f=g(),w(u.$$.fragment)},l(a){p=n(a,"P",{});var m=s(p);b=l(m,"Example:"),m.forEach(o),f=_(a),P(u.$$.fragment,a)},m(a,m){h(a,p,m),t(p,b),h(a,f,m),$(u,a,m),v=!0},p:Nr,i(a){v||(N(u.$$.fragment,a),v=!0)},o(a){L(u.$$.fragment,a),v=!1},d(a){a&&o(p),a&&o(f),y(u,a)}}}function bn(G){let p,b,f,u,v;return{c(){p=r("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),u=i("Module"),v=i(`
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(a){p=n(a,"P",{});var m=s(p);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n(m,"CODE",{});var E=s(f);u=l(E,"Module"),E.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){h(a,p,m),t(p,b),t(p,f),t(f,u),t(p,v)},d(a){a&&o(p)}}}function wn(G){let p,b,f,u,v;return u=new Lr({props:{code:`from transformers import GLPNFeatureExtractor, GLPNModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = GLPNFeatureExtractor.from_pretrained("vinvino02/glpn-kitti")
model = GLPNModel.from_pretrained("vinvino02/glpn-kitti")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GLPNFeatureExtractor, GLPNModel
<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>feature_extractor = GLPNFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;vinvino02/glpn-kitti&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GLPNModel.from_pretrained(<span class="hljs-string">&quot;vinvino02/glpn-kitti&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(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">512</span>, <span class="hljs-number">15</span>, <span class="hljs-number">20</span>]`}}),{c(){p=r("p"),b=i("Example:"),f=g(),w(u.$$.fragment)},l(a){p=n(a,"P",{});var m=s(p);b=l(m,"Example:"),m.forEach(o),f=_(a),P(u.$$.fragment,a)},m(a,m){h(a,p,m),t(p,b),h(a,f,m),$(u,a,m),v=!0},p:Nr,i(a){v||(N(u.$$.fragment,a),v=!0)},o(a){L(u.$$.fragment,a),v=!1},d(a){a&&o(p),a&&o(f),y(u,a)}}}function Pn(G){let p,b,f,u,v;return{c(){p=r("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),u=i("Module"),v=i(`
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(a){p=n(a,"P",{});var m=s(p);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n(m,"CODE",{});var E=s(f);u=l(E,"Module"),E.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){h(a,p,m),t(p,b),t(p,f),t(f,u),t(p,v)},d(a){a&&o(p)}}}function $n(G){let p,b,f,u,v;return u=new Lr({props:{code:`from transformers import GLPNFeatureExtractor, GLPNForDepthEstimation
import torch
import numpy as np
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = GLPNFeatureExtractor.from_pretrained("vinvino02/glpn-kitti")
model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-kitti")

# prepare image for the model
inputs = feature_extractor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
    predicted_depth = outputs.predicted_depth

# interpolate to original size
prediction = torch.nn.functional.interpolate(
    predicted_depth.unsqueeze(1),
    size=image.size[::-1],
    mode="bicubic",
    align_corners=False,
)

# visualize the prediction
output = prediction.squeeze().cpu().numpy()
formatted = (output * 255 / np.max(output)).astype("uint8")
depth = Image.fromarray(formatted)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GLPNFeatureExtractor, GLPNForDepthEstimation
<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>feature_extractor = GLPNFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;vinvino02/glpn-kitti&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GLPNForDepthEstimation.from_pretrained(<span class="hljs-string">&quot;vinvino02/glpn-kitti&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 = feature_extractor(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(){p=r("p"),b=i("Examples:"),f=g(),w(u.$$.fragment)},l(a){p=n(a,"P",{});var m=s(p);b=l(m,"Examples:"),m.forEach(o),f=_(a),P(u.$$.fragment,a)},m(a,m){h(a,p,m),t(p,b),h(a,f,m),$(u,a,m),v=!0},p:Nr,i(a){v||(N(u.$$.fragment,a),v=!0)},o(a){L(u.$$.fragment,a),v=!1},d(a){a&&o(p),a&&o(f),y(u,a)}}}function Nn(G){let p,b,f,u,v,a,m,E,Yt,$t,R,Nt,C,H,nt,de,Qt,st,Xt,Lt,M,Zt,pe,eo,to,Ie,oo,ro,yt,Ce,no,Gt,De,at,so,Et,Ae,ao,xt,K,D,io,qe,lo,po,ce,co,ho,mo,he,fo,Se,uo,go,Tt,J,yr,kt,Y,_o,me,vo,bo,jt,I,wo,fe,Po,$o,ue,No,Lo,Ft,A,Q,it,ge,yo,lt,Go,zt,x,_e,Eo,q,xo,Oe,To,ko,ve,jo,Fo,zo,S,Mo,Be,Io,Co,Ve,Do,Ao,qo,X,Mt,O,Z,dt,be,So,pt,Oo,It,j,we,Bo,ct,Vo,Wo,We,Pe,Ct,B,ee,ht,$e,Uo,mt,Ro,Dt,F,Ne,Ho,Le,Ko,ye,Jo,Yo,Qo,T,Ge,Xo,V,Zo,Ue,er,tr,ft,or,rr,nr,te,sr,oe,At,W,re,ut,Ee,ar,gt,ir,qt,z,xe,lr,Te,dr,ke,pr,cr,hr,k,je,mr,U,fr,Re,ur,gr,_t,_r,vr,br,ne,wr,se,St;return a=new rt({}),R=new Pr({props:{$$slots:{default:[_n]},$$scope:{ctx:G}}}),de=new rt({}),ge=new rt({}),_e=new Me({props:{name:"class transformers.GLPNConfig",anchor:"transformers.GLPNConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"num_encoder_blocks",val:" = 4"},{name:"depths",val:" = [2, 2, 2, 2]"},{name:"sr_ratios",val:" = [8, 4, 2, 1]"},{name:"hidden_sizes",val:" = [32, 64, 160, 256]"},{name:"patch_sizes",val:" = [7, 3, 3, 3]"},{name:"strides",val:" = [4, 2, 2, 2]"},{name:"num_attention_heads",val:" = [1, 2, 5, 8]"},{name:"mlp_ratios",val:" = [4, 4, 4, 4]"},{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:"drop_path_rate",val:" = 0.1"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"is_encoder_decoder",val:" = False"},{name:"decoder_hidden_size",val:" = 64"},{name:"max_depth",val:" = 10"},{name:"head_in_index",val:" = -1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GLPNConfig.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.GLPNConfig.num_encoder_blocks",description:`<strong>num_encoder_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of encoder blocks (i.e. stages in the Mix Transformer encoder).`,name:"num_encoder_blocks"},{anchor:"transformers.GLPNConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 2, 2]</code>) &#x2014;
The number of layers in each encoder block.`,name:"depths"},{anchor:"transformers.GLPNConfig.sr_ratios",description:`<strong>sr_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[8, 4, 2, 1]</code>) &#x2014;
Sequence reduction ratios in each encoder block.`,name:"sr_ratios"},{anchor:"transformers.GLPNConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 64, 160, 256]</code>) &#x2014;
Dimension of each of the encoder blocks.`,name:"hidden_sizes"},{anchor:"transformers.GLPNConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[7, 3, 3, 3]</code>) &#x2014;
Patch size before each encoder block.`,name:"patch_sizes"},{anchor:"transformers.GLPNConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 2, 2]</code>) &#x2014;
Stride before each encoder block.`,name:"strides"},{anchor:"transformers.GLPNConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 4, 8]</code>) &#x2014;
Number of attention heads for each attention layer in each block of the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GLPNConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 4, 4, 4]</code>) &#x2014;
Ratio of the size of the hidden layer compared to the size of the input layer of the Mix FFNs in the
encoder blocks.`,name:"mlp_ratios"},{anchor:"transformers.GLPNConfig.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.GLPNConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.GLPNConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.GLPNConfig.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.GLPNConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for stochastic depth, used in the blocks of the Transformer encoder.`,name:"drop_path_rate"},{anchor:"transformers.GLPNConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GLPNConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The dimension of the decoder.`,name:"decoder_hidden_size"},{anchor:"transformers.GLPNConfig.max_depth",description:`<strong>max_depth</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
The maximum depth of the decoder.`,name:"max_depth"},{anchor:"transformers.GLPNConfig.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 head.`,name:"head_in_index"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/glpn/configuration_glpn.py#L29"}}),X=new $r({props:{anchor:"transformers.GLPNConfig.example",$$slots:{default:[vn]},$$scope:{ctx:G}}}),be=new rt({}),we=new Me({props:{name:"class transformers.models.glpn.image_processing_glpn.GLPNImageProcessor",anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size_divisor",val:": int = 32"},{name:"resample",val:" = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Set the class default for the <code>do_resize</code> parameter. Controls whether to resize the image&#x2019;s (height, width)
dimensions, rounding them down to the closest multiple of <code>size_divisor</code>.`,name:"do_resize"},{anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Set the class default for the <code>size_divisor</code> parameter. When <code>do_resize</code> is <code>True</code>, images are resized so
their height and width are rounded down to the closest multiple of <code>size_divisor</code>.`,name:"size_divisor"},{anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.resample",description:`<strong>resample</strong> (<code>PIL.Image</code> resampling filter, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BILINEAR</code>) &#x2014;
Set the class default for <code>resample</code>. Defines the resampling filter to use if resizing the image.`,name:"resample"},{anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Set the class default for the <code>do_rescale</code> parameter. Controls whether or not to apply the scaling factor
(to make pixel values floats between 0. and 1.).`,name:"do_rescale"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/glpn/image_processing_glpn.py#L34"}}),Pe=new Me({props:{name:"__call__",anchor:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/image_processing_utils.py#L50"}}),$e=new rt({}),Ne=new Me({props:{name:"class transformers.GLPNModel",anchor:"transformers.GLPNModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GLPNModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNConfig">GLPNConfig</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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/glpn/modeling_glpn.py#L484"}}),Ge=new Me({props:{name:"forward",anchor:"transformers.GLPNModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{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.GLPNModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor">GLPNFeatureExtractor</a>. See <a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.__call__">GLPNFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GLPNModel.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.GLPNModel.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.GLPNModel.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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/glpn/modeling_glpn.py#L504",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNConfig"
>GLPNConfig</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>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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Pr({props:{$$slots:{default:[bn]},$$scope:{ctx:G}}}),oe=new $r({props:{anchor:"transformers.GLPNModel.forward.example",$$slots:{default:[wn]},$$scope:{ctx:G}}}),Ee=new rt({}),xe=new Me({props:{name:"class transformers.GLPNForDepthEstimation",anchor:"transformers.GLPNForDepthEstimation",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GLPNForDepthEstimation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNConfig">GLPNConfig</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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/glpn/modeling_glpn.py#L686"}}),je=new Me({props:{name:"forward",anchor:"transformers.GLPNForDepthEstimation.forward",parameters:[{name:"pixel_values",val:""},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.GLPNForDepthEstimation.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor">GLPNFeatureExtractor</a>. See <a href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor.__call__">GLPNFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GLPNForDepthEstimation.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.GLPNForDepthEstimation.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.GLPNForDepthEstimation.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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GLPNForDepthEstimation.forward.labels",description:`<strong>labels</strong> (<code>torch.FloatTensor</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/vr_19907/src/transformers/models/glpn/modeling_glpn.py#L697",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.DepthEstimatorOutput"
>transformers.modeling_outputs.DepthEstimatorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNConfig"
>GLPNConfig</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/pr_19907/en/main_classes/output#transformers.modeling_outputs.DepthEstimatorOutput"
>transformers.modeling_outputs.DepthEstimatorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Pr({props:{$$slots:{default:[Pn]},$$scope:{ctx:G}}}),se=new $r({props:{anchor:"transformers.GLPNForDepthEstimation.forward.example",$$slots:{default:[$n]},$$scope:{ctx:G}}}),{c(){p=r("meta"),b=g(),f=r("h1"),u=r("a"),v=r("span"),w(a.$$.fragment),m=g(),E=r("span"),Yt=i("GLPN"),$t=g(),w(R.$$.fragment),Nt=g(),C=r("h2"),H=r("a"),nt=r("span"),w(de.$$.fragment),Qt=g(),st=r("span"),Xt=i("Overview"),Lt=g(),M=r("p"),Zt=i("The GLPN model was proposed in "),pe=r("a"),eo=i("Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth"),to=i(`  by Doyeon Kim, Woonghyun Ga, Pyungwhan Ahn, Donggyu Joo, Sehwan Chun, Junmo Kim.
GLPN combines `),Ie=r("a"),oo=i("SegFormer"),ro=i(`\u2019s hierarchical mix-Transformer with a lightweight decoder for monocular depth estimation. The proposed decoder shows better performance than the previously proposed decoders, with considerably
less computational complexity.`),yt=g(),Ce=r("p"),no=i("The abstract from the paper is the following:"),Gt=g(),De=r("p"),at=r("em"),so=i("Depth estimation from a single image is an important task that can be applied to various fields in computer vision, and has grown rapidly with the development of convolutional neural networks. In this paper, we propose a novel structure and training strategy for monocular depth estimation to further improve the prediction accuracy of the network. We deploy a hierarchical transformer encoder to capture and convey the global context, and design a lightweight yet powerful decoder to generate an estimated depth map while considering local connectivity. By constructing connected paths between multi-scale local features and the global decoding stream with our proposed selective feature fusion module, the network can integrate both representations and recover fine details. In addition, the proposed decoder shows better performance than the previously proposed decoders, with considerably less computational complexity. Furthermore, we improve the depth-specific augmentation method by utilizing an important observation in depth estimation to enhance the model. Our network achieves state-of-the-art performance over the challenging depth dataset NYU Depth V2. Extensive experiments have been conducted to validate and show the effectiveness of the proposed approach. Finally, our model shows better generalisation ability and robustness than other comparative models."),Et=g(),Ae=r("p"),ao=i("Tips:"),xt=g(),K=r("ul"),D=r("li"),io=i("A notebook illustrating inference with "),qe=r("a"),lo=i("GLPNForDepthEstimation"),po=i(" can be found "),ce=r("a"),co=i("here"),ho=i("."),mo=g(),he=r("li"),fo=i("One can use "),Se=r("a"),uo=i("GLPNFeatureExtractor"),go=i(" to prepare images for the model."),Tt=g(),J=r("img"),kt=g(),Y=r("small"),_o=i("Summary of the approach. Taken from the "),me=r("a"),vo=i("original paper"),bo=i("."),jt=g(),I=r("p"),wo=i("This model was contributed by "),fe=r("a"),Po=i("nielsr"),$o=i(". The original code can be found "),ue=r("a"),No=i("here"),Lo=i("."),Ft=g(),A=r("h2"),Q=r("a"),it=r("span"),w(ge.$$.fragment),yo=g(),lt=r("span"),Go=i("GLPNConfig"),zt=g(),x=r("div"),w(_e.$$.fragment),Eo=g(),q=r("p"),xo=i("This is the configuration class to store the configuration of a "),Oe=r("a"),To=i("GLPNModel"),ko=i(`. It is used to instantiate an GLPN
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 GLPN
`),ve=r("a"),jo=i("vinvino02/glpn-kitti"),Fo=i(" architecture."),zo=g(),S=r("p"),Mo=i("Configuration objects inherit from "),Be=r("a"),Io=i("PretrainedConfig"),Co=i(` and can be used to control the model outputs. Read the
documentation from `),Ve=r("a"),Do=i("PretrainedConfig"),Ao=i(" for more information."),qo=g(),w(X.$$.fragment),Mt=g(),O=r("h2"),Z=r("a"),dt=r("span"),w(be.$$.fragment),So=g(),pt=r("span"),Oo=i("GLPNFeatureExtractor"),It=g(),j=r("div"),w(we.$$.fragment),Bo=g(),ct=r("p"),Vo=i("Constructs a GLPN image processor."),Wo=g(),We=r("div"),w(Pe.$$.fragment),Ct=g(),B=r("h2"),ee=r("a"),ht=r("span"),w($e.$$.fragment),Uo=g(),mt=r("span"),Ro=i("GLPNModel"),Dt=g(),F=r("div"),w(Ne.$$.fragment),Ho=g(),Le=r("p"),Ko=i(`The bare GLPN encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ye=r("a"),Jo=i("torch.nn.Module"),Yo=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qo=g(),T=r("div"),w(Ge.$$.fragment),Xo=g(),V=r("p"),Zo=i("The "),Ue=r("a"),er=i("GLPNModel"),tr=i(" forward method, overrides the "),ft=r("code"),or=i("__call__"),rr=i(" special method."),nr=g(),w(te.$$.fragment),sr=g(),w(oe.$$.fragment),At=g(),W=r("h2"),re=r("a"),ut=r("span"),w(Ee.$$.fragment),ar=g(),gt=r("span"),ir=i("GLPNForDepthEstimation"),qt=g(),z=r("div"),w(xe.$$.fragment),lr=g(),Te=r("p"),dr=i(`GLPN Model transformer with a lightweight depth estimation head on top e.g. for KITTI, NYUv2.
This model is a PyTorch `),ke=r("a"),pr=i("torch.nn.Module"),cr=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hr=g(),k=r("div"),w(je.$$.fragment),mr=g(),U=r("p"),fr=i("The "),Re=r("a"),ur=i("GLPNForDepthEstimation"),gr=i(" forward method, overrides the "),_t=r("code"),_r=i("__call__"),vr=i(" special method."),br=g(),w(ne.$$.fragment),wr=g(),w(se.$$.fragment),this.h()},l(e){const c=fn('[data-svelte="svelte-1phssyn"]',document.head);p=n(c,"META",{name:!0,content:!0}),c.forEach(o),b=_(e),f=n(e,"H1",{class:!0});var Fe=s(f);u=n(Fe,"A",{id:!0,class:!0,href:!0});var vt=s(u);v=n(vt,"SPAN",{});var bt=s(v);P(a.$$.fragment,bt),bt.forEach(o),vt.forEach(o),m=_(Fe),E=n(Fe,"SPAN",{});var wt=s(E);Yt=l(wt,"GLPN"),wt.forEach(o),Fe.forEach(o),$t=_(e),P(R.$$.fragment,e),Nt=_(e),C=n(e,"H2",{class:!0});var ze=s(C);H=n(ze,"A",{id:!0,class:!0,href:!0});var Pt=s(H);nt=n(Pt,"SPAN",{});var Gr=s(nt);P(de.$$.fragment,Gr),Gr.forEach(o),Pt.forEach(o),Qt=_(ze),st=n(ze,"SPAN",{});var Er=s(st);Xt=l(Er,"Overview"),Er.forEach(o),ze.forEach(o),Lt=_(e),M=n(e,"P",{});var He=s(M);Zt=l(He,"The GLPN model was proposed in "),pe=n(He,"A",{href:!0,rel:!0});var xr=s(pe);eo=l(xr,"Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth"),xr.forEach(o),to=l(He,`  by Doyeon Kim, Woonghyun Ga, Pyungwhan Ahn, Donggyu Joo, Sehwan Chun, Junmo Kim.
GLPN combines `),Ie=n(He,"A",{href:!0});var Tr=s(Ie);oo=l(Tr,"SegFormer"),Tr.forEach(o),ro=l(He,`\u2019s hierarchical mix-Transformer with a lightweight decoder for monocular depth estimation. The proposed decoder shows better performance than the previously proposed decoders, with considerably
less computational complexity.`),He.forEach(o),yt=_(e),Ce=n(e,"P",{});var kr=s(Ce);no=l(kr,"The abstract from the paper is the following:"),kr.forEach(o),Gt=_(e),De=n(e,"P",{});var jr=s(De);at=n(jr,"EM",{});var Fr=s(at);so=l(Fr,"Depth estimation from a single image is an important task that can be applied to various fields in computer vision, and has grown rapidly with the development of convolutional neural networks. In this paper, we propose a novel structure and training strategy for monocular depth estimation to further improve the prediction accuracy of the network. We deploy a hierarchical transformer encoder to capture and convey the global context, and design a lightweight yet powerful decoder to generate an estimated depth map while considering local connectivity. By constructing connected paths between multi-scale local features and the global decoding stream with our proposed selective feature fusion module, the network can integrate both representations and recover fine details. In addition, the proposed decoder shows better performance than the previously proposed decoders, with considerably less computational complexity. Furthermore, we improve the depth-specific augmentation method by utilizing an important observation in depth estimation to enhance the model. Our network achieves state-of-the-art performance over the challenging depth dataset NYU Depth V2. Extensive experiments have been conducted to validate and show the effectiveness of the proposed approach. Finally, our model shows better generalisation ability and robustness than other comparative models."),Fr.forEach(o),jr.forEach(o),Et=_(e),Ae=n(e,"P",{});var zr=s(Ae);ao=l(zr,"Tips:"),zr.forEach(o),xt=_(e),K=n(e,"UL",{});var Ot=s(K);D=n(Ot,"LI",{});var Ke=s(D);io=l(Ke,"A notebook illustrating inference with "),qe=n(Ke,"A",{href:!0});var Mr=s(qe);lo=l(Mr,"GLPNForDepthEstimation"),Mr.forEach(o),po=l(Ke," can be found "),ce=n(Ke,"A",{href:!0,rel:!0});var Ir=s(ce);co=l(Ir,"here"),Ir.forEach(o),ho=l(Ke,"."),Ke.forEach(o),mo=_(Ot),he=n(Ot,"LI",{});var Bt=s(he);fo=l(Bt,"One can use "),Se=n(Bt,"A",{href:!0});var Cr=s(Se);uo=l(Cr,"GLPNFeatureExtractor"),Cr.forEach(o),go=l(Bt," to prepare images for the model."),Bt.forEach(o),Ot.forEach(o),Tt=_(e),J=n(e,"IMG",{src:!0,alt:!0,width:!0}),kt=_(e),Y=n(e,"SMALL",{});var Vt=s(Y);_o=l(Vt,"Summary of the approach. Taken from the "),me=n(Vt,"A",{href:!0,target:!0});var Dr=s(me);vo=l(Dr,"original paper"),Dr.forEach(o),bo=l(Vt,"."),Vt.forEach(o),jt=_(e),I=n(e,"P",{});var Je=s(I);wo=l(Je,"This model was contributed by "),fe=n(Je,"A",{href:!0,rel:!0});var Ar=s(fe);Po=l(Ar,"nielsr"),Ar.forEach(o),$o=l(Je,". The original code can be found "),ue=n(Je,"A",{href:!0,rel:!0});var qr=s(ue);No=l(qr,"here"),qr.forEach(o),Lo=l(Je,"."),Je.forEach(o),Ft=_(e),A=n(e,"H2",{class:!0});var Wt=s(A);Q=n(Wt,"A",{id:!0,class:!0,href:!0});var Sr=s(Q);it=n(Sr,"SPAN",{});var Or=s(it);P(ge.$$.fragment,Or),Or.forEach(o),Sr.forEach(o),yo=_(Wt),lt=n(Wt,"SPAN",{});var Br=s(lt);Go=l(Br,"GLPNConfig"),Br.forEach(o),Wt.forEach(o),zt=_(e),x=n(e,"DIV",{class:!0});var ae=s(x);P(_e.$$.fragment,ae),Eo=_(ae),q=n(ae,"P",{});var Ye=s(q);xo=l(Ye,"This is the configuration class to store the configuration of a "),Oe=n(Ye,"A",{href:!0});var Vr=s(Oe);To=l(Vr,"GLPNModel"),Vr.forEach(o),ko=l(Ye,`. It is used to instantiate an GLPN
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 GLPN
`),ve=n(Ye,"A",{href:!0,rel:!0});var Wr=s(ve);jo=l(Wr,"vinvino02/glpn-kitti"),Wr.forEach(o),Fo=l(Ye," architecture."),Ye.forEach(o),zo=_(ae),S=n(ae,"P",{});var Qe=s(S);Mo=l(Qe,"Configuration objects inherit from "),Be=n(Qe,"A",{href:!0});var Ur=s(Be);Io=l(Ur,"PretrainedConfig"),Ur.forEach(o),Co=l(Qe,` and can be used to control the model outputs. Read the
documentation from `),Ve=n(Qe,"A",{href:!0});var Rr=s(Ve);Do=l(Rr,"PretrainedConfig"),Rr.forEach(o),Ao=l(Qe," for more information."),Qe.forEach(o),qo=_(ae),P(X.$$.fragment,ae),ae.forEach(o),Mt=_(e),O=n(e,"H2",{class:!0});var Ut=s(O);Z=n(Ut,"A",{id:!0,class:!0,href:!0});var Hr=s(Z);dt=n(Hr,"SPAN",{});var Kr=s(dt);P(be.$$.fragment,Kr),Kr.forEach(o),Hr.forEach(o),So=_(Ut),pt=n(Ut,"SPAN",{});var Jr=s(pt);Oo=l(Jr,"GLPNFeatureExtractor"),Jr.forEach(o),Ut.forEach(o),It=_(e),j=n(e,"DIV",{class:!0});var Xe=s(j);P(we.$$.fragment,Xe),Bo=_(Xe),ct=n(Xe,"P",{});var Yr=s(ct);Vo=l(Yr,"Constructs a GLPN image processor."),Yr.forEach(o),Wo=_(Xe),We=n(Xe,"DIV",{class:!0});var Qr=s(We);P(Pe.$$.fragment,Qr),Qr.forEach(o),Xe.forEach(o),Ct=_(e),B=n(e,"H2",{class:!0});var Rt=s(B);ee=n(Rt,"A",{id:!0,class:!0,href:!0});var Xr=s(ee);ht=n(Xr,"SPAN",{});var Zr=s(ht);P($e.$$.fragment,Zr),Zr.forEach(o),Xr.forEach(o),Uo=_(Rt),mt=n(Rt,"SPAN",{});var en=s(mt);Ro=l(en,"GLPNModel"),en.forEach(o),Rt.forEach(o),Dt=_(e),F=n(e,"DIV",{class:!0});var Ze=s(F);P(Ne.$$.fragment,Ze),Ho=_(Ze),Le=n(Ze,"P",{});var Ht=s(Le);Ko=l(Ht,`The bare GLPN encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ye=n(Ht,"A",{href:!0,rel:!0});var tn=s(ye);Jo=l(tn,"torch.nn.Module"),tn.forEach(o),Yo=l(Ht,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ht.forEach(o),Qo=_(Ze),T=n(Ze,"DIV",{class:!0});var ie=s(T);P(Ge.$$.fragment,ie),Xo=_(ie),V=n(ie,"P",{});var et=s(V);Zo=l(et,"The "),Ue=n(et,"A",{href:!0});var on=s(Ue);er=l(on,"GLPNModel"),on.forEach(o),tr=l(et," forward method, overrides the "),ft=n(et,"CODE",{});var rn=s(ft);or=l(rn,"__call__"),rn.forEach(o),rr=l(et," special method."),et.forEach(o),nr=_(ie),P(te.$$.fragment,ie),sr=_(ie),P(oe.$$.fragment,ie),ie.forEach(o),Ze.forEach(o),At=_(e),W=n(e,"H2",{class:!0});var Kt=s(W);re=n(Kt,"A",{id:!0,class:!0,href:!0});var nn=s(re);ut=n(nn,"SPAN",{});var sn=s(ut);P(Ee.$$.fragment,sn),sn.forEach(o),nn.forEach(o),ar=_(Kt),gt=n(Kt,"SPAN",{});var an=s(gt);ir=l(an,"GLPNForDepthEstimation"),an.forEach(o),Kt.forEach(o),qt=_(e),z=n(e,"DIV",{class:!0});var tt=s(z);P(xe.$$.fragment,tt),lr=_(tt),Te=n(tt,"P",{});var Jt=s(Te);dr=l(Jt,`GLPN Model transformer with a lightweight depth estimation head on top e.g. for KITTI, NYUv2.
This model is a PyTorch `),ke=n(Jt,"A",{href:!0,rel:!0});var ln=s(ke);pr=l(ln,"torch.nn.Module"),ln.forEach(o),cr=l(Jt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jt.forEach(o),hr=_(tt),k=n(tt,"DIV",{class:!0});var le=s(k);P(je.$$.fragment,le),mr=_(le),U=n(le,"P",{});var ot=s(U);fr=l(ot,"The "),Re=n(ot,"A",{href:!0});var dn=s(Re);ur=l(dn,"GLPNForDepthEstimation"),dn.forEach(o),gr=l(ot," forward method, overrides the "),_t=n(ot,"CODE",{});var pn=s(_t);_r=l(pn,"__call__"),pn.forEach(o),vr=l(ot," special method."),ot.forEach(o),br=_(le),P(ne.$$.fragment,le),wr=_(le),P(se.$$.fragment,le),le.forEach(o),tt.forEach(o),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(Ln)),d(u,"id","glpn"),d(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"),d(u,"href","#glpn"),d(f,"class","relative group"),d(H,"id","overview"),d(H,"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"),d(H,"href","#overview"),d(C,"class","relative group"),d(pe,"href","https://arxiv.org/abs/2201.07436"),d(pe,"rel","nofollow"),d(Ie,"href","segformer"),d(qe,"href","/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNForDepthEstimation"),d(ce,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/GLPN/GLPN_inference_(depth_estimation).ipynb"),d(ce,"rel","nofollow"),d(Se,"href","/docs/transformers/pr_19907/en/model_doc/glpn#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor"),un(J.src,yr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/glpn_architecture.jpg")||d(J,"src",yr),d(J,"alt","drawing"),d(J,"width","600"),d(me,"href","https://arxiv.org/abs/2201.07436"),d(me,"target","_blank"),d(fe,"href","https://huggingface.co/nielsr"),d(fe,"rel","nofollow"),d(ue,"href","https://github.com/vinvino02/GLPDepth"),d(ue,"rel","nofollow"),d(Q,"id","transformers.GLPNConfig"),d(Q,"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"),d(Q,"href","#transformers.GLPNConfig"),d(A,"class","relative group"),d(Oe,"href","/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNModel"),d(ve,"href","https://huggingface.co/vinvino02/glpn-kitti"),d(ve,"rel","nofollow"),d(Be,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ve,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"id","transformers.models.glpn.image_processing_glpn.GLPNImageProcessor"),d(Z,"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"),d(Z,"href","#transformers.models.glpn.image_processing_glpn.GLPNImageProcessor"),d(O,"class","relative group"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"id","transformers.GLPNModel"),d(ee,"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"),d(ee,"href","#transformers.GLPNModel"),d(B,"class","relative group"),d(ye,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ye,"rel","nofollow"),d(Ue,"href","/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNModel"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(re,"id","transformers.GLPNForDepthEstimation"),d(re,"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"),d(re,"href","#transformers.GLPNForDepthEstimation"),d(W,"class","relative group"),d(ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ke,"rel","nofollow"),d(Re,"href","/docs/transformers/pr_19907/en/model_doc/glpn#transformers.GLPNForDepthEstimation"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){t(document.head,p),h(e,b,c),h(e,f,c),t(f,u),t(u,v),$(a,v,null),t(f,m),t(f,E),t(E,Yt),h(e,$t,c),$(R,e,c),h(e,Nt,c),h(e,C,c),t(C,H),t(H,nt),$(de,nt,null),t(C,Qt),t(C,st),t(st,Xt),h(e,Lt,c),h(e,M,c),t(M,Zt),t(M,pe),t(pe,eo),t(M,to),t(M,Ie),t(Ie,oo),t(M,ro),h(e,yt,c),h(e,Ce,c),t(Ce,no),h(e,Gt,c),h(e,De,c),t(De,at),t(at,so),h(e,Et,c),h(e,Ae,c),t(Ae,ao),h(e,xt,c),h(e,K,c),t(K,D),t(D,io),t(D,qe),t(qe,lo),t(D,po),t(D,ce),t(ce,co),t(D,ho),t(K,mo),t(K,he),t(he,fo),t(he,Se),t(Se,uo),t(he,go),h(e,Tt,c),h(e,J,c),h(e,kt,c),h(e,Y,c),t(Y,_o),t(Y,me),t(me,vo),t(Y,bo),h(e,jt,c),h(e,I,c),t(I,wo),t(I,fe),t(fe,Po),t(I,$o),t(I,ue),t(ue,No),t(I,Lo),h(e,Ft,c),h(e,A,c),t(A,Q),t(Q,it),$(ge,it,null),t(A,yo),t(A,lt),t(lt,Go),h(e,zt,c),h(e,x,c),$(_e,x,null),t(x,Eo),t(x,q),t(q,xo),t(q,Oe),t(Oe,To),t(q,ko),t(q,ve),t(ve,jo),t(q,Fo),t(x,zo),t(x,S),t(S,Mo),t(S,Be),t(Be,Io),t(S,Co),t(S,Ve),t(Ve,Do),t(S,Ao),t(x,qo),$(X,x,null),h(e,Mt,c),h(e,O,c),t(O,Z),t(Z,dt),$(be,dt,null),t(O,So),t(O,pt),t(pt,Oo),h(e,It,c),h(e,j,c),$(we,j,null),t(j,Bo),t(j,ct),t(ct,Vo),t(j,Wo),t(j,We),$(Pe,We,null),h(e,Ct,c),h(e,B,c),t(B,ee),t(ee,ht),$($e,ht,null),t(B,Uo),t(B,mt),t(mt,Ro),h(e,Dt,c),h(e,F,c),$(Ne,F,null),t(F,Ho),t(F,Le),t(Le,Ko),t(Le,ye),t(ye,Jo),t(Le,Yo),t(F,Qo),t(F,T),$(Ge,T,null),t(T,Xo),t(T,V),t(V,Zo),t(V,Ue),t(Ue,er),t(V,tr),t(V,ft),t(ft,or),t(V,rr),t(T,nr),$(te,T,null),t(T,sr),$(oe,T,null),h(e,At,c),h(e,W,c),t(W,re),t(re,ut),$(Ee,ut,null),t(W,ar),t(W,gt),t(gt,ir),h(e,qt,c),h(e,z,c),$(xe,z,null),t(z,lr),t(z,Te),t(Te,dr),t(Te,ke),t(ke,pr),t(Te,cr),t(z,hr),t(z,k),$(je,k,null),t(k,mr),t(k,U),t(U,fr),t(U,Re),t(Re,ur),t(U,gr),t(U,_t),t(_t,_r),t(U,vr),t(k,br),$(ne,k,null),t(k,wr),$(se,k,null),St=!0},p(e,[c]){const Fe={};c&2&&(Fe.$$scope={dirty:c,ctx:e}),R.$set(Fe);const vt={};c&2&&(vt.$$scope={dirty:c,ctx:e}),X.$set(vt);const bt={};c&2&&(bt.$$scope={dirty:c,ctx:e}),te.$set(bt);const wt={};c&2&&(wt.$$scope={dirty:c,ctx:e}),oe.$set(wt);const ze={};c&2&&(ze.$$scope={dirty:c,ctx:e}),ne.$set(ze);const Pt={};c&2&&(Pt.$$scope={dirty:c,ctx:e}),se.$set(Pt)},i(e){St||(N(a.$$.fragment,e),N(R.$$.fragment,e),N(de.$$.fragment,e),N(ge.$$.fragment,e),N(_e.$$.fragment,e),N(X.$$.fragment,e),N(be.$$.fragment,e),N(we.$$.fragment,e),N(Pe.$$.fragment,e),N($e.$$.fragment,e),N(Ne.$$.fragment,e),N(Ge.$$.fragment,e),N(te.$$.fragment,e),N(oe.$$.fragment,e),N(Ee.$$.fragment,e),N(xe.$$.fragment,e),N(je.$$.fragment,e),N(ne.$$.fragment,e),N(se.$$.fragment,e),St=!0)},o(e){L(a.$$.fragment,e),L(R.$$.fragment,e),L(de.$$.fragment,e),L(ge.$$.fragment,e),L(_e.$$.fragment,e),L(X.$$.fragment,e),L(be.$$.fragment,e),L(we.$$.fragment,e),L(Pe.$$.fragment,e),L($e.$$.fragment,e),L(Ne.$$.fragment,e),L(Ge.$$.fragment,e),L(te.$$.fragment,e),L(oe.$$.fragment,e),L(Ee.$$.fragment,e),L(xe.$$.fragment,e),L(je.$$.fragment,e),L(ne.$$.fragment,e),L(se.$$.fragment,e),St=!1},d(e){o(p),e&&o(b),e&&o(f),y(a),e&&o($t),y(R,e),e&&o(Nt),e&&o(C),y(de),e&&o(Lt),e&&o(M),e&&o(yt),e&&o(Ce),e&&o(Gt),e&&o(De),e&&o(Et),e&&o(Ae),e&&o(xt),e&&o(K),e&&o(Tt),e&&o(J),e&&o(kt),e&&o(Y),e&&o(jt),e&&o(I),e&&o(Ft),e&&o(A),y(ge),e&&o(zt),e&&o(x),y(_e),y(X),e&&o(Mt),e&&o(O),y(be),e&&o(It),e&&o(j),y(we),y(Pe),e&&o(Ct),e&&o(B),y($e),e&&o(Dt),e&&o(F),y(Ne),y(Ge),y(te),y(oe),e&&o(At),e&&o(W),y(Ee),e&&o(qt),e&&o(z),y(xe),y(je),y(ne),y(se)}}}const Ln={local:"glpn",sections:[{local:"overview",title:"Overview"},{local:"transformers.GLPNConfig",title:"GLPNConfig"},{local:"transformers.models.glpn.image_processing_glpn.GLPNImageProcessor",title:"GLPNFeatureExtractor"},{local:"transformers.GLPNModel",title:"GLPNModel"},{local:"transformers.GLPNForDepthEstimation",title:"GLPNForDepthEstimation"}],title:"GLPN"};function yn(G){return gn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fn extends cn{constructor(p){super();hn(this,p,yn,Nn,mn,{})}}export{Fn as default,Ln as metadata};
