import{S as Ac,i as zc,s as Oc,e as r,k as c,w as $,t as s,M as Nc,c as n,d as t,m,a as i,x as y,h as a,b as p,G as e,g as f,y as M,q as V,o as E,B as F,v as Dc,L as ks}from"../../chunks/vendor-hf-doc-builder.js";import{T as St}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as yo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as mt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Fs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as qc}from"../../chunks/PipelineTag-hf-doc-builder.js";function Lc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import MobileViTConfig, MobileViTModel

# Initializing a mobilevit-small style configuration
configuration = MobileViTConfig()

# Initializing a model from the mobilevit-small style configuration
model = MobileViTModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){d=r("p"),T=s("Example:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Example:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function Rc(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function Wc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, MobileViTModel
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("apple/mobilevit-small")
model = MobileViTModel.from_pretrained("apple/mobilevit-small")

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

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

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){d=r("p"),T=s("Example:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Example:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function Uc(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function Hc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, MobileViTForImageClassification
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("apple/mobilevit-small")
model = MobileViTForImageClassification.from_pretrained("apple/mobilevit-small")

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

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

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,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(){d=r("p"),T=s("Example:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Example:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function Bc(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function Kc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, MobileViTForSemanticSegmentation
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-small")
model = MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-small")

inputs = image_processor(images=image, return_tensors="pt")

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

# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<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><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 = 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(){d=r("p"),T=s("Examples:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Examples:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function Gc(C){let d,T,_,g,v,l,h,I,ke,_e,O,ee,te,w,Pe,B,Ie,be,D,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,Ae,A,ze,K,ne,Oe,W,Ne,De,U,pe,q,qe,G,z,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),_=r("code"),g=s("transformers"),v=s(" accept two formats as input:"),l=c(),h=r("ul"),I=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),O=r("li"),ee=s("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),w=r("p"),Pe=s(`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 `),B=r("code"),Ie=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r("code"),xe=s("model.fit()"),oe=s(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r("code"),Ce=s("fit()"),ve=s(" and "),L=r("code"),je=s("predict()"),Te=s(`, such as when creating your own layers or models with
the Keras `),R=r("code"),ce=s("Functional"),Se=s(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=c(),x=r("ul"),S=r("li"),we=s("a single Tensor with "),j=r("code"),me=s("pixel_values"),ae=s(" only and nothing else: "),J=r("code"),re=s("model(pixel_values)"),Ae=c(),A=r("li"),ze=s(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=r("code"),ne=s("model([pixel_values, attention_mask])"),Oe=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),De=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=r("code"),qe=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),z=r("p"),Le=s(`Note that when creating models and layers with
`),N=r("a"),he=s("subclassing"),X=s(` 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(b){d=n(b,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),_=n(k,"CODE",{});var Xe=i(_);g=a(Xe,"transformers"),Xe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(b),h=n(b,"UL",{});var le=i(h);I=n(le,"LI",{});var $e=i(I);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),O=n(le,"LI",{});var Qe=i(O);ee=a(Qe,"having all inputs as a list, tuple or dict in the first positional argument."),Qe.forEach(t),le.forEach(t),te=m(b),w=n(b,"P",{});var P=i(w);Pe=a(P,`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 `),B=n(P,"CODE",{});var Ze=i(B);Ie=a(Ze,"model.fit()"),Ze.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(P,"CODE",{});var ye=i(D);xe=a(ye,"model.fit()"),ye.forEach(t),oe=a(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=n(P,"CODE",{});var Me=i(Y);Ce=a(Me,"fit()"),Me.forEach(t),ve=a(P," and "),L=n(P,"CODE",{});var et=i(L);je=a(et,"predict()"),et.forEach(t),Te=a(P,`, such as when creating your own layers or models with
the Keras `),R=n(P,"CODE",{});var Ve=i(R);ce=a(Ve,"Functional"),Ve.forEach(t),Se=a(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),se=m(b),x=n(b,"UL",{});var H=i(x);S=n(H,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var tt=i(j);me=a(tt,"pixel_values"),tt.forEach(t),ae=a(Q," only and nothing else: "),J=n(Q,"CODE",{});var We=i(J);re=a(We,"model(pixel_values)"),We.forEach(t),Q.forEach(t),Ae=m(H),A=n(H,"LI",{});var Z=i(A);ze=a(Z,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=n(Z,"CODE",{});var He=i(K);ne=a(He,"model([pixel_values, attention_mask])"),He.forEach(t),Oe=a(Z," or "),W=n(Z,"CODE",{});var Ee=i(W);Ne=a(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),Z.forEach(t),De=m(H),U=n(H,"LI",{});var Fe=i(U);pe=a(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Fe,"CODE",{});var fe=i(q);qe=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),H.forEach(t),G=m(b),z=n(b,"P",{});var de=i(z);Le=a(de,`Note that when creating models and layers with
`),N=n(de,"A",{href:!0,rel:!0});var Ue=i(N);he=a(Ue,"subclassing"),Ue.forEach(t),X=a(de,` 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!`),de.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(b,k){f(b,d,k),e(d,T),e(d,_),e(_,g),e(d,v),f(b,l,k),f(b,h,k),e(h,I),e(I,ke),e(h,_e),e(h,O),e(O,ee),f(b,te,k),f(b,w,k),e(w,Pe),e(w,B),e(B,Ie),e(w,be),e(w,D),e(D,xe),e(w,oe),e(w,Y),e(Y,Ce),e(w,ve),e(w,L),e(L,je),e(w,Te),e(w,R),e(R,ce),e(w,Se),f(b,se,k),f(b,x,k),e(x,S),e(S,we),e(S,j),e(j,me),e(S,ae),e(S,J),e(J,re),e(x,Ae),e(x,A),e(A,ze),e(A,K),e(K,ne),e(A,Oe),e(A,W),e(W,Ne),e(x,De),e(x,U),e(U,pe),e(U,q),e(q,qe),f(b,G,k),f(b,z,k),e(z,Le),e(z,N),e(N,he),e(z,X)},d(b){b&&t(d),b&&t(l),b&&t(h),b&&t(te),b&&t(w),b&&t(se),b&&t(x),b&&t(G),b&&t(z)}}}function Yc(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function Jc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, TFMobileViTModel
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("apple/mobilevit-small")
model = TFMobileViTModel.from_pretrained("apple/mobilevit-small")

inputs = image_processor(image, return_tensors="tf")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){d=r("p"),T=s("Example:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Example:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function Xc(C){let d,T,_,g,v,l,h,I,ke,_e,O,ee,te,w,Pe,B,Ie,be,D,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,Ae,A,ze,K,ne,Oe,W,Ne,De,U,pe,q,qe,G,z,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),_=r("code"),g=s("transformers"),v=s(" accept two formats as input:"),l=c(),h=r("ul"),I=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),O=r("li"),ee=s("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),w=r("p"),Pe=s(`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 `),B=r("code"),Ie=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r("code"),xe=s("model.fit()"),oe=s(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r("code"),Ce=s("fit()"),ve=s(" and "),L=r("code"),je=s("predict()"),Te=s(`, such as when creating your own layers or models with
the Keras `),R=r("code"),ce=s("Functional"),Se=s(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=c(),x=r("ul"),S=r("li"),we=s("a single Tensor with "),j=r("code"),me=s("pixel_values"),ae=s(" only and nothing else: "),J=r("code"),re=s("model(pixel_values)"),Ae=c(),A=r("li"),ze=s(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=r("code"),ne=s("model([pixel_values, attention_mask])"),Oe=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),De=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=r("code"),qe=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),z=r("p"),Le=s(`Note that when creating models and layers with
`),N=r("a"),he=s("subclassing"),X=s(` 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(b){d=n(b,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),_=n(k,"CODE",{});var Xe=i(_);g=a(Xe,"transformers"),Xe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(b),h=n(b,"UL",{});var le=i(h);I=n(le,"LI",{});var $e=i(I);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),O=n(le,"LI",{});var Qe=i(O);ee=a(Qe,"having all inputs as a list, tuple or dict in the first positional argument."),Qe.forEach(t),le.forEach(t),te=m(b),w=n(b,"P",{});var P=i(w);Pe=a(P,`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 `),B=n(P,"CODE",{});var Ze=i(B);Ie=a(Ze,"model.fit()"),Ze.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(P,"CODE",{});var ye=i(D);xe=a(ye,"model.fit()"),ye.forEach(t),oe=a(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=n(P,"CODE",{});var Me=i(Y);Ce=a(Me,"fit()"),Me.forEach(t),ve=a(P," and "),L=n(P,"CODE",{});var et=i(L);je=a(et,"predict()"),et.forEach(t),Te=a(P,`, such as when creating your own layers or models with
the Keras `),R=n(P,"CODE",{});var Ve=i(R);ce=a(Ve,"Functional"),Ve.forEach(t),Se=a(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),se=m(b),x=n(b,"UL",{});var H=i(x);S=n(H,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var tt=i(j);me=a(tt,"pixel_values"),tt.forEach(t),ae=a(Q," only and nothing else: "),J=n(Q,"CODE",{});var We=i(J);re=a(We,"model(pixel_values)"),We.forEach(t),Q.forEach(t),Ae=m(H),A=n(H,"LI",{});var Z=i(A);ze=a(Z,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=n(Z,"CODE",{});var He=i(K);ne=a(He,"model([pixel_values, attention_mask])"),He.forEach(t),Oe=a(Z," or "),W=n(Z,"CODE",{});var Ee=i(W);Ne=a(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),Z.forEach(t),De=m(H),U=n(H,"LI",{});var Fe=i(U);pe=a(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Fe,"CODE",{});var fe=i(q);qe=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),H.forEach(t),G=m(b),z=n(b,"P",{});var de=i(z);Le=a(de,`Note that when creating models and layers with
`),N=n(de,"A",{href:!0,rel:!0});var Ue=i(N);he=a(Ue,"subclassing"),Ue.forEach(t),X=a(de,` 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!`),de.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(b,k){f(b,d,k),e(d,T),e(d,_),e(_,g),e(d,v),f(b,l,k),f(b,h,k),e(h,I),e(I,ke),e(h,_e),e(h,O),e(O,ee),f(b,te,k),f(b,w,k),e(w,Pe),e(w,B),e(B,Ie),e(w,be),e(w,D),e(D,xe),e(w,oe),e(w,Y),e(Y,Ce),e(w,ve),e(w,L),e(L,je),e(w,Te),e(w,R),e(R,ce),e(w,Se),f(b,se,k),f(b,x,k),e(x,S),e(S,we),e(S,j),e(j,me),e(S,ae),e(S,J),e(J,re),e(x,Ae),e(x,A),e(A,ze),e(A,K),e(K,ne),e(A,Oe),e(A,W),e(W,Ne),e(x,De),e(x,U),e(U,pe),e(U,q),e(q,qe),f(b,G,k),f(b,z,k),e(z,Le),e(z,N),e(N,he),e(z,X)},d(b){b&&t(d),b&&t(l),b&&t(h),b&&t(te),b&&t(w),b&&t(se),b&&t(x),b&&t(G),b&&t(z)}}}function Qc(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function Zc(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, TFMobileViTForImageClassification
import tensorflow as tf
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("apple/mobilevit-small")
model = TFMobileViTForImageClassification.from_pretrained("apple/mobilevit-small")

inputs = image_processor(image, return_tensors="tf")
logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,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(){d=r("p"),T=s("Example:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Example:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function em(C){let d,T,_,g,v,l,h,I,ke,_e,O,ee,te,w,Pe,B,Ie,be,D,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,Ae,A,ze,K,ne,Oe,W,Ne,De,U,pe,q,qe,G,z,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),_=r("code"),g=s("transformers"),v=s(" accept two formats as input:"),l=c(),h=r("ul"),I=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),O=r("li"),ee=s("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),w=r("p"),Pe=s(`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 `),B=r("code"),Ie=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r("code"),xe=s("model.fit()"),oe=s(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r("code"),Ce=s("fit()"),ve=s(" and "),L=r("code"),je=s("predict()"),Te=s(`, such as when creating your own layers or models with
the Keras `),R=r("code"),ce=s("Functional"),Se=s(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=c(),x=r("ul"),S=r("li"),we=s("a single Tensor with "),j=r("code"),me=s("pixel_values"),ae=s(" only and nothing else: "),J=r("code"),re=s("model(pixel_values)"),Ae=c(),A=r("li"),ze=s(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=r("code"),ne=s("model([pixel_values, attention_mask])"),Oe=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),De=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=r("code"),qe=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),z=r("p"),Le=s(`Note that when creating models and layers with
`),N=r("a"),he=s("subclassing"),X=s(` 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(b){d=n(b,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),_=n(k,"CODE",{});var Xe=i(_);g=a(Xe,"transformers"),Xe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(b),h=n(b,"UL",{});var le=i(h);I=n(le,"LI",{});var $e=i(I);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),O=n(le,"LI",{});var Qe=i(O);ee=a(Qe,"having all inputs as a list, tuple or dict in the first positional argument."),Qe.forEach(t),le.forEach(t),te=m(b),w=n(b,"P",{});var P=i(w);Pe=a(P,`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 `),B=n(P,"CODE",{});var Ze=i(B);Ie=a(Ze,"model.fit()"),Ze.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(P,"CODE",{});var ye=i(D);xe=a(ye,"model.fit()"),ye.forEach(t),oe=a(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=n(P,"CODE",{});var Me=i(Y);Ce=a(Me,"fit()"),Me.forEach(t),ve=a(P," and "),L=n(P,"CODE",{});var et=i(L);je=a(et,"predict()"),et.forEach(t),Te=a(P,`, such as when creating your own layers or models with
the Keras `),R=n(P,"CODE",{});var Ve=i(R);ce=a(Ve,"Functional"),Ve.forEach(t),Se=a(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),se=m(b),x=n(b,"UL",{});var H=i(x);S=n(H,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var tt=i(j);me=a(tt,"pixel_values"),tt.forEach(t),ae=a(Q," only and nothing else: "),J=n(Q,"CODE",{});var We=i(J);re=a(We,"model(pixel_values)"),We.forEach(t),Q.forEach(t),Ae=m(H),A=n(H,"LI",{});var Z=i(A);ze=a(Z,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),K=n(Z,"CODE",{});var He=i(K);ne=a(He,"model([pixel_values, attention_mask])"),He.forEach(t),Oe=a(Z," or "),W=n(Z,"CODE",{});var Ee=i(W);Ne=a(Ee,"model([pixel_values, attention_mask, token_type_ids])"),Ee.forEach(t),Z.forEach(t),De=m(H),U=n(H,"LI",{});var Fe=i(U);pe=a(Fe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Fe,"CODE",{});var fe=i(q);qe=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Fe.forEach(t),H.forEach(t),G=m(b),z=n(b,"P",{});var de=i(z);Le=a(de,`Note that when creating models and layers with
`),N=n(de,"A",{href:!0,rel:!0});var Ue=i(N);he=a(Ue,"subclassing"),Ue.forEach(t),X=a(de,` 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!`),de.forEach(t),this.h()},h(){p(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(N,"rel","nofollow")},m(b,k){f(b,d,k),e(d,T),e(d,_),e(_,g),e(d,v),f(b,l,k),f(b,h,k),e(h,I),e(I,ke),e(h,_e),e(h,O),e(O,ee),f(b,te,k),f(b,w,k),e(w,Pe),e(w,B),e(B,Ie),e(w,be),e(w,D),e(D,xe),e(w,oe),e(w,Y),e(Y,Ce),e(w,ve),e(w,L),e(L,je),e(w,Te),e(w,R),e(R,ce),e(w,Se),f(b,se,k),f(b,x,k),e(x,S),e(S,we),e(S,j),e(j,me),e(S,ae),e(S,J),e(J,re),e(x,Ae),e(x,A),e(A,ze),e(A,K),e(K,ne),e(A,Oe),e(A,W),e(W,Ne),e(x,De),e(x,U),e(U,pe),e(U,q),e(q,qe),f(b,G,k),f(b,z,k),e(z,Le),e(z,N),e(N,he),e(z,X)},d(b){b&&t(d),b&&t(l),b&&t(h),b&&t(te),b&&t(w),b&&t(se),b&&t(x),b&&t(G),b&&t(z)}}}function tm(C){let d,T,_,g,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=s("Module"),v=s(`
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){d=n(l,"P",{});var h=i(d);T=a(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(h,"CODE",{});var I=i(_);g=a(I,"Module"),I.forEach(t),v=a(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,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function om(C){let d,T,_,g,v;return g=new yo({props:{code:`from transformers import AutoImageProcessor, TFMobileViTForSemanticSegmentation
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-small")
model = TFMobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-small")

inputs = image_processor(images=image, return_tensors="tf")

outputs = model(**inputs)

# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,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(){d=r("p"),T=s("Examples:"),_=c(),$(g.$$.fragment)},l(l){d=n(l,"P",{});var h=i(d);T=a(h,"Examples:"),h.forEach(t),_=m(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(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(d),l&&t(_),F(g,l)}}}function sm(C){let d,T,_,g,v,l,h,I,ke,_e,O,ee,te,w,Pe,B,Ie,be,D,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,Ae,A,ze,K,ne,Oe,W,Ne,De,U,pe,q,qe,G,z,Le,N,he,X,b,k,Xe,le,$e,Qe,P,Ze,ye,Me,et,Ve,H,Q,tt,We,Z,He,Ee,Fe,fe,de,Ue,Xr,Qr,Ya,ot,Zr,Mo,en,tn,Vo,on,sn,Eo,an,rn,Ja,gt,At,aa,Fo,nn,ra,ln,Xa,Ps,dn,Qa,ko,Za,Is,ft,xs,cn,mn,Po,pn,hn,Io,fn,un,er,Cs,gn,tr,_t,zt,na,xo,_n,ia,bn,or,Be,Co,vn,bt,Tn,js,wn,$n,jo,yn,Mn,Vn,vt,En,Ss,Fn,kn,As,Pn,In,xn,Ot,sr,Tt,Nt,la,So,Cn,da,jn,ar,pt,Ao,Sn,Dt,zo,An,ca,zn,On,qt,Oo,Nn,No,Dn,zs,qn,Ln,rr,wt,Lt,ma,Do,Rn,pa,Wn,nr,Ke,qo,Un,ha,Hn,Bn,Rt,Lo,Kn,fa,Gn,Yn,Wt,Ro,Jn,Wo,Xn,Os,Qn,Zn,ir,$t,Ut,ua,Uo,ei,ga,ti,lr,ht,Ho,oi,Bo,si,Ko,ai,ri,ni,st,Go,ii,yt,li,Ns,di,ci,_a,mi,pi,hi,Ht,fi,Bt,dr,Mt,Kt,ba,Yo,ui,va,gi,cr,Ge,Jo,_i,Ta,bi,vi,Xo,Ti,Qo,wi,$i,yi,at,Zo,Mi,Vt,Vi,Ds,Ei,Fi,wa,ki,Pi,Ii,Gt,xi,Yt,mr,Et,Jt,$a,es,Ci,ya,ji,pr,Ye,ts,Si,Ma,Ai,zi,os,Oi,ss,Ni,Di,qi,rt,as,Li,Ft,Ri,qs,Wi,Ui,Va,Hi,Bi,Ki,Xt,Gi,Qt,hr,kt,Zt,Ea,rs,Yi,Fa,Ji,fr,Re,ns,Xi,is,Qi,Ls,Zi,el,tl,ls,ol,ds,sl,al,rl,eo,nl,nt,cs,il,Pt,ll,Rs,dl,cl,ka,ml,pl,hl,to,fl,oo,ur,It,so,Pa,ms,ul,Ia,gl,gr,ue,ps,_l,xa,bl,vl,hs,Tl,Ws,wl,$l,yl,fs,Ml,us,Vl,El,Fl,ao,kl,it,gs,Pl,xt,Il,Us,xl,Cl,Ca,jl,Sl,Al,ro,zl,no,_r,Ct,io,ja,_s,Ol,Sa,Nl,br,ge,bs,Dl,Aa,ql,Ll,vs,Rl,Hs,Wl,Ul,Hl,Ts,Bl,ws,Kl,Gl,Yl,lo,Jl,lt,$s,Xl,jt,Ql,Bs,Zl,ed,za,td,od,sd,co,ad,mo,vr;return l=new mt({}),w=new mt({}),Ee=new yo({props:{code:`from transformers import TFMobileViTForImageClassification
import tensorflow as tf


model_ckpt = "apple/mobilevit-xx-small"
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("/")[-1] + ".tflite"
with open(tflite_filename, "wb") as f:
    f.write(tflite_model)`,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)`}}),Fo=new mt({}),ko=new qc({props:{pipeline:"image-classification"}}),xo=new mt({}),Co=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/main/src/transformers/models/mobilevit/configuration_mobilevit.py#L46"}}),Ot=new Fs({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[Lc]},$$scope:{ctx:C}}}),So=new mt({}),Ao=new ie({props:{name:"class transformers.MobileViTFeatureExtractor",anchor:"transformers.MobileViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L26"}}),zo=new ie({props:{name:"__call__",anchor:"transformers.MobileViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L448"}}),Oo=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/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileViTFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
A list of length <code>batch_size</code>, where each item is a <code>Tuple[int, int]</code> corresponding to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L325",returnDescription:`
<p>A list 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><code>List[torch.Tensor]</code></p>
`}}),Do=new mt({}),qo=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/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L76"}}),Lo=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[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L223"}}),Ro=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/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation">MobileViTForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
A list of length <code>batch_size</code>, where each item is a <code>Tuple[int, int]</code> corresponding to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/image_processing_mobilevit.py#L325",returnDescription:`
<p>A list 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><code>List[torch.Tensor]</code></p>
`}}),Uo=new mt({}),Ho=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L708"}}),Go=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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \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>
`}}),Ht=new St({props:{$$slots:{default:[Rc]},$$scope:{ctx:C}}}),Bt=new Fs({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[Wc]},$$scope:{ctx:C}}}),Yo=new mt({}),Jo=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L802"}}),Zo=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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L818",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \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/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gt=new St({props:{$$slots:{default:[Uc]},$$scope:{ctx:C}}}),Yt=new Fs({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[Hc]},$$scope:{ctx:C}}}),es=new mt({}),ts=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L997"}}),as=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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_mobilevit.py#L1008",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \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/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xt=new St({props:{$$slots:{default:[Bc]},$$scope:{ctx:C}}}),Qt=new Fs({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[Kc]},$$scope:{ctx:C}}}),rs=new mt({}),ns=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L830"}}),eo=new St({props:{$$slots:{default:[Gc]},$$scope:{ctx:C}}}),cs=new ie({props:{name:"call",anchor:"transformers.TFMobileViTModel.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L838",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),to=new St({props:{$$slots:{default:[Yc]},$$scope:{ctx:C}}}),oo=new Fs({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[Jc]},$$scope:{ctx:C}}}),ms=new mt({}),ps=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L874"}}),ao=new St({props:{$$slots:{default:[Xc]},$$scope:{ctx:C}}}),gs=new ie({props:{name:"call",anchor:"transformers.TFMobileViTForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L887",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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \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 St({props:{$$slots:{default:[Qc]},$$scope:{ctx:C}}}),no=new Fs({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[Zc]},$$scope:{ctx:C}}}),_s=new mt({}),bs=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/main/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1054"}}),lo=new St({props:{$$slots:{default:[em]},$$scope:{ctx:C}}}),$s=new ie({props:{name:"call",anchor:"transformers.TFMobileViTForSemanticSegmentation.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code>, <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1082",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/main/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \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>
`}}),co=new St({props:{$$slots:{default:[tm]},$$scope:{ctx:C}}}),mo=new Fs({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[om]},$$scope:{ctx:C}}}),{c(){d=r("meta"),T=c(),_=r("h1"),g=r("a"),v=r("span"),$(l.$$.fragment),h=c(),I=r("span"),ke=s("MobileViT"),_e=c(),O=r("h2"),ee=r("a"),te=r("span"),$(w.$$.fragment),Pe=c(),B=r("span"),Ie=s("Overview"),be=c(),D=r("p"),xe=s("The MobileViT model was proposed in "),oe=r("a"),Y=s("MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),Ce=s(" by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),ve=c(),L=r("p"),je=s("The abstract from the paper is the following:"),Te=c(),R=r("p"),ce=r("em"),Se=s("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=c(),x=r("p"),S=s("Tips:"),we=c(),j=r("ul"),me=r("li"),ae=r("p"),J=s("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 "),re=r("a"),Ae=s("this tutorial"),A=s(" for a lightweight introduction."),ze=c(),K=r("li"),ne=r("p"),Oe=s("One can use "),W=r("a"),Ne=s("MobileViTImageProcessor"),De=s(" 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)."),U=c(),pe=r("li"),q=r("p"),qe=s("The available image classification checkpoints are pre-trained on "),G=r("a"),z=s("ImageNet-1k"),Le=s(" (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),N=c(),he=r("li"),X=r("p"),b=s("The segmentation model uses a "),k=r("a"),Xe=s("DeepLabV3"),le=s(" head. The available semantic segmentation checkpoints are pre-trained on "),$e=r("a"),Qe=s("PASCAL VOC"),P=s("."),Ze=c(),ye=r("li"),Me=r("p"),et=s("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=r("a"),H=s("TensorFlow Lite"),Q=s("."),tt=c(),We=r("p"),Z=s(`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),He=c(),$(Ee.$$.fragment),Fe=c(),fe=r("p"),de=s("The resulting model will be just "),Ue=r("strong"),Xr=s("about an MB"),Qr=s(` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Ya=c(),ot=r("p"),Zr=s("This model was contributed by "),Mo=r("a"),en=s("matthijs"),tn=s(". The TensorFlow version of the model was contributed by "),Vo=r("a"),on=s("sayakpaul"),sn=s(". The original code and weights can be found "),Eo=r("a"),an=s("here"),rn=s("."),Ja=c(),gt=r("h2"),At=r("a"),aa=r("span"),$(Fo.$$.fragment),nn=c(),ra=r("span"),ln=s("Resources"),Xa=c(),Ps=r("p"),dn=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileViT."),Qa=c(),$(ko.$$.fragment),Za=c(),Is=r("ul"),ft=r("li"),xs=r("a"),cn=s("MobileViTForImageClassification"),mn=s(" is supported by this "),Po=r("a"),pn=s("example script"),hn=s(" and "),Io=r("a"),fn=s("notebook"),un=s("."),er=c(),Cs=r("p"),gn=s("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."),tr=c(),_t=r("h2"),zt=r("a"),na=r("span"),$(xo.$$.fragment),_n=c(),ia=r("span"),bn=s("MobileViTConfig"),or=c(),Be=r("div"),$(Co.$$.fragment),vn=c(),bt=r("p"),Tn=s("This is the configuration class to store the configuration of a "),js=r("a"),wn=s("MobileViTModel"),$n=s(`. 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
`),jo=r("a"),yn=s("apple/mobilevit-small"),Mn=s(" architecture."),Vn=c(),vt=r("p"),En=s("Configuration objects inherit from "),Ss=r("a"),Fn=s("PretrainedConfig"),kn=s(` and can be used to control the model outputs. Read the
documentation from `),As=r("a"),Pn=s("PretrainedConfig"),In=s(" for more information."),xn=c(),$(Ot.$$.fragment),sr=c(),Tt=r("h2"),Nt=r("a"),la=r("span"),$(So.$$.fragment),Cn=c(),da=r("span"),jn=s("MobileViTFeatureExtractor"),ar=c(),pt=r("div"),$(Ao.$$.fragment),Sn=c(),Dt=r("div"),$(zo.$$.fragment),An=c(),ca=r("p"),zn=s("Preprocess an image or a batch of images."),On=c(),qt=r("div"),$(Oo.$$.fragment),Nn=c(),No=r("p"),Dn=s("Converts the output of "),zs=r("a"),qn=s("MobileViTForSemanticSegmentation"),Ln=s(` into semantic segmentation maps. Only supports
PyTorch.`),rr=c(),wt=r("h2"),Lt=r("a"),ma=r("span"),$(Do.$$.fragment),Rn=c(),pa=r("span"),Wn=s("MobileViTImageProcessor"),nr=c(),Ke=r("div"),$(qo.$$.fragment),Un=c(),ha=r("p"),Hn=s("Constructs a MobileViT image processor."),Bn=c(),Rt=r("div"),$(Lo.$$.fragment),Kn=c(),fa=r("p"),Gn=s("Preprocess an image or batch of images."),Yn=c(),Wt=r("div"),$(Ro.$$.fragment),Jn=c(),Wo=r("p"),Xn=s("Converts the output of "),Os=r("a"),Qn=s("MobileViTForSemanticSegmentation"),Zn=s(` into semantic segmentation maps. Only supports
PyTorch.`),ir=c(),$t=r("h2"),Ut=r("a"),ua=r("span"),$(Uo.$$.fragment),ei=c(),ga=r("span"),ti=s("MobileViTModel"),lr=c(),ht=r("div"),$(Ho.$$.fragment),oi=c(),Bo=r("p"),si=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ko=r("a"),ai=s("torch.nn.Module"),ri=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ni=c(),st=r("div"),$(Go.$$.fragment),ii=c(),yt=r("p"),li=s("The "),Ns=r("a"),di=s("MobileViTModel"),ci=s(" forward method, overrides the "),_a=r("code"),mi=s("__call__"),pi=s(" special method."),hi=c(),$(Ht.$$.fragment),fi=c(),$(Bt.$$.fragment),dr=c(),Mt=r("h2"),Kt=r("a"),ba=r("span"),$(Yo.$$.fragment),ui=c(),va=r("span"),gi=s("MobileViTForImageClassification"),cr=c(),Ge=r("div"),$(Jo.$$.fragment),_i=c(),Ta=r("p"),bi=s(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),vi=c(),Xo=r("p"),Ti=s("This model is a PyTorch "),Qo=r("a"),wi=s("torch.nn.Module"),$i=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yi=c(),at=r("div"),$(Zo.$$.fragment),Mi=c(),Vt=r("p"),Vi=s("The "),Ds=r("a"),Ei=s("MobileViTForImageClassification"),Fi=s(" forward method, overrides the "),wa=r("code"),ki=s("__call__"),Pi=s(" special method."),Ii=c(),$(Gt.$$.fragment),xi=c(),$(Yt.$$.fragment),mr=c(),Et=r("h2"),Jt=r("a"),$a=r("span"),$(es.$$.fragment),Ci=c(),ya=r("span"),ji=s("MobileViTForSemanticSegmentation"),pr=c(),Ye=r("div"),$(ts.$$.fragment),Si=c(),Ma=r("p"),Ai=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),zi=c(),os=r("p"),Oi=s("This model is a PyTorch "),ss=r("a"),Ni=s("torch.nn.Module"),Di=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qi=c(),rt=r("div"),$(as.$$.fragment),Li=c(),Ft=r("p"),Ri=s("The "),qs=r("a"),Wi=s("MobileViTForSemanticSegmentation"),Ui=s(" forward method, overrides the "),Va=r("code"),Hi=s("__call__"),Bi=s(" special method."),Ki=c(),$(Xt.$$.fragment),Gi=c(),$(Qt.$$.fragment),hr=c(),kt=r("h2"),Zt=r("a"),Ea=r("span"),$(rs.$$.fragment),Yi=c(),Fa=r("span"),Ji=s("TFMobileViTModel"),fr=c(),Re=r("div"),$(ns.$$.fragment),Xi=c(),is=r("p"),Qi=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ls=r("a"),Zi=s("TFPreTrainedModel"),el=s(`. 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.)`),tl=c(),ls=r("p"),ol=s("This model is also a "),ds=r("a"),sl=s("tf.keras.Model"),al=s(` 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.`),rl=c(),$(eo.$$.fragment),nl=c(),nt=r("div"),$(cs.$$.fragment),il=c(),Pt=r("p"),ll=s("The "),Rs=r("a"),dl=s("TFMobileViTModel"),cl=s(" forward method, overrides the "),ka=r("code"),ml=s("__call__"),pl=s(" special method."),hl=c(),$(to.$$.fragment),fl=c(),$(oo.$$.fragment),ur=c(),It=r("h2"),so=r("a"),Pa=r("span"),$(ms.$$.fragment),ul=c(),Ia=r("span"),gl=s("TFMobileViTForImageClassification"),gr=c(),ue=r("div"),$(ps.$$.fragment),_l=c(),xa=r("p"),bl=s(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),vl=c(),hs=r("p"),Tl=s("This model inherits from "),Ws=r("a"),wl=s("TFPreTrainedModel"),$l=s(`. 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.)`),yl=c(),fs=r("p"),Ml=s("This model is also a "),us=r("a"),Vl=s("tf.keras.Model"),El=s(` 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.`),Fl=c(),$(ao.$$.fragment),kl=c(),it=r("div"),$(gs.$$.fragment),Pl=c(),xt=r("p"),Il=s("The "),Us=r("a"),xl=s("TFMobileViTForImageClassification"),Cl=s(" forward method, overrides the "),Ca=r("code"),jl=s("__call__"),Sl=s(" special method."),Al=c(),$(ro.$$.fragment),zl=c(),$(no.$$.fragment),_r=c(),Ct=r("h2"),io=r("a"),ja=r("span"),$(_s.$$.fragment),Ol=c(),Sa=r("span"),Nl=s("TFMobileViTForSemanticSegmentation"),br=c(),ge=r("div"),$(bs.$$.fragment),Dl=c(),Aa=r("p"),ql=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Ll=c(),vs=r("p"),Rl=s("This model inherits from "),Hs=r("a"),Wl=s("TFPreTrainedModel"),Ul=s(`. 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.)`),Hl=c(),Ts=r("p"),Bl=s("This model is also a "),ws=r("a"),Kl=s("tf.keras.Model"),Gl=s(` 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.`),Yl=c(),$(lo.$$.fragment),Jl=c(),lt=r("div"),$($s.$$.fragment),Xl=c(),jt=r("p"),Ql=s("The "),Bs=r("a"),Zl=s("TFMobileViTForSemanticSegmentation"),ed=s(" forward method, overrides the "),za=r("code"),td=s("__call__"),od=s(" special method."),sd=c(),$(co.$$.fragment),ad=c(),$(mo.$$.fragment),this.h()},l(o){const u=Nc('[data-svelte="svelte-1phssyn"]',document.head);d=n(u,"META",{name:!0,content:!0}),u.forEach(t),T=m(o),_=n(o,"H1",{class:!0});var ys=i(_);g=n(ys,"A",{id:!0,class:!0,href:!0});var Oa=i(g);v=n(Oa,"SPAN",{});var Na=i(v);y(l.$$.fragment,Na),Na.forEach(t),Oa.forEach(t),h=m(ys),I=n(ys,"SPAN",{});var Da=i(I);ke=a(Da,"MobileViT"),Da.forEach(t),ys.forEach(t),_e=m(o),O=n(o,"H2",{class:!0});var Ms=i(O);ee=n(Ms,"A",{id:!0,class:!0,href:!0});var qa=i(ee);te=n(qa,"SPAN",{});var La=i(te);y(w.$$.fragment,La),La.forEach(t),qa.forEach(t),Pe=m(Ms),B=n(Ms,"SPAN",{});var Ra=i(B);Ie=a(Ra,"Overview"),Ra.forEach(t),Ms.forEach(t),be=m(o),D=n(o,"P",{});var Vs=i(D);xe=a(Vs,"The MobileViT model was proposed in "),oe=n(Vs,"A",{href:!0,rel:!0});var Wa=i(oe);Y=a(Wa,"MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),Wa.forEach(t),Ce=a(Vs," by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),Vs.forEach(t),ve=m(o),L=n(o,"P",{});var Ua=i(L);je=a(Ua,"The abstract from the paper is the following:"),Ua.forEach(t),Te=m(o),R=n(o,"P",{});var Ha=i(R);ce=n(Ha,"EM",{});var Ba=i(ce);Se=a(Ba,"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."),Ba.forEach(t),Ha.forEach(t),se=m(o),x=n(o,"P",{});var Ka=i(x);S=a(Ka,"Tips:"),Ka.forEach(t),we=m(o),j=n(o,"UL",{});var Je=i(j);me=n(Je,"LI",{});var Ga=i(me);ae=n(Ga,"P",{});var Tr=i(ae);J=a(Tr,"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 "),re=n(Tr,"A",{href:!0,rel:!0});var rd=i(re);Ae=a(rd,"this tutorial"),rd.forEach(t),A=a(Tr," for a lightweight introduction."),Tr.forEach(t),Ga.forEach(t),ze=m(Je),K=n(Je,"LI",{});var nd=i(K);ne=n(nd,"P",{});var wr=i(ne);Oe=a(wr,"One can use "),W=n(wr,"A",{href:!0});var id=i(W);Ne=a(id,"MobileViTImageProcessor"),id.forEach(t),De=a(wr," 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)."),wr.forEach(t),nd.forEach(t),U=m(Je),pe=n(Je,"LI",{});var ld=i(pe);q=n(ld,"P",{});var $r=i(q);qe=a($r,"The available image classification checkpoints are pre-trained on "),G=n($r,"A",{href:!0,rel:!0});var dd=i(G);z=a(dd,"ImageNet-1k"),dd.forEach(t),Le=a($r," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),$r.forEach(t),ld.forEach(t),N=m(Je),he=n(Je,"LI",{});var cd=i(he);X=n(cd,"P",{});var Ks=i(X);b=a(Ks,"The segmentation model uses a "),k=n(Ks,"A",{href:!0,rel:!0});var md=i(k);Xe=a(md,"DeepLabV3"),md.forEach(t),le=a(Ks," head. The available semantic segmentation checkpoints are pre-trained on "),$e=n(Ks,"A",{href:!0,rel:!0});var pd=i($e);Qe=a(pd,"PASCAL VOC"),pd.forEach(t),P=a(Ks,"."),Ks.forEach(t),cd.forEach(t),Ze=m(Je),ye=n(Je,"LI",{});var yr=i(ye);Me=n(yr,"P",{});var Mr=i(Me);et=a(Mr,"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=n(Mr,"A",{href:!0,rel:!0});var hd=i(Ve);H=a(hd,"TensorFlow Lite"),hd.forEach(t),Q=a(Mr,"."),Mr.forEach(t),tt=m(yr),We=n(yr,"P",{});var fd=i(We);Z=a(fd,`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),fd.forEach(t),yr.forEach(t),Je.forEach(t),He=m(o),y(Ee.$$.fragment,o),Fe=m(o),fe=n(o,"P",{});var Vr=i(fe);de=a(Vr,"The resulting model will be just "),Ue=n(Vr,"STRONG",{});var ud=i(Ue);Xr=a(ud,"about an MB"),ud.forEach(t),Qr=a(Vr,` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Vr.forEach(t),Ya=m(o),ot=n(o,"P",{});var po=i(ot);Zr=a(po,"This model was contributed by "),Mo=n(po,"A",{href:!0,rel:!0});var gd=i(Mo);en=a(gd,"matthijs"),gd.forEach(t),tn=a(po,". The TensorFlow version of the model was contributed by "),Vo=n(po,"A",{href:!0,rel:!0});var _d=i(Vo);on=a(_d,"sayakpaul"),_d.forEach(t),sn=a(po,". The original code and weights can be found "),Eo=n(po,"A",{href:!0,rel:!0});var bd=i(Eo);an=a(bd,"here"),bd.forEach(t),rn=a(po,"."),po.forEach(t),Ja=m(o),gt=n(o,"H2",{class:!0});var Er=i(gt);At=n(Er,"A",{id:!0,class:!0,href:!0});var vd=i(At);aa=n(vd,"SPAN",{});var Td=i(aa);y(Fo.$$.fragment,Td),Td.forEach(t),vd.forEach(t),nn=m(Er),ra=n(Er,"SPAN",{});var wd=i(ra);ln=a(wd,"Resources"),wd.forEach(t),Er.forEach(t),Xa=m(o),Ps=n(o,"P",{});var $d=i(Ps);dn=a($d,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileViT."),$d.forEach(t),Qa=m(o),y(ko.$$.fragment,o),Za=m(o),Is=n(o,"UL",{});var yd=i(Is);ft=n(yd,"LI",{});var Es=i(ft);xs=n(Es,"A",{href:!0});var Md=i(xs);cn=a(Md,"MobileViTForImageClassification"),Md.forEach(t),mn=a(Es," is supported by this "),Po=n(Es,"A",{href:!0,rel:!0});var Vd=i(Po);pn=a(Vd,"example script"),Vd.forEach(t),hn=a(Es," and "),Io=n(Es,"A",{href:!0,rel:!0});var Ed=i(Io);fn=a(Ed,"notebook"),Ed.forEach(t),un=a(Es,"."),Es.forEach(t),yd.forEach(t),er=m(o),Cs=n(o,"P",{});var Fd=i(Cs);gn=a(Fd,"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."),Fd.forEach(t),tr=m(o),_t=n(o,"H2",{class:!0});var Fr=i(_t);zt=n(Fr,"A",{id:!0,class:!0,href:!0});var kd=i(zt);na=n(kd,"SPAN",{});var Pd=i(na);y(xo.$$.fragment,Pd),Pd.forEach(t),kd.forEach(t),_n=m(Fr),ia=n(Fr,"SPAN",{});var Id=i(ia);bn=a(Id,"MobileViTConfig"),Id.forEach(t),Fr.forEach(t),or=m(o),Be=n(o,"DIV",{class:!0});var ho=i(Be);y(Co.$$.fragment,ho),vn=m(ho),bt=n(ho,"P",{});var Gs=i(bt);Tn=a(Gs,"This is the configuration class to store the configuration of a "),js=n(Gs,"A",{href:!0});var xd=i(js);wn=a(xd,"MobileViTModel"),xd.forEach(t),$n=a(Gs,`. 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
`),jo=n(Gs,"A",{href:!0,rel:!0});var Cd=i(jo);yn=a(Cd,"apple/mobilevit-small"),Cd.forEach(t),Mn=a(Gs," architecture."),Gs.forEach(t),Vn=m(ho),vt=n(ho,"P",{});var Ys=i(vt);En=a(Ys,"Configuration objects inherit from "),Ss=n(Ys,"A",{href:!0});var jd=i(Ss);Fn=a(jd,"PretrainedConfig"),jd.forEach(t),kn=a(Ys,` and can be used to control the model outputs. Read the
documentation from `),As=n(Ys,"A",{href:!0});var Sd=i(As);Pn=a(Sd,"PretrainedConfig"),Sd.forEach(t),In=a(Ys," for more information."),Ys.forEach(t),xn=m(ho),y(Ot.$$.fragment,ho),ho.forEach(t),sr=m(o),Tt=n(o,"H2",{class:!0});var kr=i(Tt);Nt=n(kr,"A",{id:!0,class:!0,href:!0});var Ad=i(Nt);la=n(Ad,"SPAN",{});var zd=i(la);y(So.$$.fragment,zd),zd.forEach(t),Ad.forEach(t),Cn=m(kr),da=n(kr,"SPAN",{});var Od=i(da);jn=a(Od,"MobileViTFeatureExtractor"),Od.forEach(t),kr.forEach(t),ar=m(o),pt=n(o,"DIV",{class:!0});var Js=i(pt);y(Ao.$$.fragment,Js),Sn=m(Js),Dt=n(Js,"DIV",{class:!0});var Pr=i(Dt);y(zo.$$.fragment,Pr),An=m(Pr),ca=n(Pr,"P",{});var Nd=i(ca);zn=a(Nd,"Preprocess an image or a batch of images."),Nd.forEach(t),Pr.forEach(t),On=m(Js),qt=n(Js,"DIV",{class:!0});var Ir=i(qt);y(Oo.$$.fragment,Ir),Nn=m(Ir),No=n(Ir,"P",{});var xr=i(No);Dn=a(xr,"Converts the output of "),zs=n(xr,"A",{href:!0});var Dd=i(zs);qn=a(Dd,"MobileViTForSemanticSegmentation"),Dd.forEach(t),Ln=a(xr,` into semantic segmentation maps. Only supports
PyTorch.`),xr.forEach(t),Ir.forEach(t),Js.forEach(t),rr=m(o),wt=n(o,"H2",{class:!0});var Cr=i(wt);Lt=n(Cr,"A",{id:!0,class:!0,href:!0});var qd=i(Lt);ma=n(qd,"SPAN",{});var Ld=i(ma);y(Do.$$.fragment,Ld),Ld.forEach(t),qd.forEach(t),Rn=m(Cr),pa=n(Cr,"SPAN",{});var Rd=i(pa);Wn=a(Rd,"MobileViTImageProcessor"),Rd.forEach(t),Cr.forEach(t),nr=m(o),Ke=n(o,"DIV",{class:!0});var fo=i(Ke);y(qo.$$.fragment,fo),Un=m(fo),ha=n(fo,"P",{});var Wd=i(ha);Hn=a(Wd,"Constructs a MobileViT image processor."),Wd.forEach(t),Bn=m(fo),Rt=n(fo,"DIV",{class:!0});var jr=i(Rt);y(Lo.$$.fragment,jr),Kn=m(jr),fa=n(jr,"P",{});var Ud=i(fa);Gn=a(Ud,"Preprocess an image or batch of images."),Ud.forEach(t),jr.forEach(t),Yn=m(fo),Wt=n(fo,"DIV",{class:!0});var Sr=i(Wt);y(Ro.$$.fragment,Sr),Jn=m(Sr),Wo=n(Sr,"P",{});var Ar=i(Wo);Xn=a(Ar,"Converts the output of "),Os=n(Ar,"A",{href:!0});var Hd=i(Os);Qn=a(Hd,"MobileViTForSemanticSegmentation"),Hd.forEach(t),Zn=a(Ar,` into semantic segmentation maps. Only supports
PyTorch.`),Ar.forEach(t),Sr.forEach(t),fo.forEach(t),ir=m(o),$t=n(o,"H2",{class:!0});var zr=i($t);Ut=n(zr,"A",{id:!0,class:!0,href:!0});var Bd=i(Ut);ua=n(Bd,"SPAN",{});var Kd=i(ua);y(Uo.$$.fragment,Kd),Kd.forEach(t),Bd.forEach(t),ei=m(zr),ga=n(zr,"SPAN",{});var Gd=i(ga);ti=a(Gd,"MobileViTModel"),Gd.forEach(t),zr.forEach(t),lr=m(o),ht=n(o,"DIV",{class:!0});var Xs=i(ht);y(Ho.$$.fragment,Xs),oi=m(Xs),Bo=n(Xs,"P",{});var Or=i(Bo);si=a(Or,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ko=n(Or,"A",{href:!0,rel:!0});var Yd=i(Ko);ai=a(Yd,"torch.nn.Module"),Yd.forEach(t),ri=a(Or,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Or.forEach(t),ni=m(Xs),st=n(Xs,"DIV",{class:!0});var uo=i(st);y(Go.$$.fragment,uo),ii=m(uo),yt=n(uo,"P",{});var Qs=i(yt);li=a(Qs,"The "),Ns=n(Qs,"A",{href:!0});var Jd=i(Ns);di=a(Jd,"MobileViTModel"),Jd.forEach(t),ci=a(Qs," forward method, overrides the "),_a=n(Qs,"CODE",{});var Xd=i(_a);mi=a(Xd,"__call__"),Xd.forEach(t),pi=a(Qs," special method."),Qs.forEach(t),hi=m(uo),y(Ht.$$.fragment,uo),fi=m(uo),y(Bt.$$.fragment,uo),uo.forEach(t),Xs.forEach(t),dr=m(o),Mt=n(o,"H2",{class:!0});var Nr=i(Mt);Kt=n(Nr,"A",{id:!0,class:!0,href:!0});var Qd=i(Kt);ba=n(Qd,"SPAN",{});var Zd=i(ba);y(Yo.$$.fragment,Zd),Zd.forEach(t),Qd.forEach(t),ui=m(Nr),va=n(Nr,"SPAN",{});var ec=i(va);gi=a(ec,"MobileViTForImageClassification"),ec.forEach(t),Nr.forEach(t),cr=m(o),Ge=n(o,"DIV",{class:!0});var go=i(Ge);y(Jo.$$.fragment,go),_i=m(go),Ta=n(go,"P",{});var tc=i(Ta);bi=a(tc,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),tc.forEach(t),vi=m(go),Xo=n(go,"P",{});var Dr=i(Xo);Ti=a(Dr,"This model is a PyTorch "),Qo=n(Dr,"A",{href:!0,rel:!0});var oc=i(Qo);wi=a(oc,"torch.nn.Module"),oc.forEach(t),$i=a(Dr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dr.forEach(t),yi=m(go),at=n(go,"DIV",{class:!0});var _o=i(at);y(Zo.$$.fragment,_o),Mi=m(_o),Vt=n(_o,"P",{});var Zs=i(Vt);Vi=a(Zs,"The "),Ds=n(Zs,"A",{href:!0});var sc=i(Ds);Ei=a(sc,"MobileViTForImageClassification"),sc.forEach(t),Fi=a(Zs," forward method, overrides the "),wa=n(Zs,"CODE",{});var ac=i(wa);ki=a(ac,"__call__"),ac.forEach(t),Pi=a(Zs," special method."),Zs.forEach(t),Ii=m(_o),y(Gt.$$.fragment,_o),xi=m(_o),y(Yt.$$.fragment,_o),_o.forEach(t),go.forEach(t),mr=m(o),Et=n(o,"H2",{class:!0});var qr=i(Et);Jt=n(qr,"A",{id:!0,class:!0,href:!0});var rc=i(Jt);$a=n(rc,"SPAN",{});var nc=i($a);y(es.$$.fragment,nc),nc.forEach(t),rc.forEach(t),Ci=m(qr),ya=n(qr,"SPAN",{});var ic=i(ya);ji=a(ic,"MobileViTForSemanticSegmentation"),ic.forEach(t),qr.forEach(t),pr=m(o),Ye=n(o,"DIV",{class:!0});var bo=i(Ye);y(ts.$$.fragment,bo),Si=m(bo),Ma=n(bo,"P",{});var lc=i(Ma);Ai=a(lc,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),lc.forEach(t),zi=m(bo),os=n(bo,"P",{});var Lr=i(os);Oi=a(Lr,"This model is a PyTorch "),ss=n(Lr,"A",{href:!0,rel:!0});var dc=i(ss);Ni=a(dc,"torch.nn.Module"),dc.forEach(t),Di=a(Lr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Lr.forEach(t),qi=m(bo),rt=n(bo,"DIV",{class:!0});var vo=i(rt);y(as.$$.fragment,vo),Li=m(vo),Ft=n(vo,"P",{});var ea=i(Ft);Ri=a(ea,"The "),qs=n(ea,"A",{href:!0});var cc=i(qs);Wi=a(cc,"MobileViTForSemanticSegmentation"),cc.forEach(t),Ui=a(ea," forward method, overrides the "),Va=n(ea,"CODE",{});var mc=i(Va);Hi=a(mc,"__call__"),mc.forEach(t),Bi=a(ea," special method."),ea.forEach(t),Ki=m(vo),y(Xt.$$.fragment,vo),Gi=m(vo),y(Qt.$$.fragment,vo),vo.forEach(t),bo.forEach(t),hr=m(o),kt=n(o,"H2",{class:!0});var Rr=i(kt);Zt=n(Rr,"A",{id:!0,class:!0,href:!0});var pc=i(Zt);Ea=n(pc,"SPAN",{});var hc=i(Ea);y(rs.$$.fragment,hc),hc.forEach(t),pc.forEach(t),Yi=m(Rr),Fa=n(Rr,"SPAN",{});var fc=i(Fa);Ji=a(fc,"TFMobileViTModel"),fc.forEach(t),Rr.forEach(t),fr=m(o),Re=n(o,"DIV",{class:!0});var ut=i(Re);y(ns.$$.fragment,ut),Xi=m(ut),is=n(ut,"P",{});var Wr=i(is);Qi=a(Wr,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ls=n(Wr,"A",{href:!0});var uc=i(Ls);Zi=a(uc,"TFPreTrainedModel"),uc.forEach(t),el=a(Wr,`. 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.)`),Wr.forEach(t),tl=m(ut),ls=n(ut,"P",{});var Ur=i(ls);ol=a(Ur,"This model is also a "),ds=n(Ur,"A",{href:!0,rel:!0});var gc=i(ds);sl=a(gc,"tf.keras.Model"),gc.forEach(t),al=a(Ur,` 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.`),Ur.forEach(t),rl=m(ut),y(eo.$$.fragment,ut),nl=m(ut),nt=n(ut,"DIV",{class:!0});var To=i(nt);y(cs.$$.fragment,To),il=m(To),Pt=n(To,"P",{});var ta=i(Pt);ll=a(ta,"The "),Rs=n(ta,"A",{href:!0});var _c=i(Rs);dl=a(_c,"TFMobileViTModel"),_c.forEach(t),cl=a(ta," forward method, overrides the "),ka=n(ta,"CODE",{});var bc=i(ka);ml=a(bc,"__call__"),bc.forEach(t),pl=a(ta," special method."),ta.forEach(t),hl=m(To),y(to.$$.fragment,To),fl=m(To),y(oo.$$.fragment,To),To.forEach(t),ut.forEach(t),ur=m(o),It=n(o,"H2",{class:!0});var Hr=i(It);so=n(Hr,"A",{id:!0,class:!0,href:!0});var vc=i(so);Pa=n(vc,"SPAN",{});var Tc=i(Pa);y(ms.$$.fragment,Tc),Tc.forEach(t),vc.forEach(t),ul=m(Hr),Ia=n(Hr,"SPAN",{});var wc=i(Ia);gl=a(wc,"TFMobileViTForImageClassification"),wc.forEach(t),Hr.forEach(t),gr=m(o),ue=n(o,"DIV",{class:!0});var dt=i(ue);y(ps.$$.fragment,dt),_l=m(dt),xa=n(dt,"P",{});var $c=i(xa);bl=a($c,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),$c.forEach(t),vl=m(dt),hs=n(dt,"P",{});var Br=i(hs);Tl=a(Br,"This model inherits from "),Ws=n(Br,"A",{href:!0});var yc=i(Ws);wl=a(yc,"TFPreTrainedModel"),yc.forEach(t),$l=a(Br,`. 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.)`),Br.forEach(t),yl=m(dt),fs=n(dt,"P",{});var Kr=i(fs);Ml=a(Kr,"This model is also a "),us=n(Kr,"A",{href:!0,rel:!0});var Mc=i(us);Vl=a(Mc,"tf.keras.Model"),Mc.forEach(t),El=a(Kr,` 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.`),Kr.forEach(t),Fl=m(dt),y(ao.$$.fragment,dt),kl=m(dt),it=n(dt,"DIV",{class:!0});var wo=i(it);y(gs.$$.fragment,wo),Pl=m(wo),xt=n(wo,"P",{});var oa=i(xt);Il=a(oa,"The "),Us=n(oa,"A",{href:!0});var Vc=i(Us);xl=a(Vc,"TFMobileViTForImageClassification"),Vc.forEach(t),Cl=a(oa," forward method, overrides the "),Ca=n(oa,"CODE",{});var Ec=i(Ca);jl=a(Ec,"__call__"),Ec.forEach(t),Sl=a(oa," special method."),oa.forEach(t),Al=m(wo),y(ro.$$.fragment,wo),zl=m(wo),y(no.$$.fragment,wo),wo.forEach(t),dt.forEach(t),_r=m(o),Ct=n(o,"H2",{class:!0});var Gr=i(Ct);io=n(Gr,"A",{id:!0,class:!0,href:!0});var Fc=i(io);ja=n(Fc,"SPAN",{});var kc=i(ja);y(_s.$$.fragment,kc),kc.forEach(t),Fc.forEach(t),Ol=m(Gr),Sa=n(Gr,"SPAN",{});var Pc=i(Sa);Nl=a(Pc,"TFMobileViTForSemanticSegmentation"),Pc.forEach(t),Gr.forEach(t),br=m(o),ge=n(o,"DIV",{class:!0});var ct=i(ge);y(bs.$$.fragment,ct),Dl=m(ct),Aa=n(ct,"P",{});var Ic=i(Aa);ql=a(Ic,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Ic.forEach(t),Ll=m(ct),vs=n(ct,"P",{});var Yr=i(vs);Rl=a(Yr,"This model inherits from "),Hs=n(Yr,"A",{href:!0});var xc=i(Hs);Wl=a(xc,"TFPreTrainedModel"),xc.forEach(t),Ul=a(Yr,`. 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.)`),Yr.forEach(t),Hl=m(ct),Ts=n(ct,"P",{});var Jr=i(Ts);Bl=a(Jr,"This model is also a "),ws=n(Jr,"A",{href:!0,rel:!0});var Cc=i(ws);Kl=a(Cc,"tf.keras.Model"),Cc.forEach(t),Gl=a(Jr,` 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.`),Jr.forEach(t),Yl=m(ct),y(lo.$$.fragment,ct),Jl=m(ct),lt=n(ct,"DIV",{class:!0});var $o=i(lt);y($s.$$.fragment,$o),Xl=m($o),jt=n($o,"P",{});var sa=i(jt);Ql=a(sa,"The "),Bs=n(sa,"A",{href:!0});var jc=i(Bs);Zl=a(jc,"TFMobileViTForSemanticSegmentation"),jc.forEach(t),ed=a(sa," forward method, overrides the "),za=n(sa,"CODE",{});var Sc=i(za);td=a(Sc,"__call__"),Sc.forEach(t),od=a(sa," special method."),sa.forEach(t),sd=m($o),y(co.$$.fragment,$o),ad=m($o),y(mo.$$.fragment,$o),$o.forEach(t),ct.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(am)),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(_,"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(O,"class","relative group"),p(oe,"href","https://arxiv.org/abs/2110.02178"),p(oe,"rel","nofollow"),p(re,"href","https://keras.io/examples/vision/mobilevit"),p(re,"rel","nofollow"),p(W,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTImageProcessor"),p(G,"href","https://huggingface.co/datasets/imagenet-1k"),p(G,"rel","nofollow"),p(k,"href","https://arxiv.org/abs/1706.05587"),p(k,"rel","nofollow"),p($e,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),p($e,"rel","nofollow"),p(Ve,"href","https://www.tensorflow.org/lite"),p(Ve,"rel","nofollow"),p(Mo,"href","https://huggingface.co/Matthijs"),p(Mo,"rel","nofollow"),p(Vo,"href","https://huggingface.co/sayakpaul"),p(Vo,"rel","nofollow"),p(Eo,"href","https://github.com/apple/ml-cvnets"),p(Eo,"rel","nofollow"),p(At,"id","resources"),p(At,"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(At,"href","#resources"),p(gt,"class","relative group"),p(xs,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForImageClassification"),p(Po,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),p(Po,"rel","nofollow"),p(Io,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),p(Io,"rel","nofollow"),p(zt,"id","transformers.MobileViTConfig"),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.MobileViTConfig"),p(_t,"class","relative group"),p(js,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTModel"),p(jo,"href","https://huggingface.co/apple/mobilevit-small"),p(jo,"rel","nofollow"),p(Ss,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(As,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Nt,"id","transformers.MobileViTFeatureExtractor"),p(Nt,"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(Nt,"href","#transformers.MobileViTFeatureExtractor"),p(Tt,"class","relative group"),p(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(zs,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),p(qt,"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(Lt,"id","transformers.MobileViTImageProcessor"),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.MobileViTImageProcessor"),p(wt,"class","relative group"),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(Os,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),p(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ut,"id","transformers.MobileViTModel"),p(Ut,"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(Ut,"href","#transformers.MobileViTModel"),p($t,"class","relative group"),p(Ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Ko,"rel","nofollow"),p(Ns,"href","/docs/transformers/main/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(Kt,"id","transformers.MobileViTForImageClassification"),p(Kt,"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(Kt,"href","#transformers.MobileViTForImageClassification"),p(Mt,"class","relative group"),p(Qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Qo,"rel","nofollow"),p(Ds,"href","/docs/transformers/main/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(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(Jt,"id","transformers.MobileViTForSemanticSegmentation"),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","#transformers.MobileViTForSemanticSegmentation"),p(Et,"class","relative group"),p(ss,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ss,"rel","nofollow"),p(qs,"href","/docs/transformers/main/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(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(Zt,"id","transformers.TFMobileViTModel"),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.TFMobileViTModel"),p(kt,"class","relative group"),p(Ls,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(ds,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(ds,"rel","nofollow"),p(Rs,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.TFMobileViTModel"),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(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(so,"id","transformers.TFMobileViTForImageClassification"),p(so,"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(so,"href","#transformers.TFMobileViTForImageClassification"),p(It,"class","relative group"),p(Ws,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(us,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(us,"rel","nofollow"),p(Us,"href","/docs/transformers/main/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(io,"id","transformers.TFMobileViTForSemanticSegmentation"),p(io,"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(io,"href","#transformers.TFMobileViTForSemanticSegmentation"),p(Ct,"class","relative group"),p(Hs,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(ws,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(ws,"rel","nofollow"),p(Bs,"href","/docs/transformers/main/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,d),f(o,T,u),f(o,_,u),e(_,g),e(g,v),M(l,v,null),e(_,h),e(_,I),e(I,ke),f(o,_e,u),f(o,O,u),e(O,ee),e(ee,te),M(w,te,null),e(O,Pe),e(O,B),e(B,Ie),f(o,be,u),f(o,D,u),e(D,xe),e(D,oe),e(oe,Y),e(D,Ce),f(o,ve,u),f(o,L,u),e(L,je),f(o,Te,u),f(o,R,u),e(R,ce),e(ce,Se),f(o,se,u),f(o,x,u),e(x,S),f(o,we,u),f(o,j,u),e(j,me),e(me,ae),e(ae,J),e(ae,re),e(re,Ae),e(ae,A),e(j,ze),e(j,K),e(K,ne),e(ne,Oe),e(ne,W),e(W,Ne),e(ne,De),e(j,U),e(j,pe),e(pe,q),e(q,qe),e(q,G),e(G,z),e(q,Le),e(j,N),e(j,he),e(he,X),e(X,b),e(X,k),e(k,Xe),e(X,le),e(X,$e),e($e,Qe),e(X,P),e(j,Ze),e(j,ye),e(ye,Me),e(Me,et),e(Me,Ve),e(Ve,H),e(Me,Q),e(ye,tt),e(ye,We),e(We,Z),f(o,He,u),M(Ee,o,u),f(o,Fe,u),f(o,fe,u),e(fe,de),e(fe,Ue),e(Ue,Xr),e(fe,Qr),f(o,Ya,u),f(o,ot,u),e(ot,Zr),e(ot,Mo),e(Mo,en),e(ot,tn),e(ot,Vo),e(Vo,on),e(ot,sn),e(ot,Eo),e(Eo,an),e(ot,rn),f(o,Ja,u),f(o,gt,u),e(gt,At),e(At,aa),M(Fo,aa,null),e(gt,nn),e(gt,ra),e(ra,ln),f(o,Xa,u),f(o,Ps,u),e(Ps,dn),f(o,Qa,u),M(ko,o,u),f(o,Za,u),f(o,Is,u),e(Is,ft),e(ft,xs),e(xs,cn),e(ft,mn),e(ft,Po),e(Po,pn),e(ft,hn),e(ft,Io),e(Io,fn),e(ft,un),f(o,er,u),f(o,Cs,u),e(Cs,gn),f(o,tr,u),f(o,_t,u),e(_t,zt),e(zt,na),M(xo,na,null),e(_t,_n),e(_t,ia),e(ia,bn),f(o,or,u),f(o,Be,u),M(Co,Be,null),e(Be,vn),e(Be,bt),e(bt,Tn),e(bt,js),e(js,wn),e(bt,$n),e(bt,jo),e(jo,yn),e(bt,Mn),e(Be,Vn),e(Be,vt),e(vt,En),e(vt,Ss),e(Ss,Fn),e(vt,kn),e(vt,As),e(As,Pn),e(vt,In),e(Be,xn),M(Ot,Be,null),f(o,sr,u),f(o,Tt,u),e(Tt,Nt),e(Nt,la),M(So,la,null),e(Tt,Cn),e(Tt,da),e(da,jn),f(o,ar,u),f(o,pt,u),M(Ao,pt,null),e(pt,Sn),e(pt,Dt),M(zo,Dt,null),e(Dt,An),e(Dt,ca),e(ca,zn),e(pt,On),e(pt,qt),M(Oo,qt,null),e(qt,Nn),e(qt,No),e(No,Dn),e(No,zs),e(zs,qn),e(No,Ln),f(o,rr,u),f(o,wt,u),e(wt,Lt),e(Lt,ma),M(Do,ma,null),e(wt,Rn),e(wt,pa),e(pa,Wn),f(o,nr,u),f(o,Ke,u),M(qo,Ke,null),e(Ke,Un),e(Ke,ha),e(ha,Hn),e(Ke,Bn),e(Ke,Rt),M(Lo,Rt,null),e(Rt,Kn),e(Rt,fa),e(fa,Gn),e(Ke,Yn),e(Ke,Wt),M(Ro,Wt,null),e(Wt,Jn),e(Wt,Wo),e(Wo,Xn),e(Wo,Os),e(Os,Qn),e(Wo,Zn),f(o,ir,u),f(o,$t,u),e($t,Ut),e(Ut,ua),M(Uo,ua,null),e($t,ei),e($t,ga),e(ga,ti),f(o,lr,u),f(o,ht,u),M(Ho,ht,null),e(ht,oi),e(ht,Bo),e(Bo,si),e(Bo,Ko),e(Ko,ai),e(Bo,ri),e(ht,ni),e(ht,st),M(Go,st,null),e(st,ii),e(st,yt),e(yt,li),e(yt,Ns),e(Ns,di),e(yt,ci),e(yt,_a),e(_a,mi),e(yt,pi),e(st,hi),M(Ht,st,null),e(st,fi),M(Bt,st,null),f(o,dr,u),f(o,Mt,u),e(Mt,Kt),e(Kt,ba),M(Yo,ba,null),e(Mt,ui),e(Mt,va),e(va,gi),f(o,cr,u),f(o,Ge,u),M(Jo,Ge,null),e(Ge,_i),e(Ge,Ta),e(Ta,bi),e(Ge,vi),e(Ge,Xo),e(Xo,Ti),e(Xo,Qo),e(Qo,wi),e(Xo,$i),e(Ge,yi),e(Ge,at),M(Zo,at,null),e(at,Mi),e(at,Vt),e(Vt,Vi),e(Vt,Ds),e(Ds,Ei),e(Vt,Fi),e(Vt,wa),e(wa,ki),e(Vt,Pi),e(at,Ii),M(Gt,at,null),e(at,xi),M(Yt,at,null),f(o,mr,u),f(o,Et,u),e(Et,Jt),e(Jt,$a),M(es,$a,null),e(Et,Ci),e(Et,ya),e(ya,ji),f(o,pr,u),f(o,Ye,u),M(ts,Ye,null),e(Ye,Si),e(Ye,Ma),e(Ma,Ai),e(Ye,zi),e(Ye,os),e(os,Oi),e(os,ss),e(ss,Ni),e(os,Di),e(Ye,qi),e(Ye,rt),M(as,rt,null),e(rt,Li),e(rt,Ft),e(Ft,Ri),e(Ft,qs),e(qs,Wi),e(Ft,Ui),e(Ft,Va),e(Va,Hi),e(Ft,Bi),e(rt,Ki),M(Xt,rt,null),e(rt,Gi),M(Qt,rt,null),f(o,hr,u),f(o,kt,u),e(kt,Zt),e(Zt,Ea),M(rs,Ea,null),e(kt,Yi),e(kt,Fa),e(Fa,Ji),f(o,fr,u),f(o,Re,u),M(ns,Re,null),e(Re,Xi),e(Re,is),e(is,Qi),e(is,Ls),e(Ls,Zi),e(is,el),e(Re,tl),e(Re,ls),e(ls,ol),e(ls,ds),e(ds,sl),e(ls,al),e(Re,rl),M(eo,Re,null),e(Re,nl),e(Re,nt),M(cs,nt,null),e(nt,il),e(nt,Pt),e(Pt,ll),e(Pt,Rs),e(Rs,dl),e(Pt,cl),e(Pt,ka),e(ka,ml),e(Pt,pl),e(nt,hl),M(to,nt,null),e(nt,fl),M(oo,nt,null),f(o,ur,u),f(o,It,u),e(It,so),e(so,Pa),M(ms,Pa,null),e(It,ul),e(It,Ia),e(Ia,gl),f(o,gr,u),f(o,ue,u),M(ps,ue,null),e(ue,_l),e(ue,xa),e(xa,bl),e(ue,vl),e(ue,hs),e(hs,Tl),e(hs,Ws),e(Ws,wl),e(hs,$l),e(ue,yl),e(ue,fs),e(fs,Ml),e(fs,us),e(us,Vl),e(fs,El),e(ue,Fl),M(ao,ue,null),e(ue,kl),e(ue,it),M(gs,it,null),e(it,Pl),e(it,xt),e(xt,Il),e(xt,Us),e(Us,xl),e(xt,Cl),e(xt,Ca),e(Ca,jl),e(xt,Sl),e(it,Al),M(ro,it,null),e(it,zl),M(no,it,null),f(o,_r,u),f(o,Ct,u),e(Ct,io),e(io,ja),M(_s,ja,null),e(Ct,Ol),e(Ct,Sa),e(Sa,Nl),f(o,br,u),f(o,ge,u),M(bs,ge,null),e(ge,Dl),e(ge,Aa),e(Aa,ql),e(ge,Ll),e(ge,vs),e(vs,Rl),e(vs,Hs),e(Hs,Wl),e(vs,Ul),e(ge,Hl),e(ge,Ts),e(Ts,Bl),e(Ts,ws),e(ws,Kl),e(Ts,Gl),e(ge,Yl),M(lo,ge,null),e(ge,Jl),e(ge,lt),M($s,lt,null),e(lt,Xl),e(lt,jt),e(jt,Ql),e(jt,Bs),e(Bs,Zl),e(jt,ed),e(jt,za),e(za,td),e(jt,od),e(lt,sd),M(co,lt,null),e(lt,ad),M(mo,lt,null),vr=!0},p(o,[u]){const ys={};u&2&&(ys.$$scope={dirty:u,ctx:o}),Ot.$set(ys);const Oa={};u&2&&(Oa.$$scope={dirty:u,ctx:o}),Ht.$set(Oa);const Na={};u&2&&(Na.$$scope={dirty:u,ctx:o}),Bt.$set(Na);const Da={};u&2&&(Da.$$scope={dirty:u,ctx:o}),Gt.$set(Da);const Ms={};u&2&&(Ms.$$scope={dirty:u,ctx:o}),Yt.$set(Ms);const qa={};u&2&&(qa.$$scope={dirty:u,ctx:o}),Xt.$set(qa);const La={};u&2&&(La.$$scope={dirty:u,ctx:o}),Qt.$set(La);const Ra={};u&2&&(Ra.$$scope={dirty:u,ctx:o}),eo.$set(Ra);const Vs={};u&2&&(Vs.$$scope={dirty:u,ctx:o}),to.$set(Vs);const Wa={};u&2&&(Wa.$$scope={dirty:u,ctx:o}),oo.$set(Wa);const Ua={};u&2&&(Ua.$$scope={dirty:u,ctx:o}),ao.$set(Ua);const Ha={};u&2&&(Ha.$$scope={dirty:u,ctx:o}),ro.$set(Ha);const Ba={};u&2&&(Ba.$$scope={dirty:u,ctx:o}),no.$set(Ba);const Ka={};u&2&&(Ka.$$scope={dirty:u,ctx:o}),lo.$set(Ka);const Je={};u&2&&(Je.$$scope={dirty:u,ctx:o}),co.$set(Je);const Ga={};u&2&&(Ga.$$scope={dirty:u,ctx:o}),mo.$set(Ga)},i(o){vr||(V(l.$$.fragment,o),V(w.$$.fragment,o),V(Ee.$$.fragment,o),V(Fo.$$.fragment,o),V(ko.$$.fragment,o),V(xo.$$.fragment,o),V(Co.$$.fragment,o),V(Ot.$$.fragment,o),V(So.$$.fragment,o),V(Ao.$$.fragment,o),V(zo.$$.fragment,o),V(Oo.$$.fragment,o),V(Do.$$.fragment,o),V(qo.$$.fragment,o),V(Lo.$$.fragment,o),V(Ro.$$.fragment,o),V(Uo.$$.fragment,o),V(Ho.$$.fragment,o),V(Go.$$.fragment,o),V(Ht.$$.fragment,o),V(Bt.$$.fragment,o),V(Yo.$$.fragment,o),V(Jo.$$.fragment,o),V(Zo.$$.fragment,o),V(Gt.$$.fragment,o),V(Yt.$$.fragment,o),V(es.$$.fragment,o),V(ts.$$.fragment,o),V(as.$$.fragment,o),V(Xt.$$.fragment,o),V(Qt.$$.fragment,o),V(rs.$$.fragment,o),V(ns.$$.fragment,o),V(eo.$$.fragment,o),V(cs.$$.fragment,o),V(to.$$.fragment,o),V(oo.$$.fragment,o),V(ms.$$.fragment,o),V(ps.$$.fragment,o),V(ao.$$.fragment,o),V(gs.$$.fragment,o),V(ro.$$.fragment,o),V(no.$$.fragment,o),V(_s.$$.fragment,o),V(bs.$$.fragment,o),V(lo.$$.fragment,o),V($s.$$.fragment,o),V(co.$$.fragment,o),V(mo.$$.fragment,o),vr=!0)},o(o){E(l.$$.fragment,o),E(w.$$.fragment,o),E(Ee.$$.fragment,o),E(Fo.$$.fragment,o),E(ko.$$.fragment,o),E(xo.$$.fragment,o),E(Co.$$.fragment,o),E(Ot.$$.fragment,o),E(So.$$.fragment,o),E(Ao.$$.fragment,o),E(zo.$$.fragment,o),E(Oo.$$.fragment,o),E(Do.$$.fragment,o),E(qo.$$.fragment,o),E(Lo.$$.fragment,o),E(Ro.$$.fragment,o),E(Uo.$$.fragment,o),E(Ho.$$.fragment,o),E(Go.$$.fragment,o),E(Ht.$$.fragment,o),E(Bt.$$.fragment,o),E(Yo.$$.fragment,o),E(Jo.$$.fragment,o),E(Zo.$$.fragment,o),E(Gt.$$.fragment,o),E(Yt.$$.fragment,o),E(es.$$.fragment,o),E(ts.$$.fragment,o),E(as.$$.fragment,o),E(Xt.$$.fragment,o),E(Qt.$$.fragment,o),E(rs.$$.fragment,o),E(ns.$$.fragment,o),E(eo.$$.fragment,o),E(cs.$$.fragment,o),E(to.$$.fragment,o),E(oo.$$.fragment,o),E(ms.$$.fragment,o),E(ps.$$.fragment,o),E(ao.$$.fragment,o),E(gs.$$.fragment,o),E(ro.$$.fragment,o),E(no.$$.fragment,o),E(_s.$$.fragment,o),E(bs.$$.fragment,o),E(lo.$$.fragment,o),E($s.$$.fragment,o),E(co.$$.fragment,o),E(mo.$$.fragment,o),vr=!1},d(o){t(d),o&&t(T),o&&t(_),F(l),o&&t(_e),o&&t(O),F(w),o&&t(be),o&&t(D),o&&t(ve),o&&t(L),o&&t(Te),o&&t(R),o&&t(se),o&&t(x),o&&t(we),o&&t(j),o&&t(He),F(Ee,o),o&&t(Fe),o&&t(fe),o&&t(Ya),o&&t(ot),o&&t(Ja),o&&t(gt),F(Fo),o&&t(Xa),o&&t(Ps),o&&t(Qa),F(ko,o),o&&t(Za),o&&t(Is),o&&t(er),o&&t(Cs),o&&t(tr),o&&t(_t),F(xo),o&&t(or),o&&t(Be),F(Co),F(Ot),o&&t(sr),o&&t(Tt),F(So),o&&t(ar),o&&t(pt),F(Ao),F(zo),F(Oo),o&&t(rr),o&&t(wt),F(Do),o&&t(nr),o&&t(Ke),F(qo),F(Lo),F(Ro),o&&t(ir),o&&t($t),F(Uo),o&&t(lr),o&&t(ht),F(Ho),F(Go),F(Ht),F(Bt),o&&t(dr),o&&t(Mt),F(Yo),o&&t(cr),o&&t(Ge),F(Jo),F(Zo),F(Gt),F(Yt),o&&t(mr),o&&t(Et),F(es),o&&t(pr),o&&t(Ye),F(ts),F(as),F(Xt),F(Qt),o&&t(hr),o&&t(kt),F(rs),o&&t(fr),o&&t(Re),F(ns),F(eo),F(cs),F(to),F(oo),o&&t(ur),o&&t(It),F(ms),o&&t(gr),o&&t(ue),F(ps),F(ao),F(gs),F(ro),F(no),o&&t(_r),o&&t(Ct),F(_s),o&&t(br),o&&t(ge),F(bs),F(lo),F($s),F(co),F(mo)}}}const am={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 rm(C){return Dc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hm extends Ac{constructor(d){super();zc(this,d,rm,sm,Oc,{})}}export{hm as default,am as metadata};
