import{s as fn,o as hn,n as k}from"../chunks/scheduler.9bc65507.js";import{S as un,i as gn,g as m,s as a,r as g,A as bn,h as p,f as o,c as r,j as U,u as b,x as h,k as I,y as c,a as i,v as _,d as T,t as M,w as v}from"../chunks/index.707bf1b6.js";import{T as pe}from"../chunks/Tip.c2ecdbf4.js";import{D as Z}from"../chunks/Docstring.17db21ae.js";import{C as ke}from"../chunks/CodeBlock.54a9f38d.js";import{E as xt}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as _n}from"../chunks/PipelineTag.44585822.js";import{H as K}from"../chunks/Heading.342b1fa6.js";function Tn($){let t,y="Example:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function Mn($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function vn($){let t,y="Example:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function yn($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function wn($){let t,y="Example:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function $n($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function Vn($){let t,y="Examples:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-kvfsh7"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function xn($){let t,y="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",d,l,w="<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,u,N=`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:`,F,x,R=`<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>`,j,C,L=`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(){t=m("p"),t.innerHTML=y,d=a(),l=m("ul"),l.innerHTML=w,s=a(),u=m("p"),u.innerHTML=N,F=a(),x=m("ul"),x.innerHTML=R,j=a(),C=m("p"),C.innerHTML=L},l(f){t=p(f,"P",{"data-svelte-h":!0}),h(t)!=="svelte-1ajbfxg"&&(t.innerHTML=y),d=r(f),l=p(f,"UL",{"data-svelte-h":!0}),h(l)!=="svelte-qm1t26"&&(l.innerHTML=w),s=r(f),u=p(f,"P",{"data-svelte-h":!0}),h(u)!=="svelte-1v9qsc5"&&(u.innerHTML=N),F=r(f),x=p(f,"UL",{"data-svelte-h":!0}),h(x)!=="svelte-99h8aq"&&(x.innerHTML=R),j=r(f),C=p(f,"P",{"data-svelte-h":!0}),h(C)!=="svelte-1an3odd"&&(C.innerHTML=L)},m(f,V){i(f,t,V),i(f,d,V),i(f,l,V),i(f,s,V),i(f,u,V),i(f,F,V),i(f,x,V),i(f,j,V),i(f,C,V)},p:k,d(f){f&&(o(t),o(d),o(l),o(s),o(u),o(F),o(x),o(j),o(C))}}}function Cn($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function Fn($){let t,y="Example:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function jn($){let t,y="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",d,l,w="<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,u,N=`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:`,F,x,R=`<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>`,j,C,L=`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(){t=m("p"),t.innerHTML=y,d=a(),l=m("ul"),l.innerHTML=w,s=a(),u=m("p"),u.innerHTML=N,F=a(),x=m("ul"),x.innerHTML=R,j=a(),C=m("p"),C.innerHTML=L},l(f){t=p(f,"P",{"data-svelte-h":!0}),h(t)!=="svelte-1ajbfxg"&&(t.innerHTML=y),d=r(f),l=p(f,"UL",{"data-svelte-h":!0}),h(l)!=="svelte-qm1t26"&&(l.innerHTML=w),s=r(f),u=p(f,"P",{"data-svelte-h":!0}),h(u)!=="svelte-1v9qsc5"&&(u.innerHTML=N),F=r(f),x=p(f,"UL",{"data-svelte-h":!0}),h(x)!=="svelte-99h8aq"&&(x.innerHTML=R),j=r(f),C=p(f,"P",{"data-svelte-h":!0}),h(C)!=="svelte-1an3odd"&&(C.innerHTML=L)},m(f,V){i(f,t,V),i(f,d,V),i(f,l,V),i(f,s,V),i(f,u,V),i(f,F,V),i(f,x,V),i(f,j,V),i(f,C,V)},p:k,d(f){f&&(o(t),o(d),o(l),o(s),o(u),o(F),o(x),o(j),o(C))}}}function Un($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function In($){let t,y="Example:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function Zn($){let t,y="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",d,l,w="<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,u,N=`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:`,F,x,R=`<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>`,j,C,L=`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(){t=m("p"),t.innerHTML=y,d=a(),l=m("ul"),l.innerHTML=w,s=a(),u=m("p"),u.innerHTML=N,F=a(),x=m("ul"),x.innerHTML=R,j=a(),C=m("p"),C.innerHTML=L},l(f){t=p(f,"P",{"data-svelte-h":!0}),h(t)!=="svelte-1ajbfxg"&&(t.innerHTML=y),d=r(f),l=p(f,"UL",{"data-svelte-h":!0}),h(l)!=="svelte-qm1t26"&&(l.innerHTML=w),s=r(f),u=p(f,"P",{"data-svelte-h":!0}),h(u)!=="svelte-1v9qsc5"&&(u.innerHTML=N),F=r(f),x=p(f,"UL",{"data-svelte-h":!0}),h(x)!=="svelte-99h8aq"&&(x.innerHTML=R),j=r(f),C=p(f,"P",{"data-svelte-h":!0}),h(C)!=="svelte-1an3odd"&&(C.innerHTML=L)},m(f,V){i(f,t,V),i(f,d,V),i(f,l,V),i(f,s,V),i(f,u,V),i(f,F,V),i(f,x,V),i(f,j,V),i(f,C,V)},p:k,d(f){f&&(o(t),o(d),o(l),o(s),o(u),o(F),o(x),o(j),o(C))}}}function Jn($){let t,y=`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(){t=m("p"),t.innerHTML=y},l(d){t=p(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,l){i(d,t,l)},p:k,d(d){d&&o(t)}}}function zn($){let t,y="Examples:",d,l,w;return l=new ke({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(){t=m("p"),t.textContent=y,d=a(),g(l.$$.fragment)},l(s){t=p(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-kvfsh7"&&(t.textContent=y),d=r(s),b(l.$$.fragment,s)},m(s,u){i(s,t,u),i(s,d,u),_(l,s,u),w=!0},p:k,i(s){w||(T(l.$$.fragment,s),w=!0)},o(s){M(l.$$.fragment,s),w=!1},d(s){s&&(o(t),o(d)),v(l,s)}}}function kn($){let t,y,d,l,w,s,u,N,F,x='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.',R,j,C="The abstract from the paper is the following:",L,f,V="<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>",eo,We,Is="Tips:",to,Se,Zs=`<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>`,oo,Ne,so,Re,Js=`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.`,no,Le,zs='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>.',ao,Ge,ro,Pe,ks="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with MobileViT.",io,He,lo,Be,Ws='<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>',co,Ee,Ss="<strong>Semantic segmentation</strong>",mo,qe,Ns='<li><a href="../tasks/semantic_segmentation">Semantic segmentation task guide</a></li>',po,Xe,Rs="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.",fo,Ye,ho,G,Qe,Jo,Ct,Ls=`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.`,zo,Ft,Gs=`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.`,ko,fe,uo,Ae,go,ee,De,Wo,he,Oe,So,jt,Ps="Preprocess an image or a batch of images.",No,ue,Ke,Ro,Ut,Hs=`Converts the output of <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> into semantic segmentation maps. Only supports
PyTorch.`,bo,et,_o,P,tt,Lo,It,Bs="Constructs a MobileViT image processor.",Go,ge,ot,Po,Zt,Es="Preprocess an image or batch of images.",Ho,be,st,Bo,Jt,qs=`Converts the output of <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> into semantic segmentation maps. Only supports
PyTorch.`,To,nt,Mo,te,at,Eo,zt,Xs=`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.`,qo,q,rt,Xo,kt,Ys='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTModel">MobileViTModel</a> forward method, overrides the <code>__call__</code> special method.',Yo,_e,Qo,Te,vo,it,yo,H,lt,Ao,Wt,Qs=`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,Do,St,As=`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.`,Oo,X,dt,Ko,Nt,Ds='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForImageClassification">MobileViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',es,Me,ts,ve,wo,ct,$o,B,mt,os,Rt,Os="MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC.",ss,Lt,Ks=`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.`,ns,Y,pt,as,Gt,en='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',rs,ye,is,we,Vo,ft,xo,W,ht,ls,Pt,tn=`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.)`,ds,Ht,on=`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.`,cs,$e,ms,Q,ut,ps,Bt,sn='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTModel">TFMobileViTModel</a> forward method, overrides the <code>__call__</code> special method.',fs,Ve,hs,xe,Co,gt,Fo,J,bt,us,Et,nn=`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,gs,qt,an=`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.)`,bs,Xt,rn=`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.`,_s,Ce,Ts,A,_t,Ms,Yt,ln='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTForImageClassification">TFMobileViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',vs,Fe,ys,je,jo,Tt,Uo,z,Mt,ws,Qt,dn="MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC.",$s,At,cn=`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.)`,Vs,Dt,mn=`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.`,xs,Ue,Cs,D,vt,Fs,Ot,pn='The <a href="/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTForSemanticSegmentation">TFMobileViTForSemanticSegmentation</a> forward method, overrides the <code>__call__</code> special method.',js,Ie,Us,Ze,Io,Kt,Zo;return w=new K({props:{title:"MobileViT",local:"mobilevit",headingTag:"h1"}}),u=new K({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Ne=new ke({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}}),Ge=new K({props:{title:"Resources",local:"resources",headingTag:"h2"}}),He=new _n({props:{pipeline:"image-classification"}}),Ye=new K({props:{title:"MobileViTConfig",local:"transformers.MobileViTConfig",headingTag:"h2"}}),Qe=new Z({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"}}),fe=new xt({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[Tn]},$$scope:{ctx:$}}}),Ae=new K({props:{title:"MobileViTFeatureExtractor",local:"transformers.MobileViTFeatureExtractor",headingTag:"h2"}}),De=new Z({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"}}),Oe=new Z({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"}}),Ke=new Z({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>
`}}),et=new K({props:{title:"MobileViTImageProcessor",local:"transformers.MobileViTImageProcessor",headingTag:"h2"}}),tt=new Z({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"}}),ot=new Z({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"}}),st=new Z({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>
`}}),nt=new K({props:{title:"MobileViTModel",local:"transformers.MobileViTModel",headingTag:"h2"}}),at=new Z({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"}}),rt=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),_e=new pe({props:{$$slots:{default:[Mn]},$$scope:{ctx:$}}}),Te=new xt({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[vn]},$$scope:{ctx:$}}}),it=new K({props:{title:"MobileViTForImageClassification",local:"transformers.MobileViTForImageClassification",headingTag:"h2"}}),lt=new Z({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"}}),dt=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),Me=new pe({props:{$$slots:{default:[yn]},$$scope:{ctx:$}}}),ve=new xt({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[wn]},$$scope:{ctx:$}}}),ct=new K({props:{title:"MobileViTForSemanticSegmentation",local:"transformers.MobileViTForSemanticSegmentation",headingTag:"h2"}}),mt=new Z({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"}}),pt=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),ye=new pe({props:{$$slots:{default:[$n]},$$scope:{ctx:$}}}),we=new xt({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[Vn]},$$scope:{ctx:$}}}),ft=new K({props:{title:"TFMobileViTModel",local:"transformers.TFMobileViTModel",headingTag:"h2"}}),ht=new Z({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"}}),$e=new pe({props:{$$slots:{default:[xn]},$$scope:{ctx:$}}}),ut=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),Ve=new pe({props:{$$slots:{default:[Cn]},$$scope:{ctx:$}}}),xe=new xt({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[Fn]},$$scope:{ctx:$}}}),gt=new K({props:{title:"TFMobileViTForImageClassification",local:"transformers.TFMobileViTForImageClassification",headingTag:"h2"}}),bt=new Z({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"}}),Ce=new pe({props:{$$slots:{default:[jn]},$$scope:{ctx:$}}}),_t=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),Fe=new pe({props:{$$slots:{default:[Un]},$$scope:{ctx:$}}}),je=new xt({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[In]},$$scope:{ctx:$}}}),Tt=new K({props:{title:"TFMobileViTForSemanticSegmentation",local:"transformers.TFMobileViTForSemanticSegmentation",headingTag:"h2"}}),Mt=new Z({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"}}),Ue=new pe({props:{$$slots:{default:[Zn]},$$scope:{ctx:$}}}),vt=new Z({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/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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>
`}}),Ie=new pe({props:{$$slots:{default:[Jn]},$$scope:{ctx:$}}}),Ze=new xt({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[zn]},$$scope:{ctx:$}}}),{c(){t=m("meta"),y=a(),d=m("p"),l=a(),g(w.$$.fragment),s=a(),g(u.$$.fragment),N=a(),F=m("p"),F.innerHTML=x,R=a(),j=m("p"),j.textContent=C,L=a(),f=m("p"),f.innerHTML=V,eo=a(),We=m("p"),We.textContent=Is,to=a(),Se=m("ul"),Se.innerHTML=Zs,oo=a(),g(Ne.$$.fragment),so=a(),Re=m("p"),Re.innerHTML=Js,no=a(),Le=m("p"),Le.innerHTML=zs,ao=a(),g(Ge.$$.fragment),ro=a(),Pe=m("p"),Pe.textContent=ks,io=a(),g(He.$$.fragment),lo=a(),Be=m("ul"),Be.innerHTML=Ws,co=a(),Ee=m("p"),Ee.innerHTML=Ss,mo=a(),qe=m("ul"),qe.innerHTML=Ns,po=a(),Xe=m("p"),Xe.textContent=Rs,fo=a(),g(Ye.$$.fragment),ho=a(),G=m("div"),g(Qe.$$.fragment),Jo=a(),Ct=m("p"),Ct.innerHTML=Ls,zo=a(),Ft=m("p"),Ft.innerHTML=Gs,ko=a(),g(fe.$$.fragment),uo=a(),g(Ae.$$.fragment),go=a(),ee=m("div"),g(De.$$.fragment),Wo=a(),he=m("div"),g(Oe.$$.fragment),So=a(),jt=m("p"),jt.textContent=Ps,No=a(),ue=m("div"),g(Ke.$$.fragment),Ro=a(),Ut=m("p"),Ut.innerHTML=Hs,bo=a(),g(et.$$.fragment),_o=a(),P=m("div"),g(tt.$$.fragment),Lo=a(),It=m("p"),It.textContent=Bs,Go=a(),ge=m("div"),g(ot.$$.fragment),Po=a(),Zt=m("p"),Zt.textContent=Es,Ho=a(),be=m("div"),g(st.$$.fragment),Bo=a(),Jt=m("p"),Jt.innerHTML=qs,To=a(),g(nt.$$.fragment),Mo=a(),te=m("div"),g(at.$$.fragment),Eo=a(),zt=m("p"),zt.innerHTML=Xs,qo=a(),q=m("div"),g(rt.$$.fragment),Xo=a(),kt=m("p"),kt.innerHTML=Ys,Yo=a(),g(_e.$$.fragment),Qo=a(),g(Te.$$.fragment),vo=a(),g(it.$$.fragment),yo=a(),H=m("div"),g(lt.$$.fragment),Ao=a(),Wt=m("p"),Wt.textContent=Qs,Do=a(),St=m("p"),St.innerHTML=As,Oo=a(),X=m("div"),g(dt.$$.fragment),Ko=a(),Nt=m("p"),Nt.innerHTML=Ds,es=a(),g(Me.$$.fragment),ts=a(),g(ve.$$.fragment),wo=a(),g(ct.$$.fragment),$o=a(),B=m("div"),g(mt.$$.fragment),os=a(),Rt=m("p"),Rt.textContent=Os,ss=a(),Lt=m("p"),Lt.innerHTML=Ks,ns=a(),Y=m("div"),g(pt.$$.fragment),as=a(),Gt=m("p"),Gt.innerHTML=en,rs=a(),g(ye.$$.fragment),is=a(),g(we.$$.fragment),Vo=a(),g(ft.$$.fragment),xo=a(),W=m("div"),g(ht.$$.fragment),ls=a(),Pt=m("p"),Pt.innerHTML=tn,ds=a(),Ht=m("p"),Ht.innerHTML=on,cs=a(),g($e.$$.fragment),ms=a(),Q=m("div"),g(ut.$$.fragment),ps=a(),Bt=m("p"),Bt.innerHTML=sn,fs=a(),g(Ve.$$.fragment),hs=a(),g(xe.$$.fragment),Co=a(),g(gt.$$.fragment),Fo=a(),J=m("div"),g(bt.$$.fragment),us=a(),Et=m("p"),Et.textContent=nn,gs=a(),qt=m("p"),qt.innerHTML=an,bs=a(),Xt=m("p"),Xt.innerHTML=rn,_s=a(),g(Ce.$$.fragment),Ts=a(),A=m("div"),g(_t.$$.fragment),Ms=a(),Yt=m("p"),Yt.innerHTML=ln,vs=a(),g(Fe.$$.fragment),ys=a(),g(je.$$.fragment),jo=a(),g(Tt.$$.fragment),Uo=a(),z=m("div"),g(Mt.$$.fragment),ws=a(),Qt=m("p"),Qt.textContent=dn,$s=a(),At=m("p"),At.innerHTML=cn,Vs=a(),Dt=m("p"),Dt.innerHTML=mn,xs=a(),g(Ue.$$.fragment),Cs=a(),D=m("div"),g(vt.$$.fragment),Fs=a(),Ot=m("p"),Ot.innerHTML=pn,js=a(),g(Ie.$$.fragment),Us=a(),g(Ze.$$.fragment),Io=a(),Kt=m("p"),this.h()},l(e){const n=bn("svelte-u9bgzb",document.head);t=p(n,"META",{name:!0,content:!0}),n.forEach(o),y=r(e),d=p(e,"P",{}),U(d).forEach(o),l=r(e),b(w.$$.fragment,e),s=r(e),b(u.$$.fragment,e),N=r(e),F=p(e,"P",{"data-svelte-h":!0}),h(F)!=="svelte-apjtbw"&&(F.innerHTML=x),R=r(e),j=p(e,"P",{"data-svelte-h":!0}),h(j)!=="svelte-vfdo9a"&&(j.textContent=C),L=r(e),f=p(e,"P",{"data-svelte-h":!0}),h(f)!=="svelte-1sl3ue4"&&(f.innerHTML=V),eo=r(e),We=p(e,"P",{"data-svelte-h":!0}),h(We)!=="svelte-axv494"&&(We.textContent=Is),to=r(e),Se=p(e,"UL",{"data-svelte-h":!0}),h(Se)!=="svelte-1o1s0uy"&&(Se.innerHTML=Zs),oo=r(e),b(Ne.$$.fragment,e),so=r(e),Re=p(e,"P",{"data-svelte-h":!0}),h(Re)!=="svelte-j7j4pu"&&(Re.innerHTML=Js),no=r(e),Le=p(e,"P",{"data-svelte-h":!0}),h(Le)!=="svelte-wh05f9"&&(Le.innerHTML=zs),ao=r(e),b(Ge.$$.fragment,e),ro=r(e),Pe=p(e,"P",{"data-svelte-h":!0}),h(Pe)!=="svelte-1vdwjx8"&&(Pe.textContent=ks),io=r(e),b(He.$$.fragment,e),lo=r(e),Be=p(e,"UL",{"data-svelte-h":!0}),h(Be)!=="svelte-1cdiv4y"&&(Be.innerHTML=Ws),co=r(e),Ee=p(e,"P",{"data-svelte-h":!0}),h(Ee)!=="svelte-1qspi63"&&(Ee.innerHTML=Ss),mo=r(e),qe=p(e,"UL",{"data-svelte-h":!0}),h(qe)!=="svelte-bnel3y"&&(qe.innerHTML=Ns),po=r(e),Xe=p(e,"P",{"data-svelte-h":!0}),h(Xe)!=="svelte-1xesile"&&(Xe.textContent=Rs),fo=r(e),b(Ye.$$.fragment,e),ho=r(e),G=p(e,"DIV",{class:!0});var oe=U(G);b(Qe.$$.fragment,oe),Jo=r(oe),Ct=p(oe,"P",{"data-svelte-h":!0}),h(Ct)!=="svelte-rgsi04"&&(Ct.innerHTML=Ls),zo=r(oe),Ft=p(oe,"P",{"data-svelte-h":!0}),h(Ft)!=="svelte-o55m63"&&(Ft.innerHTML=Gs),ko=r(oe),b(fe.$$.fragment,oe),oe.forEach(o),uo=r(e),b(Ae.$$.fragment,e),go=r(e),ee=p(e,"DIV",{class:!0});var ce=U(ee);b(De.$$.fragment,ce),Wo=r(ce),he=p(ce,"DIV",{class:!0});var yt=U(he);b(Oe.$$.fragment,yt),So=r(yt),jt=p(yt,"P",{"data-svelte-h":!0}),h(jt)!=="svelte-khengj"&&(jt.textContent=Ps),yt.forEach(o),No=r(ce),ue=p(ce,"DIV",{class:!0});var wt=U(ue);b(Ke.$$.fragment,wt),Ro=r(wt),Ut=p(wt,"P",{"data-svelte-h":!0}),h(Ut)!=="svelte-us34kl"&&(Ut.innerHTML=Hs),wt.forEach(o),ce.forEach(o),bo=r(e),b(et.$$.fragment,e),_o=r(e),P=p(e,"DIV",{class:!0});var se=U(P);b(tt.$$.fragment,se),Lo=r(se),It=p(se,"P",{"data-svelte-h":!0}),h(It)!=="svelte-7gbr4d"&&(It.textContent=Bs),Go=r(se),ge=p(se,"DIV",{class:!0});var $t=U(ge);b(ot.$$.fragment,$t),Po=r($t),Zt=p($t,"P",{"data-svelte-h":!0}),h(Zt)!=="svelte-1x3yxsa"&&(Zt.textContent=Es),$t.forEach(o),Ho=r(se),be=p(se,"DIV",{class:!0});var Vt=U(be);b(st.$$.fragment,Vt),Bo=r(Vt),Jt=p(Vt,"P",{"data-svelte-h":!0}),h(Jt)!=="svelte-us34kl"&&(Jt.innerHTML=qs),Vt.forEach(o),se.forEach(o),To=r(e),b(nt.$$.fragment,e),Mo=r(e),te=p(e,"DIV",{class:!0});var me=U(te);b(at.$$.fragment,me),Eo=r(me),zt=p(me,"P",{"data-svelte-h":!0}),h(zt)!=="svelte-1nu7yyb"&&(zt.innerHTML=Xs),qo=r(me),q=p(me,"DIV",{class:!0});var ne=U(q);b(rt.$$.fragment,ne),Xo=r(ne),kt=p(ne,"P",{"data-svelte-h":!0}),h(kt)!=="svelte-1gamdqu"&&(kt.innerHTML=Ys),Yo=r(ne),b(_e.$$.fragment,ne),Qo=r(ne),b(Te.$$.fragment,ne),ne.forEach(o),me.forEach(o),vo=r(e),b(it.$$.fragment,e),yo=r(e),H=p(e,"DIV",{class:!0});var ae=U(H);b(lt.$$.fragment,ae),Ao=r(ae),Wt=p(ae,"P",{"data-svelte-h":!0}),h(Wt)!=="svelte-zljr1p"&&(Wt.textContent=Qs),Do=r(ae),St=p(ae,"P",{"data-svelte-h":!0}),h(St)!=="svelte-1gjh92c"&&(St.innerHTML=As),Oo=r(ae),X=p(ae,"DIV",{class:!0});var re=U(X);b(dt.$$.fragment,re),Ko=r(re),Nt=p(re,"P",{"data-svelte-h":!0}),h(Nt)!=="svelte-le7sky"&&(Nt.innerHTML=Ds),es=r(re),b(Me.$$.fragment,re),ts=r(re),b(ve.$$.fragment,re),re.forEach(o),ae.forEach(o),wo=r(e),b(ct.$$.fragment,e),$o=r(e),B=p(e,"DIV",{class:!0});var ie=U(B);b(mt.$$.fragment,ie),os=r(ie),Rt=p(ie,"P",{"data-svelte-h":!0}),h(Rt)!=="svelte-n2rd9e"&&(Rt.textContent=Os),ss=r(ie),Lt=p(ie,"P",{"data-svelte-h":!0}),h(Lt)!=="svelte-1gjh92c"&&(Lt.innerHTML=Ks),ns=r(ie),Y=p(ie,"DIV",{class:!0});var le=U(Y);b(pt.$$.fragment,le),as=r(le),Gt=p(le,"P",{"data-svelte-h":!0}),h(Gt)!=="svelte-gglgdy"&&(Gt.innerHTML=en),rs=r(le),b(ye.$$.fragment,le),is=r(le),b(we.$$.fragment,le),le.forEach(o),ie.forEach(o),Vo=r(e),b(ft.$$.fragment,e),xo=r(e),W=p(e,"DIV",{class:!0});var E=U(W);b(ht.$$.fragment,E),ls=r(E),Pt=p(E,"P",{"data-svelte-h":!0}),h(Pt)!=="svelte-18iys0r"&&(Pt.innerHTML=tn),ds=r(E),Ht=p(E,"P",{"data-svelte-h":!0}),h(Ht)!=="svelte-1ivrf8m"&&(Ht.innerHTML=on),cs=r(E),b($e.$$.fragment,E),ms=r(E),Q=p(E,"DIV",{class:!0});var de=U(Q);b(ut.$$.fragment,de),ps=r(de),Bt=p(de,"P",{"data-svelte-h":!0}),h(Bt)!=="svelte-9bc1u"&&(Bt.innerHTML=sn),fs=r(de),b(Ve.$$.fragment,de),hs=r(de),b(xe.$$.fragment,de),de.forEach(o),E.forEach(o),Co=r(e),b(gt.$$.fragment,e),Fo=r(e),J=p(e,"DIV",{class:!0});var S=U(J);b(bt.$$.fragment,S),us=r(S),Et=p(S,"P",{"data-svelte-h":!0}),h(Et)!=="svelte-zljr1p"&&(Et.textContent=nn),gs=r(S),qt=p(S,"P",{"data-svelte-h":!0}),h(qt)!=="svelte-1qaxm70"&&(qt.innerHTML=an),bs=r(S),Xt=p(S,"P",{"data-svelte-h":!0}),h(Xt)!=="svelte-1ivrf8m"&&(Xt.innerHTML=rn),_s=r(S),b(Ce.$$.fragment,S),Ts=r(S),A=p(S,"DIV",{class:!0});var Je=U(A);b(_t.$$.fragment,Je),Ms=r(Je),Yt=p(Je,"P",{"data-svelte-h":!0}),h(Yt)!=="svelte-18jq6g2"&&(Yt.innerHTML=ln),vs=r(Je),b(Fe.$$.fragment,Je),ys=r(Je),b(je.$$.fragment,Je),Je.forEach(o),S.forEach(o),jo=r(e),b(Tt.$$.fragment,e),Uo=r(e),z=p(e,"DIV",{class:!0});var O=U(z);b(Mt.$$.fragment,O),ws=r(O),Qt=p(O,"P",{"data-svelte-h":!0}),h(Qt)!=="svelte-n2rd9e"&&(Qt.textContent=dn),$s=r(O),At=p(O,"P",{"data-svelte-h":!0}),h(At)!=="svelte-1qaxm70"&&(At.innerHTML=cn),Vs=r(O),Dt=p(O,"P",{"data-svelte-h":!0}),h(Dt)!=="svelte-1ivrf8m"&&(Dt.innerHTML=mn),xs=r(O),b(Ue.$$.fragment,O),Cs=r(O),D=p(O,"DIV",{class:!0});var ze=U(D);b(vt.$$.fragment,ze),Fs=r(ze),Ot=p(ze,"P",{"data-svelte-h":!0}),h(Ot)!=="svelte-14tuciq"&&(Ot.innerHTML=pn),js=r(ze),b(Ie.$$.fragment,ze),Us=r(ze),b(Ze.$$.fragment,ze),ze.forEach(o),O.forEach(o),Io=r(e),Kt=p(e,"P",{}),U(Kt).forEach(o),this.h()},h(){I(t,"name","hf:doc:metadata"),I(t,"content",Wn),I(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){c(document.head,t),i(e,y,n),i(e,d,n),i(e,l,n),_(w,e,n),i(e,s,n),_(u,e,n),i(e,N,n),i(e,F,n),i(e,R,n),i(e,j,n),i(e,L,n),i(e,f,n),i(e,eo,n),i(e,We,n),i(e,to,n),i(e,Se,n),i(e,oo,n),_(Ne,e,n),i(e,so,n),i(e,Re,n),i(e,no,n),i(e,Le,n),i(e,ao,n),_(Ge,e,n),i(e,ro,n),i(e,Pe,n),i(e,io,n),_(He,e,n),i(e,lo,n),i(e,Be,n),i(e,co,n),i(e,Ee,n),i(e,mo,n),i(e,qe,n),i(e,po,n),i(e,Xe,n),i(e,fo,n),_(Ye,e,n),i(e,ho,n),i(e,G,n),_(Qe,G,null),c(G,Jo),c(G,Ct),c(G,zo),c(G,Ft),c(G,ko),_(fe,G,null),i(e,uo,n),_(Ae,e,n),i(e,go,n),i(e,ee,n),_(De,ee,null),c(ee,Wo),c(ee,he),_(Oe,he,null),c(he,So),c(he,jt),c(ee,No),c(ee,ue),_(Ke,ue,null),c(ue,Ro),c(ue,Ut),i(e,bo,n),_(et,e,n),i(e,_o,n),i(e,P,n),_(tt,P,null),c(P,Lo),c(P,It),c(P,Go),c(P,ge),_(ot,ge,null),c(ge,Po),c(ge,Zt),c(P,Ho),c(P,be),_(st,be,null),c(be,Bo),c(be,Jt),i(e,To,n),_(nt,e,n),i(e,Mo,n),i(e,te,n),_(at,te,null),c(te,Eo),c(te,zt),c(te,qo),c(te,q),_(rt,q,null),c(q,Xo),c(q,kt),c(q,Yo),_(_e,q,null),c(q,Qo),_(Te,q,null),i(e,vo,n),_(it,e,n),i(e,yo,n),i(e,H,n),_(lt,H,null),c(H,Ao),c(H,Wt),c(H,Do),c(H,St),c(H,Oo),c(H,X),_(dt,X,null),c(X,Ko),c(X,Nt),c(X,es),_(Me,X,null),c(X,ts),_(ve,X,null),i(e,wo,n),_(ct,e,n),i(e,$o,n),i(e,B,n),_(mt,B,null),c(B,os),c(B,Rt),c(B,ss),c(B,Lt),c(B,ns),c(B,Y),_(pt,Y,null),c(Y,as),c(Y,Gt),c(Y,rs),_(ye,Y,null),c(Y,is),_(we,Y,null),i(e,Vo,n),_(ft,e,n),i(e,xo,n),i(e,W,n),_(ht,W,null),c(W,ls),c(W,Pt),c(W,ds),c(W,Ht),c(W,cs),_($e,W,null),c(W,ms),c(W,Q),_(ut,Q,null),c(Q,ps),c(Q,Bt),c(Q,fs),_(Ve,Q,null),c(Q,hs),_(xe,Q,null),i(e,Co,n),_(gt,e,n),i(e,Fo,n),i(e,J,n),_(bt,J,null),c(J,us),c(J,Et),c(J,gs),c(J,qt),c(J,bs),c(J,Xt),c(J,_s),_(Ce,J,null),c(J,Ts),c(J,A),_(_t,A,null),c(A,Ms),c(A,Yt),c(A,vs),_(Fe,A,null),c(A,ys),_(je,A,null),i(e,jo,n),_(Tt,e,n),i(e,Uo,n),i(e,z,n),_(Mt,z,null),c(z,ws),c(z,Qt),c(z,$s),c(z,At),c(z,Vs),c(z,Dt),c(z,xs),_(Ue,z,null),c(z,Cs),c(z,D),_(vt,D,null),c(D,Fs),c(D,Ot),c(D,js),_(Ie,D,null),c(D,Us),_(Ze,D,null),i(e,Io,n),i(e,Kt,n),Zo=!0},p(e,[n]){const oe={};n&2&&(oe.$$scope={dirty:n,ctx:e}),fe.$set(oe);const ce={};n&2&&(ce.$$scope={dirty:n,ctx:e}),_e.$set(ce);const yt={};n&2&&(yt.$$scope={dirty:n,ctx:e}),Te.$set(yt);const wt={};n&2&&(wt.$$scope={dirty:n,ctx:e}),Me.$set(wt);const se={};n&2&&(se.$$scope={dirty:n,ctx:e}),ve.$set(se);const $t={};n&2&&($t.$$scope={dirty:n,ctx:e}),ye.$set($t);const Vt={};n&2&&(Vt.$$scope={dirty:n,ctx:e}),we.$set(Vt);const me={};n&2&&(me.$$scope={dirty:n,ctx:e}),$e.$set(me);const ne={};n&2&&(ne.$$scope={dirty:n,ctx:e}),Ve.$set(ne);const ae={};n&2&&(ae.$$scope={dirty:n,ctx:e}),xe.$set(ae);const re={};n&2&&(re.$$scope={dirty:n,ctx:e}),Ce.$set(re);const ie={};n&2&&(ie.$$scope={dirty:n,ctx:e}),Fe.$set(ie);const le={};n&2&&(le.$$scope={dirty:n,ctx:e}),je.$set(le);const E={};n&2&&(E.$$scope={dirty:n,ctx:e}),Ue.$set(E);const de={};n&2&&(de.$$scope={dirty:n,ctx:e}),Ie.$set(de);const S={};n&2&&(S.$$scope={dirty:n,ctx:e}),Ze.$set(S)},i(e){Zo||(T(w.$$.fragment,e),T(u.$$.fragment,e),T(Ne.$$.fragment,e),T(Ge.$$.fragment,e),T(He.$$.fragment,e),T(Ye.$$.fragment,e),T(Qe.$$.fragment,e),T(fe.$$.fragment,e),T(Ae.$$.fragment,e),T(De.$$.fragment,e),T(Oe.$$.fragment,e),T(Ke.$$.fragment,e),T(et.$$.fragment,e),T(tt.$$.fragment,e),T(ot.$$.fragment,e),T(st.$$.fragment,e),T(nt.$$.fragment,e),T(at.$$.fragment,e),T(rt.$$.fragment,e),T(_e.$$.fragment,e),T(Te.$$.fragment,e),T(it.$$.fragment,e),T(lt.$$.fragment,e),T(dt.$$.fragment,e),T(Me.$$.fragment,e),T(ve.$$.fragment,e),T(ct.$$.fragment,e),T(mt.$$.fragment,e),T(pt.$$.fragment,e),T(ye.$$.fragment,e),T(we.$$.fragment,e),T(ft.$$.fragment,e),T(ht.$$.fragment,e),T($e.$$.fragment,e),T(ut.$$.fragment,e),T(Ve.$$.fragment,e),T(xe.$$.fragment,e),T(gt.$$.fragment,e),T(bt.$$.fragment,e),T(Ce.$$.fragment,e),T(_t.$$.fragment,e),T(Fe.$$.fragment,e),T(je.$$.fragment,e),T(Tt.$$.fragment,e),T(Mt.$$.fragment,e),T(Ue.$$.fragment,e),T(vt.$$.fragment,e),T(Ie.$$.fragment,e),T(Ze.$$.fragment,e),Zo=!0)},o(e){M(w.$$.fragment,e),M(u.$$.fragment,e),M(Ne.$$.fragment,e),M(Ge.$$.fragment,e),M(He.$$.fragment,e),M(Ye.$$.fragment,e),M(Qe.$$.fragment,e),M(fe.$$.fragment,e),M(Ae.$$.fragment,e),M(De.$$.fragment,e),M(Oe.$$.fragment,e),M(Ke.$$.fragment,e),M(et.$$.fragment,e),M(tt.$$.fragment,e),M(ot.$$.fragment,e),M(st.$$.fragment,e),M(nt.$$.fragment,e),M(at.$$.fragment,e),M(rt.$$.fragment,e),M(_e.$$.fragment,e),M(Te.$$.fragment,e),M(it.$$.fragment,e),M(lt.$$.fragment,e),M(dt.$$.fragment,e),M(Me.$$.fragment,e),M(ve.$$.fragment,e),M(ct.$$.fragment,e),M(mt.$$.fragment,e),M(pt.$$.fragment,e),M(ye.$$.fragment,e),M(we.$$.fragment,e),M(ft.$$.fragment,e),M(ht.$$.fragment,e),M($e.$$.fragment,e),M(ut.$$.fragment,e),M(Ve.$$.fragment,e),M(xe.$$.fragment,e),M(gt.$$.fragment,e),M(bt.$$.fragment,e),M(Ce.$$.fragment,e),M(_t.$$.fragment,e),M(Fe.$$.fragment,e),M(je.$$.fragment,e),M(Tt.$$.fragment,e),M(Mt.$$.fragment,e),M(Ue.$$.fragment,e),M(vt.$$.fragment,e),M(Ie.$$.fragment,e),M(Ze.$$.fragment,e),Zo=!1},d(e){e&&(o(y),o(d),o(l),o(s),o(N),o(F),o(R),o(j),o(L),o(f),o(eo),o(We),o(to),o(Se),o(oo),o(so),o(Re),o(no),o(Le),o(ao),o(ro),o(Pe),o(io),o(lo),o(Be),o(co),o(Ee),o(mo),o(qe),o(po),o(Xe),o(fo),o(ho),o(G),o(uo),o(go),o(ee),o(bo),o(_o),o(P),o(To),o(Mo),o(te),o(vo),o(yo),o(H),o(wo),o($o),o(B),o(Vo),o(xo),o(W),o(Co),o(Fo),o(J),o(jo),o(Uo),o(z),o(Io),o(Kt)),o(t),v(w,e),v(u,e),v(Ne,e),v(Ge,e),v(He,e),v(Ye,e),v(Qe),v(fe),v(Ae,e),v(De),v(Oe),v(Ke),v(et,e),v(tt),v(ot),v(st),v(nt,e),v(at),v(rt),v(_e),v(Te),v(it,e),v(lt),v(dt),v(Me),v(ve),v(ct,e),v(mt),v(pt),v(ye),v(we),v(ft,e),v(ht),v($e),v(ut),v(Ve),v(xe),v(gt,e),v(bt),v(Ce),v(_t),v(Fe),v(je),v(Tt,e),v(Mt),v(Ue),v(vt),v(Ie),v(Ze)}}}const Wn='{"title":"MobileViT","local":"mobilevit","sections":[{"title":"Overview","local":"overview","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 Sn($){return hn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qn extends un{constructor(t){super(),gn(this,t,Sn,kn,fn,{})}}export{qn as component};
