import{s as Jo,o as Wo,n as Ce}from"../chunks/scheduler.9bc65507.js";import{S as ko,i as Io,g as a,s as l,u as v,A as Uo,h as r,f as t,c,j as g,v as _,y as f,k as h,o as s,a as d,w as M,d as T,t as V,x as w}from"../chunks/index.78c82d43.js";import{T as qt}from"../chunks/Tip.87d55b76.js";import{D as $e}from"../chunks/Docstring.4e7352e2.js";import{C as wt}from"../chunks/CodeBlock.73e038be.js";import{I as Ee}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Vt}from"../chunks/ExampleCodeBlock.872b014d.js";function Zo($){let n,b="Example:",m,p,u;return p=new wt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1vYmlsZVZpVFYyQ29uZmlnJTJDJTIwTW9iaWxlVmlUVjJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2JpbGV2aXR2Mi1zbWFsbCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNb2JpbGVWaVRWMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMG1vYmlsZXZpdHYyLXNtYWxsJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVWaVRWMk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileViTV2Config, MobileViTV2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a mobilevitv2-small style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MobileViTV2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the mobilevitv2-small style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2Model(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`,wrap:!1}}),{c(){n=a("p"),n.textContent=b,m=l(),v(p.$$.fragment)},l(o){n=r(o,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=b),m=c(o),_(p.$$.fragment,o)},m(o,y){d(o,n,y),d(o,m,y),M(p,o,y),u=!0},p:Ce,i(o){u||(T(p.$$.fragment,o),u=!0)},o(o){V(p.$$.fragment,o),u=!1},d(o){o&&(t(n),t(m)),w(p,o)}}}function Fo($){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=b},l(m){n=r(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(m,p){d(m,n,p)},p:Ce,d(m){m&&t(n)}}}function So($){let n,b="Example:",m,p,u;return p=new wt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVFYyTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0djItMS4wLWltYWdlbmV0MWstMjU2JTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlVmlUVjJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXR2Mi0xLjAtaW1hZ2VuZXQxay0yNTYlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTV2Model
<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;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2Model.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&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">512</span>, <span class="hljs-number">8</span>, <span class="hljs-number">8</span>]`,wrap:!1}}),{c(){n=a("p"),n.textContent=b,m=l(),v(p.$$.fragment)},l(o){n=r(o,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=b),m=c(o),_(p.$$.fragment,o)},m(o,y){d(o,n,y),d(o,m,y),M(p,o,y),u=!0},p:Ce,i(o){u||(T(p.$$.fragment,o),u=!0)},o(o){V(p.$$.fragment,o),u=!1},d(o){o&&(t(n),t(m)),w(p,o)}}}function No($){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=b},l(m){n=r(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(m,p){d(m,n,p)},p:Ce,d(m){m&&t(n)}}}function Bo($){let n,b="Example:",m,p,u;return p=new wt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVFYyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXR2Mi0xLjAtaW1hZ2VuZXQxay0yNTYlMjIpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVWaVRWMkZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0djItMS4wLWltYWdlbmV0MWstMjU2JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTV2ForImageClassification
<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;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&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>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,wrap:!1}}),{c(){n=a("p"),n.textContent=b,m=l(),v(p.$$.fragment)},l(o){n=r(o,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=b),m=c(o),_(p.$$.fragment,o)},m(o,y){d(o,n,y),d(o,m,y),M(p,o,y),u=!0},p:Ce,i(o){u||(T(p.$$.fragment,o),u=!0)},o(o){V(p.$$.fragment,o),u=!1},d(o){o&&(t(n),t(m)),w(p,o)}}}function zo($){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=b},l(m){n=r(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(m,p){d(m,n,p)},p:Ce,d(m){m&&t(n)}}}function Go($){let n,b="Examples:",m,p,u;return p=new wt({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMjBNb2JpbGVWaVRWMkZvclNlbWFudGljU2VnbWVudGF0aW9uJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXR2Mi0xLjAtaW1hZ2VuZXQxay0yNTYlMjIpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVWaVRWMkZvclNlbWFudGljU2VnbWVudGF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhcHBsZSUyRm1vYmlsZXZpdHYyLTEuMC1pbWFnZW5ldDFrLTI1NiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwbG9naXRzJTIwYXJlJTIwb2YlMjBzaGFwZSUyMChiYXRjaF9zaXplJTJDJTIwbnVtX2xhYmVscyUyQyUyMGhlaWdodCUyQyUyMHdpZHRoKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTV2ForSemanticSegmentation

<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;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2ForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&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><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><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`,wrap:!1}}),{c(){n=a("p"),n.textContent=b,m=l(),v(p.$$.fragment)},l(o){n=r(o,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=b),m=c(o),_(p.$$.fragment,o)},m(o,y){d(o,n,y),d(o,m,y),M(p,o,y),u=!0},p:Ce,i(o){u||(T(p.$$.fragment,o),u=!0)},o(o){V(p.$$.fragment,o),u=!1},d(o){o&&(t(n),t(m)),w(p,o)}}}function Po($){let n,b,m,p,u,o,y,oe,yt,xe,Ot="MobileViTV2",tt,U,B,He,ne,$t,je,Dt="Overview",ot,se,Kt='The MobileViTV2 model was proposed in <a href="https://arxiv.org/abs/2206.02680" rel="nofollow">Separable Self-attention for Mobile Vision Transformers</a> by Sachin Mehta and Mohammad Rastegari.',nt,ae,eo="MobileViTV2 is the second version of MobileViT, constructed by replacing the multi-headed self-attention in MobileViT with separable self-attention.",st,re,to="The abstract from the paper is the following:",at,ie,oo="<em>Mobile vision transformers (MobileViT) can achieve state-of-the-art performance across several mobile vision tasks, including classification and detection. Though these models have fewer parameters, they have high latency as compared to convolutional neural network-based models. The main efficiency bottleneck in MobileViT is the multi-headed self-attention (MHA) in transformers, which requires O(k2) time complexity with respect to the number of tokens (or patches) k. Moreover, MHA requires costly operations (e.g., batch-wise matrix multiplication) for computing self-attention, impacting latency on resource-constrained devices. This paper introduces a separable self-attention method with linear complexity, i.e. O(k). A simple yet effective characteristic of the proposed method is that it uses element-wise operations for computing self-attention, making it a good choice for resource-constrained devices. The improved model, MobileViTV2, is state-of-the-art on several mobile vision tasks, including ImageNet object classification and MS-COCO object detection. With about three million parameters, MobileViTV2 achieves a top-1 accuracy of 75.6% on the ImageNet dataset, outperforming MobileViT by about 1% while running 3.2× faster on a mobile device.</em>",rt,le,no="Tips:",it,ce,so='<li>MobileViTV2 is more like a CNN than a Transformer model. It does not work on sequence data but on batches of images. Unlike ViT, there are no embeddings. The backbone model outputs a feature map.</li> <li>One can use <a href="/docs/transformers/v4.34.0/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a> to prepare images for the model. Note that if you do your own preprocessing, the pretrained checkpoints expect images to be in BGR pixel order (not RGB).</li> <li>The available image classification checkpoints are pre-trained on <a href="https://huggingface.co/datasets/imagenet-1k" rel="nofollow">ImageNet-1k</a> (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes).</li> <li>The segmentation model uses a <a href="https://arxiv.org/abs/1706.05587" rel="nofollow">DeepLabV3</a> head. The available semantic segmentation checkpoints are pre-trained on <a href="http://host.robots.ox.ac.uk/pascal/VOC/" rel="nofollow">PASCAL VOC</a>.</li>',lt,de,ao=`This model was contributed by <a href="https://huggingface.co/shehan97" rel="nofollow">shehan97</a>.
The original code can be found <a href="https://github.com/apple/ml-cvnets" rel="nofollow">here</a>.`,ct,Z,z,Ae,me,Ct,Je,ro="MobileViTV2Config",dt,C,pe,xt,We,io=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Model">MobileViTV2Model</a>. It is used to instantiate a
MobileViTV2 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 MobileViTV2
<a href="https://huggingface.co/apple/mobilevitv2-1.0" rel="nofollow">apple/mobilevitv2-1.0</a> architecture.`,jt,ke,lo=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Jt,G,mt,F,P,Ye,he,Wt,Ie,co="MobileViTV2Model",pt,I,fe,kt,Ue,mo=`The bare MobileViTV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,It,J,ue,Ut,Ze,po='The <a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Model">MobileViTV2Model</a> forward method, overrides the <code>__call__</code> special method.',Zt,R,Ft,X,ht,S,E,Qe,ge,St,Fe,ho="MobileViTV2ForImageClassification",ft,x,be,Nt,Se,fo=`MobileViTV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,Bt,Ne,uo=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,zt,W,ve,Gt,Be,go='The <a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2ForImageClassification">MobileViTV2ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Pt,H,Rt,A,ut,N,Y,Le,_e,Xt,ze,bo="MobileViTV2ForSemanticSegmentation",gt,j,Me,Et,Ge,vo="MobileViTV2 model with a semantic segmentation head on top, e.g. for Pascal VOC.",Ht,Pe,_o=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,At,k,Te,Yt,Re,Mo='The <a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2ForSemanticSegmentation">MobileViTV2ForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',Qt,Q,Lt,L,bt,qe,vt;return oe=new Ee({}),ne=new Ee({}),me=new Ee({}),pe=new $e({props:{name:"class transformers.MobileViTV2Config",anchor:"transformers.MobileViTV2Config",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 256"},{name:"patch_size",val:" = 2"},{name:"expand_ratio",val:" = 2.0"},{name:"hidden_act",val:" = 'swish'"},{name:"conv_kernel_size",val:" = 3"},{name:"output_stride",val:" = 32"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"aspp_out_channels",val:" = 512"},{name:"atrous_rates",val:" = [6, 12, 18]"},{name:"aspp_dropout_prob",val:" = 0.1"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"n_attn_blocks",val:" = [2, 4, 3]"},{name:"base_attn_unit_dims",val:" = [128, 192, 256]"},{name:"width_multiplier",val:" = 1.0"},{name:"ffn_multiplier",val:" = 2"},{name:"attn_dropout",val:" = 0.0"},{name:"ffn_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.MobileViTV2Config.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.MobileViTV2Config.expand_ratio",description:`<strong>expand_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Expansion factor for the MobileNetv2 layers.`,name:"expand_ratio"},{anchor:"transformers.MobileViTV2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;swish&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the Transformer encoder and convolution layers.`,name:"hidden_act"},{anchor:"transformers.MobileViTV2Config.conv_kernel_size",description:`<strong>conv_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The size of the convolutional kernel in the MobileViTV2 layer.`,name:"conv_kernel_size"},{anchor:"transformers.MobileViTV2Config.output_stride",description:`<strong>output_stride</strong> (<code>int</code>, <code>optional</code>, defaults to 32) &#x2014;
The ratio of the spatial resolution of the output to the resolution of the input image.`,name:"output_stride"},{anchor:"transformers.MobileViTV2Config.classifier_dropout_prob",description:`<strong>classifier_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for attached classifiers.`,name:"classifier_dropout_prob"},{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MobileViTV2Config.aspp_out_channels",description:`<strong>aspp_out_channels</strong> (<code>int</code>, <code>optional</code>, defaults to 512) &#x2014;
Number of output channels used in the ASPP layer for semantic segmentation.`,name:"aspp_out_channels"},{anchor:"transformers.MobileViTV2Config.atrous_rates",description:`<strong>atrous_rates</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[6, 12, 18]</code>) &#x2014;
Dilation (atrous) factors used in the ASPP layer for semantic segmentation.`,name:"atrous_rates"},{anchor:"transformers.MobileViTV2Config.aspp_dropout_prob",description:`<strong>aspp_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the ASPP layer for semantic segmentation.`,name:"aspp_dropout_prob"},{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.n_attn_blocks",description:`<strong>n_attn_blocks</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 4, 3]</code>) &#x2014;
The number of attention blocks in each MobileViTV2Layer`,name:"n_attn_blocks"},{anchor:"transformers.MobileViTV2Config.base_attn_unit_dims",description:`<strong>base_attn_unit_dims</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[128, 192, 256]</code>) &#x2014;
The base multiplier for dimensions of attention blocks in each MobileViTV2Layer`,name:"base_attn_unit_dims"},{anchor:"transformers.MobileViTV2Config.width_multiplier",description:`<strong>width_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The width multiplier for MobileViTV2.`,name:"width_multiplier"},{anchor:"transformers.MobileViTV2Config.ffn_multiplier",description:`<strong>ffn_multiplier</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The FFN multiplier for MobileViTV2.`,name:"ffn_multiplier"},{anchor:"transformers.MobileViTV2Config.attn_dropout",description:`<strong>attn_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout in the attention layer.`,name:"attn_dropout"},{anchor:"transformers.MobileViTV2Config.ffn_dropout",description:`<strong>ffn_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout between FFN layers.`,name:"ffn_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py#L34"}}),G=new Vt({props:{anchor:"transformers.MobileViTV2Config.example",$$slots:{default:[Zo]},$$scope:{ctx:$}}}),he=new Ee({}),fe=new $e({props:{name:"class transformers.MobileViTV2Model",anchor:"transformers.MobileViTV2Model",parameters:[{name:"config",val:": MobileViTV2Config"},{name:"expand_output",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileViTV2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</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.34.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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L665"}}),ue=new $e({props:{name:"forward",anchor:"transformers.MobileViTV2Model.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTV2Model.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2Model.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.MobileViTV2Model.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.34.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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L699",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</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.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new qt({props:{$$slots:{default:[Fo]},$$scope:{ctx:$}}}),X=new Vt({props:{anchor:"transformers.MobileViTV2Model.forward.example",$$slots:{default:[So]},$$scope:{ctx:$}}}),ge=new Ee({}),be=new $e({props:{name:"class transformers.MobileViTV2ForImageClassification",anchor:"transformers.MobileViTV2ForImageClassification",parameters:[{name:"config",val:": MobileViTV2Config"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</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.34.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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L756"}}),ve=new $e({props:{name:"forward",anchor:"transformers.MobileViTV2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForImageClassification.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2ForImageClassification.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.MobileViTV2ForImageClassification.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTV2ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). 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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L774",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</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.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),H=new qt({props:{$$slots:{default:[No]},$$scope:{ctx:$}}}),A=new Vt({props:{anchor:"transformers.MobileViTV2ForImageClassification.forward.example",$$slots:{default:[Bo]},$$scope:{ctx:$}}}),_e=new Ee({}),Me=new $e({props:{name:"class transformers.MobileViTV2ForSemanticSegmentation",anchor:"transformers.MobileViTV2ForSemanticSegmentation",parameters:[{name:"config",val:": MobileViTV2Config"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</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.34.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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L956"}}),Te=new $e({props:{name:"forward",anchor:"transformers.MobileViTV2ForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForSemanticSegmentation.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2ForSemanticSegmentation.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.MobileViTV2ForSemanticSegmentation.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTV2ForSemanticSegmentation.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.34.0/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L967",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.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.34.0/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) — Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Q=new qt({props:{$$slots:{default:[zo]},$$scope:{ctx:$}}}),L=new Vt({props:{anchor:"transformers.MobileViTV2ForSemanticSegmentation.forward.example",$$slots:{default:[Go]},$$scope:{ctx:$}}}),{c(){n=a("meta"),b=l(),m=a("p"),p=l(),u=a("h1"),o=a("a"),y=a("span"),v(oe.$$.fragment),yt=l(),xe=a("span"),xe.textContent=Ot,tt=l(),U=a("h2"),B=a("a"),He=a("span"),v(ne.$$.fragment),$t=l(),je=a("span"),je.textContent=Dt,ot=l(),se=a("p"),se.innerHTML=Kt,nt=l(),ae=a("p"),ae.textContent=eo,st=l(),re=a("p"),re.textContent=to,at=l(),ie=a("p"),ie.innerHTML=oo,rt=l(),le=a("p"),le.textContent=no,it=l(),ce=a("ul"),ce.innerHTML=so,lt=l(),de=a("p"),de.innerHTML=ao,ct=l(),Z=a("h2"),z=a("a"),Ae=a("span"),v(me.$$.fragment),Ct=l(),Je=a("span"),Je.textContent=ro,dt=l(),C=a("div"),v(pe.$$.fragment),xt=l(),We=a("p"),We.innerHTML=io,jt=l(),ke=a("p"),ke.innerHTML=lo,Jt=l(),v(G.$$.fragment),mt=l(),F=a("h2"),P=a("a"),Ye=a("span"),v(he.$$.fragment),Wt=l(),Ie=a("span"),Ie.textContent=co,pt=l(),I=a("div"),v(fe.$$.fragment),kt=l(),Ue=a("p"),Ue.innerHTML=mo,It=l(),J=a("div"),v(ue.$$.fragment),Ut=l(),Ze=a("p"),Ze.innerHTML=po,Zt=l(),v(R.$$.fragment),Ft=l(),v(X.$$.fragment),ht=l(),S=a("h2"),E=a("a"),Qe=a("span"),v(ge.$$.fragment),St=l(),Fe=a("span"),Fe.textContent=ho,ft=l(),x=a("div"),v(be.$$.fragment),Nt=l(),Se=a("p"),Se.textContent=fo,Bt=l(),Ne=a("p"),Ne.innerHTML=uo,zt=l(),W=a("div"),v(ve.$$.fragment),Gt=l(),Be=a("p"),Be.innerHTML=go,Pt=l(),v(H.$$.fragment),Rt=l(),v(A.$$.fragment),ut=l(),N=a("h2"),Y=a("a"),Le=a("span"),v(_e.$$.fragment),Xt=l(),ze=a("span"),ze.textContent=bo,gt=l(),j=a("div"),v(Me.$$.fragment),Et=l(),Ge=a("p"),Ge.textContent=vo,Ht=l(),Pe=a("p"),Pe.innerHTML=_o,At=l(),k=a("div"),v(Te.$$.fragment),Yt=l(),Re=a("p"),Re.innerHTML=Mo,Qt=l(),v(Q.$$.fragment),Lt=l(),v(L.$$.fragment),bt=l(),qe=a("p"),this.h()},l(e){const i=Uo("svelte-1phssyn",document.head);n=r(i,"META",{name:!0,content:!0}),i.forEach(t),b=c(e),m=r(e,"P",{}),g(m).forEach(t),p=c(e),u=r(e,"H1",{class:!0});var Ve=g(u);o=r(Ve,"A",{id:!0,class:!0,href:!0});var Oe=g(o);y=r(Oe,"SPAN",{});var De=g(y);_(oe.$$.fragment,De),De.forEach(t),Oe.forEach(t),yt=c(Ve),xe=r(Ve,"SPAN",{"data-svelte-h":!0}),f(xe)!=="svelte-vthpmu"&&(xe.textContent=Ot),Ve.forEach(t),tt=c(e),U=r(e,"H2",{class:!0});var we=g(U);B=r(we,"A",{id:!0,class:!0,href:!0});var Ke=g(B);He=r(Ke,"SPAN",{});var et=g(He);_(ne.$$.fragment,et),et.forEach(t),Ke.forEach(t),$t=c(we),je=r(we,"SPAN",{"data-svelte-h":!0}),f(je)!=="svelte-1jsw1pg"&&(je.textContent=Dt),we.forEach(t),ot=c(e),se=r(e,"P",{"data-svelte-h":!0}),f(se)!=="svelte-1mta9ef"&&(se.innerHTML=Kt),nt=c(e),ae=r(e,"P",{"data-svelte-h":!0}),f(ae)!=="svelte-1eurxj7"&&(ae.textContent=eo),st=c(e),re=r(e,"P",{"data-svelte-h":!0}),f(re)!=="svelte-vfdo9a"&&(re.textContent=to),at=c(e),ie=r(e,"P",{"data-svelte-h":!0}),f(ie)!=="svelte-1xe01bc"&&(ie.innerHTML=oo),rt=c(e),le=r(e,"P",{"data-svelte-h":!0}),f(le)!=="svelte-axv494"&&(le.textContent=no),it=c(e),ce=r(e,"UL",{"data-svelte-h":!0}),f(ce)!=="svelte-u06zlz"&&(ce.innerHTML=so),lt=c(e),de=r(e,"P",{"data-svelte-h":!0}),f(de)!=="svelte-rz3bb6"&&(de.innerHTML=ao),ct=c(e),Z=r(e,"H2",{class:!0});var ye=g(Z);z=r(ye,"A",{id:!0,class:!0,href:!0});var To=g(z);Ae=r(To,"SPAN",{});var Vo=g(Ae);_(me.$$.fragment,Vo),Vo.forEach(t),To.forEach(t),Ct=c(ye),Je=r(ye,"SPAN",{"data-svelte-h":!0}),f(Je)!=="svelte-1ti39r0"&&(Je.textContent=ro),ye.forEach(t),dt=c(e),C=r(e,"DIV",{class:!0});var q=g(C);_(pe.$$.fragment,q),xt=c(q),We=r(q,"P",{"data-svelte-h":!0}),f(We)!=="svelte-10zgqsq"&&(We.innerHTML=io),jt=c(q),ke=r(q,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-10kqkkl"&&(ke.innerHTML=lo),Jt=c(q),_(G.$$.fragment,q),q.forEach(t),mt=c(e),F=r(e,"H2",{class:!0});var _t=g(F);P=r(_t,"A",{id:!0,class:!0,href:!0});var wo=g(P);Ye=r(wo,"SPAN",{});var yo=g(Ye);_(he.$$.fragment,yo),yo.forEach(t),wo.forEach(t),Wt=c(_t),Ie=r(_t,"SPAN",{"data-svelte-h":!0}),f(Ie)!=="svelte-1i6xjuj"&&(Ie.textContent=co),_t.forEach(t),pt=c(e),I=r(e,"DIV",{class:!0});var Xe=g(I);_(fe.$$.fragment,Xe),kt=c(Xe),Ue=r(Xe,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-1vozw9r"&&(Ue.innerHTML=mo),It=c(Xe),J=r(Xe,"DIV",{class:!0});var O=g(J);_(ue.$$.fragment,O),Ut=c(O),Ze=r(O,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-16ebqcy"&&(Ze.innerHTML=po),Zt=c(O),_(R.$$.fragment,O),Ft=c(O),_(X.$$.fragment,O),O.forEach(t),Xe.forEach(t),ht=c(e),S=r(e,"H2",{class:!0});var Mt=g(S);E=r(Mt,"A",{id:!0,class:!0,href:!0});var $o=g(E);Qe=r($o,"SPAN",{});var Co=g(Qe);_(ge.$$.fragment,Co),Co.forEach(t),$o.forEach(t),St=c(Mt),Fe=r(Mt,"SPAN",{"data-svelte-h":!0}),f(Fe)!=="svelte-al2hba"&&(Fe.textContent=ho),Mt.forEach(t),ft=c(e),x=r(e,"DIV",{class:!0});var D=g(x);_(be.$$.fragment,D),Nt=c(D),Se=r(D,"P",{"data-svelte-h":!0}),f(Se)!=="svelte-1ojd07h"&&(Se.textContent=fo),Bt=c(D),Ne=r(D,"P",{"data-svelte-h":!0}),f(Ne)!=="svelte-1gjh92c"&&(Ne.innerHTML=uo),zt=c(D),W=r(D,"DIV",{class:!0});var K=g(W);_(ve.$$.fragment,K),Gt=c(K),Be=r(K,"P",{"data-svelte-h":!0}),f(Be)!=="svelte-1yer7vm"&&(Be.innerHTML=go),Pt=c(K),_(H.$$.fragment,K),Rt=c(K),_(A.$$.fragment,K),K.forEach(t),D.forEach(t),ut=c(e),N=r(e,"H2",{class:!0});var Tt=g(N);Y=r(Tt,"A",{id:!0,class:!0,href:!0});var xo=g(Y);Le=r(xo,"SPAN",{});var jo=g(Le);_(_e.$$.fragment,jo),jo.forEach(t),xo.forEach(t),Xt=c(Tt),ze=r(Tt,"SPAN",{"data-svelte-h":!0}),f(ze)!=="svelte-dytxn"&&(ze.textContent=bo),Tt.forEach(t),gt=c(e),j=r(e,"DIV",{class:!0});var ee=g(j);_(Me.$$.fragment,ee),Et=c(ee),Ge=r(ee,"P",{"data-svelte-h":!0}),f(Ge)!=="svelte-w9c1ym"&&(Ge.textContent=vo),Ht=c(ee),Pe=r(ee,"P",{"data-svelte-h":!0}),f(Pe)!=="svelte-1gjh92c"&&(Pe.innerHTML=_o),At=c(ee),k=r(ee,"DIV",{class:!0});var te=g(k);_(Te.$$.fragment,te),Yt=c(te),Re=r(te,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-1iv07pu"&&(Re.innerHTML=Mo),Qt=c(te),_(Q.$$.fragment,te),Lt=c(te),_(L.$$.fragment,te),te.forEach(t),ee.forEach(t),bt=c(e),qe=r(e,"P",{}),g(qe).forEach(t),this.h()},h(){h(n,"name","hf:doc:metadata"),h(n,"content",JSON.stringify(Ro)),h(o,"id","mobilevitv2"),h(o,"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"),h(o,"href","#mobilevitv2"),h(u,"class","relative group"),h(B,"id","overview"),h(B,"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"),h(B,"href","#overview"),h(U,"class","relative group"),h(z,"id","transformers.MobileViTV2Config"),h(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"),h(z,"href","#transformers.MobileViTV2Config"),h(Z,"class","relative group"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(P,"id","transformers.MobileViTV2Model"),h(P,"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"),h(P,"href","#transformers.MobileViTV2Model"),h(F,"class","relative group"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(E,"id","transformers.MobileViTV2ForImageClassification"),h(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"),h(E,"href","#transformers.MobileViTV2ForImageClassification"),h(S,"class","relative group"),h(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Y,"id","transformers.MobileViTV2ForSemanticSegmentation"),h(Y,"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"),h(Y,"href","#transformers.MobileViTV2ForSemanticSegmentation"),h(N,"class","relative group"),h(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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(e,i){s(document.head,n),d(e,b,i),d(e,m,i),d(e,p,i),d(e,u,i),s(u,o),s(o,y),M(oe,y,null),s(u,yt),s(u,xe),d(e,tt,i),d(e,U,i),s(U,B),s(B,He),M(ne,He,null),s(U,$t),s(U,je),d(e,ot,i),d(e,se,i),d(e,nt,i),d(e,ae,i),d(e,st,i),d(e,re,i),d(e,at,i),d(e,ie,i),d(e,rt,i),d(e,le,i),d(e,it,i),d(e,ce,i),d(e,lt,i),d(e,de,i),d(e,ct,i),d(e,Z,i),s(Z,z),s(z,Ae),M(me,Ae,null),s(Z,Ct),s(Z,Je),d(e,dt,i),d(e,C,i),M(pe,C,null),s(C,xt),s(C,We),s(C,jt),s(C,ke),s(C,Jt),M(G,C,null),d(e,mt,i),d(e,F,i),s(F,P),s(P,Ye),M(he,Ye,null),s(F,Wt),s(F,Ie),d(e,pt,i),d(e,I,i),M(fe,I,null),s(I,kt),s(I,Ue),s(I,It),s(I,J),M(ue,J,null),s(J,Ut),s(J,Ze),s(J,Zt),M(R,J,null),s(J,Ft),M(X,J,null),d(e,ht,i),d(e,S,i),s(S,E),s(E,Qe),M(ge,Qe,null),s(S,St),s(S,Fe),d(e,ft,i),d(e,x,i),M(be,x,null),s(x,Nt),s(x,Se),s(x,Bt),s(x,Ne),s(x,zt),s(x,W),M(ve,W,null),s(W,Gt),s(W,Be),s(W,Pt),M(H,W,null),s(W,Rt),M(A,W,null),d(e,ut,i),d(e,N,i),s(N,Y),s(Y,Le),M(_e,Le,null),s(N,Xt),s(N,ze),d(e,gt,i),d(e,j,i),M(Me,j,null),s(j,Et),s(j,Ge),s(j,Ht),s(j,Pe),s(j,At),s(j,k),M(Te,k,null),s(k,Yt),s(k,Re),s(k,Qt),M(Q,k,null),s(k,Lt),M(L,k,null),d(e,bt,i),d(e,qe,i),vt=!0},p(e,[i]){const Ve={};i&2&&(Ve.$$scope={dirty:i,ctx:e}),G.$set(Ve);const Oe={};i&2&&(Oe.$$scope={dirty:i,ctx:e}),R.$set(Oe);const De={};i&2&&(De.$$scope={dirty:i,ctx:e}),X.$set(De);const we={};i&2&&(we.$$scope={dirty:i,ctx:e}),H.$set(we);const Ke={};i&2&&(Ke.$$scope={dirty:i,ctx:e}),A.$set(Ke);const et={};i&2&&(et.$$scope={dirty:i,ctx:e}),Q.$set(et);const ye={};i&2&&(ye.$$scope={dirty:i,ctx:e}),L.$set(ye)},i(e){vt||(T(oe.$$.fragment,e),T(ne.$$.fragment,e),T(me.$$.fragment,e),T(pe.$$.fragment,e),T(G.$$.fragment,e),T(he.$$.fragment,e),T(fe.$$.fragment,e),T(ue.$$.fragment,e),T(R.$$.fragment,e),T(X.$$.fragment,e),T(ge.$$.fragment,e),T(be.$$.fragment,e),T(ve.$$.fragment,e),T(H.$$.fragment,e),T(A.$$.fragment,e),T(_e.$$.fragment,e),T(Me.$$.fragment,e),T(Te.$$.fragment,e),T(Q.$$.fragment,e),T(L.$$.fragment,e),vt=!0)},o(e){V(oe.$$.fragment,e),V(ne.$$.fragment,e),V(me.$$.fragment,e),V(pe.$$.fragment,e),V(G.$$.fragment,e),V(he.$$.fragment,e),V(fe.$$.fragment,e),V(ue.$$.fragment,e),V(R.$$.fragment,e),V(X.$$.fragment,e),V(ge.$$.fragment,e),V(be.$$.fragment,e),V(ve.$$.fragment,e),V(H.$$.fragment,e),V(A.$$.fragment,e),V(_e.$$.fragment,e),V(Me.$$.fragment,e),V(Te.$$.fragment,e),V(Q.$$.fragment,e),V(L.$$.fragment,e),vt=!1},d(e){e&&(t(b),t(m),t(p),t(u),t(tt),t(U),t(ot),t(se),t(nt),t(ae),t(st),t(re),t(at),t(ie),t(rt),t(le),t(it),t(ce),t(lt),t(de),t(ct),t(Z),t(dt),t(C),t(mt),t(F),t(pt),t(I),t(ht),t(S),t(ft),t(x),t(ut),t(N),t(gt),t(j),t(bt),t(qe)),t(n),w(oe),w(ne),w(me),w(pe),w(G),w(he),w(fe),w(ue),w(R),w(X),w(ge),w(be),w(ve),w(H),w(A),w(_e),w(Me),w(Te),w(Q),w(L)}}}const Ro={local:"mobilevitv2",sections:[{local:"overview",title:"Overview"},{local:"transformers.MobileViTV2Config",title:"MobileViTV2Config"},{local:"transformers.MobileViTV2Model",title:"MobileViTV2Model"},{local:"transformers.MobileViTV2ForImageClassification",title:"MobileViTV2ForImageClassification"},{local:"transformers.MobileViTV2ForSemanticSegmentation",title:"MobileViTV2ForSemanticSegmentation"}],title:"MobileViTV2"};function Xo($){return Wo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oo extends ko{constructor(n){super(),Io(this,n,Xo,Po,Jo,{})}}export{Oo as component};
