import{s as Ft,o as jt,n as ye}from"../chunks/scheduler.9bc65507.js";import{S as Ut,i as It,g as m,s as r,r as M,A as Zt,h as p,f as n,c as i,j as D,u as v,x as _,k as A,y as d,a as l,v as y,d as w,t as $,w as V}from"../chunks/index.707bf1b6.js";import{T as Oe}from"../chunks/Tip.c2ecdbf4.js";import{D as me}from"../chunks/Docstring.17db21ae.js";import{C as st}from"../chunks/CodeBlock.54a9f38d.js";import{F as kt,M as Ct}from"../chunks/Markdown.8ab98a13.js";import{E as it}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as Jt}from"../chunks/PipelineTag.44585822.js";import{H as Se}from"../chunks/Heading.342b1fa6.js";function zt(F){let e,u="Example:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1vYmlsZVZpVENvbmZpZyUyQyUyME1vYmlsZVZpVE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vYmlsZXZpdC1zbWFsbCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNb2JpbGVWaVRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBtb2JpbGV2aXQtc21hbGwlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME1vYmlsZVZpVE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileViTConfig, MobileViTModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the mobilevit-small style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTModel(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(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Wt(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function St(F){let e,u="Example:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJhcHBsZSUyRm1vYmlsZXZpdC1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZVZpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJhcHBsZSUyRm1vYmlsZXZpdC1zbWFsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTModel
<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/mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTModel.from_pretrained(<span class="hljs-string">&quot;apple/mobilevit-small&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">640</span>, <span class="hljs-number">8</span>, <span class="hljs-number">8</span>]`,wrap:!1}}),{c(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Nt(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function Rt(F){let e,u="Example:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXQtc21hbGwlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTForImageClassification
<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/mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTForImageClassification.from_pretrained(<span class="hljs-string">&quot;apple/mobilevit-small&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(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Pt(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function Gt(F){let e,u="Examples:",o,a,g;return a=new st({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMjBNb2JpbGVWaVRGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbiUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGZGVlcGxhYnYzLW1vYmlsZXZpdC1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZVZpVEZvclNlbWFudGljU2VnbWVudGF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhcHBsZSUyRmRlZXBsYWJ2My1tb2JpbGV2aXQtc21hbGwlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMGxvZ2l0cyUyMGFyZSUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9sYWJlbHMlMkMlMjBoZWlnaHQlMkMlMjB3aWR0aCklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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, MobileViTForSemanticSegmentation

<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/deeplabv3-mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;apple/deeplabv3-mobilevit-small&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(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Lt(F){let e,u,o,a,g,s,b=`The bare MobileViT 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.`,X,C,k,Y,Z,J='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTModel">MobileViTModel</a> forward method, overrides the <code>__call__</code> special method.',W,c,j,O,we,Fe,pe,R,Q,_e,he,Ne=`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,S,ne,je=`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.`,ze,K,ae,$e,ue,Ye='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForImageClassification">MobileViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Ve,re,Re,P,He,G,ee,te,ie,Ue,We,Te="MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC.",xe,fe,Pe=`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.`,le,q,U,ce,Ie,Me='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',Qe,ve,ge,Ze,Ge;return e=new Se({props:{title:"MobileViTModel",local:"transformers.MobileViTModel",headingTag:"h2"}}),a=new me({props:{name:"class transformers.MobileViTModel",anchor:"transformers.MobileViTModel",parameters:[{name:"config",val:": MobileViTConfig"},{name:"expand_output",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/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/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L697"}}),k=new me({props:{name:"forward",anchor:"transformers.MobileViTModel.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.MobileViTModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTModel.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.MobileViTModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L734",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),c=new Oe({props:{$$slots:{default:[Wt]},$$scope:{ctx:F}}}),O=new it({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[St]},$$scope:{ctx:F}}}),Fe=new Se({props:{title:"MobileViTForImageClassification",local:"transformers.MobileViTForImageClassification",headingTag:"h2"}}),Q=new me({props:{name:"class transformers.MobileViTForImageClassification",anchor:"transformers.MobileViTForImageClassification",parameters:[{name:"config",val:": MobileViTConfig"}],parametersDescription:[{anchor:"transformers.MobileViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/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/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L791"}}),ae=new me({props:{name:"forward",anchor:"transformers.MobileViTForImageClassification.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.MobileViTForImageClassification.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForImageClassification.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.MobileViTForImageClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForImageClassification.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/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L807",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new Oe({props:{$$slots:{default:[Nt]},$$scope:{ctx:F}}}),P=new it({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[Rt]},$$scope:{ctx:F}}}),G=new Se({props:{title:"MobileViTForSemanticSegmentation",local:"transformers.MobileViTForSemanticSegmentation",headingTag:"h2"}}),ie=new me({props:{name:"class transformers.MobileViTForSemanticSegmentation",anchor:"transformers.MobileViTForSemanticSegmentation",parameters:[{name:"config",val:": MobileViTConfig"}],parametersDescription:[{anchor:"transformers.MobileViTForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/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/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L986"}}),U=new me({props:{name:"forward",anchor:"transformers.MobileViTForSemanticSegmentation.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.MobileViTForSemanticSegmentation.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForSemanticSegmentation.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.MobileViTForSemanticSegmentation.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForSemanticSegmentation.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/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L997",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new Oe({props:{$$slots:{default:[Pt]},$$scope:{ctx:F}}}),Ze=new it({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[Gt]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment),u=r(),o=m("div"),M(a.$$.fragment),g=r(),s=m("p"),s.innerHTML=b,X=r(),C=m("div"),M(k.$$.fragment),Y=r(),Z=m("p"),Z.innerHTML=J,W=r(),M(c.$$.fragment),j=r(),M(O.$$.fragment),we=r(),M(Fe.$$.fragment),pe=r(),R=m("div"),M(Q.$$.fragment),_e=r(),he=m("p"),he.textContent=Ne,S=r(),ne=m("p"),ne.innerHTML=je,ze=r(),K=m("div"),M(ae.$$.fragment),$e=r(),ue=m("p"),ue.innerHTML=Ye,Ve=r(),M(re.$$.fragment),Re=r(),M(P.$$.fragment),He=r(),M(G.$$.fragment),ee=r(),te=m("div"),M(ie.$$.fragment),Ue=r(),We=m("p"),We.textContent=Te,xe=r(),fe=m("p"),fe.innerHTML=Pe,le=r(),q=m("div"),M(U.$$.fragment),ce=r(),Ie=m("p"),Ie.innerHTML=Me,Qe=r(),M(ve.$$.fragment),ge=r(),M(Ze.$$.fragment),this.h()},l(f){v(e.$$.fragment,f),u=i(f),o=p(f,"DIV",{class:!0});var I=D(o);v(a.$$.fragment,I),g=i(I),s=p(I,"P",{"data-svelte-h":!0}),_(s)!=="svelte-1nu7yyb"&&(s.innerHTML=b),X=i(I),C=p(I,"DIV",{class:!0});var B=D(C);v(k.$$.fragment,B),Y=i(B),Z=p(B,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-1gamdqu"&&(Z.innerHTML=J),W=i(B),v(c.$$.fragment,B),j=i(B),v(O.$$.fragment,B),B.forEach(n),I.forEach(n),we=i(f),v(Fe.$$.fragment,f),pe=i(f),R=p(f,"DIV",{class:!0});var L=D(R);v(Q.$$.fragment,L),_e=i(L),he=p(L,"P",{"data-svelte-h":!0}),_(he)!=="svelte-zljr1p"&&(he.textContent=Ne),S=i(L),ne=p(L,"P",{"data-svelte-h":!0}),_(ne)!=="svelte-1gjh92c"&&(ne.innerHTML=je),ze=i(L),K=p(L,"DIV",{class:!0});var N=D(K);v(ae.$$.fragment,N),$e=i(N),ue=p(N,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-le7sky"&&(ue.innerHTML=Ye),Ve=i(N),v(re.$$.fragment,N),Re=i(N),v(P.$$.fragment,N),N.forEach(n),L.forEach(n),He=i(f),v(G.$$.fragment,f),ee=i(f),te=p(f,"DIV",{class:!0});var z=D(te);v(ie.$$.fragment,z),Ue=i(z),We=p(z,"P",{"data-svelte-h":!0}),_(We)!=="svelte-n2rd9e"&&(We.textContent=Te),xe=i(z),fe=p(z,"P",{"data-svelte-h":!0}),_(fe)!=="svelte-1gjh92c"&&(fe.innerHTML=Pe),le=i(z),q=p(z,"DIV",{class:!0});var E=D(q);v(U.$$.fragment,E),ce=i(E),Ie=p(E,"P",{"data-svelte-h":!0}),_(Ie)!=="svelte-gglgdy"&&(Ie.innerHTML=Me),Qe=i(E),v(ve.$$.fragment,E),ge=i(E),v(Ze.$$.fragment,E),E.forEach(n),z.forEach(n),this.h()},h(){A(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(f,I){y(e,f,I),l(f,u,I),l(f,o,I),y(a,o,null),d(o,g),d(o,s),d(o,X),d(o,C),y(k,C,null),d(C,Y),d(C,Z),d(C,W),y(c,C,null),d(C,j),y(O,C,null),l(f,we,I),y(Fe,f,I),l(f,pe,I),l(f,R,I),y(Q,R,null),d(R,_e),d(R,he),d(R,S),d(R,ne),d(R,ze),d(R,K),y(ae,K,null),d(K,$e),d(K,ue),d(K,Ve),y(re,K,null),d(K,Re),y(P,K,null),l(f,He,I),y(G,f,I),l(f,ee,I),l(f,te,I),y(ie,te,null),d(te,Ue),d(te,We),d(te,xe),d(te,fe),d(te,le),d(te,q),y(U,q,null),d(q,ce),d(q,Ie),d(q,Qe),y(ve,q,null),d(q,ge),y(Ze,q,null),Ge=!0},p(f,I){const B={};I&2&&(B.$$scope={dirty:I,ctx:f}),c.$set(B);const L={};I&2&&(L.$$scope={dirty:I,ctx:f}),O.$set(L);const N={};I&2&&(N.$$scope={dirty:I,ctx:f}),re.$set(N);const z={};I&2&&(z.$$scope={dirty:I,ctx:f}),P.$set(z);const E={};I&2&&(E.$$scope={dirty:I,ctx:f}),ve.$set(E);const Ce={};I&2&&(Ce.$$scope={dirty:I,ctx:f}),Ze.$set(Ce)},i(f){Ge||(w(e.$$.fragment,f),w(a.$$.fragment,f),w(k.$$.fragment,f),w(c.$$.fragment,f),w(O.$$.fragment,f),w(Fe.$$.fragment,f),w(Q.$$.fragment,f),w(ae.$$.fragment,f),w(re.$$.fragment,f),w(P.$$.fragment,f),w(G.$$.fragment,f),w(ie.$$.fragment,f),w(U.$$.fragment,f),w(ve.$$.fragment,f),w(Ze.$$.fragment,f),Ge=!0)},o(f){$(e.$$.fragment,f),$(a.$$.fragment,f),$(k.$$.fragment,f),$(c.$$.fragment,f),$(O.$$.fragment,f),$(Fe.$$.fragment,f),$(Q.$$.fragment,f),$(ae.$$.fragment,f),$(re.$$.fragment,f),$(P.$$.fragment,f),$(G.$$.fragment,f),$(ie.$$.fragment,f),$(U.$$.fragment,f),$(ve.$$.fragment,f),$(Ze.$$.fragment,f),Ge=!1},d(f){f&&(n(u),n(o),n(we),n(pe),n(R),n(He),n(ee),n(te)),V(e,f),V(a),V(k),V(c),V(O),V(Fe,f),V(Q),V(ae),V(re),V(P),V(G,f),V(ie),V(U),V(ve),V(Ze)}}}function Ht(F){let e,u;return e=new Ct({props:{$$slots:{default:[Lt]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment)},l(o){v(e.$$.fragment,o)},m(o,a){y(e,o,a),u=!0},p(o,a){const g={};a&2&&(g.$$scope={dirty:a,ctx:o}),e.$set(g)},i(o){u||(w(e.$$.fragment,o),u=!0)},o(o){$(e.$$.fragment,o),u=!1},d(o){V(e,o)}}}function Bt(F){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,a,g="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",s,b,X=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,C,k,Y=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Z,J,W=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=m("p"),e.innerHTML=u,o=r(),a=m("ul"),a.innerHTML=g,s=r(),b=m("p"),b.innerHTML=X,C=r(),k=m("ul"),k.innerHTML=Y,Z=r(),J=m("p"),J.innerHTML=W},l(c){e=p(c,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),o=i(c),a=p(c,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=g),s=i(c),b=p(c,"P",{"data-svelte-h":!0}),_(b)!=="svelte-1v9qsc5"&&(b.innerHTML=X),C=i(c),k=p(c,"UL",{"data-svelte-h":!0}),_(k)!=="svelte-99h8aq"&&(k.innerHTML=Y),Z=i(c),J=p(c,"P",{"data-svelte-h":!0}),_(J)!=="svelte-1an3odd"&&(J.innerHTML=W)},m(c,j){l(c,e,j),l(c,o,j),l(c,a,j),l(c,s,j),l(c,b,j),l(c,C,j),l(c,k,j),l(c,Z,j),l(c,J,j)},p:ye,d(c){c&&(n(e),n(o),n(a),n(s),n(b),n(C),n(k),n(Z),n(J))}}}function Et(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function qt(F){let e,u="Example:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGTW9iaWxlVmlUTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJhcHBsZSUyRm1vYmlsZXZpdC1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTW9iaWxlVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0LXNtYWxsJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTModel
<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/mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileViTModel.from_pretrained(<span class="hljs-string">&quot;apple/mobilevit-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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">640</span>, <span class="hljs-number">8</span>, <span class="hljs-number">8</span>]`,wrap:!1}}),{c(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Xt(F){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,a,g="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",s,b,X=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,C,k,Y=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Z,J,W=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=m("p"),e.innerHTML=u,o=r(),a=m("ul"),a.innerHTML=g,s=r(),b=m("p"),b.innerHTML=X,C=r(),k=m("ul"),k.innerHTML=Y,Z=r(),J=m("p"),J.innerHTML=W},l(c){e=p(c,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),o=i(c),a=p(c,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=g),s=i(c),b=p(c,"P",{"data-svelte-h":!0}),_(b)!=="svelte-1v9qsc5"&&(b.innerHTML=X),C=i(c),k=p(c,"UL",{"data-svelte-h":!0}),_(k)!=="svelte-99h8aq"&&(k.innerHTML=Y),Z=i(c),J=p(c,"P",{"data-svelte-h":!0}),_(J)!=="svelte-1an3odd"&&(J.innerHTML=W)},m(c,j){l(c,e,j),l(c,o,j),l(c,a,j),l(c,s,j),l(c,b,j),l(c,C,j),l(c,k,j),l(c,Z,j),l(c,J,j)},p:ye,d(c){c&&(n(e),n(o),n(a),n(s),n(b),n(C),n(k),n(Z),n(J))}}}function Yt(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function Qt(F){let e,u="Example:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGTW9iaWxlVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXQtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1vYmlsZVZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0LXNtYWxsJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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/mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileViTForImageClassification.from_pretrained(<span class="hljs-string">&quot;apple/mobilevit-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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 = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<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(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Dt(F){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,a,g="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",s,b,X=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,C,k,Y=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Z,J,W=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=m("p"),e.innerHTML=u,o=r(),a=m("ul"),a.innerHTML=g,s=r(),b=m("p"),b.innerHTML=X,C=r(),k=m("ul"),k.innerHTML=Y,Z=r(),J=m("p"),J.innerHTML=W},l(c){e=p(c,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),o=i(c),a=p(c,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=g),s=i(c),b=p(c,"P",{"data-svelte-h":!0}),_(b)!=="svelte-1v9qsc5"&&(b.innerHTML=X),C=i(c),k=p(c,"UL",{"data-svelte-h":!0}),_(k)!=="svelte-99h8aq"&&(k.innerHTML=Y),Z=i(c),J=p(c,"P",{"data-svelte-h":!0}),_(J)!=="svelte-1an3odd"&&(J.innerHTML=W)},m(c,j){l(c,e,j),l(c,o,j),l(c,a,j),l(c,s,j),l(c,b,j),l(c,C,j),l(c,k,j),l(c,Z,j),l(c,J,j)},p:ye,d(c){c&&(n(e),n(o),n(a),n(s),n(b),n(C),n(k),n(Z),n(J))}}}function At(F){let e,u=`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(){e=m("p"),e.innerHTML=u},l(o){e=p(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,a){l(o,e,a)},p:ye,d(o){o&&n(e)}}}function Ot(F){let e,u="Examples:",o,a,g;return a=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGTW9iaWxlVmlURm9yU2VtYW50aWNTZWdtZW50YXRpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGZGVlcGxhYnYzLW1vYmlsZXZpdC1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTW9iaWxlVmlURm9yU2VtYW50aWNTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGZGVlcGxhYnYzLW1vYmlsZXZpdC1zbWFsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEElMjMlMjBsb2dpdHMlMjBhcmUlMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fbGFiZWxzJTJDJTIwaGVpZ2h0JTJDJTIwd2lkdGgpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;apple/deeplabv3-mobilevit-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileViTForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;apple/deeplabv3-mobilevit-small&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </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(){e=m("p"),e.textContent=u,o=r(),M(a.$$.fragment)},l(s){e=p(s,"P",{"data-svelte-h":!0}),_(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=i(s),v(a.$$.fragment,s)},m(s,b){l(s,e,b),l(s,o,b),y(a,s,b),g=!0},p:ye,i(s){g||(w(a.$$.fragment,s),g=!0)},o(s){$(a.$$.fragment,s),g=!1},d(s){s&&(n(e),n(o)),V(a,s)}}}function Kt(F){let e,u,o,a,g,s,b=`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,X,C,k=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Y,Z,J,W,c,j,O,we='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTModel">TFMobileViTModel</a> forward method, overrides the <code>__call__</code> special method.',Fe,pe,R,Q,_e,he,Ne,S,ne,je,ze,K=`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,ae,$e,ue=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ye,Ve,re=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Re,P,He,G,ee,te,ie,Ue='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTForImageClassification">TFMobileViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',We,Te,xe,fe,Pe,le,q,U,ce,Ie,Me,Qe="MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC.",ve,ge,Ze=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ge,f,I=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,B,L,N,z,E,Ce,ke,lt='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTForSemanticSegmentation">TFMobileViTForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',qe,Be,nt,be,Le;return e=new Se({props:{title:"TFMobileViTModel",local:"transformers.TFMobileViTModel",headingTag:"h2"}}),a=new me({props:{name:"class transformers.TFMobileViTModel",anchor:"transformers.TFMobileViTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L800"}}),Z=new Oe({props:{$$slots:{default:[Bt]},$$scope:{ctx:F}}}),c=new me({props:{name:"call",anchor:"transformers.TFMobileViTModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L808",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),pe=new Oe({props:{$$slots:{default:[Et]},$$scope:{ctx:F}}}),Q=new it({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[qt]},$$scope:{ctx:F}}}),he=new Se({props:{title:"TFMobileViTForImageClassification",local:"transformers.TFMobileViTForImageClassification",headingTag:"h2"}}),ne=new me({props:{name:"class transformers.TFMobileViTForImageClassification",anchor:"transformers.TFMobileViTForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L835"}}),P=new Oe({props:{$$slots:{default:[Xt]},$$scope:{ctx:F}}}),ee=new me({props:{name:"call",anchor:"transformers.TFMobileViTForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForImageClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L848",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Te=new Oe({props:{$$slots:{default:[Yt]},$$scope:{ctx:F}}}),fe=new it({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[Qt]},$$scope:{ctx:F}}}),le=new Se({props:{title:"TFMobileViTForSemanticSegmentation",local:"transformers.TFMobileViTForSemanticSegmentation",headingTag:"h2"}}),ce=new me({props:{name:"class transformers.TFMobileViTForSemanticSegmentation",anchor:"transformers.TFMobileViTForSemanticSegmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</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/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1011"}}),L=new Oe({props:{$$slots:{default:[Dt]},$$scope:{ctx:F}}}),E=new me({props:{name:"call",anchor:"transformers.TFMobileViTForSemanticSegmentation.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1039",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Be=new Oe({props:{$$slots:{default:[At]},$$scope:{ctx:F}}}),be=new it({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[Ot]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment),u=r(),o=m("div"),M(a.$$.fragment),g=r(),s=m("p"),s.innerHTML=b,X=r(),C=m("p"),C.innerHTML=k,Y=r(),M(Z.$$.fragment),J=r(),W=m("div"),M(c.$$.fragment),j=r(),O=m("p"),O.innerHTML=we,Fe=r(),M(pe.$$.fragment),R=r(),M(Q.$$.fragment),_e=r(),M(he.$$.fragment),Ne=r(),S=m("div"),M(ne.$$.fragment),je=r(),ze=m("p"),ze.textContent=K,ae=r(),$e=m("p"),$e.innerHTML=ue,Ye=r(),Ve=m("p"),Ve.innerHTML=re,Re=r(),M(P.$$.fragment),He=r(),G=m("div"),M(ee.$$.fragment),te=r(),ie=m("p"),ie.innerHTML=Ue,We=r(),M(Te.$$.fragment),xe=r(),M(fe.$$.fragment),Pe=r(),M(le.$$.fragment),q=r(),U=m("div"),M(ce.$$.fragment),Ie=r(),Me=m("p"),Me.textContent=Qe,ve=r(),ge=m("p"),ge.innerHTML=Ze,Ge=r(),f=m("p"),f.innerHTML=I,B=r(),M(L.$$.fragment),N=r(),z=m("div"),M(E.$$.fragment),Ce=r(),ke=m("p"),ke.innerHTML=lt,qe=r(),M(Be.$$.fragment),nt=r(),M(be.$$.fragment),this.h()},l(h){v(e.$$.fragment,h),u=i(h),o=p(h,"DIV",{class:!0});var x=D(o);v(a.$$.fragment,x),g=i(x),s=p(x,"P",{"data-svelte-h":!0}),_(s)!=="svelte-18iys0r"&&(s.innerHTML=b),X=i(x),C=p(x,"P",{"data-svelte-h":!0}),_(C)!=="svelte-1ivrf8m"&&(C.innerHTML=k),Y=i(x),v(Z.$$.fragment,x),J=i(x),W=p(x,"DIV",{class:!0});var Je=D(W);v(c.$$.fragment,Je),j=i(Je),O=p(Je,"P",{"data-svelte-h":!0}),_(O)!=="svelte-9bc1u"&&(O.innerHTML=we),Fe=i(Je),v(pe.$$.fragment,Je),R=i(Je),v(Q.$$.fragment,Je),Je.forEach(n),x.forEach(n),_e=i(h),v(he.$$.fragment,h),Ne=i(h),S=p(h,"DIV",{class:!0});var oe=D(S);v(ne.$$.fragment,oe),je=i(oe),ze=p(oe,"P",{"data-svelte-h":!0}),_(ze)!=="svelte-zljr1p"&&(ze.textContent=K),ae=i(oe),$e=p(oe,"P",{"data-svelte-h":!0}),_($e)!=="svelte-1qaxm70"&&($e.innerHTML=ue),Ye=i(oe),Ve=p(oe,"P",{"data-svelte-h":!0}),_(Ve)!=="svelte-1ivrf8m"&&(Ve.innerHTML=re),Re=i(oe),v(P.$$.fragment,oe),He=i(oe),G=p(oe,"DIV",{class:!0});var de=D(G);v(ee.$$.fragment,de),te=i(de),ie=p(de,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-18jq6g2"&&(ie.innerHTML=Ue),We=i(de),v(Te.$$.fragment,de),xe=i(de),v(fe.$$.fragment,de),de.forEach(n),oe.forEach(n),Pe=i(h),v(le.$$.fragment,h),q=i(h),U=p(h,"DIV",{class:!0});var se=D(U);v(ce.$$.fragment,se),Ie=i(se),Me=p(se,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-n2rd9e"&&(Me.textContent=Qe),ve=i(se),ge=p(se,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-1qaxm70"&&(ge.innerHTML=Ze),Ge=i(se),f=p(se,"P",{"data-svelte-h":!0}),_(f)!=="svelte-1ivrf8m"&&(f.innerHTML=I),B=i(se),v(L.$$.fragment,se),N=i(se),z=p(se,"DIV",{class:!0});var H=D(z);v(E.$$.fragment,H),Ce=i(H),ke=p(H,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-14tuciq"&&(ke.innerHTML=lt),qe=i(H),v(Be.$$.fragment,H),nt=i(H),v(be.$$.fragment,H),H.forEach(n),se.forEach(n),this.h()},h(){A(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(h,x){y(e,h,x),l(h,u,x),l(h,o,x),y(a,o,null),d(o,g),d(o,s),d(o,X),d(o,C),d(o,Y),y(Z,o,null),d(o,J),d(o,W),y(c,W,null),d(W,j),d(W,O),d(W,Fe),y(pe,W,null),d(W,R),y(Q,W,null),l(h,_e,x),y(he,h,x),l(h,Ne,x),l(h,S,x),y(ne,S,null),d(S,je),d(S,ze),d(S,ae),d(S,$e),d(S,Ye),d(S,Ve),d(S,Re),y(P,S,null),d(S,He),d(S,G),y(ee,G,null),d(G,te),d(G,ie),d(G,We),y(Te,G,null),d(G,xe),y(fe,G,null),l(h,Pe,x),y(le,h,x),l(h,q,x),l(h,U,x),y(ce,U,null),d(U,Ie),d(U,Me),d(U,ve),d(U,ge),d(U,Ge),d(U,f),d(U,B),y(L,U,null),d(U,N),d(U,z),y(E,z,null),d(z,Ce),d(z,ke),d(z,qe),y(Be,z,null),d(z,nt),y(be,z,null),Le=!0},p(h,x){const Je={};x&2&&(Je.$$scope={dirty:x,ctx:h}),Z.$set(Je);const oe={};x&2&&(oe.$$scope={dirty:x,ctx:h}),pe.$set(oe);const de={};x&2&&(de.$$scope={dirty:x,ctx:h}),Q.$set(de);const se={};x&2&&(se.$$scope={dirty:x,ctx:h}),P.$set(se);const H={};x&2&&(H.$$scope={dirty:x,ctx:h}),Te.$set(H);const Xe={};x&2&&(Xe.$$scope={dirty:x,ctx:h}),fe.$set(Xe);const ct={};x&2&&(ct.$$scope={dirty:x,ctx:h}),L.$set(ct);const De={};x&2&&(De.$$scope={dirty:x,ctx:h}),Be.$set(De);const pt={};x&2&&(pt.$$scope={dirty:x,ctx:h}),be.$set(pt)},i(h){Le||(w(e.$$.fragment,h),w(a.$$.fragment,h),w(Z.$$.fragment,h),w(c.$$.fragment,h),w(pe.$$.fragment,h),w(Q.$$.fragment,h),w(he.$$.fragment,h),w(ne.$$.fragment,h),w(P.$$.fragment,h),w(ee.$$.fragment,h),w(Te.$$.fragment,h),w(fe.$$.fragment,h),w(le.$$.fragment,h),w(ce.$$.fragment,h),w(L.$$.fragment,h),w(E.$$.fragment,h),w(Be.$$.fragment,h),w(be.$$.fragment,h),Le=!0)},o(h){$(e.$$.fragment,h),$(a.$$.fragment,h),$(Z.$$.fragment,h),$(c.$$.fragment,h),$(pe.$$.fragment,h),$(Q.$$.fragment,h),$(he.$$.fragment,h),$(ne.$$.fragment,h),$(P.$$.fragment,h),$(ee.$$.fragment,h),$(Te.$$.fragment,h),$(fe.$$.fragment,h),$(le.$$.fragment,h),$(ce.$$.fragment,h),$(L.$$.fragment,h),$(E.$$.fragment,h),$(Be.$$.fragment,h),$(be.$$.fragment,h),Le=!1},d(h){h&&(n(u),n(o),n(_e),n(Ne),n(S),n(Pe),n(q),n(U)),V(e,h),V(a),V(Z),V(c),V(pe),V(Q),V(he,h),V(ne),V(P),V(ee),V(Te),V(fe),V(le,h),V(ce),V(L),V(E),V(Be),V(be)}}}function eo(F){let e,u;return e=new Ct({props:{$$slots:{default:[Kt]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment)},l(o){v(e.$$.fragment,o)},m(o,a){y(e,o,a),u=!0},p(o,a){const g={};a&2&&(g.$$scope={dirty:a,ctx:o}),e.$set(g)},i(o){u||(w(e.$$.fragment,o),u=!0)},o(o){$(e.$$.fragment,o),u=!1},d(o){V(e,o)}}}function to(F){let e,u,o,a,g,s,b,X,C,k='The MobileViT model was proposed in <a href="https://arxiv.org/abs/2110.02178" rel="nofollow">MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer</a> by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers.',Y,Z,J="The abstract from the paper is the following:",W,c,j="<em>Light-weight convolutional neural networks (CNNs) are the de-facto for mobile vision tasks. Their spatial inductive biases allow them to learn representations with fewer parameters across different vision tasks. However, these networks are spatially local. To learn global representations, self-attention-based vision trans-formers (ViTs) have been adopted. Unlike CNNs, ViTs are heavy-weight. In this paper, we ask the following question: is it possible to combine the strengths of CNNs and ViTs to build a light-weight and low latency network for mobile vision tasks? Towards this end, we introduce MobileViT, a light-weight and general-purpose vision transformer for mobile devices. MobileViT presents a different perspective for the global processing of information with transformers, i.e., transformers as convolutions. Our results show that MobileViT significantly outperforms CNN- and ViT-based networks across different tasks and datasets. On the ImageNet-1k dataset, MobileViT achieves top-1 accuracy of 78.4% with about 6 million parameters, which is 3.2% and 6.2% more accurate than MobileNetv3 (CNN-based) and DeIT (ViT-based) for a similar number of parameters. On the MS-COCO object detection task, MobileViT is 5.7% more accurate than MobileNetv3 for a similar number of parameters.</em>",O,we,Fe='This model was contributed by <a href="https://huggingface.co/Matthijs" rel="nofollow">matthijs</a>. The TensorFlow version of the model was contributed by <a href="https://huggingface.co/sayakpaul" rel="nofollow">sayakpaul</a>. The original code and weights can be found <a href="https://github.com/apple/ml-cvnets" rel="nofollow">here</a>.',pe,R,Q,_e,he=`<li><p>MobileViT 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. You can follow <a href="https://keras.io/examples/vision/mobilevit" rel="nofollow">this tutorial</a> for a lightweight introduction.</p></li> <li><p>One can use <a href="/docs/transformers/main/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).</p></li> <li><p>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).</p></li> <li><p>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>.</p></li> <li><p>As the name suggests MobileViT was designed to be performant and efficient on mobile phones. The TensorFlow versions of the MobileViT models are fully compatible with <a href="https://www.tensorflow.org/lite" rel="nofollow">TensorFlow Lite</a>.</p> <p>You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:</p></li>`,Ne,S,ne,je,ze=`The resulting model will be just <strong>about an MB</strong> making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`,K,ae,$e,ue,Ye="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with MobileViT.",Ve,re,Re,P,He='<li><a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForImageClassification">MobileViTForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',G,ee,te="<strong>Semantic segmentation</strong>",ie,Ue,We='<li><a href="../tasks/semantic_segmentation">Semantic segmentation task guide</a></li>',Te,xe,fe="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",Pe,le,q,U,ce,Ie,Me,Qe=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTModel">MobileViTModel</a>. It is used to instantiate a
MobileViT 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 MobileViT
<a href="https://huggingface.co/apple/mobilevit-small" rel="nofollow">apple/mobilevit-small</a> architecture.`,ve,ge,Ze=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ge,f,I,B,L,N,z,E,Ce,ke,lt,qe,Be="Preprocess an image or a batch of images.",nt,be,Le,h,x,Je='Converts the output of <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',oe,de,se,H,Xe,ct,De,pt="Constructs a MobileViT image processor.",vt,Ke,at,yt,dt,Vt="Preprocess an image or batch of images.",wt,et,rt,$t,mt,xt='Converts the output of <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> into semantic segmentation maps. Only supports PyTorch.',ht,tt,ut,ft,gt;return g=new Se({props:{title:"MobileViT",local:"mobilevit",headingTag:"h1"}}),b=new Se({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new Se({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),S=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGTW9iaWxlVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBJTBBbW9kZWxfY2twdCUyMCUzRCUyMCUyMmFwcGxlJTJGbW9iaWxldml0LXh4LXNtYWxsJTIyJTBBbW9kZWwlMjAlM0QlMjBURk1vYmlsZVZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2NrcHQpJTBBJTBBY29udmVydGVyJTIwJTNEJTIwdGYubGl0ZS5URkxpdGVDb252ZXJ0ZXIuZnJvbV9rZXJhc19tb2RlbChtb2RlbCklMEFjb252ZXJ0ZXIub3B0aW1pemF0aW9ucyUyMCUzRCUyMCU1QnRmLmxpdGUuT3B0aW1pemUuREVGQVVMVCU1RCUwQWNvbnZlcnRlci50YXJnZXRfc3BlYy5zdXBwb3J0ZWRfb3BzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwdGYubGl0ZS5PcHNTZXQuVEZMSVRFX0JVSUxUSU5TJTJDJTBBJTIwJTIwJTIwJTIwdGYubGl0ZS5PcHNTZXQuU0VMRUNUX1RGX09QUyUyQyUwQSU1RCUwQXRmbGl0ZV9tb2RlbCUyMCUzRCUyMGNvbnZlcnRlci5jb252ZXJ0KCklMEF0ZmxpdGVfZmlsZW5hbWUlMjAlM0QlMjBtb2RlbF9ja3B0LnNwbGl0KCUyMiUyRiUyMiklNUItMSU1RCUyMCUyQiUyMCUyMi50ZmxpdGUlMjIlMEF3aXRoJTIwb3Blbih0ZmxpdGVfZmlsZW5hbWUlMkMlMjAlMjJ3YiUyMiklMjBhcyUyMGYlM0ElMEElMjAlMjAlMjAlMjBmLndyaXRlKHRmbGl0ZV9tb2RlbCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFMobileViTForImageClassification
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf


model_ckpt = <span class="hljs-string">&quot;apple/mobilevit-xx-small&quot;</span>
model = TFMobileViTForImageClassification.from_pretrained(model_ckpt)

converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [
    tf.lite.OpsSet.TFLITE_BUILTINS,
    tf.lite.OpsSet.SELECT_TF_OPS,
]
tflite_model = converter.convert()
tflite_filename = model_ckpt.split(<span class="hljs-string">&quot;/&quot;</span>)[-<span class="hljs-number">1</span>] + <span class="hljs-string">&quot;.tflite&quot;</span>
<span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(tflite_filename, <span class="hljs-string">&quot;wb&quot;</span>) <span class="hljs-keyword">as</span> f:
    f.write(tflite_model)`,wrap:!1}}),ae=new Se({props:{title:"Resources",local:"resources",headingTag:"h2"}}),re=new Jt({props:{pipeline:"image-classification"}}),le=new Se({props:{title:"MobileViTConfig",local:"transformers.MobileViTConfig",headingTag:"h2"}}),ce=new me({props:{name:"class transformers.MobileViTConfig",anchor:"transformers.MobileViTConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 256"},{name:"patch_size",val:" = 2"},{name:"hidden_sizes",val:" = [144, 192, 240]"},{name:"neck_hidden_sizes",val:" = [16, 32, 64, 96, 128, 160, 640]"},{name:"num_attention_heads",val:" = 4"},{name:"mlp_ratio",val:" = 2.0"},{name:"expand_ratio",val:" = 4.0"},{name:"hidden_act",val:" = 'silu'"},{name:"conv_kernel_size",val:" = 3"},{name:"output_stride",val:" = 32"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"qkv_bias",val:" = True"},{name:"aspp_out_channels",val:" = 256"},{name:"atrous_rates",val:" = [6, 12, 18]"},{name:"aspp_dropout_prob",val:" = 0.1"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTConfig.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.MobileViTConfig.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.MobileViTConfig.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.MobileViTConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[144, 192, 240]</code>) &#x2014;
Dimensionality (hidden size) of the Transformer encoders at each stage.`,name:"hidden_sizes"},{anchor:"transformers.MobileViTConfig.neck_hidden_sizes",description:`<strong>neck_hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[16, 32, 64, 96, 128, 160, 640]</code>) &#x2014;
The number of channels for the feature maps of the backbone.`,name:"neck_hidden_sizes"},{anchor:"transformers.MobileViTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MobileViTConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
The ratio of the number of channels in the output of the MLP to the number of channels in the input.`,name:"mlp_ratio"},{anchor:"transformers.MobileViTConfig.expand_ratio",description:`<strong>expand_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Expansion factor for the MobileNetv2 layers.`,name:"expand_ratio"},{anchor:"transformers.MobileViTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the Transformer encoder and convolution layers.`,name:"hidden_act"},{anchor:"transformers.MobileViTConfig.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 MobileViT layer.`,name:"conv_kernel_size"},{anchor:"transformers.MobileViTConfig.output_stride",description:`<strong>output_stride</strong> (<code>int</code>, <em>optional</em>, 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.MobileViTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the Transformer encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.MobileViTConfig.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.MobileViTConfig.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.MobileViTConfig.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.MobileViTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MobileViTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.MobileViTConfig.aspp_out_channels",description:`<strong>aspp_out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Number of output channels used in the ASPP layer for semantic segmentation.`,name:"aspp_out_channels"},{anchor:"transformers.MobileViTConfig.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.MobileViTConfig.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.MobileViTConfig.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/configuration_mobilevit.py#L46"}}),f=new it({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[zt]},$$scope:{ctx:F}}}),B=new Se({props:{title:"MobileViTFeatureExtractor",local:"transformers.MobileViTFeatureExtractor",headingTag:"h2"}}),z=new me({props:{name:"class transformers.MobileViTFeatureExtractor",anchor:"transformers.MobileViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L26"}}),ke=new me({props:{name:"__call__",anchor:"transformers.MobileViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L547"}}),Le=new me({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileViTFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileViTFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileViTFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If unset,
predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L312",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>semantic_segmentation</p>
`}}),de=new Se({props:{title:"MobileViTImageProcessor",local:"transformers.MobileViTImageProcessor",headingTag:"h2"}}),Xe=new me({props:{name:"class transformers.MobileViTImageProcessor",anchor:"transformers.MobileViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_flip_channel_order",val:": bool = True"},{name:"use_square_size",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.MobileViTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Controls the size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the
<code>preprocess</code> method.`,name:"size"},{anchor:"transformers.MobileViTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Defines the resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter
in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.MobileViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.MobileViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.MobileViTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input at the center. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped. Can be overridden by the <code>do_center_crop</code> parameter in
the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.MobileViTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Desired output size <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code> when applying center-cropping. Can be overridden by
the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.MobileViTImageProcessor.do_flip_channel_order",description:`<strong>do_flip_channel_order</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to flip the color channels from RGB to BGR. Can be overridden by the <code>do_flip_channel_order</code>
parameter in the <code>preprocess</code> method.`,name:"do_flip_channel_order"},{anchor:"transformers.MobileViTImageProcessor.use_square_size",description:`<strong>use_square_size</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
The value to be passed to <code>get_size_dict</code> as <code>default_to_square</code> when computing the image size. If the
<code>size</code> argument in <code>get_size_dict</code> is an <code>int</code>, it determines whether to default to a square image or not.
Note that this attribute is not used in computing <code>crop_size</code> via calling <code>get_size_dict</code>.`,name:"use_square_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L51"}}),at=new me({props:{name:"preprocess",anchor:"transformers.MobileViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_flip_channel_order",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.MobileViTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.MobileViTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing.`,name:"size"},{anchor:"transformers.MobileViTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.MobileViTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image by rescale factor.`,name:"do_rescale"},{anchor:"transformers.MobileViTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.MobileViTImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.MobileViTImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.MobileViTImageProcessor.preprocess.do_flip_channel_order",description:`<strong>do_flip_channel_order</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_flip_channel_order</code>) &#x2014;
Whether to flip the channel order of the image.`,name:"do_flip_channel_order"},{anchor:"transformers.MobileViTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.MobileViTImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"},{anchor:"transformers.MobileViTImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L181"}}),rt=new me({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If unset,
predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L312",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>semantic_segmentation</p>
`}}),tt=new kt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[eo],pytorch:[Ht]},$$scope:{ctx:F}}}),{c(){e=m("meta"),u=r(),o=m("p"),a=r(),M(g.$$.fragment),s=r(),M(b.$$.fragment),X=r(),C=m("p"),C.innerHTML=k,Y=r(),Z=m("p"),Z.textContent=J,W=r(),c=m("p"),c.innerHTML=j,O=r(),we=m("p"),we.innerHTML=Fe,pe=r(),M(R.$$.fragment),Q=r(),_e=m("ul"),_e.innerHTML=he,Ne=r(),M(S.$$.fragment),ne=r(),je=m("p"),je.innerHTML=ze,K=r(),M(ae.$$.fragment),$e=r(),ue=m("p"),ue.textContent=Ye,Ve=r(),M(re.$$.fragment),Re=r(),P=m("ul"),P.innerHTML=He,G=r(),ee=m("p"),ee.innerHTML=te,ie=r(),Ue=m("ul"),Ue.innerHTML=We,Te=r(),xe=m("p"),xe.textContent=fe,Pe=r(),M(le.$$.fragment),q=r(),U=m("div"),M(ce.$$.fragment),Ie=r(),Me=m("p"),Me.innerHTML=Qe,ve=r(),ge=m("p"),ge.innerHTML=Ze,Ge=r(),M(f.$$.fragment),I=r(),M(B.$$.fragment),L=r(),N=m("div"),M(z.$$.fragment),E=r(),Ce=m("div"),M(ke.$$.fragment),lt=r(),qe=m("p"),qe.textContent=Be,nt=r(),be=m("div"),M(Le.$$.fragment),h=r(),x=m("p"),x.innerHTML=Je,oe=r(),M(de.$$.fragment),se=r(),H=m("div"),M(Xe.$$.fragment),ct=r(),De=m("p"),De.textContent=pt,vt=r(),Ke=m("div"),M(at.$$.fragment),yt=r(),dt=m("p"),dt.textContent=Vt,wt=r(),et=m("div"),M(rt.$$.fragment),$t=r(),mt=m("p"),mt.innerHTML=xt,ht=r(),M(tt.$$.fragment),ut=r(),ft=m("p"),this.h()},l(t){const T=Zt("svelte-u9bgzb",document.head);e=p(T,"META",{name:!0,content:!0}),T.forEach(n),u=i(t),o=p(t,"P",{}),D(o).forEach(n),a=i(t),v(g.$$.fragment,t),s=i(t),v(b.$$.fragment,t),X=i(t),C=p(t,"P",{"data-svelte-h":!0}),_(C)!=="svelte-apjtbw"&&(C.innerHTML=k),Y=i(t),Z=p(t,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-vfdo9a"&&(Z.textContent=J),W=i(t),c=p(t,"P",{"data-svelte-h":!0}),_(c)!=="svelte-1sl3ue4"&&(c.innerHTML=j),O=i(t),we=p(t,"P",{"data-svelte-h":!0}),_(we)!=="svelte-wh05f9"&&(we.innerHTML=Fe),pe=i(t),v(R.$$.fragment,t),Q=i(t),_e=p(t,"UL",{"data-svelte-h":!0}),_(_e)!=="svelte-1o1s0uy"&&(_e.innerHTML=he),Ne=i(t),v(S.$$.fragment,t),ne=i(t),je=p(t,"P",{"data-svelte-h":!0}),_(je)!=="svelte-j7j4pu"&&(je.innerHTML=ze),K=i(t),v(ae.$$.fragment,t),$e=i(t),ue=p(t,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-1vdwjx8"&&(ue.textContent=Ye),Ve=i(t),v(re.$$.fragment,t),Re=i(t),P=p(t,"UL",{"data-svelte-h":!0}),_(P)!=="svelte-1cdiv4y"&&(P.innerHTML=He),G=i(t),ee=p(t,"P",{"data-svelte-h":!0}),_(ee)!=="svelte-1qspi63"&&(ee.innerHTML=te),ie=i(t),Ue=p(t,"UL",{"data-svelte-h":!0}),_(Ue)!=="svelte-bnel3y"&&(Ue.innerHTML=We),Te=i(t),xe=p(t,"P",{"data-svelte-h":!0}),_(xe)!=="svelte-1xesile"&&(xe.textContent=fe),Pe=i(t),v(le.$$.fragment,t),q=i(t),U=p(t,"DIV",{class:!0});var Ee=D(U);v(ce.$$.fragment,Ee),Ie=i(Ee),Me=p(Ee,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-rgsi04"&&(Me.innerHTML=Qe),ve=i(Ee),ge=p(Ee,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-o55m63"&&(ge.innerHTML=Ze),Ge=i(Ee),v(f.$$.fragment,Ee),Ee.forEach(n),I=i(t),v(B.$$.fragment,t),L=i(t),N=p(t,"DIV",{class:!0});var Ae=D(N);v(z.$$.fragment,Ae),E=i(Ae),Ce=p(Ae,"DIV",{class:!0});var bt=D(Ce);v(ke.$$.fragment,bt),lt=i(bt),qe=p(bt,"P",{"data-svelte-h":!0}),_(qe)!=="svelte-khengj"&&(qe.textContent=Be),bt.forEach(n),nt=i(Ae),be=p(Ae,"DIV",{class:!0});var _t=D(be);v(Le.$$.fragment,_t),h=i(_t),x=p(_t,"P",{"data-svelte-h":!0}),_(x)!=="svelte-xkmk9b"&&(x.innerHTML=Je),_t.forEach(n),Ae.forEach(n),oe=i(t),v(de.$$.fragment,t),se=i(t),H=p(t,"DIV",{class:!0});var ot=D(H);v(Xe.$$.fragment,ot),ct=i(ot),De=p(ot,"P",{"data-svelte-h":!0}),_(De)!=="svelte-7gbr4d"&&(De.textContent=pt),vt=i(ot),Ke=p(ot,"DIV",{class:!0});var Tt=D(Ke);v(at.$$.fragment,Tt),yt=i(Tt),dt=p(Tt,"P",{"data-svelte-h":!0}),_(dt)!=="svelte-1x3yxsa"&&(dt.textContent=Vt),Tt.forEach(n),wt=i(ot),et=p(ot,"DIV",{class:!0});var Mt=D(et);v(rt.$$.fragment,Mt),$t=i(Mt),mt=p(Mt,"P",{"data-svelte-h":!0}),_(mt)!=="svelte-xkmk9b"&&(mt.innerHTML=xt),Mt.forEach(n),ot.forEach(n),ht=i(t),v(tt.$$.fragment,t),ut=i(t),ft=p(t,"P",{}),D(ft).forEach(n),this.h()},h(){A(e,"name","hf:doc:metadata"),A(e,"content",oo),A(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,T){d(document.head,e),l(t,u,T),l(t,o,T),l(t,a,T),y(g,t,T),l(t,s,T),y(b,t,T),l(t,X,T),l(t,C,T),l(t,Y,T),l(t,Z,T),l(t,W,T),l(t,c,T),l(t,O,T),l(t,we,T),l(t,pe,T),y(R,t,T),l(t,Q,T),l(t,_e,T),l(t,Ne,T),y(S,t,T),l(t,ne,T),l(t,je,T),l(t,K,T),y(ae,t,T),l(t,$e,T),l(t,ue,T),l(t,Ve,T),y(re,t,T),l(t,Re,T),l(t,P,T),l(t,G,T),l(t,ee,T),l(t,ie,T),l(t,Ue,T),l(t,Te,T),l(t,xe,T),l(t,Pe,T),y(le,t,T),l(t,q,T),l(t,U,T),y(ce,U,null),d(U,Ie),d(U,Me),d(U,ve),d(U,ge),d(U,Ge),y(f,U,null),l(t,I,T),y(B,t,T),l(t,L,T),l(t,N,T),y(z,N,null),d(N,E),d(N,Ce),y(ke,Ce,null),d(Ce,lt),d(Ce,qe),d(N,nt),d(N,be),y(Le,be,null),d(be,h),d(be,x),l(t,oe,T),y(de,t,T),l(t,se,T),l(t,H,T),y(Xe,H,null),d(H,ct),d(H,De),d(H,vt),d(H,Ke),y(at,Ke,null),d(Ke,yt),d(Ke,dt),d(H,wt),d(H,et),y(rt,et,null),d(et,$t),d(et,mt),l(t,ht,T),y(tt,t,T),l(t,ut,T),l(t,ft,T),gt=!0},p(t,[T]){const Ee={};T&2&&(Ee.$$scope={dirty:T,ctx:t}),f.$set(Ee);const Ae={};T&2&&(Ae.$$scope={dirty:T,ctx:t}),tt.$set(Ae)},i(t){gt||(w(g.$$.fragment,t),w(b.$$.fragment,t),w(R.$$.fragment,t),w(S.$$.fragment,t),w(ae.$$.fragment,t),w(re.$$.fragment,t),w(le.$$.fragment,t),w(ce.$$.fragment,t),w(f.$$.fragment,t),w(B.$$.fragment,t),w(z.$$.fragment,t),w(ke.$$.fragment,t),w(Le.$$.fragment,t),w(de.$$.fragment,t),w(Xe.$$.fragment,t),w(at.$$.fragment,t),w(rt.$$.fragment,t),w(tt.$$.fragment,t),gt=!0)},o(t){$(g.$$.fragment,t),$(b.$$.fragment,t),$(R.$$.fragment,t),$(S.$$.fragment,t),$(ae.$$.fragment,t),$(re.$$.fragment,t),$(le.$$.fragment,t),$(ce.$$.fragment,t),$(f.$$.fragment,t),$(B.$$.fragment,t),$(z.$$.fragment,t),$(ke.$$.fragment,t),$(Le.$$.fragment,t),$(de.$$.fragment,t),$(Xe.$$.fragment,t),$(at.$$.fragment,t),$(rt.$$.fragment,t),$(tt.$$.fragment,t),gt=!1},d(t){t&&(n(u),n(o),n(a),n(s),n(X),n(C),n(Y),n(Z),n(W),n(c),n(O),n(we),n(pe),n(Q),n(_e),n(Ne),n(ne),n(je),n(K),n($e),n(ue),n(Ve),n(Re),n(P),n(G),n(ee),n(ie),n(Ue),n(Te),n(xe),n(Pe),n(q),n(U),n(I),n(L),n(N),n(oe),n(se),n(H),n(ht),n(ut),n(ft)),n(e),V(g,t),V(b,t),V(R,t),V(S,t),V(ae,t),V(re,t),V(le,t),V(ce),V(f),V(B,t),V(z),V(ke),V(Le),V(de,t),V(Xe),V(at),V(rt),V(tt,t)}}}const oo='{"title":"MobileViT","local":"mobilevit","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"MobileViTConfig","local":"transformers.MobileViTConfig","sections":[],"depth":2},{"title":"MobileViTFeatureExtractor","local":"transformers.MobileViTFeatureExtractor","sections":[],"depth":2},{"title":"MobileViTImageProcessor","local":"transformers.MobileViTImageProcessor","sections":[],"depth":2},{"title":"MobileViTModel","local":"transformers.MobileViTModel","sections":[],"depth":2},{"title":"MobileViTForImageClassification","local":"transformers.MobileViTForImageClassification","sections":[],"depth":2},{"title":"MobileViTForSemanticSegmentation","local":"transformers.MobileViTForSemanticSegmentation","sections":[],"depth":2},{"title":"TFMobileViTModel","local":"transformers.TFMobileViTModel","sections":[],"depth":2},{"title":"TFMobileViTForImageClassification","local":"transformers.TFMobileViTForImageClassification","sections":[],"depth":2},{"title":"TFMobileViTForSemanticSegmentation","local":"transformers.TFMobileViTForSemanticSegmentation","sections":[],"depth":2}],"depth":1}';function so(F){return jt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ho extends Ut{constructor(e){super(),It(this,e,so,to,Ft,{})}}export{ho as component};
