import{S as om,i as sm,s as am,e as s,k as d,w as y,t as n,M as nm,c as a,d as t,m,a as i,x as M,h as r,b as p,G as e,g as f,y as $,q as V,o as E,B as F,v as rm,L as ks}from"../../chunks/vendor-hf-doc-builder.js";import{T as Zt}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as $o}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as mt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Cs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as im}from"../../chunks/PipelineTag-hf-doc-builder.js";function lm(U){let c,T,b,g,v;return g=new $o({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`}}),{c(){c=s("p"),T=n("Example:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Example:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function cm(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function dm(U){let c,T,b,g,v;return g=new $o({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>]`}}),{c(){c=s("p"),T=n("Example:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Example:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function mm(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function pm(U){let c,T,b,g,v;return g=new $o({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`}}),{c(){c=s("p"),T=n("Example:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Example:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function hm(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function fm(U){let c,T,b,g,v;return g=new $o({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`}}),{c(){c=s("p"),T=n("Examples:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Examples:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function um(U){let c,T,b,g,v,l,h,I,Ce,be,S,ee,te,w,ke,X,Ie,_e,z,je,oe,Y,Ue,ve,R,xe,Te,G,de,Ze,se,j,Z,we,x,me,ae,q,ne,Je,J,We,O,re,Se,B,Ne,ze,A,pe,P,Pe,L,W,Re,N,he,Q;return{c(){c=s("p"),T=n("TensorFlow models and layers in "),b=s("code"),g=n("transformers"),v=n(" accept two formats as input:"),l=d(),h=s("ul"),I=s("li"),Ce=n("having all inputs as keyword arguments (like PyTorch models), or"),be=d(),S=s("li"),ee=n("having all inputs as a list, tuple or dict in the first positional argument."),te=d(),w=s("p"),ke=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 `),X=s("code"),Ie=n("model.fit()"),_e=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=s("code"),je=n("model.fit()"),oe=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=s("code"),Ue=n("fit()"),ve=n(" and "),R=s("code"),xe=n("predict()"),Te=n(`, such as when creating your own layers or models with
the Keras `),G=s("code"),de=n("Functional"),Ze=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=d(),j=s("ul"),Z=s("li"),we=n("a single Tensor with "),x=s("code"),me=n("pixel_values"),ae=n(" only and nothing else: "),q=s("code"),ne=n("model(pixel_values)"),Je=d(),J=s("li"),We=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=s("code"),re=n("model([pixel_values, attention_mask])"),Se=n(" or "),B=s("code"),Ne=n("model([pixel_values, attention_mask, token_type_ids])"),ze=d(),A=s("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=s("code"),Pe=n('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),L=d(),W=s("p"),Re=n(`Note that when creating models and layers with
`),N=s("a"),he=n("subclassing"),Q=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){c=a(_,"P",{});var C=i(c);T=r(C,"TensorFlow models and layers in "),b=a(C,"CODE",{});var Qe=i(b);g=r(Qe,"transformers"),Qe.forEach(t),v=r(C," accept two formats as input:"),C.forEach(t),l=m(_),h=a(_,"UL",{});var le=i(h);I=a(le,"LI",{});var ye=i(I);Ce=r(ye,"having all inputs as keyword arguments (like PyTorch models), or"),ye.forEach(t),be=m(le),S=a(le,"LI",{});var He=i(S);ee=r(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),le.forEach(t),te=m(_),w=a(_,"P",{});var k=i(w);ke=r(k,`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 `),X=a(k,"CODE",{});var Ke=i(X);Ie=r(Ke,"model.fit()"),Ke.forEach(t),_e=r(k,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=a(k,"CODE",{});var Me=i(z);je=r(Me,"model.fit()"),Me.forEach(t),oe=r(k,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a(k,"CODE",{});var $e=i(Y);Ue=r($e,"fit()"),$e.forEach(t),ve=r(k," and "),R=a(k,"CODE",{});var et=i(R);xe=r(et,"predict()"),et.forEach(t),Te=r(k,`, such as when creating your own layers or models with
the Keras `),G=a(k,"CODE",{});var Ve=i(G);de=r(Ve,"Functional"),Ve.forEach(t),Ze=r(k,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),k.forEach(t),se=m(_),j=a(_,"UL",{});var D=i(j);Z=a(D,"LI",{});var H=i(Z);we=r(H,"a single Tensor with "),x=a(H,"CODE",{});var tt=i(x);me=r(tt,"pixel_values"),tt.forEach(t),ae=r(H," only and nothing else: "),q=a(H,"CODE",{});var Be=i(q);ne=r(Be,"model(pixel_values)"),Be.forEach(t),H.forEach(t),Je=m(D),J=a(D,"LI",{});var K=i(J);We=r(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a(K,"CODE",{});var De=i(O);re=r(De,"model([pixel_values, attention_mask])"),De.forEach(t),Se=r(K," or "),B=a(K,"CODE",{});var Ee=i(B);Ne=r(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),K.forEach(t),ze=m(D),A=a(D,"LI",{});var Fe=i(A);pe=r(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a(Fe,"CODE",{});var fe=i(P);Pe=r(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),D.forEach(t),L=m(_),W=a(_,"P",{});var ce=i(W);Re=r(ce,`Note that when creating models and layers with
`),N=a(ce,"A",{href:!0,rel:!0});var Ae=i(N);he=r(Ae,"subclassing"),Ae.forEach(t),Q=r(ce,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ce.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(_,C){f(_,c,C),e(c,T),e(c,b),e(b,g),e(c,v),f(_,l,C),f(_,h,C),e(h,I),e(I,Ce),e(h,be),e(h,S),e(S,ee),f(_,te,C),f(_,w,C),e(w,ke),e(w,X),e(X,Ie),e(w,_e),e(w,z),e(z,je),e(w,oe),e(w,Y),e(Y,Ue),e(w,ve),e(w,R),e(R,xe),e(w,Te),e(w,G),e(G,de),e(w,Ze),f(_,se,C),f(_,j,C),e(j,Z),e(Z,we),e(Z,x),e(x,me),e(Z,ae),e(Z,q),e(q,ne),e(j,Je),e(j,J),e(J,We),e(J,O),e(O,re),e(J,Se),e(J,B),e(B,Ne),e(j,ze),e(j,A),e(A,pe),e(A,P),e(P,Pe),f(_,L,C),f(_,W,C),e(W,Re),e(W,N),e(N,he),e(W,Q)},d(_){_&&t(c),_&&t(l),_&&t(h),_&&t(te),_&&t(w),_&&t(se),_&&t(j),_&&t(L),_&&t(W)}}}function gm(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function bm(U){let c,T,b,g,v;return g=new $o({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>]`}}),{c(){c=s("p"),T=n("Example:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Example:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function _m(U){let c,T,b,g,v,l,h,I,Ce,be,S,ee,te,w,ke,X,Ie,_e,z,je,oe,Y,Ue,ve,R,xe,Te,G,de,Ze,se,j,Z,we,x,me,ae,q,ne,Je,J,We,O,re,Se,B,Ne,ze,A,pe,P,Pe,L,W,Re,N,he,Q;return{c(){c=s("p"),T=n("TensorFlow models and layers in "),b=s("code"),g=n("transformers"),v=n(" accept two formats as input:"),l=d(),h=s("ul"),I=s("li"),Ce=n("having all inputs as keyword arguments (like PyTorch models), or"),be=d(),S=s("li"),ee=n("having all inputs as a list, tuple or dict in the first positional argument."),te=d(),w=s("p"),ke=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 `),X=s("code"),Ie=n("model.fit()"),_e=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=s("code"),je=n("model.fit()"),oe=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=s("code"),Ue=n("fit()"),ve=n(" and "),R=s("code"),xe=n("predict()"),Te=n(`, such as when creating your own layers or models with
the Keras `),G=s("code"),de=n("Functional"),Ze=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=d(),j=s("ul"),Z=s("li"),we=n("a single Tensor with "),x=s("code"),me=n("pixel_values"),ae=n(" only and nothing else: "),q=s("code"),ne=n("model(pixel_values)"),Je=d(),J=s("li"),We=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=s("code"),re=n("model([pixel_values, attention_mask])"),Se=n(" or "),B=s("code"),Ne=n("model([pixel_values, attention_mask, token_type_ids])"),ze=d(),A=s("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=s("code"),Pe=n('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),L=d(),W=s("p"),Re=n(`Note that when creating models and layers with
`),N=s("a"),he=n("subclassing"),Q=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){c=a(_,"P",{});var C=i(c);T=r(C,"TensorFlow models and layers in "),b=a(C,"CODE",{});var Qe=i(b);g=r(Qe,"transformers"),Qe.forEach(t),v=r(C," accept two formats as input:"),C.forEach(t),l=m(_),h=a(_,"UL",{});var le=i(h);I=a(le,"LI",{});var ye=i(I);Ce=r(ye,"having all inputs as keyword arguments (like PyTorch models), or"),ye.forEach(t),be=m(le),S=a(le,"LI",{});var He=i(S);ee=r(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),le.forEach(t),te=m(_),w=a(_,"P",{});var k=i(w);ke=r(k,`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 `),X=a(k,"CODE",{});var Ke=i(X);Ie=r(Ke,"model.fit()"),Ke.forEach(t),_e=r(k,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=a(k,"CODE",{});var Me=i(z);je=r(Me,"model.fit()"),Me.forEach(t),oe=r(k,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a(k,"CODE",{});var $e=i(Y);Ue=r($e,"fit()"),$e.forEach(t),ve=r(k," and "),R=a(k,"CODE",{});var et=i(R);xe=r(et,"predict()"),et.forEach(t),Te=r(k,`, such as when creating your own layers or models with
the Keras `),G=a(k,"CODE",{});var Ve=i(G);de=r(Ve,"Functional"),Ve.forEach(t),Ze=r(k,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),k.forEach(t),se=m(_),j=a(_,"UL",{});var D=i(j);Z=a(D,"LI",{});var H=i(Z);we=r(H,"a single Tensor with "),x=a(H,"CODE",{});var tt=i(x);me=r(tt,"pixel_values"),tt.forEach(t),ae=r(H," only and nothing else: "),q=a(H,"CODE",{});var Be=i(q);ne=r(Be,"model(pixel_values)"),Be.forEach(t),H.forEach(t),Je=m(D),J=a(D,"LI",{});var K=i(J);We=r(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a(K,"CODE",{});var De=i(O);re=r(De,"model([pixel_values, attention_mask])"),De.forEach(t),Se=r(K," or "),B=a(K,"CODE",{});var Ee=i(B);Ne=r(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),K.forEach(t),ze=m(D),A=a(D,"LI",{});var Fe=i(A);pe=r(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a(Fe,"CODE",{});var fe=i(P);Pe=r(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),D.forEach(t),L=m(_),W=a(_,"P",{});var ce=i(W);Re=r(ce,`Note that when creating models and layers with
`),N=a(ce,"A",{href:!0,rel:!0});var Ae=i(N);he=r(Ae,"subclassing"),Ae.forEach(t),Q=r(ce,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ce.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(_,C){f(_,c,C),e(c,T),e(c,b),e(b,g),e(c,v),f(_,l,C),f(_,h,C),e(h,I),e(I,Ce),e(h,be),e(h,S),e(S,ee),f(_,te,C),f(_,w,C),e(w,ke),e(w,X),e(X,Ie),e(w,_e),e(w,z),e(z,je),e(w,oe),e(w,Y),e(Y,Ue),e(w,ve),e(w,R),e(R,xe),e(w,Te),e(w,G),e(G,de),e(w,Ze),f(_,se,C),f(_,j,C),e(j,Z),e(Z,we),e(Z,x),e(x,me),e(Z,ae),e(Z,q),e(q,ne),e(j,Je),e(j,J),e(J,We),e(J,O),e(O,re),e(J,Se),e(J,B),e(B,Ne),e(j,ze),e(j,A),e(A,pe),e(A,P),e(P,Pe),f(_,L,C),f(_,W,C),e(W,Re),e(W,N),e(N,he),e(W,Q)},d(_){_&&t(c),_&&t(l),_&&t(h),_&&t(te),_&&t(w),_&&t(se),_&&t(j),_&&t(L),_&&t(W)}}}function vm(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function Tm(U){let c,T,b,g,v;return g=new $o({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`}}),{c(){c=s("p"),T=n("Example:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Example:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function wm(U){let c,T,b,g,v,l,h,I,Ce,be,S,ee,te,w,ke,X,Ie,_e,z,je,oe,Y,Ue,ve,R,xe,Te,G,de,Ze,se,j,Z,we,x,me,ae,q,ne,Je,J,We,O,re,Se,B,Ne,ze,A,pe,P,Pe,L,W,Re,N,he,Q;return{c(){c=s("p"),T=n("TensorFlow models and layers in "),b=s("code"),g=n("transformers"),v=n(" accept two formats as input:"),l=d(),h=s("ul"),I=s("li"),Ce=n("having all inputs as keyword arguments (like PyTorch models), or"),be=d(),S=s("li"),ee=n("having all inputs as a list, tuple or dict in the first positional argument."),te=d(),w=s("p"),ke=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 `),X=s("code"),Ie=n("model.fit()"),_e=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=s("code"),je=n("model.fit()"),oe=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=s("code"),Ue=n("fit()"),ve=n(" and "),R=s("code"),xe=n("predict()"),Te=n(`, such as when creating your own layers or models with
the Keras `),G=s("code"),de=n("Functional"),Ze=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=d(),j=s("ul"),Z=s("li"),we=n("a single Tensor with "),x=s("code"),me=n("pixel_values"),ae=n(" only and nothing else: "),q=s("code"),ne=n("model(pixel_values)"),Je=d(),J=s("li"),We=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=s("code"),re=n("model([pixel_values, attention_mask])"),Se=n(" or "),B=s("code"),Ne=n("model([pixel_values, attention_mask, token_type_ids])"),ze=d(),A=s("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=s("code"),Pe=n('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),L=d(),W=s("p"),Re=n(`Note that when creating models and layers with
`),N=s("a"),he=n("subclassing"),Q=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){c=a(_,"P",{});var C=i(c);T=r(C,"TensorFlow models and layers in "),b=a(C,"CODE",{});var Qe=i(b);g=r(Qe,"transformers"),Qe.forEach(t),v=r(C," accept two formats as input:"),C.forEach(t),l=m(_),h=a(_,"UL",{});var le=i(h);I=a(le,"LI",{});var ye=i(I);Ce=r(ye,"having all inputs as keyword arguments (like PyTorch models), or"),ye.forEach(t),be=m(le),S=a(le,"LI",{});var He=i(S);ee=r(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),le.forEach(t),te=m(_),w=a(_,"P",{});var k=i(w);ke=r(k,`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 `),X=a(k,"CODE",{});var Ke=i(X);Ie=r(Ke,"model.fit()"),Ke.forEach(t),_e=r(k,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),z=a(k,"CODE",{});var Me=i(z);je=r(Me,"model.fit()"),Me.forEach(t),oe=r(k,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a(k,"CODE",{});var $e=i(Y);Ue=r($e,"fit()"),$e.forEach(t),ve=r(k," and "),R=a(k,"CODE",{});var et=i(R);xe=r(et,"predict()"),et.forEach(t),Te=r(k,`, such as when creating your own layers or models with
the Keras `),G=a(k,"CODE",{});var Ve=i(G);de=r(Ve,"Functional"),Ve.forEach(t),Ze=r(k,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),k.forEach(t),se=m(_),j=a(_,"UL",{});var D=i(j);Z=a(D,"LI",{});var H=i(Z);we=r(H,"a single Tensor with "),x=a(H,"CODE",{});var tt=i(x);me=r(tt,"pixel_values"),tt.forEach(t),ae=r(H," only and nothing else: "),q=a(H,"CODE",{});var Be=i(q);ne=r(Be,"model(pixel_values)"),Be.forEach(t),H.forEach(t),Je=m(D),J=a(D,"LI",{});var K=i(J);We=r(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a(K,"CODE",{});var De=i(O);re=r(De,"model([pixel_values, attention_mask])"),De.forEach(t),Se=r(K," or "),B=a(K,"CODE",{});var Ee=i(B);Ne=r(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),K.forEach(t),ze=m(D),A=a(D,"LI",{});var Fe=i(A);pe=r(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a(Fe,"CODE",{});var fe=i(P);Pe=r(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),D.forEach(t),L=m(_),W=a(_,"P",{});var ce=i(W);Re=r(ce,`Note that when creating models and layers with
`),N=a(ce,"A",{href:!0,rel:!0});var Ae=i(N);he=r(Ae,"subclassing"),Ae.forEach(t),Q=r(ce,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ce.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(_,C){f(_,c,C),e(c,T),e(c,b),e(b,g),e(c,v),f(_,l,C),f(_,h,C),e(h,I),e(I,Ce),e(h,be),e(h,S),e(S,ee),f(_,te,C),f(_,w,C),e(w,ke),e(w,X),e(X,Ie),e(w,_e),e(w,z),e(z,je),e(w,oe),e(w,Y),e(Y,Ue),e(w,ve),e(w,R),e(R,xe),e(w,Te),e(w,G),e(G,de),e(w,Ze),f(_,se,C),f(_,j,C),e(j,Z),e(Z,we),e(Z,x),e(x,me),e(Z,ae),e(Z,q),e(q,ne),e(j,Je),e(j,J),e(J,We),e(J,O),e(O,re),e(J,Se),e(J,B),e(B,Ne),e(j,ze),e(j,A),e(A,pe),e(A,P),e(P,Pe),f(_,L,C),f(_,W,C),e(W,Re),e(W,N),e(N,he),e(W,Q)},d(_){_&&t(c),_&&t(l),_&&t(h),_&&t(te),_&&t(w),_&&t(se),_&&t(j),_&&t(L),_&&t(W)}}}function ym(U){let c,T,b,g,v;return{c(){c=s("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=s("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(h,"CODE",{});var I=i(b);g=r(I,"Module"),I.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,c,h),e(c,T),e(c,b),e(b,g),e(c,v)},d(l){l&&t(c)}}}function Mm(U){let c,T,b,g,v;return g=new $o({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`}}),{c(){c=s("p"),T=n("Examples:"),b=d(),y(g.$$.fragment)},l(l){c=a(l,"P",{});var h=i(c);T=r(h,"Examples:"),h.forEach(t),b=m(l),M(g.$$.fragment,l)},m(l,h){f(l,c,h),e(c,T),f(l,b,h),$(g,l,h),v=!0},p:ks,i(l){v||(V(g.$$.fragment,l),v=!0)},o(l){E(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(b),F(g,l)}}}function $m(U){let c,T,b,g,v,l,h,I,Ce,be,S,ee,te,w,ke,X,Ie,_e,z,je,oe,Y,Ue,ve,R,xe,Te,G,de,Ze,se,j,Z,we,x,me,ae,q,ne,Je,J,We,O,re,Se,B,Ne,ze,A,pe,P,Pe,L,W,Re,N,he,Q,_,C,Qe,le,ye,He,k,Ke,Me,$e,et,Ve,D,H,tt,Be,K,De,Ee,Fe,fe,ce,Ae,lr,cr,on,ot,dr,Vo,mr,pr,Eo,hr,fr,Fo,ur,gr,sn,gt,Jt,ca,Co,br,da,_r,an,Is,vr,nn,ko,rn,Wt,ft,js,Tr,wr,Io,yr,Mr,jo,$r,Vr,Er,Us,Fr,xs,Cr,ln,Zs,ma,kr,cn,Js,pa,Ws,Ir,dn,Ss,jr,mn,bt,St,ha,Uo,Ur,fa,xr,pn,Xe,xo,Zr,_t,Jr,Ns,Wr,Sr,Zo,Nr,zr,Pr,vt,Rr,zs,Gr,Br,Ps,Ar,Dr,Xr,Nt,hn,Tt,zt,ua,Jo,Or,ga,Lr,fn,pt,Wo,Yr,Pt,So,qr,ba,Qr,Hr,Rt,No,Kr,zo,ei,Rs,ti,oi,un,wt,Gt,_a,Po,si,va,ai,gn,Oe,Ro,ni,Ta,ri,ii,Bt,Go,li,wa,ci,di,At,Bo,mi,Ao,pi,Gs,hi,fi,bn,yt,Dt,ya,Do,ui,Ma,gi,_n,ht,Xo,bi,Oo,_i,Lo,vi,Ti,wi,st,Yo,yi,Mt,Mi,Bs,$i,Vi,$a,Ei,Fi,Ci,Xt,ki,Ot,vn,$t,Lt,Va,qo,Ii,Ea,ji,Tn,Le,Qo,Ui,Fa,xi,Zi,Ho,Ji,Ko,Wi,Si,Ni,at,es,zi,Vt,Pi,As,Ri,Gi,Ca,Bi,Ai,Di,Yt,Xi,qt,wn,Et,Qt,ka,ts,Oi,Ia,Li,yn,Ye,os,Yi,ja,qi,Qi,ss,Hi,as,Ki,el,tl,nt,ns,ol,Ft,sl,Ds,al,nl,Ua,rl,il,ll,Ht,cl,Kt,Mn,Ct,eo,xa,rs,dl,Za,ml,$n,Ge,is,pl,ls,hl,Xs,fl,ul,gl,cs,bl,ds,_l,vl,Tl,to,wl,rt,ms,yl,kt,Ml,Os,$l,Vl,Ja,El,Fl,Cl,oo,kl,so,Vn,It,ao,Wa,ps,Il,Sa,jl,En,ue,hs,Ul,Na,xl,Zl,fs,Jl,Ls,Wl,Sl,Nl,us,zl,gs,Pl,Rl,Gl,no,Bl,it,bs,Al,jt,Dl,Ys,Xl,Ol,za,Ll,Yl,ql,ro,Ql,io,Fn,Ut,lo,Pa,_s,Hl,Ra,Kl,Cn,ge,vs,ec,Ga,tc,oc,Ts,sc,qs,ac,nc,rc,ws,ic,ys,lc,cc,dc,co,mc,lt,Ms,pc,xt,hc,Qs,fc,uc,Ba,gc,bc,_c,mo,vc,po,kn;return l=new mt({}),w=new mt({}),Ee=new $o({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)`}}),Co=new mt({}),ko=new im({props:{pipeline:"image-classification"}}),Uo=new mt({}),xo=new ie({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>, <code>optional</code>, defaults to 32) &#x2014;
The ratio of the spatial resolution of the output to the resolution of the input image.`,name:"output_stride"},{anchor:"transformers.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-5) &#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>, <code>optional</code>, 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/v4.32.0/src/transformers/models/mobilevit/configuration_mobilevit.py#L46"}}),Nt=new Cs({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[lm]},$$scope:{ctx:U}}}),Jo=new mt({}),Wo=new ie({props:{name:"class transformers.MobileViTFeatureExtractor",anchor:"transformers.MobileViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L26"}}),So=new ie({props:{name:"__call__",anchor:"transformers.MobileViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/image_processing_utils.py#L544"}}),No=new ie({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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/image_processing_mobilevit.py#L295",returnDescription:`
<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p>semantic_segmentation</p>
`}}),Po=new mt({}),Ro=new ie({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:"**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>PILImageResampling.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/image_processing_mobilevit.py#L50"}}),Go=new ie({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.`,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/v4.32.0/src/transformers/models/mobilevit/image_processing_mobilevit.py#L171"}}),Bo=new ie({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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/image_processing_mobilevit.py#L295",returnDescription:`
<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p>semantic_segmentation</p>
`}}),Do=new mt({}),Xo=new ie({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/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L708"}}),Yo=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L745",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/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>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xt=new Zt({props:{$$slots:{default:[cm]},$$scope:{ctx:U}}}),Ot=new Cs({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[dm]},$$scope:{ctx:U}}}),qo=new mt({}),Qo=new ie({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/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L802"}}),es=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L818",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/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) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yt=new Zt({props:{$$slots:{default:[mm]},$$scope:{ctx:U}}}),qt=new Cs({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[pm]},$$scope:{ctx:U}}}),ts=new mt({}),os=new ie({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/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L997"}}),ns=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_mobilevit.py#L1008",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/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) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ht=new Zt({props:{$$slots:{default:[hm]},$$scope:{ctx:U}}}),Kt=new Cs({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[fm]},$$scope:{ctx:U}}}),rs=new mt({}),is=new ie({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L800"}}),to=new Zt({props:{$$slots:{default:[um]},$$scope:{ctx:U}}}),ms=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L808",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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>) \u2014 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>) \u2014 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\u2019re 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oo=new Zt({props:{$$slots:{default:[gm]},$$scope:{ctx:U}}}),so=new Cs({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[bm]},$$scope:{ctx:U}}}),ps=new mt({}),hs=new ie({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L835"}}),no=new Zt({props:{$$slots:{default:[_m]},$$scope:{ctx:U}}}),bs=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L848",returnDescription:`
<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/v4.32.0/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) \u2014 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>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ro=new Zt({props:{$$slots:{default:[vm]},$$scope:{ctx:U}}}),io=new Cs({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[Tm]},$$scope:{ctx:U}}}),_s=new mt({}),vs=new ie({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1011"}}),co=new Zt({props:{$$slots:{default:[wm]},$$scope:{ctx:U}}}),Ms=new ie({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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.32.0/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/v4.32.0/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1039",returnDescription:`
<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/v4.32.0/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) \u2014 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>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(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>) \u2014 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:`
<p><code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),mo=new Zt({props:{$$slots:{default:[ym]},$$scope:{ctx:U}}}),po=new Cs({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[Mm]},$$scope:{ctx:U}}}),{c(){c=s("meta"),T=d(),b=s("h1"),g=s("a"),v=s("span"),y(l.$$.fragment),h=d(),I=s("span"),Ce=n("MobileViT"),be=d(),S=s("h2"),ee=s("a"),te=s("span"),y(w.$$.fragment),ke=d(),X=s("span"),Ie=n("Overview"),_e=d(),z=s("p"),je=n("The MobileViT model was proposed in "),oe=s("a"),Y=n("MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),Ue=n(" by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),ve=d(),R=s("p"),xe=n("The abstract from the paper is the following:"),Te=d(),G=s("p"),de=s("em"),Ze=n("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."),se=d(),j=s("p"),Z=n("Tips:"),we=d(),x=s("ul"),me=s("li"),ae=s("p"),q=n("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 "),ne=s("a"),Je=n("this tutorial"),J=n(" for a lightweight introduction."),We=d(),O=s("li"),re=s("p"),Se=n("One can use "),B=s("a"),Ne=n("MobileViTImageProcessor"),ze=n(" 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)."),A=d(),pe=s("li"),P=s("p"),Pe=n("The available image classification checkpoints are pre-trained on "),L=s("a"),W=n("ImageNet-1k"),Re=n(" (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),N=d(),he=s("li"),Q=s("p"),_=n("The segmentation model uses a "),C=s("a"),Qe=n("DeepLabV3"),le=n(" head. The available semantic segmentation checkpoints are pre-trained on "),ye=s("a"),He=n("PASCAL VOC"),k=n("."),Ke=d(),Me=s("li"),$e=s("p"),et=n("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 "),Ve=s("a"),D=n("TensorFlow Lite"),H=n("."),tt=d(),Be=s("p"),K=n(`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),De=d(),y(Ee.$$.fragment),Fe=d(),fe=s("p"),ce=n("The resulting model will be just "),Ae=s("strong"),lr=n("about an MB"),cr=n(` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),on=d(),ot=s("p"),dr=n("This model was contributed by "),Vo=s("a"),mr=n("matthijs"),pr=n(". The TensorFlow version of the model was contributed by "),Eo=s("a"),hr=n("sayakpaul"),fr=n(". The original code and weights can be found "),Fo=s("a"),ur=n("here"),gr=n("."),sn=d(),gt=s("h2"),Jt=s("a"),ca=s("span"),y(Co.$$.fragment),br=d(),da=s("span"),_r=n("Resources"),an=d(),Is=s("p"),vr=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileViT."),nn=d(),y(ko.$$.fragment),rn=d(),Wt=s("ul"),ft=s("li"),js=s("a"),Tr=n("MobileViTForImageClassification"),wr=n(" is supported by this "),Io=s("a"),yr=n("example script"),Mr=n(" and "),jo=s("a"),$r=n("notebook"),Vr=n("."),Er=d(),Us=s("li"),Fr=n("See also: "),xs=s("a"),Cr=n("Image classification task guide"),ln=d(),Zs=s("p"),ma=s("strong"),kr=n("Semantic segmentation"),cn=d(),Js=s("ul"),pa=s("li"),Ws=s("a"),Ir=n("Semantic segmentation task guide"),dn=d(),Ss=s("p"),jr=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),mn=d(),bt=s("h2"),St=s("a"),ha=s("span"),y(Uo.$$.fragment),Ur=d(),fa=s("span"),xr=n("MobileViTConfig"),pn=d(),Xe=s("div"),y(xo.$$.fragment),Zr=d(),_t=s("p"),Jr=n("This is the configuration class to store the configuration of a "),Ns=s("a"),Wr=n("MobileViTModel"),Sr=n(`. 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
`),Zo=s("a"),Nr=n("apple/mobilevit-small"),zr=n(" architecture."),Pr=d(),vt=s("p"),Rr=n("Configuration objects inherit from "),zs=s("a"),Gr=n("PretrainedConfig"),Br=n(` and can be used to control the model outputs. Read the
documentation from `),Ps=s("a"),Ar=n("PretrainedConfig"),Dr=n(" for more information."),Xr=d(),y(Nt.$$.fragment),hn=d(),Tt=s("h2"),zt=s("a"),ua=s("span"),y(Jo.$$.fragment),Or=d(),ga=s("span"),Lr=n("MobileViTFeatureExtractor"),fn=d(),pt=s("div"),y(Wo.$$.fragment),Yr=d(),Pt=s("div"),y(So.$$.fragment),qr=d(),ba=s("p"),Qr=n("Preprocess an image or a batch of images."),Hr=d(),Rt=s("div"),y(No.$$.fragment),Kr=d(),zo=s("p"),ei=n("Converts the output of "),Rs=s("a"),ti=n("MobileViTForSemanticSegmentation"),oi=n(` into semantic segmentation maps. Only supports
PyTorch.`),un=d(),wt=s("h2"),Gt=s("a"),_a=s("span"),y(Po.$$.fragment),si=d(),va=s("span"),ai=n("MobileViTImageProcessor"),gn=d(),Oe=s("div"),y(Ro.$$.fragment),ni=d(),Ta=s("p"),ri=n("Constructs a MobileViT image processor."),ii=d(),Bt=s("div"),y(Go.$$.fragment),li=d(),wa=s("p"),ci=n("Preprocess an image or batch of images."),di=d(),At=s("div"),y(Bo.$$.fragment),mi=d(),Ao=s("p"),pi=n("Converts the output of "),Gs=s("a"),hi=n("MobileViTForSemanticSegmentation"),fi=n(` into semantic segmentation maps. Only supports
PyTorch.`),bn=d(),yt=s("h2"),Dt=s("a"),ya=s("span"),y(Do.$$.fragment),ui=d(),Ma=s("span"),gi=n("MobileViTModel"),_n=d(),ht=s("div"),y(Xo.$$.fragment),bi=d(),Oo=s("p"),_i=n(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Lo=s("a"),vi=n("torch.nn.Module"),Ti=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wi=d(),st=s("div"),y(Yo.$$.fragment),yi=d(),Mt=s("p"),Mi=n("The "),Bs=s("a"),$i=n("MobileViTModel"),Vi=n(" forward method, overrides the "),$a=s("code"),Ei=n("__call__"),Fi=n(" special method."),Ci=d(),y(Xt.$$.fragment),ki=d(),y(Ot.$$.fragment),vn=d(),$t=s("h2"),Lt=s("a"),Va=s("span"),y(qo.$$.fragment),Ii=d(),Ea=s("span"),ji=n("MobileViTForImageClassification"),Tn=d(),Le=s("div"),y(Qo.$$.fragment),Ui=d(),Fa=s("p"),xi=n(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Zi=d(),Ho=s("p"),Ji=n("This model is a PyTorch "),Ko=s("a"),Wi=n("torch.nn.Module"),Si=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ni=d(),at=s("div"),y(es.$$.fragment),zi=d(),Vt=s("p"),Pi=n("The "),As=s("a"),Ri=n("MobileViTForImageClassification"),Gi=n(" forward method, overrides the "),Ca=s("code"),Bi=n("__call__"),Ai=n(" special method."),Di=d(),y(Yt.$$.fragment),Xi=d(),y(qt.$$.fragment),wn=d(),Et=s("h2"),Qt=s("a"),ka=s("span"),y(ts.$$.fragment),Oi=d(),Ia=s("span"),Li=n("MobileViTForSemanticSegmentation"),yn=d(),Ye=s("div"),y(os.$$.fragment),Yi=d(),ja=s("p"),qi=n("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Qi=d(),ss=s("p"),Hi=n("This model is a PyTorch "),as=s("a"),Ki=n("torch.nn.Module"),el=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tl=d(),nt=s("div"),y(ns.$$.fragment),ol=d(),Ft=s("p"),sl=n("The "),Ds=s("a"),al=n("MobileViTForSemanticSegmentation"),nl=n(" forward method, overrides the "),Ua=s("code"),rl=n("__call__"),il=n(" special method."),ll=d(),y(Ht.$$.fragment),cl=d(),y(Kt.$$.fragment),Mn=d(),Ct=s("h2"),eo=s("a"),xa=s("span"),y(rs.$$.fragment),dl=d(),Za=s("span"),ml=n("TFMobileViTModel"),$n=d(),Ge=s("div"),y(is.$$.fragment),pl=d(),ls=s("p"),hl=n(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Xs=s("a"),fl=n("TFPreTrainedModel"),ul=n(`. 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.)`),gl=d(),cs=s("p"),bl=n("This model is also a "),ds=s("a"),_l=n("tf.keras.Model"),vl=n(` 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.`),Tl=d(),y(to.$$.fragment),wl=d(),rt=s("div"),y(ms.$$.fragment),yl=d(),kt=s("p"),Ml=n("The "),Os=s("a"),$l=n("TFMobileViTModel"),Vl=n(" forward method, overrides the "),Ja=s("code"),El=n("__call__"),Fl=n(" special method."),Cl=d(),y(oo.$$.fragment),kl=d(),y(so.$$.fragment),Vn=d(),It=s("h2"),ao=s("a"),Wa=s("span"),y(ps.$$.fragment),Il=d(),Sa=s("span"),jl=n("TFMobileViTForImageClassification"),En=d(),ue=s("div"),y(hs.$$.fragment),Ul=d(),Na=s("p"),xl=n(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Zl=d(),fs=s("p"),Jl=n("This model inherits from "),Ls=s("a"),Wl=n("TFPreTrainedModel"),Sl=n(`. 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.)`),Nl=d(),us=s("p"),zl=n("This model is also a "),gs=s("a"),Pl=n("tf.keras.Model"),Rl=n(` 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.`),Gl=d(),y(no.$$.fragment),Bl=d(),it=s("div"),y(bs.$$.fragment),Al=d(),jt=s("p"),Dl=n("The "),Ys=s("a"),Xl=n("TFMobileViTForImageClassification"),Ol=n(" forward method, overrides the "),za=s("code"),Ll=n("__call__"),Yl=n(" special method."),ql=d(),y(ro.$$.fragment),Ql=d(),y(io.$$.fragment),Fn=d(),Ut=s("h2"),lo=s("a"),Pa=s("span"),y(_s.$$.fragment),Hl=d(),Ra=s("span"),Kl=n("TFMobileViTForSemanticSegmentation"),Cn=d(),ge=s("div"),y(vs.$$.fragment),ec=d(),Ga=s("p"),tc=n("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),oc=d(),Ts=s("p"),sc=n("This model inherits from "),qs=s("a"),ac=n("TFPreTrainedModel"),nc=n(`. 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.)`),rc=d(),ws=s("p"),ic=n("This model is also a "),ys=s("a"),lc=n("tf.keras.Model"),cc=n(` 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.`),dc=d(),y(co.$$.fragment),mc=d(),lt=s("div"),y(Ms.$$.fragment),pc=d(),xt=s("p"),hc=n("The "),Qs=s("a"),fc=n("TFMobileViTForSemanticSegmentation"),uc=n(" forward method, overrides the "),Ba=s("code"),gc=n("__call__"),bc=n(" special method."),_c=d(),y(mo.$$.fragment),vc=d(),y(po.$$.fragment),this.h()},l(o){const u=nm('[data-svelte="svelte-1phssyn"]',document.head);c=a(u,"META",{name:!0,content:!0}),u.forEach(t),T=m(o),b=a(o,"H1",{class:!0});var $s=i(b);g=a($s,"A",{id:!0,class:!0,href:!0});var Aa=i(g);v=a(Aa,"SPAN",{});var Da=i(v);M(l.$$.fragment,Da),Da.forEach(t),Aa.forEach(t),h=m($s),I=a($s,"SPAN",{});var Xa=i(I);Ce=r(Xa,"MobileViT"),Xa.forEach(t),$s.forEach(t),be=m(o),S=a(o,"H2",{class:!0});var Vs=i(S);ee=a(Vs,"A",{id:!0,class:!0,href:!0});var Oa=i(ee);te=a(Oa,"SPAN",{});var La=i(te);M(w.$$.fragment,La),La.forEach(t),Oa.forEach(t),ke=m(Vs),X=a(Vs,"SPAN",{});var Ya=i(X);Ie=r(Ya,"Overview"),Ya.forEach(t),Vs.forEach(t),_e=m(o),z=a(o,"P",{});var Es=i(z);je=r(Es,"The MobileViT model was proposed in "),oe=a(Es,"A",{href:!0,rel:!0});var qa=i(oe);Y=r(qa,"MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),qa.forEach(t),Ue=r(Es," by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),Es.forEach(t),ve=m(o),R=a(o,"P",{});var Qa=i(R);xe=r(Qa,"The abstract from the paper is the following:"),Qa.forEach(t),Te=m(o),G=a(o,"P",{});var Ha=i(G);de=a(Ha,"EM",{});var Ka=i(de);Ze=r(Ka,"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."),Ka.forEach(t),Ha.forEach(t),se=m(o),j=a(o,"P",{});var en=i(j);Z=r(en,"Tips:"),en.forEach(t),we=m(o),x=a(o,"UL",{});var qe=i(x);me=a(qe,"LI",{});var tn=i(me);ae=a(tn,"P",{});var In=i(ae);q=r(In,"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 "),ne=a(In,"A",{href:!0,rel:!0});var wc=i(ne);Je=r(wc,"this tutorial"),wc.forEach(t),J=r(In," for a lightweight introduction."),In.forEach(t),tn.forEach(t),We=m(qe),O=a(qe,"LI",{});var yc=i(O);re=a(yc,"P",{});var jn=i(re);Se=r(jn,"One can use "),B=a(jn,"A",{href:!0});var Mc=i(B);Ne=r(Mc,"MobileViTImageProcessor"),Mc.forEach(t),ze=r(jn," 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)."),jn.forEach(t),yc.forEach(t),A=m(qe),pe=a(qe,"LI",{});var $c=i(pe);P=a($c,"P",{});var Un=i(P);Pe=r(Un,"The available image classification checkpoints are pre-trained on "),L=a(Un,"A",{href:!0,rel:!0});var Vc=i(L);W=r(Vc,"ImageNet-1k"),Vc.forEach(t),Re=r(Un," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),Un.forEach(t),$c.forEach(t),N=m(qe),he=a(qe,"LI",{});var Ec=i(he);Q=a(Ec,"P",{});var Hs=i(Q);_=r(Hs,"The segmentation model uses a "),C=a(Hs,"A",{href:!0,rel:!0});var Fc=i(C);Qe=r(Fc,"DeepLabV3"),Fc.forEach(t),le=r(Hs," head. The available semantic segmentation checkpoints are pre-trained on "),ye=a(Hs,"A",{href:!0,rel:!0});var Cc=i(ye);He=r(Cc,"PASCAL VOC"),Cc.forEach(t),k=r(Hs,"."),Hs.forEach(t),Ec.forEach(t),Ke=m(qe),Me=a(qe,"LI",{});var xn=i(Me);$e=a(xn,"P",{});var Zn=i($e);et=r(Zn,"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 "),Ve=a(Zn,"A",{href:!0,rel:!0});var kc=i(Ve);D=r(kc,"TensorFlow Lite"),kc.forEach(t),H=r(Zn,"."),Zn.forEach(t),tt=m(xn),Be=a(xn,"P",{});var Ic=i(Be);K=r(Ic,`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),Ic.forEach(t),xn.forEach(t),qe.forEach(t),De=m(o),M(Ee.$$.fragment,o),Fe=m(o),fe=a(o,"P",{});var Jn=i(fe);ce=r(Jn,"The resulting model will be just "),Ae=a(Jn,"STRONG",{});var jc=i(Ae);lr=r(jc,"about an MB"),jc.forEach(t),cr=r(Jn,` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Jn.forEach(t),on=m(o),ot=a(o,"P",{});var ho=i(ot);dr=r(ho,"This model was contributed by "),Vo=a(ho,"A",{href:!0,rel:!0});var Uc=i(Vo);mr=r(Uc,"matthijs"),Uc.forEach(t),pr=r(ho,". The TensorFlow version of the model was contributed by "),Eo=a(ho,"A",{href:!0,rel:!0});var xc=i(Eo);hr=r(xc,"sayakpaul"),xc.forEach(t),fr=r(ho,". The original code and weights can be found "),Fo=a(ho,"A",{href:!0,rel:!0});var Zc=i(Fo);ur=r(Zc,"here"),Zc.forEach(t),gr=r(ho,"."),ho.forEach(t),sn=m(o),gt=a(o,"H2",{class:!0});var Wn=i(gt);Jt=a(Wn,"A",{id:!0,class:!0,href:!0});var Jc=i(Jt);ca=a(Jc,"SPAN",{});var Wc=i(ca);M(Co.$$.fragment,Wc),Wc.forEach(t),Jc.forEach(t),br=m(Wn),da=a(Wn,"SPAN",{});var Sc=i(da);_r=r(Sc,"Resources"),Sc.forEach(t),Wn.forEach(t),an=m(o),Is=a(o,"P",{});var Nc=i(Is);vr=r(Nc,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileViT."),Nc.forEach(t),nn=m(o),M(ko.$$.fragment,o),rn=m(o),Wt=a(o,"UL",{});var Sn=i(Wt);ft=a(Sn,"LI",{});var Fs=i(ft);js=a(Fs,"A",{href:!0});var zc=i(js);Tr=r(zc,"MobileViTForImageClassification"),zc.forEach(t),wr=r(Fs," is supported by this "),Io=a(Fs,"A",{href:!0,rel:!0});var Pc=i(Io);yr=r(Pc,"example script"),Pc.forEach(t),Mr=r(Fs," and "),jo=a(Fs,"A",{href:!0,rel:!0});var Rc=i(jo);$r=r(Rc,"notebook"),Rc.forEach(t),Vr=r(Fs,"."),Fs.forEach(t),Er=m(Sn),Us=a(Sn,"LI",{});var Tc=i(Us);Fr=r(Tc,"See also: "),xs=a(Tc,"A",{href:!0});var Gc=i(xs);Cr=r(Gc,"Image classification task guide"),Gc.forEach(t),Tc.forEach(t),Sn.forEach(t),ln=m(o),Zs=a(o,"P",{});var Bc=i(Zs);ma=a(Bc,"STRONG",{});var Ac=i(ma);kr=r(Ac,"Semantic segmentation"),Ac.forEach(t),Bc.forEach(t),cn=m(o),Js=a(o,"UL",{});var Dc=i(Js);pa=a(Dc,"LI",{});var Xc=i(pa);Ws=a(Xc,"A",{href:!0});var Oc=i(Ws);Ir=r(Oc,"Semantic segmentation task guide"),Oc.forEach(t),Xc.forEach(t),Dc.forEach(t),dn=m(o),Ss=a(o,"P",{});var Lc=i(Ss);jr=r(Lc,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Lc.forEach(t),mn=m(o),bt=a(o,"H2",{class:!0});var Nn=i(bt);St=a(Nn,"A",{id:!0,class:!0,href:!0});var Yc=i(St);ha=a(Yc,"SPAN",{});var qc=i(ha);M(Uo.$$.fragment,qc),qc.forEach(t),Yc.forEach(t),Ur=m(Nn),fa=a(Nn,"SPAN",{});var Qc=i(fa);xr=r(Qc,"MobileViTConfig"),Qc.forEach(t),Nn.forEach(t),pn=m(o),Xe=a(o,"DIV",{class:!0});var fo=i(Xe);M(xo.$$.fragment,fo),Zr=m(fo),_t=a(fo,"P",{});var Ks=i(_t);Jr=r(Ks,"This is the configuration class to store the configuration of a "),Ns=a(Ks,"A",{href:!0});var Hc=i(Ns);Wr=r(Hc,"MobileViTModel"),Hc.forEach(t),Sr=r(Ks,`. 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
`),Zo=a(Ks,"A",{href:!0,rel:!0});var Kc=i(Zo);Nr=r(Kc,"apple/mobilevit-small"),Kc.forEach(t),zr=r(Ks," architecture."),Ks.forEach(t),Pr=m(fo),vt=a(fo,"P",{});var ea=i(vt);Rr=r(ea,"Configuration objects inherit from "),zs=a(ea,"A",{href:!0});var ed=i(zs);Gr=r(ed,"PretrainedConfig"),ed.forEach(t),Br=r(ea,` and can be used to control the model outputs. Read the
documentation from `),Ps=a(ea,"A",{href:!0});var td=i(Ps);Ar=r(td,"PretrainedConfig"),td.forEach(t),Dr=r(ea," for more information."),ea.forEach(t),Xr=m(fo),M(Nt.$$.fragment,fo),fo.forEach(t),hn=m(o),Tt=a(o,"H2",{class:!0});var zn=i(Tt);zt=a(zn,"A",{id:!0,class:!0,href:!0});var od=i(zt);ua=a(od,"SPAN",{});var sd=i(ua);M(Jo.$$.fragment,sd),sd.forEach(t),od.forEach(t),Or=m(zn),ga=a(zn,"SPAN",{});var ad=i(ga);Lr=r(ad,"MobileViTFeatureExtractor"),ad.forEach(t),zn.forEach(t),fn=m(o),pt=a(o,"DIV",{class:!0});var ta=i(pt);M(Wo.$$.fragment,ta),Yr=m(ta),Pt=a(ta,"DIV",{class:!0});var Pn=i(Pt);M(So.$$.fragment,Pn),qr=m(Pn),ba=a(Pn,"P",{});var nd=i(ba);Qr=r(nd,"Preprocess an image or a batch of images."),nd.forEach(t),Pn.forEach(t),Hr=m(ta),Rt=a(ta,"DIV",{class:!0});var Rn=i(Rt);M(No.$$.fragment,Rn),Kr=m(Rn),zo=a(Rn,"P",{});var Gn=i(zo);ei=r(Gn,"Converts the output of "),Rs=a(Gn,"A",{href:!0});var rd=i(Rs);ti=r(rd,"MobileViTForSemanticSegmentation"),rd.forEach(t),oi=r(Gn,` into semantic segmentation maps. Only supports
PyTorch.`),Gn.forEach(t),Rn.forEach(t),ta.forEach(t),un=m(o),wt=a(o,"H2",{class:!0});var Bn=i(wt);Gt=a(Bn,"A",{id:!0,class:!0,href:!0});var id=i(Gt);_a=a(id,"SPAN",{});var ld=i(_a);M(Po.$$.fragment,ld),ld.forEach(t),id.forEach(t),si=m(Bn),va=a(Bn,"SPAN",{});var cd=i(va);ai=r(cd,"MobileViTImageProcessor"),cd.forEach(t),Bn.forEach(t),gn=m(o),Oe=a(o,"DIV",{class:!0});var uo=i(Oe);M(Ro.$$.fragment,uo),ni=m(uo),Ta=a(uo,"P",{});var dd=i(Ta);ri=r(dd,"Constructs a MobileViT image processor."),dd.forEach(t),ii=m(uo),Bt=a(uo,"DIV",{class:!0});var An=i(Bt);M(Go.$$.fragment,An),li=m(An),wa=a(An,"P",{});var md=i(wa);ci=r(md,"Preprocess an image or batch of images."),md.forEach(t),An.forEach(t),di=m(uo),At=a(uo,"DIV",{class:!0});var Dn=i(At);M(Bo.$$.fragment,Dn),mi=m(Dn),Ao=a(Dn,"P",{});var Xn=i(Ao);pi=r(Xn,"Converts the output of "),Gs=a(Xn,"A",{href:!0});var pd=i(Gs);hi=r(pd,"MobileViTForSemanticSegmentation"),pd.forEach(t),fi=r(Xn,` into semantic segmentation maps. Only supports
PyTorch.`),Xn.forEach(t),Dn.forEach(t),uo.forEach(t),bn=m(o),yt=a(o,"H2",{class:!0});var On=i(yt);Dt=a(On,"A",{id:!0,class:!0,href:!0});var hd=i(Dt);ya=a(hd,"SPAN",{});var fd=i(ya);M(Do.$$.fragment,fd),fd.forEach(t),hd.forEach(t),ui=m(On),Ma=a(On,"SPAN",{});var ud=i(Ma);gi=r(ud,"MobileViTModel"),ud.forEach(t),On.forEach(t),_n=m(o),ht=a(o,"DIV",{class:!0});var oa=i(ht);M(Xo.$$.fragment,oa),bi=m(oa),Oo=a(oa,"P",{});var Ln=i(Oo);_i=r(Ln,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Lo=a(Ln,"A",{href:!0,rel:!0});var gd=i(Lo);vi=r(gd,"torch.nn.Module"),gd.forEach(t),Ti=r(Ln,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ln.forEach(t),wi=m(oa),st=a(oa,"DIV",{class:!0});var go=i(st);M(Yo.$$.fragment,go),yi=m(go),Mt=a(go,"P",{});var sa=i(Mt);Mi=r(sa,"The "),Bs=a(sa,"A",{href:!0});var bd=i(Bs);$i=r(bd,"MobileViTModel"),bd.forEach(t),Vi=r(sa," forward method, overrides the "),$a=a(sa,"CODE",{});var _d=i($a);Ei=r(_d,"__call__"),_d.forEach(t),Fi=r(sa," special method."),sa.forEach(t),Ci=m(go),M(Xt.$$.fragment,go),ki=m(go),M(Ot.$$.fragment,go),go.forEach(t),oa.forEach(t),vn=m(o),$t=a(o,"H2",{class:!0});var Yn=i($t);Lt=a(Yn,"A",{id:!0,class:!0,href:!0});var vd=i(Lt);Va=a(vd,"SPAN",{});var Td=i(Va);M(qo.$$.fragment,Td),Td.forEach(t),vd.forEach(t),Ii=m(Yn),Ea=a(Yn,"SPAN",{});var wd=i(Ea);ji=r(wd,"MobileViTForImageClassification"),wd.forEach(t),Yn.forEach(t),Tn=m(o),Le=a(o,"DIV",{class:!0});var bo=i(Le);M(Qo.$$.fragment,bo),Ui=m(bo),Fa=a(bo,"P",{});var yd=i(Fa);xi=r(yd,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),yd.forEach(t),Zi=m(bo),Ho=a(bo,"P",{});var qn=i(Ho);Ji=r(qn,"This model is a PyTorch "),Ko=a(qn,"A",{href:!0,rel:!0});var Md=i(Ko);Wi=r(Md,"torch.nn.Module"),Md.forEach(t),Si=r(qn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qn.forEach(t),Ni=m(bo),at=a(bo,"DIV",{class:!0});var _o=i(at);M(es.$$.fragment,_o),zi=m(_o),Vt=a(_o,"P",{});var aa=i(Vt);Pi=r(aa,"The "),As=a(aa,"A",{href:!0});var $d=i(As);Ri=r($d,"MobileViTForImageClassification"),$d.forEach(t),Gi=r(aa," forward method, overrides the "),Ca=a(aa,"CODE",{});var Vd=i(Ca);Bi=r(Vd,"__call__"),Vd.forEach(t),Ai=r(aa," special method."),aa.forEach(t),Di=m(_o),M(Yt.$$.fragment,_o),Xi=m(_o),M(qt.$$.fragment,_o),_o.forEach(t),bo.forEach(t),wn=m(o),Et=a(o,"H2",{class:!0});var Qn=i(Et);Qt=a(Qn,"A",{id:!0,class:!0,href:!0});var Ed=i(Qt);ka=a(Ed,"SPAN",{});var Fd=i(ka);M(ts.$$.fragment,Fd),Fd.forEach(t),Ed.forEach(t),Oi=m(Qn),Ia=a(Qn,"SPAN",{});var Cd=i(Ia);Li=r(Cd,"MobileViTForSemanticSegmentation"),Cd.forEach(t),Qn.forEach(t),yn=m(o),Ye=a(o,"DIV",{class:!0});var vo=i(Ye);M(os.$$.fragment,vo),Yi=m(vo),ja=a(vo,"P",{});var kd=i(ja);qi=r(kd,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),kd.forEach(t),Qi=m(vo),ss=a(vo,"P",{});var Hn=i(ss);Hi=r(Hn,"This model is a PyTorch "),as=a(Hn,"A",{href:!0,rel:!0});var Id=i(as);Ki=r(Id,"torch.nn.Module"),Id.forEach(t),el=r(Hn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Hn.forEach(t),tl=m(vo),nt=a(vo,"DIV",{class:!0});var To=i(nt);M(ns.$$.fragment,To),ol=m(To),Ft=a(To,"P",{});var na=i(Ft);sl=r(na,"The "),Ds=a(na,"A",{href:!0});var jd=i(Ds);al=r(jd,"MobileViTForSemanticSegmentation"),jd.forEach(t),nl=r(na," forward method, overrides the "),Ua=a(na,"CODE",{});var Ud=i(Ua);rl=r(Ud,"__call__"),Ud.forEach(t),il=r(na," special method."),na.forEach(t),ll=m(To),M(Ht.$$.fragment,To),cl=m(To),M(Kt.$$.fragment,To),To.forEach(t),vo.forEach(t),Mn=m(o),Ct=a(o,"H2",{class:!0});var Kn=i(Ct);eo=a(Kn,"A",{id:!0,class:!0,href:!0});var xd=i(eo);xa=a(xd,"SPAN",{});var Zd=i(xa);M(rs.$$.fragment,Zd),Zd.forEach(t),xd.forEach(t),dl=m(Kn),Za=a(Kn,"SPAN",{});var Jd=i(Za);ml=r(Jd,"TFMobileViTModel"),Jd.forEach(t),Kn.forEach(t),$n=m(o),Ge=a(o,"DIV",{class:!0});var ut=i(Ge);M(is.$$.fragment,ut),pl=m(ut),ls=a(ut,"P",{});var er=i(ls);hl=r(er,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Xs=a(er,"A",{href:!0});var Wd=i(Xs);fl=r(Wd,"TFPreTrainedModel"),Wd.forEach(t),ul=r(er,`. 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.)`),er.forEach(t),gl=m(ut),cs=a(ut,"P",{});var tr=i(cs);bl=r(tr,"This model is also a "),ds=a(tr,"A",{href:!0,rel:!0});var Sd=i(ds);_l=r(Sd,"tf.keras.Model"),Sd.forEach(t),vl=r(tr,` 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.`),tr.forEach(t),Tl=m(ut),M(to.$$.fragment,ut),wl=m(ut),rt=a(ut,"DIV",{class:!0});var wo=i(rt);M(ms.$$.fragment,wo),yl=m(wo),kt=a(wo,"P",{});var ra=i(kt);Ml=r(ra,"The "),Os=a(ra,"A",{href:!0});var Nd=i(Os);$l=r(Nd,"TFMobileViTModel"),Nd.forEach(t),Vl=r(ra," forward method, overrides the "),Ja=a(ra,"CODE",{});var zd=i(Ja);El=r(zd,"__call__"),zd.forEach(t),Fl=r(ra," special method."),ra.forEach(t),Cl=m(wo),M(oo.$$.fragment,wo),kl=m(wo),M(so.$$.fragment,wo),wo.forEach(t),ut.forEach(t),Vn=m(o),It=a(o,"H2",{class:!0});var or=i(It);ao=a(or,"A",{id:!0,class:!0,href:!0});var Pd=i(ao);Wa=a(Pd,"SPAN",{});var Rd=i(Wa);M(ps.$$.fragment,Rd),Rd.forEach(t),Pd.forEach(t),Il=m(or),Sa=a(or,"SPAN",{});var Gd=i(Sa);jl=r(Gd,"TFMobileViTForImageClassification"),Gd.forEach(t),or.forEach(t),En=m(o),ue=a(o,"DIV",{class:!0});var ct=i(ue);M(hs.$$.fragment,ct),Ul=m(ct),Na=a(ct,"P",{});var Bd=i(Na);xl=r(Bd,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Bd.forEach(t),Zl=m(ct),fs=a(ct,"P",{});var sr=i(fs);Jl=r(sr,"This model inherits from "),Ls=a(sr,"A",{href:!0});var Ad=i(Ls);Wl=r(Ad,"TFPreTrainedModel"),Ad.forEach(t),Sl=r(sr,`. 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.)`),sr.forEach(t),Nl=m(ct),us=a(ct,"P",{});var ar=i(us);zl=r(ar,"This model is also a "),gs=a(ar,"A",{href:!0,rel:!0});var Dd=i(gs);Pl=r(Dd,"tf.keras.Model"),Dd.forEach(t),Rl=r(ar,` 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.`),ar.forEach(t),Gl=m(ct),M(no.$$.fragment,ct),Bl=m(ct),it=a(ct,"DIV",{class:!0});var yo=i(it);M(bs.$$.fragment,yo),Al=m(yo),jt=a(yo,"P",{});var ia=i(jt);Dl=r(ia,"The "),Ys=a(ia,"A",{href:!0});var Xd=i(Ys);Xl=r(Xd,"TFMobileViTForImageClassification"),Xd.forEach(t),Ol=r(ia," forward method, overrides the "),za=a(ia,"CODE",{});var Od=i(za);Ll=r(Od,"__call__"),Od.forEach(t),Yl=r(ia," special method."),ia.forEach(t),ql=m(yo),M(ro.$$.fragment,yo),Ql=m(yo),M(io.$$.fragment,yo),yo.forEach(t),ct.forEach(t),Fn=m(o),Ut=a(o,"H2",{class:!0});var nr=i(Ut);lo=a(nr,"A",{id:!0,class:!0,href:!0});var Ld=i(lo);Pa=a(Ld,"SPAN",{});var Yd=i(Pa);M(_s.$$.fragment,Yd),Yd.forEach(t),Ld.forEach(t),Hl=m(nr),Ra=a(nr,"SPAN",{});var qd=i(Ra);Kl=r(qd,"TFMobileViTForSemanticSegmentation"),qd.forEach(t),nr.forEach(t),Cn=m(o),ge=a(o,"DIV",{class:!0});var dt=i(ge);M(vs.$$.fragment,dt),ec=m(dt),Ga=a(dt,"P",{});var Qd=i(Ga);tc=r(Qd,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Qd.forEach(t),oc=m(dt),Ts=a(dt,"P",{});var rr=i(Ts);sc=r(rr,"This model inherits from "),qs=a(rr,"A",{href:!0});var Hd=i(qs);ac=r(Hd,"TFPreTrainedModel"),Hd.forEach(t),nc=r(rr,`. 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.)`),rr.forEach(t),rc=m(dt),ws=a(dt,"P",{});var ir=i(ws);ic=r(ir,"This model is also a "),ys=a(ir,"A",{href:!0,rel:!0});var Kd=i(ys);lc=r(Kd,"tf.keras.Model"),Kd.forEach(t),cc=r(ir,` 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.`),ir.forEach(t),dc=m(dt),M(co.$$.fragment,dt),mc=m(dt),lt=a(dt,"DIV",{class:!0});var Mo=i(lt);M(Ms.$$.fragment,Mo),pc=m(Mo),xt=a(Mo,"P",{});var la=i(xt);hc=r(la,"The "),Qs=a(la,"A",{href:!0});var em=i(Qs);fc=r(em,"TFMobileViTForSemanticSegmentation"),em.forEach(t),uc=r(la," forward method, overrides the "),Ba=a(la,"CODE",{});var tm=i(Ba);gc=r(tm,"__call__"),tm.forEach(t),bc=r(la," special method."),la.forEach(t),_c=m(Mo),M(mo.$$.fragment,Mo),vc=m(Mo),M(po.$$.fragment,Mo),Mo.forEach(t),dt.forEach(t),this.h()},h(){p(c,"name","hf:doc:metadata"),p(c,"content",JSON.stringify(Vm)),p(g,"id","mobilevit"),p(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(g,"href","#mobilevit"),p(b,"class","relative group"),p(ee,"id","overview"),p(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ee,"href","#overview"),p(S,"class","relative group"),p(oe,"href","https://arxiv.org/abs/2110.02178"),p(oe,"rel","nofollow"),p(ne,"href","https://keras.io/examples/vision/mobilevit"),p(ne,"rel","nofollow"),p(B,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTImageProcessor"),p(L,"href","https://huggingface.co/datasets/imagenet-1k"),p(L,"rel","nofollow"),p(C,"href","https://arxiv.org/abs/1706.05587"),p(C,"rel","nofollow"),p(ye,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),p(ye,"rel","nofollow"),p(Ve,"href","https://www.tensorflow.org/lite"),p(Ve,"rel","nofollow"),p(Vo,"href","https://huggingface.co/Matthijs"),p(Vo,"rel","nofollow"),p(Eo,"href","https://huggingface.co/sayakpaul"),p(Eo,"rel","nofollow"),p(Fo,"href","https://github.com/apple/ml-cvnets"),p(Fo,"rel","nofollow"),p(Jt,"id","resources"),p(Jt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Jt,"href","#resources"),p(gt,"class","relative group"),p(js,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTForImageClassification"),p(Io,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),p(Io,"rel","nofollow"),p(jo,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),p(jo,"rel","nofollow"),p(xs,"href","../tasks/image_classification"),p(Ws,"href","../tasks/semantic_segmentation"),p(St,"id","transformers.MobileViTConfig"),p(St,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(St,"href","#transformers.MobileViTConfig"),p(bt,"class","relative group"),p(Ns,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTModel"),p(Zo,"href","https://huggingface.co/apple/mobilevit-small"),p(Zo,"rel","nofollow"),p(zs,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Ps,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(zt,"id","transformers.MobileViTFeatureExtractor"),p(zt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(zt,"href","#transformers.MobileViTFeatureExtractor"),p(Tt,"class","relative group"),p(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Rs,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),p(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Gt,"id","transformers.MobileViTImageProcessor"),p(Gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Gt,"href","#transformers.MobileViTImageProcessor"),p(wt,"class","relative group"),p(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Gs,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),p(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Dt,"id","transformers.MobileViTModel"),p(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Dt,"href","#transformers.MobileViTModel"),p(yt,"class","relative group"),p(Lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Lo,"rel","nofollow"),p(Bs,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTModel"),p(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Lt,"id","transformers.MobileViTForImageClassification"),p(Lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Lt,"href","#transformers.MobileViTForImageClassification"),p($t,"class","relative group"),p(Ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Ko,"rel","nofollow"),p(As,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTForImageClassification"),p(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Qt,"id","transformers.MobileViTForSemanticSegmentation"),p(Qt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Qt,"href","#transformers.MobileViTForSemanticSegmentation"),p(Et,"class","relative group"),p(as,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(as,"rel","nofollow"),p(Ds,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),p(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(eo,"id","transformers.TFMobileViTModel"),p(eo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(eo,"href","#transformers.TFMobileViTModel"),p(Ct,"class","relative group"),p(Xs,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),p(ds,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(ds,"rel","nofollow"),p(Os,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.TFMobileViTModel"),p(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ao,"id","transformers.TFMobileViTForImageClassification"),p(ao,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ao,"href","#transformers.TFMobileViTForImageClassification"),p(It,"class","relative group"),p(Ls,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),p(gs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(gs,"rel","nofollow"),p(Ys,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.TFMobileViTForImageClassification"),p(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(lo,"id","transformers.TFMobileViTForSemanticSegmentation"),p(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(lo,"href","#transformers.TFMobileViTForSemanticSegmentation"),p(Ut,"class","relative group"),p(qs,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),p(ys,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(ys,"rel","nofollow"),p(Qs,"href","/docs/transformers/v4.32.0/en/model_doc/mobilevit#transformers.TFMobileViTForSemanticSegmentation"),p(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,u){e(document.head,c),f(o,T,u),f(o,b,u),e(b,g),e(g,v),$(l,v,null),e(b,h),e(b,I),e(I,Ce),f(o,be,u),f(o,S,u),e(S,ee),e(ee,te),$(w,te,null),e(S,ke),e(S,X),e(X,Ie),f(o,_e,u),f(o,z,u),e(z,je),e(z,oe),e(oe,Y),e(z,Ue),f(o,ve,u),f(o,R,u),e(R,xe),f(o,Te,u),f(o,G,u),e(G,de),e(de,Ze),f(o,se,u),f(o,j,u),e(j,Z),f(o,we,u),f(o,x,u),e(x,me),e(me,ae),e(ae,q),e(ae,ne),e(ne,Je),e(ae,J),e(x,We),e(x,O),e(O,re),e(re,Se),e(re,B),e(B,Ne),e(re,ze),e(x,A),e(x,pe),e(pe,P),e(P,Pe),e(P,L),e(L,W),e(P,Re),e(x,N),e(x,he),e(he,Q),e(Q,_),e(Q,C),e(C,Qe),e(Q,le),e(Q,ye),e(ye,He),e(Q,k),e(x,Ke),e(x,Me),e(Me,$e),e($e,et),e($e,Ve),e(Ve,D),e($e,H),e(Me,tt),e(Me,Be),e(Be,K),f(o,De,u),$(Ee,o,u),f(o,Fe,u),f(o,fe,u),e(fe,ce),e(fe,Ae),e(Ae,lr),e(fe,cr),f(o,on,u),f(o,ot,u),e(ot,dr),e(ot,Vo),e(Vo,mr),e(ot,pr),e(ot,Eo),e(Eo,hr),e(ot,fr),e(ot,Fo),e(Fo,ur),e(ot,gr),f(o,sn,u),f(o,gt,u),e(gt,Jt),e(Jt,ca),$(Co,ca,null),e(gt,br),e(gt,da),e(da,_r),f(o,an,u),f(o,Is,u),e(Is,vr),f(o,nn,u),$(ko,o,u),f(o,rn,u),f(o,Wt,u),e(Wt,ft),e(ft,js),e(js,Tr),e(ft,wr),e(ft,Io),e(Io,yr),e(ft,Mr),e(ft,jo),e(jo,$r),e(ft,Vr),e(Wt,Er),e(Wt,Us),e(Us,Fr),e(Us,xs),e(xs,Cr),f(o,ln,u),f(o,Zs,u),e(Zs,ma),e(ma,kr),f(o,cn,u),f(o,Js,u),e(Js,pa),e(pa,Ws),e(Ws,Ir),f(o,dn,u),f(o,Ss,u),e(Ss,jr),f(o,mn,u),f(o,bt,u),e(bt,St),e(St,ha),$(Uo,ha,null),e(bt,Ur),e(bt,fa),e(fa,xr),f(o,pn,u),f(o,Xe,u),$(xo,Xe,null),e(Xe,Zr),e(Xe,_t),e(_t,Jr),e(_t,Ns),e(Ns,Wr),e(_t,Sr),e(_t,Zo),e(Zo,Nr),e(_t,zr),e(Xe,Pr),e(Xe,vt),e(vt,Rr),e(vt,zs),e(zs,Gr),e(vt,Br),e(vt,Ps),e(Ps,Ar),e(vt,Dr),e(Xe,Xr),$(Nt,Xe,null),f(o,hn,u),f(o,Tt,u),e(Tt,zt),e(zt,ua),$(Jo,ua,null),e(Tt,Or),e(Tt,ga),e(ga,Lr),f(o,fn,u),f(o,pt,u),$(Wo,pt,null),e(pt,Yr),e(pt,Pt),$(So,Pt,null),e(Pt,qr),e(Pt,ba),e(ba,Qr),e(pt,Hr),e(pt,Rt),$(No,Rt,null),e(Rt,Kr),e(Rt,zo),e(zo,ei),e(zo,Rs),e(Rs,ti),e(zo,oi),f(o,un,u),f(o,wt,u),e(wt,Gt),e(Gt,_a),$(Po,_a,null),e(wt,si),e(wt,va),e(va,ai),f(o,gn,u),f(o,Oe,u),$(Ro,Oe,null),e(Oe,ni),e(Oe,Ta),e(Ta,ri),e(Oe,ii),e(Oe,Bt),$(Go,Bt,null),e(Bt,li),e(Bt,wa),e(wa,ci),e(Oe,di),e(Oe,At),$(Bo,At,null),e(At,mi),e(At,Ao),e(Ao,pi),e(Ao,Gs),e(Gs,hi),e(Ao,fi),f(o,bn,u),f(o,yt,u),e(yt,Dt),e(Dt,ya),$(Do,ya,null),e(yt,ui),e(yt,Ma),e(Ma,gi),f(o,_n,u),f(o,ht,u),$(Xo,ht,null),e(ht,bi),e(ht,Oo),e(Oo,_i),e(Oo,Lo),e(Lo,vi),e(Oo,Ti),e(ht,wi),e(ht,st),$(Yo,st,null),e(st,yi),e(st,Mt),e(Mt,Mi),e(Mt,Bs),e(Bs,$i),e(Mt,Vi),e(Mt,$a),e($a,Ei),e(Mt,Fi),e(st,Ci),$(Xt,st,null),e(st,ki),$(Ot,st,null),f(o,vn,u),f(o,$t,u),e($t,Lt),e(Lt,Va),$(qo,Va,null),e($t,Ii),e($t,Ea),e(Ea,ji),f(o,Tn,u),f(o,Le,u),$(Qo,Le,null),e(Le,Ui),e(Le,Fa),e(Fa,xi),e(Le,Zi),e(Le,Ho),e(Ho,Ji),e(Ho,Ko),e(Ko,Wi),e(Ho,Si),e(Le,Ni),e(Le,at),$(es,at,null),e(at,zi),e(at,Vt),e(Vt,Pi),e(Vt,As),e(As,Ri),e(Vt,Gi),e(Vt,Ca),e(Ca,Bi),e(Vt,Ai),e(at,Di),$(Yt,at,null),e(at,Xi),$(qt,at,null),f(o,wn,u),f(o,Et,u),e(Et,Qt),e(Qt,ka),$(ts,ka,null),e(Et,Oi),e(Et,Ia),e(Ia,Li),f(o,yn,u),f(o,Ye,u),$(os,Ye,null),e(Ye,Yi),e(Ye,ja),e(ja,qi),e(Ye,Qi),e(Ye,ss),e(ss,Hi),e(ss,as),e(as,Ki),e(ss,el),e(Ye,tl),e(Ye,nt),$(ns,nt,null),e(nt,ol),e(nt,Ft),e(Ft,sl),e(Ft,Ds),e(Ds,al),e(Ft,nl),e(Ft,Ua),e(Ua,rl),e(Ft,il),e(nt,ll),$(Ht,nt,null),e(nt,cl),$(Kt,nt,null),f(o,Mn,u),f(o,Ct,u),e(Ct,eo),e(eo,xa),$(rs,xa,null),e(Ct,dl),e(Ct,Za),e(Za,ml),f(o,$n,u),f(o,Ge,u),$(is,Ge,null),e(Ge,pl),e(Ge,ls),e(ls,hl),e(ls,Xs),e(Xs,fl),e(ls,ul),e(Ge,gl),e(Ge,cs),e(cs,bl),e(cs,ds),e(ds,_l),e(cs,vl),e(Ge,Tl),$(to,Ge,null),e(Ge,wl),e(Ge,rt),$(ms,rt,null),e(rt,yl),e(rt,kt),e(kt,Ml),e(kt,Os),e(Os,$l),e(kt,Vl),e(kt,Ja),e(Ja,El),e(kt,Fl),e(rt,Cl),$(oo,rt,null),e(rt,kl),$(so,rt,null),f(o,Vn,u),f(o,It,u),e(It,ao),e(ao,Wa),$(ps,Wa,null),e(It,Il),e(It,Sa),e(Sa,jl),f(o,En,u),f(o,ue,u),$(hs,ue,null),e(ue,Ul),e(ue,Na),e(Na,xl),e(ue,Zl),e(ue,fs),e(fs,Jl),e(fs,Ls),e(Ls,Wl),e(fs,Sl),e(ue,Nl),e(ue,us),e(us,zl),e(us,gs),e(gs,Pl),e(us,Rl),e(ue,Gl),$(no,ue,null),e(ue,Bl),e(ue,it),$(bs,it,null),e(it,Al),e(it,jt),e(jt,Dl),e(jt,Ys),e(Ys,Xl),e(jt,Ol),e(jt,za),e(za,Ll),e(jt,Yl),e(it,ql),$(ro,it,null),e(it,Ql),$(io,it,null),f(o,Fn,u),f(o,Ut,u),e(Ut,lo),e(lo,Pa),$(_s,Pa,null),e(Ut,Hl),e(Ut,Ra),e(Ra,Kl),f(o,Cn,u),f(o,ge,u),$(vs,ge,null),e(ge,ec),e(ge,Ga),e(Ga,tc),e(ge,oc),e(ge,Ts),e(Ts,sc),e(Ts,qs),e(qs,ac),e(Ts,nc),e(ge,rc),e(ge,ws),e(ws,ic),e(ws,ys),e(ys,lc),e(ws,cc),e(ge,dc),$(co,ge,null),e(ge,mc),e(ge,lt),$(Ms,lt,null),e(lt,pc),e(lt,xt),e(xt,hc),e(xt,Qs),e(Qs,fc),e(xt,uc),e(xt,Ba),e(Ba,gc),e(xt,bc),e(lt,_c),$(mo,lt,null),e(lt,vc),$(po,lt,null),kn=!0},p(o,[u]){const $s={};u&2&&($s.$$scope={dirty:u,ctx:o}),Nt.$set($s);const Aa={};u&2&&(Aa.$$scope={dirty:u,ctx:o}),Xt.$set(Aa);const Da={};u&2&&(Da.$$scope={dirty:u,ctx:o}),Ot.$set(Da);const Xa={};u&2&&(Xa.$$scope={dirty:u,ctx:o}),Yt.$set(Xa);const Vs={};u&2&&(Vs.$$scope={dirty:u,ctx:o}),qt.$set(Vs);const Oa={};u&2&&(Oa.$$scope={dirty:u,ctx:o}),Ht.$set(Oa);const La={};u&2&&(La.$$scope={dirty:u,ctx:o}),Kt.$set(La);const Ya={};u&2&&(Ya.$$scope={dirty:u,ctx:o}),to.$set(Ya);const Es={};u&2&&(Es.$$scope={dirty:u,ctx:o}),oo.$set(Es);const qa={};u&2&&(qa.$$scope={dirty:u,ctx:o}),so.$set(qa);const Qa={};u&2&&(Qa.$$scope={dirty:u,ctx:o}),no.$set(Qa);const Ha={};u&2&&(Ha.$$scope={dirty:u,ctx:o}),ro.$set(Ha);const Ka={};u&2&&(Ka.$$scope={dirty:u,ctx:o}),io.$set(Ka);const en={};u&2&&(en.$$scope={dirty:u,ctx:o}),co.$set(en);const qe={};u&2&&(qe.$$scope={dirty:u,ctx:o}),mo.$set(qe);const tn={};u&2&&(tn.$$scope={dirty:u,ctx:o}),po.$set(tn)},i(o){kn||(V(l.$$.fragment,o),V(w.$$.fragment,o),V(Ee.$$.fragment,o),V(Co.$$.fragment,o),V(ko.$$.fragment,o),V(Uo.$$.fragment,o),V(xo.$$.fragment,o),V(Nt.$$.fragment,o),V(Jo.$$.fragment,o),V(Wo.$$.fragment,o),V(So.$$.fragment,o),V(No.$$.fragment,o),V(Po.$$.fragment,o),V(Ro.$$.fragment,o),V(Go.$$.fragment,o),V(Bo.$$.fragment,o),V(Do.$$.fragment,o),V(Xo.$$.fragment,o),V(Yo.$$.fragment,o),V(Xt.$$.fragment,o),V(Ot.$$.fragment,o),V(qo.$$.fragment,o),V(Qo.$$.fragment,o),V(es.$$.fragment,o),V(Yt.$$.fragment,o),V(qt.$$.fragment,o),V(ts.$$.fragment,o),V(os.$$.fragment,o),V(ns.$$.fragment,o),V(Ht.$$.fragment,o),V(Kt.$$.fragment,o),V(rs.$$.fragment,o),V(is.$$.fragment,o),V(to.$$.fragment,o),V(ms.$$.fragment,o),V(oo.$$.fragment,o),V(so.$$.fragment,o),V(ps.$$.fragment,o),V(hs.$$.fragment,o),V(no.$$.fragment,o),V(bs.$$.fragment,o),V(ro.$$.fragment,o),V(io.$$.fragment,o),V(_s.$$.fragment,o),V(vs.$$.fragment,o),V(co.$$.fragment,o),V(Ms.$$.fragment,o),V(mo.$$.fragment,o),V(po.$$.fragment,o),kn=!0)},o(o){E(l.$$.fragment,o),E(w.$$.fragment,o),E(Ee.$$.fragment,o),E(Co.$$.fragment,o),E(ko.$$.fragment,o),E(Uo.$$.fragment,o),E(xo.$$.fragment,o),E(Nt.$$.fragment,o),E(Jo.$$.fragment,o),E(Wo.$$.fragment,o),E(So.$$.fragment,o),E(No.$$.fragment,o),E(Po.$$.fragment,o),E(Ro.$$.fragment,o),E(Go.$$.fragment,o),E(Bo.$$.fragment,o),E(Do.$$.fragment,o),E(Xo.$$.fragment,o),E(Yo.$$.fragment,o),E(Xt.$$.fragment,o),E(Ot.$$.fragment,o),E(qo.$$.fragment,o),E(Qo.$$.fragment,o),E(es.$$.fragment,o),E(Yt.$$.fragment,o),E(qt.$$.fragment,o),E(ts.$$.fragment,o),E(os.$$.fragment,o),E(ns.$$.fragment,o),E(Ht.$$.fragment,o),E(Kt.$$.fragment,o),E(rs.$$.fragment,o),E(is.$$.fragment,o),E(to.$$.fragment,o),E(ms.$$.fragment,o),E(oo.$$.fragment,o),E(so.$$.fragment,o),E(ps.$$.fragment,o),E(hs.$$.fragment,o),E(no.$$.fragment,o),E(bs.$$.fragment,o),E(ro.$$.fragment,o),E(io.$$.fragment,o),E(_s.$$.fragment,o),E(vs.$$.fragment,o),E(co.$$.fragment,o),E(Ms.$$.fragment,o),E(mo.$$.fragment,o),E(po.$$.fragment,o),kn=!1},d(o){t(c),o&&t(T),o&&t(b),F(l),o&&t(be),o&&t(S),F(w),o&&t(_e),o&&t(z),o&&t(ve),o&&t(R),o&&t(Te),o&&t(G),o&&t(se),o&&t(j),o&&t(we),o&&t(x),o&&t(De),F(Ee,o),o&&t(Fe),o&&t(fe),o&&t(on),o&&t(ot),o&&t(sn),o&&t(gt),F(Co),o&&t(an),o&&t(Is),o&&t(nn),F(ko,o),o&&t(rn),o&&t(Wt),o&&t(ln),o&&t(Zs),o&&t(cn),o&&t(Js),o&&t(dn),o&&t(Ss),o&&t(mn),o&&t(bt),F(Uo),o&&t(pn),o&&t(Xe),F(xo),F(Nt),o&&t(hn),o&&t(Tt),F(Jo),o&&t(fn),o&&t(pt),F(Wo),F(So),F(No),o&&t(un),o&&t(wt),F(Po),o&&t(gn),o&&t(Oe),F(Ro),F(Go),F(Bo),o&&t(bn),o&&t(yt),F(Do),o&&t(_n),o&&t(ht),F(Xo),F(Yo),F(Xt),F(Ot),o&&t(vn),o&&t($t),F(qo),o&&t(Tn),o&&t(Le),F(Qo),F(es),F(Yt),F(qt),o&&t(wn),o&&t(Et),F(ts),o&&t(yn),o&&t(Ye),F(os),F(ns),F(Ht),F(Kt),o&&t(Mn),o&&t(Ct),F(rs),o&&t($n),o&&t(Ge),F(is),F(to),F(ms),F(oo),F(so),o&&t(Vn),o&&t(It),F(ps),o&&t(En),o&&t(ue),F(hs),F(no),F(bs),F(ro),F(io),o&&t(Fn),o&&t(Ut),F(_s),o&&t(Cn),o&&t(ge),F(vs),F(co),F(Ms),F(mo),F(po)}}}const Vm={local:"mobilevit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.MobileViTConfig",title:"MobileViTConfig"},{local:"transformers.MobileViTFeatureExtractor",title:"MobileViTFeatureExtractor"},{local:"transformers.MobileViTImageProcessor",title:"MobileViTImageProcessor"},{local:"transformers.MobileViTModel",title:"MobileViTModel"},{local:"transformers.MobileViTForImageClassification",title:"MobileViTForImageClassification"},{local:"transformers.MobileViTForSemanticSegmentation",title:"MobileViTForSemanticSegmentation"},{local:"transformers.TFMobileViTModel",title:"TFMobileViTModel"},{local:"transformers.TFMobileViTForImageClassification",title:"TFMobileViTForImageClassification"},{local:"transformers.TFMobileViTForSemanticSegmentation",title:"TFMobileViTForSemanticSegmentation"}],title:"MobileViT"};function Em(U){return rm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zm extends om{constructor(c){super();sm(this,c,Em,$m,am,{})}}export{Zm as default,Vm as metadata};
