import{S as ec,i as tc,s as oc,e as r,k as c,w as $,t as s,M as sc,c as n,d as t,m,a as i,x as y,h as a,b as h,G as e,g as f,y as M,q as V,o as E,B as I,v as ac,L as ws}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ct}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as wo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ht}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ts}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function rc(C){let d,T,g,u,v;return u=new wo({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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Example:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function nc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function ic(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, MobileViTModel
import torch
from datasets import load_dataset

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

feature_extractor = MobileViTImageProcessor.from_pretrained("apple/mobilevit-small")
model = MobileViTModel.from_pretrained("apple/mobilevit-small")

inputs = feature_extractor(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> MobileViTImageProcessor, 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>feature_extractor = MobileViTImageProcessor.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 = feature_extractor(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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Example:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function lc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function dc(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, MobileViTForImageClassification
import torch
from datasets import load_dataset

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

feature_extractor = MobileViTImageProcessor.from_pretrained("apple/mobilevit-small")
model = MobileViTForImageClassification.from_pretrained("apple/mobilevit-small")

inputs = feature_extractor(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> MobileViTImageProcessor, 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>feature_extractor = MobileViTImageProcessor.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 = feature_extractor(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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Example:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function cc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function mc(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, 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 = MobileViTImageProcessor.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> MobileViTImageProcessor, 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 = MobileViTImageProcessor.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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Examples:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function pc(C){let d,T,g,u,v,l,p,F,ke,_e,D,ee,te,w,Pe,H,Fe,be,q,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,ze,z,Oe,K,ne,De,W,Ne,qe,U,pe,A,Ae,G,O,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),g=r("code"),u=s("transformers"),v=s(" accept two formats as input:"),l=c(),p=r("ul"),F=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),D=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 `),H=r("code"),Fe=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=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)"),ze=c(),z=r("li"),Oe=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])"),De=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),qe=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),Ae=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),O=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(_){d=n(_,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),g=n(k,"CODE",{});var Qe=i(g);u=a(Qe,"transformers"),Qe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(_),p=n(_,"UL",{});var le=i(p);F=n(le,"LI",{});var $e=i(F);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),D=n(le,"LI",{});var Ze=i(D);ee=a(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),le.forEach(t),te=m(_),w=n(_,"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 `),H=n(P,"CODE",{});var et=i(H);Fe=a(et,"model.fit()"),et.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=n(P,"CODE",{});var ye=i(q);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 tt=i(L);je=a(tt,"predict()"),tt.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(_),x=n(_,"UL",{});var B=i(x);S=n(B,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var ot=i(j);me=a(ot,"pixel_values"),ot.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),ze=m(B),z=n(B,"LI",{});var Z=i(z);Oe=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 Be=i(K);ne=a(Be,"model([pixel_values, attention_mask])"),Be.forEach(t),De=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),qe=m(B),U=n(B,"LI",{});var Ie=i(U);pe=a(Ie,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=n(Ie,"CODE",{});var fe=i(A);Ae=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Ie.forEach(t),B.forEach(t),G=m(_),O=n(_,"P",{});var de=i(O);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(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(_,k){f(_,d,k),e(d,T),e(d,g),e(g,u),e(d,v),f(_,l,k),f(_,p,k),e(p,F),e(F,ke),e(p,_e),e(p,D),e(D,ee),f(_,te,k),f(_,w,k),e(w,Pe),e(w,H),e(H,Fe),e(w,be),e(w,q),e(q,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(_,se,k),f(_,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,ze),e(x,z),e(z,Oe),e(z,K),e(K,ne),e(z,De),e(z,W),e(W,Ne),e(x,qe),e(x,U),e(U,pe),e(U,A),e(A,Ae),f(_,G,k),f(_,O,k),e(O,Le),e(O,N),e(N,he),e(O,X)},d(_){_&&t(d),_&&t(l),_&&t(p),_&&t(te),_&&t(w),_&&t(se),_&&t(x),_&&t(G),_&&t(O)}}}function hc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function fc(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, TFMobileViTModel
from datasets import load_dataset

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

feature_extractor = MobileViTImageProcessor.from_pretrained("apple/mobilevit-small")
model = TFMobileViTModel.from_pretrained("apple/mobilevit-small")

inputs = feature_extractor(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> MobileViTImageProcessor, 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>feature_extractor = MobileViTImageProcessor.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 = feature_extractor(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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Example:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function uc(C){let d,T,g,u,v,l,p,F,ke,_e,D,ee,te,w,Pe,H,Fe,be,q,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,ze,z,Oe,K,ne,De,W,Ne,qe,U,pe,A,Ae,G,O,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),g=r("code"),u=s("transformers"),v=s(" accept two formats as input:"),l=c(),p=r("ul"),F=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),D=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 `),H=r("code"),Fe=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=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)"),ze=c(),z=r("li"),Oe=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])"),De=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),qe=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),Ae=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),O=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(_){d=n(_,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),g=n(k,"CODE",{});var Qe=i(g);u=a(Qe,"transformers"),Qe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(_),p=n(_,"UL",{});var le=i(p);F=n(le,"LI",{});var $e=i(F);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),D=n(le,"LI",{});var Ze=i(D);ee=a(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),le.forEach(t),te=m(_),w=n(_,"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 `),H=n(P,"CODE",{});var et=i(H);Fe=a(et,"model.fit()"),et.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=n(P,"CODE",{});var ye=i(q);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 tt=i(L);je=a(tt,"predict()"),tt.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(_),x=n(_,"UL",{});var B=i(x);S=n(B,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var ot=i(j);me=a(ot,"pixel_values"),ot.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),ze=m(B),z=n(B,"LI",{});var Z=i(z);Oe=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 Be=i(K);ne=a(Be,"model([pixel_values, attention_mask])"),Be.forEach(t),De=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),qe=m(B),U=n(B,"LI",{});var Ie=i(U);pe=a(Ie,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=n(Ie,"CODE",{});var fe=i(A);Ae=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Ie.forEach(t),B.forEach(t),G=m(_),O=n(_,"P",{});var de=i(O);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(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(_,k){f(_,d,k),e(d,T),e(d,g),e(g,u),e(d,v),f(_,l,k),f(_,p,k),e(p,F),e(F,ke),e(p,_e),e(p,D),e(D,ee),f(_,te,k),f(_,w,k),e(w,Pe),e(w,H),e(H,Fe),e(w,be),e(w,q),e(q,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(_,se,k),f(_,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,ze),e(x,z),e(z,Oe),e(z,K),e(K,ne),e(z,De),e(z,W),e(W,Ne),e(x,qe),e(x,U),e(U,pe),e(U,A),e(A,Ae),f(_,G,k),f(_,O,k),e(O,Le),e(O,N),e(N,he),e(O,X)},d(_){_&&t(d),_&&t(l),_&&t(p),_&&t(te),_&&t(w),_&&t(se),_&&t(x),_&&t(G),_&&t(O)}}}function gc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function _c(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, TFMobileViTForImageClassification
import tensorflow as tf
from datasets import load_dataset

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

feature_extractor = MobileViTImageProcessor.from_pretrained("apple/mobilevit-small")
model = TFMobileViTForImageClassification.from_pretrained("apple/mobilevit-small")

inputs = feature_extractor(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> MobileViTImageProcessor, 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>feature_extractor = MobileViTImageProcessor.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 = feature_extractor(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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Example:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function bc(C){let d,T,g,u,v,l,p,F,ke,_e,D,ee,te,w,Pe,H,Fe,be,q,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,ze,z,Oe,K,ne,De,W,Ne,qe,U,pe,A,Ae,G,O,Le,N,he,X;return{c(){d=r("p"),T=s("TensorFlow models and layers in "),g=r("code"),u=s("transformers"),v=s(" accept two formats as input:"),l=c(),p=r("ul"),F=r("li"),ke=s("having all inputs as keyword arguments (like PyTorch models), or"),_e=c(),D=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 `),H=r("code"),Fe=s("model.fit()"),be=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=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)"),ze=c(),z=r("li"),Oe=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])"),De=s(" or "),W=r("code"),Ne=s("model([pixel_values, attention_mask, token_type_ids])"),qe=c(),U=r("li"),pe=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),Ae=s('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),G=c(),O=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(_){d=n(_,"P",{});var k=i(d);T=a(k,"TensorFlow models and layers in "),g=n(k,"CODE",{});var Qe=i(g);u=a(Qe,"transformers"),Qe.forEach(t),v=a(k," accept two formats as input:"),k.forEach(t),l=m(_),p=n(_,"UL",{});var le=i(p);F=n(le,"LI",{});var $e=i(F);ke=a($e,"having all inputs as keyword arguments (like PyTorch models), or"),$e.forEach(t),_e=m(le),D=n(le,"LI",{});var Ze=i(D);ee=a(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),le.forEach(t),te=m(_),w=n(_,"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 `),H=n(P,"CODE",{});var et=i(H);Fe=a(et,"model.fit()"),et.forEach(t),be=a(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),q=n(P,"CODE",{});var ye=i(q);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 tt=i(L);je=a(tt,"predict()"),tt.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(_),x=n(_,"UL",{});var B=i(x);S=n(B,"LI",{});var Q=i(S);we=a(Q,"a single Tensor with "),j=n(Q,"CODE",{});var ot=i(j);me=a(ot,"pixel_values"),ot.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),ze=m(B),z=n(B,"LI",{});var Z=i(z);Oe=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 Be=i(K);ne=a(Be,"model([pixel_values, attention_mask])"),Be.forEach(t),De=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),qe=m(B),U=n(B,"LI",{});var Ie=i(U);pe=a(Ie,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=n(Ie,"CODE",{});var fe=i(A);Ae=a(fe,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe.forEach(t),Ie.forEach(t),B.forEach(t),G=m(_),O=n(_,"P",{});var de=i(O);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(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(_,k){f(_,d,k),e(d,T),e(d,g),e(g,u),e(d,v),f(_,l,k),f(_,p,k),e(p,F),e(F,ke),e(p,_e),e(p,D),e(D,ee),f(_,te,k),f(_,w,k),e(w,Pe),e(w,H),e(H,Fe),e(w,be),e(w,q),e(q,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(_,se,k),f(_,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,ze),e(x,z),e(z,Oe),e(z,K),e(K,ne),e(z,De),e(z,W),e(W,Ne),e(x,qe),e(x,U),e(U,pe),e(U,A),e(A,Ae),f(_,G,k),f(_,O,k),e(O,Le),e(O,N),e(N,he),e(O,X)},d(_){_&&t(d),_&&t(l),_&&t(p),_&&t(te),_&&t(w),_&&t(se),_&&t(x),_&&t(G),_&&t(O)}}}function vc(C){let d,T,g,u,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 "),g=r("code"),u=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 p=i(d);T=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var F=i(g);u=a(F,"Module"),F.forEach(t),v=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){f(l,d,p),e(d,T),e(d,g),e(g,u),e(d,v)},d(l){l&&t(d)}}}function Tc(C){let d,T,g,u,v;return u=new wo({props:{code:`from transformers import MobileViTImageProcessor, 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 = MobileViTImageProcessor.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> MobileViTImageProcessor, 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 = MobileViTImageProcessor.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:"),g=c(),$(u.$$.fragment)},l(l){d=n(l,"P",{});var p=i(d);T=a(p,"Examples:"),p.forEach(t),g=m(l),y(u.$$.fragment,l)},m(l,p){f(l,d,p),e(d,T),f(l,g,p),M(u,l,p),v=!0},p:ws,i(l){v||(V(u.$$.fragment,l),v=!0)},o(l){E(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(g),I(u,l)}}}function wc(C){let d,T,g,u,v,l,p,F,ke,_e,D,ee,te,w,Pe,H,Fe,be,q,xe,oe,Y,Ce,ve,L,je,Te,R,ce,Se,se,x,S,we,j,me,ae,J,re,ze,z,Oe,K,ne,De,W,Ne,qe,U,pe,A,Ae,G,O,Le,N,he,X,_,k,Qe,le,$e,Ze,P,et,ye,Me,tt,Ve,B,Q,ot,We,Z,Be,Ee,Ie,fe,de,Ue,Cr,jr,Oa,st,Sr,$o,zr,Or,yo,Dr,Nr,Mo,qr,Ar,Da,ut,jt,Hs,Vo,Lr,Ks,Rr,Na,He,Eo,Wr,gt,Ur,$s,Br,Hr,Io,Kr,Gr,Yr,_t,Jr,ys,Xr,Qr,Ms,Zr,en,tn,St,qa,bt,zt,Gs,ko,on,Ys,sn,Aa,Ke,Po,an,Js,rn,nn,Ot,Fo,ln,Xs,dn,cn,Dt,xo,mn,Co,pn,Vs,hn,fn,La,vt,Nt,Qs,jo,un,Zs,gn,Ra,Ge,So,_n,ea,bn,vn,qt,zo,Tn,ta,wn,$n,At,Oo,yn,Do,Mn,Es,Vn,En,Wa,Tt,Lt,oa,No,In,sa,kn,Ua,pt,qo,Pn,Ao,Fn,Lo,xn,Cn,jn,at,Ro,Sn,wt,zn,Is,On,Dn,aa,Nn,qn,An,Rt,Ln,Wt,Ba,$t,Ut,ra,Wo,Rn,na,Wn,Ha,Ye,Uo,Un,ia,Bn,Hn,Bo,Kn,Ho,Gn,Yn,Jn,rt,Ko,Xn,yt,Qn,ks,Zn,ei,la,ti,oi,si,Bt,ai,Ht,Ka,Mt,Kt,da,Go,ri,ca,ni,Ga,Je,Yo,ii,ma,li,di,Jo,ci,Xo,mi,pi,hi,nt,Qo,fi,Vt,ui,Ps,gi,_i,pa,bi,vi,Ti,Gt,wi,Yt,Ya,Et,Jt,ha,Zo,$i,fa,yi,Ja,Re,es,Mi,ts,Vi,Fs,Ei,Ii,ki,os,Pi,ss,Fi,xi,Ci,Xt,ji,it,as,Si,It,zi,xs,Oi,Di,ua,Ni,qi,Ai,Qt,Li,Zt,Xa,kt,eo,ga,rs,Ri,_a,Wi,Qa,ue,ns,Ui,ba,Bi,Hi,is,Ki,Cs,Gi,Yi,Ji,ls,Xi,ds,Qi,Zi,el,to,tl,lt,cs,ol,Pt,sl,js,al,rl,va,nl,il,ll,oo,dl,so,Za,Ft,ao,Ta,ms,cl,wa,ml,er,ge,ps,pl,$a,hl,fl,hs,ul,Ss,gl,_l,bl,fs,vl,us,Tl,wl,$l,ro,yl,dt,gs,Ml,xt,Vl,zs,El,Il,ya,kl,Pl,Fl,no,xl,io,tr;return l=new ht({}),w=new ht({}),Ee=new wo({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)`}}),Vo=new ht({}),Eo=new ie({props:{name:"class transformers.MobileViTConfig",anchor:"transformers.MobileViTConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 256"},{name:"patch_size",val:" = 2"},{name:"hidden_sizes",val:" = [144, 192, 240]"},{name:"neck_hidden_sizes",val:" = [16, 32, 64, 96, 128, 160, 640]"},{name:"num_attention_heads",val:" = 4"},{name:"mlp_ratio",val:" = 2.0"},{name:"expand_ratio",val:" = 4.0"},{name:"hidden_act",val:" = 'silu'"},{name:"conv_kernel_size",val:" = 3"},{name:"output_stride",val:" = 32"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"qkv_bias",val:" = True"},{name:"aspp_out_channels",val:" = 256"},{name:"atrous_rates",val:" = [6, 12, 18]"},{name:"aspp_dropout_prob",val:" = 0.1"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.MobileViTConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.MobileViTConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.MobileViTConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[144, 192, 240]</code>) &#x2014;
Dimensionality (hidden size) of the Transformer encoders at each stage.`,name:"hidden_sizes"},{anchor:"transformers.MobileViTConfig.neck_hidden_sizes",description:`<strong>neck_hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[16, 32, 64, 96, 128, 160, 640]</code>) &#x2014;
The number of channels for the feature maps of the backbone.`,name:"neck_hidden_sizes"},{anchor:"transformers.MobileViTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MobileViTConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
The ratio of the number of channels in the output of the MLP to the number of channels in the input.`,name:"mlp_ratio"},{anchor:"transformers.MobileViTConfig.expand_ratio",description:`<strong>expand_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Expansion factor for the MobileNetv2 layers.`,name:"expand_ratio"},{anchor:"transformers.MobileViTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the Transformer encoder and convolution layers.`,name:"hidden_act"},{anchor:"transformers.MobileViTConfig.conv_kernel_size",description:`<strong>conv_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The size of the convolutional kernel in the MobileViT layer.`,name:"conv_kernel_size"},{anchor:"transformers.MobileViTConfig.output_stride",description:`<strong>output_stride</strong> (<code>int</code>, <code>optional</code>, defaults to 32) &#x2014;
The ratio of the spatial resolution of the output to the resolution of the input image.`,name:"output_stride"},{anchor:"transformers.MobileViTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the Transformer encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.MobileViTConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.MobileViTConfig.classifier_dropout_prob",description:`<strong>classifier_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for attached classifiers.`,name:"classifier_dropout_prob"},{anchor:"transformers.MobileViTConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.MobileViTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MobileViTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.MobileViTConfig.aspp_out_channels",description:`<strong>aspp_out_channels</strong> (<code>int</code>, <code>optional</code>, defaults to 256) &#x2014;
Number of output channels used in the ASPP layer for semantic segmentation.`,name:"aspp_out_channels"},{anchor:"transformers.MobileViTConfig.atrous_rates",description:`<strong>atrous_rates</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[6, 12, 18]</code>) &#x2014;
Dilation (atrous) factors used in the ASPP layer for semantic segmentation.`,name:"atrous_rates"},{anchor:"transformers.MobileViTConfig.aspp_dropout_prob",description:`<strong>aspp_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the ASPP layer for semantic segmentation.`,name:"aspp_dropout_prob"},{anchor:"transformers.MobileViTConfig.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/configuration_mobilevit.py#L46"}}),St=new Ts({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[rc]},$$scope:{ctx:C}}}),ko=new ht({}),Po=new ie({props:{name:"class transformers.MobileViTImageProcessor",anchor:"transformers.MobileViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_flip_channel_order",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.MobileViTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Controls the size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the
<code>preprocess</code> method.`,name:"size"},{anchor:"transformers.MobileViTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Defines the resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter
in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.MobileViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.MobileViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.MobileViTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input at the center. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped. Can be overridden by the <code>do_center_crop</code> parameter in
the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.MobileViTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Desired output size <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code> when applying center-cropping. Can be overridden by
the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.MobileViTImageProcessor.do_flip_channel_order",description:`<strong>do_flip_channel_order</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to flip the color channels from RGB to BGR. Can be overridden by the <code>do_flip_channel_order</code>
parameter in the <code>preprocess</code> method.`,name:"do_flip_channel_order"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/image_processing_mobilevit.py#L76"}}),Fo=new ie({props:{name:"__call__",anchor:"transformers.MobileViTImageProcessor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/image_processing_utils.py#L435"}}),xo=new ie({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/src/transformers/models/mobilevit/image_processing_mobilevit.py#L326",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>
`}}),jo=new ht({}),So=new ie({props:{name:"class transformers.MobileViTImageProcessor",anchor:"transformers.MobileViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_flip_channel_order",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.MobileViTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Controls the size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the
<code>preprocess</code> method.`,name:"size"},{anchor:"transformers.MobileViTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Defines the resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter
in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.MobileViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.MobileViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.MobileViTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input at the center. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped. Can be overridden by the <code>do_center_crop</code> parameter in
the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.MobileViTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Desired output size <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code> when applying center-cropping. Can be overridden by
the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.MobileViTImageProcessor.do_flip_channel_order",description:`<strong>do_flip_channel_order</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to flip the color channels from RGB to BGR. Can be overridden by the <code>do_flip_channel_order</code>
parameter in the <code>preprocess</code> method.`,name:"do_flip_channel_order"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/image_processing_mobilevit.py#L76"}}),zo=new ie({props:{name:"preprocess",anchor:"transformers.MobileViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_flip_channel_order",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**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/v4.25.1/src/transformers/models/mobilevit/image_processing_mobilevit.py#L223"}}),Oo=new ie({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileViTImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/src/transformers/models/mobilevit/image_processing_mobilevit.py#L326",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>
`}}),No=new ht({}),qo=new ie({props:{name:"class transformers.MobileViTModel",anchor:"transformers.MobileViTModel",parameters:[{name:"config",val:": MobileViTConfig"},{name:"expand_output",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L709"}}),Ro=new ie({props:{name:"forward",anchor:"transformers.MobileViTModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L746",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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>
`}}),Rt=new Ct({props:{$$slots:{default:[nc]},$$scope:{ctx:C}}}),Wt=new Ts({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[ic]},$$scope:{ctx:C}}}),Wo=new ht({}),Uo=new ie({props:{name:"class transformers.MobileViTForImageClassification",anchor:"transformers.MobileViTForImageClassification",parameters:[{name:"config",val:": MobileViTConfig"}],parametersDescription:[{anchor:"transformers.MobileViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L804"}}),Ko=new ie({props:{name:"forward",anchor:"transformers.MobileViTForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L820",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bt=new Ct({props:{$$slots:{default:[lc]},$$scope:{ctx:C}}}),Ht=new Ts({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[dc]},$$scope:{ctx:C}}}),Go=new ht({}),Yo=new ie({props:{name:"class transformers.MobileViTForSemanticSegmentation",anchor:"transformers.MobileViTForSemanticSegmentation",parameters:[{name:"config",val:": MobileViTConfig"}],parametersDescription:[{anchor:"transformers.MobileViTForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L1000"}}),Qo=new ie({props:{name:"forward",anchor:"transformers.MobileViTForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileViTForSemanticSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_mobilevit.py#L1011",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gt=new Ct({props:{$$slots:{default:[cc]},$$scope:{ctx:C}}}),Yt=new Ts({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[mc]},$$scope:{ctx:C}}}),Zo=new ht({}),es=new ie({props:{name:"class transformers.TFMobileViTModel",anchor:"transformers.TFMobileViTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L831"}}),Xt=new Ct({props:{$$slots:{default:[pc]},$$scope:{ctx:C}}}),as=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/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L839",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig"
>MobileViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Qt=new Ct({props:{$$slots:{default:[hc]},$$scope:{ctx:C}}}),Zt=new Ts({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[fc]},$$scope:{ctx:C}}}),rs=new ht({}),ns=new ie({props:{name:"class transformers.TFMobileViTForImageClassification",anchor:"transformers.TFMobileViTForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L876"}}),to=new Ct({props:{$$slots:{default:[uc]},$$scope:{ctx:C}}}),cs=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/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L889",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/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>
`}}),oo=new Ct({props:{$$slots:{default:[gc]},$$scope:{ctx:C}}}),so=new Ts({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[_c]},$$scope:{ctx:C}}}),ms=new ht({}),ps=new ie({props:{name:"class transformers.TFMobileViTForSemanticSegmentation",anchor:"transformers.TFMobileViTForSemanticSegmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileViTForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTConfig">MobileViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1057"}}),ro=new Ct({props:{$$slots:{default:[bc]},$$scope:{ctx:C}}}),gs=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/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor">MobileViTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1085",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/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>
`}}),no=new Ct({props:{$$slots:{default:[vc]},$$scope:{ctx:C}}}),io=new Ts({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[Tc]},$$scope:{ctx:C}}}),{c(){d=r("meta"),T=c(),g=r("h1"),u=r("a"),v=r("span"),$(l.$$.fragment),p=c(),F=r("span"),ke=s("MobileViT"),_e=c(),D=r("h2"),ee=r("a"),te=r("span"),$(w.$$.fragment),Pe=c(),H=r("span"),Fe=s("Overview"),be=c(),q=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"),ze=s("this tutorial"),z=s(" for a lightweight introduction."),Oe=c(),K=r("li"),ne=r("p"),De=s("One can use "),W=r("a"),Ne=s("MobileViTImageProcessor"),qe=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"),A=r("p"),Ae=s("The available image classification checkpoints are pre-trained on "),G=r("a"),O=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"),_=s("The segmentation model uses a "),k=r("a"),Qe=s("DeepLabV3"),le=s(" head. The available semantic segmentation checkpoints are pre-trained on "),$e=r("a"),Ze=s("PASCAL VOC"),P=s("."),et=c(),ye=r("li"),Me=r("p"),tt=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"),B=s("TensorFlow Lite"),Q=s("."),ot=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:`),Be=c(),$(Ee.$$.fragment),Ie=c(),fe=r("p"),de=s("The resulting model will be just "),Ue=r("strong"),Cr=s("about an MB"),jr=s(` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Oa=c(),st=r("p"),Sr=s("This model was contributed by "),$o=r("a"),zr=s("matthijs"),Or=s(". The TensorFlow version of the model was contributed by "),yo=r("a"),Dr=s("sayakpaul"),Nr=s(". The original code and weights can be found "),Mo=r("a"),qr=s("here"),Ar=s("."),Da=c(),ut=r("h2"),jt=r("a"),Hs=r("span"),$(Vo.$$.fragment),Lr=c(),Ks=r("span"),Rr=s("MobileViTConfig"),Na=c(),He=r("div"),$(Eo.$$.fragment),Wr=c(),gt=r("p"),Ur=s("This is the configuration class to store the configuration of a "),$s=r("a"),Br=s("MobileViTModel"),Hr=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
`),Io=r("a"),Kr=s("apple/mobilevit-small"),Gr=s(" architecture."),Yr=c(),_t=r("p"),Jr=s("Configuration objects inherit from "),ys=r("a"),Xr=s("PretrainedConfig"),Qr=s(` and can be used to control the model outputs. Read the
documentation from `),Ms=r("a"),Zr=s("PretrainedConfig"),en=s(" for more information."),tn=c(),$(St.$$.fragment),qa=c(),bt=r("h2"),zt=r("a"),Gs=r("span"),$(ko.$$.fragment),on=c(),Ys=r("span"),sn=s("MobileViTFeatureExtractor"),Aa=c(),Ke=r("div"),$(Po.$$.fragment),an=c(),Js=r("p"),rn=s("Constructs a MobileViT image processor."),nn=c(),Ot=r("div"),$(Fo.$$.fragment),ln=c(),Xs=r("p"),dn=s("Preprocess an image or a batch of images."),cn=c(),Dt=r("div"),$(xo.$$.fragment),mn=c(),Co=r("p"),pn=s("Converts the output of "),Vs=r("a"),hn=s("MobileViTForSemanticSegmentation"),fn=s(` into semantic segmentation maps. Only supports
PyTorch.`),La=c(),vt=r("h2"),Nt=r("a"),Qs=r("span"),$(jo.$$.fragment),un=c(),Zs=r("span"),gn=s("MobileViTImageProcessor"),Ra=c(),Ge=r("div"),$(So.$$.fragment),_n=c(),ea=r("p"),bn=s("Constructs a MobileViT image processor."),vn=c(),qt=r("div"),$(zo.$$.fragment),Tn=c(),ta=r("p"),wn=s("Preprocess an image or batch of images."),$n=c(),At=r("div"),$(Oo.$$.fragment),yn=c(),Do=r("p"),Mn=s("Converts the output of "),Es=r("a"),Vn=s("MobileViTForSemanticSegmentation"),En=s(` into semantic segmentation maps. Only supports
PyTorch.`),Wa=c(),Tt=r("h2"),Lt=r("a"),oa=r("span"),$(No.$$.fragment),In=c(),sa=r("span"),kn=s("MobileViTModel"),Ua=c(),pt=r("div"),$(qo.$$.fragment),Pn=c(),Ao=r("p"),Fn=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Lo=r("a"),xn=s("torch.nn.Module"),Cn=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jn=c(),at=r("div"),$(Ro.$$.fragment),Sn=c(),wt=r("p"),zn=s("The "),Is=r("a"),On=s("MobileViTModel"),Dn=s(" forward method, overrides the "),aa=r("code"),Nn=s("__call__"),qn=s(" special method."),An=c(),$(Rt.$$.fragment),Ln=c(),$(Wt.$$.fragment),Ba=c(),$t=r("h2"),Ut=r("a"),ra=r("span"),$(Wo.$$.fragment),Rn=c(),na=r("span"),Wn=s("MobileViTForImageClassification"),Ha=c(),Ye=r("div"),$(Uo.$$.fragment),Un=c(),ia=r("p"),Bn=s(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Hn=c(),Bo=r("p"),Kn=s("This model is a PyTorch "),Ho=r("a"),Gn=s("torch.nn.Module"),Yn=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jn=c(),rt=r("div"),$(Ko.$$.fragment),Xn=c(),yt=r("p"),Qn=s("The "),ks=r("a"),Zn=s("MobileViTForImageClassification"),ei=s(" forward method, overrides the "),la=r("code"),ti=s("__call__"),oi=s(" special method."),si=c(),$(Bt.$$.fragment),ai=c(),$(Ht.$$.fragment),Ka=c(),Mt=r("h2"),Kt=r("a"),da=r("span"),$(Go.$$.fragment),ri=c(),ca=r("span"),ni=s("MobileViTForSemanticSegmentation"),Ga=c(),Je=r("div"),$(Yo.$$.fragment),ii=c(),ma=r("p"),li=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),di=c(),Jo=r("p"),ci=s("This model is a PyTorch "),Xo=r("a"),mi=s("torch.nn.Module"),pi=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hi=c(),nt=r("div"),$(Qo.$$.fragment),fi=c(),Vt=r("p"),ui=s("The "),Ps=r("a"),gi=s("MobileViTForSemanticSegmentation"),_i=s(" forward method, overrides the "),pa=r("code"),bi=s("__call__"),vi=s(" special method."),Ti=c(),$(Gt.$$.fragment),wi=c(),$(Yt.$$.fragment),Ya=c(),Et=r("h2"),Jt=r("a"),ha=r("span"),$(Zo.$$.fragment),$i=c(),fa=r("span"),yi=s("TFMobileViTModel"),Ja=c(),Re=r("div"),$(es.$$.fragment),Mi=c(),ts=r("p"),Vi=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Fs=r("a"),Ei=s("TFPreTrainedModel"),Ii=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.)`),ki=c(),os=r("p"),Pi=s("This model is also a "),ss=r("a"),Fi=s("tf.keras.Model"),xi=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.`),Ci=c(),$(Xt.$$.fragment),ji=c(),it=r("div"),$(as.$$.fragment),Si=c(),It=r("p"),zi=s("The "),xs=r("a"),Oi=s("TFMobileViTModel"),Di=s(" forward method, overrides the "),ua=r("code"),Ni=s("__call__"),qi=s(" special method."),Ai=c(),$(Qt.$$.fragment),Li=c(),$(Zt.$$.fragment),Xa=c(),kt=r("h2"),eo=r("a"),ga=r("span"),$(rs.$$.fragment),Ri=c(),_a=r("span"),Wi=s("TFMobileViTForImageClassification"),Qa=c(),ue=r("div"),$(ns.$$.fragment),Ui=c(),ba=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.`),Hi=c(),is=r("p"),Ki=s("This model inherits from "),Cs=r("a"),Gi=s("TFPreTrainedModel"),Yi=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.)`),Ji=c(),ls=r("p"),Xi=s("This model is also a "),ds=r("a"),Qi=s("tf.keras.Model"),Zi=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.`),el=c(),$(to.$$.fragment),tl=c(),lt=r("div"),$(cs.$$.fragment),ol=c(),Pt=r("p"),sl=s("The "),js=r("a"),al=s("TFMobileViTForImageClassification"),rl=s(" forward method, overrides the "),va=r("code"),nl=s("__call__"),il=s(" special method."),ll=c(),$(oo.$$.fragment),dl=c(),$(so.$$.fragment),Za=c(),Ft=r("h2"),ao=r("a"),Ta=r("span"),$(ms.$$.fragment),cl=c(),wa=r("span"),ml=s("TFMobileViTForSemanticSegmentation"),er=c(),ge=r("div"),$(ps.$$.fragment),pl=c(),$a=r("p"),hl=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),fl=c(),hs=r("p"),ul=s("This model inherits from "),Ss=r("a"),gl=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.)`),bl=c(),fs=r("p"),vl=s("This model is also a "),us=r("a"),Tl=s("tf.keras.Model"),wl=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.`),$l=c(),$(ro.$$.fragment),yl=c(),dt=r("div"),$(gs.$$.fragment),Ml=c(),xt=r("p"),Vl=s("The "),zs=r("a"),El=s("TFMobileViTForSemanticSegmentation"),Il=s(" forward method, overrides the "),ya=r("code"),kl=s("__call__"),Pl=s(" special method."),Fl=c(),$(no.$$.fragment),xl=c(),$(io.$$.fragment),this.h()},l(o){const b=sc('[data-svelte="svelte-1phssyn"]',document.head);d=n(b,"META",{name:!0,content:!0}),b.forEach(t),T=m(o),g=n(o,"H1",{class:!0});var _s=i(g);u=n(_s,"A",{id:!0,class:!0,href:!0});var Ma=i(u);v=n(Ma,"SPAN",{});var Va=i(v);y(l.$$.fragment,Va),Va.forEach(t),Ma.forEach(t),p=m(_s),F=n(_s,"SPAN",{});var Ea=i(F);ke=a(Ea,"MobileViT"),Ea.forEach(t),_s.forEach(t),_e=m(o),D=n(o,"H2",{class:!0});var bs=i(D);ee=n(bs,"A",{id:!0,class:!0,href:!0});var Ia=i(ee);te=n(Ia,"SPAN",{});var ka=i(te);y(w.$$.fragment,ka),ka.forEach(t),Ia.forEach(t),Pe=m(bs),H=n(bs,"SPAN",{});var Pa=i(H);Fe=a(Pa,"Overview"),Pa.forEach(t),bs.forEach(t),be=m(o),q=n(o,"P",{});var vs=i(q);xe=a(vs,"The MobileViT model was proposed in "),oe=n(vs,"A",{href:!0,rel:!0});var Fa=i(oe);Y=a(Fa,"MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),Fa.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 xa=i(L);je=a(xa,"The abstract from the paper is the following:"),xa.forEach(t),Te=m(o),R=n(o,"P",{});var Ca=i(R);ce=n(Ca,"EM",{});var ja=i(ce);Se=a(ja,"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."),ja.forEach(t),Ca.forEach(t),se=m(o),x=n(o,"P",{});var Sa=i(x);S=a(Sa,"Tips:"),Sa.forEach(t),we=m(o),j=n(o,"UL",{});var Xe=i(j);me=n(Xe,"LI",{});var za=i(me);ae=n(za,"P",{});var or=i(ae);J=a(or,"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(or,"A",{href:!0,rel:!0});var Cl=i(re);ze=a(Cl,"this tutorial"),Cl.forEach(t),z=a(or," for a lightweight introduction."),or.forEach(t),za.forEach(t),Oe=m(Xe),K=n(Xe,"LI",{});var jl=i(K);ne=n(jl,"P",{});var sr=i(ne);De=a(sr,"One can use "),W=n(sr,"A",{href:!0});var Sl=i(W);Ne=a(Sl,"MobileViTImageProcessor"),Sl.forEach(t),qe=a(sr," 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)."),sr.forEach(t),jl.forEach(t),U=m(Xe),pe=n(Xe,"LI",{});var zl=i(pe);A=n(zl,"P",{});var ar=i(A);Ae=a(ar,"The available image classification checkpoints are pre-trained on "),G=n(ar,"A",{href:!0,rel:!0});var Ol=i(G);O=a(Ol,"ImageNet-1k"),Ol.forEach(t),Le=a(ar," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),ar.forEach(t),zl.forEach(t),N=m(Xe),he=n(Xe,"LI",{});var Dl=i(he);X=n(Dl,"P",{});var Os=i(X);_=a(Os,"The segmentation model uses a "),k=n(Os,"A",{href:!0,rel:!0});var Nl=i(k);Qe=a(Nl,"DeepLabV3"),Nl.forEach(t),le=a(Os," head. The available semantic segmentation checkpoints are pre-trained on "),$e=n(Os,"A",{href:!0,rel:!0});var ql=i($e);Ze=a(ql,"PASCAL VOC"),ql.forEach(t),P=a(Os,"."),Os.forEach(t),Dl.forEach(t),et=m(Xe),ye=n(Xe,"LI",{});var rr=i(ye);Me=n(rr,"P",{});var nr=i(Me);tt=a(nr,"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(nr,"A",{href:!0,rel:!0});var Al=i(Ve);B=a(Al,"TensorFlow Lite"),Al.forEach(t),Q=a(nr,"."),nr.forEach(t),ot=m(rr),We=n(rr,"P",{});var Ll=i(We);Z=a(Ll,`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),Ll.forEach(t),rr.forEach(t),Xe.forEach(t),Be=m(o),y(Ee.$$.fragment,o),Ie=m(o),fe=n(o,"P",{});var ir=i(fe);de=a(ir,"The resulting model will be just "),Ue=n(ir,"STRONG",{});var Rl=i(Ue);Cr=a(Rl,"about an MB"),Rl.forEach(t),jr=a(ir,` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),ir.forEach(t),Oa=m(o),st=n(o,"P",{});var lo=i(st);Sr=a(lo,"This model was contributed by "),$o=n(lo,"A",{href:!0,rel:!0});var Wl=i($o);zr=a(Wl,"matthijs"),Wl.forEach(t),Or=a(lo,". The TensorFlow version of the model was contributed by "),yo=n(lo,"A",{href:!0,rel:!0});var Ul=i(yo);Dr=a(Ul,"sayakpaul"),Ul.forEach(t),Nr=a(lo,". The original code and weights can be found "),Mo=n(lo,"A",{href:!0,rel:!0});var Bl=i(Mo);qr=a(Bl,"here"),Bl.forEach(t),Ar=a(lo,"."),lo.forEach(t),Da=m(o),ut=n(o,"H2",{class:!0});var lr=i(ut);jt=n(lr,"A",{id:!0,class:!0,href:!0});var Hl=i(jt);Hs=n(Hl,"SPAN",{});var Kl=i(Hs);y(Vo.$$.fragment,Kl),Kl.forEach(t),Hl.forEach(t),Lr=m(lr),Ks=n(lr,"SPAN",{});var Gl=i(Ks);Rr=a(Gl,"MobileViTConfig"),Gl.forEach(t),lr.forEach(t),Na=m(o),He=n(o,"DIV",{class:!0});var co=i(He);y(Eo.$$.fragment,co),Wr=m(co),gt=n(co,"P",{});var Ds=i(gt);Ur=a(Ds,"This is the configuration class to store the configuration of a "),$s=n(Ds,"A",{href:!0});var Yl=i($s);Br=a(Yl,"MobileViTModel"),Yl.forEach(t),Hr=a(Ds,`. 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
`),Io=n(Ds,"A",{href:!0,rel:!0});var Jl=i(Io);Kr=a(Jl,"apple/mobilevit-small"),Jl.forEach(t),Gr=a(Ds," architecture."),Ds.forEach(t),Yr=m(co),_t=n(co,"P",{});var Ns=i(_t);Jr=a(Ns,"Configuration objects inherit from "),ys=n(Ns,"A",{href:!0});var Xl=i(ys);Xr=a(Xl,"PretrainedConfig"),Xl.forEach(t),Qr=a(Ns,` and can be used to control the model outputs. Read the
documentation from `),Ms=n(Ns,"A",{href:!0});var Ql=i(Ms);Zr=a(Ql,"PretrainedConfig"),Ql.forEach(t),en=a(Ns," for more information."),Ns.forEach(t),tn=m(co),y(St.$$.fragment,co),co.forEach(t),qa=m(o),bt=n(o,"H2",{class:!0});var dr=i(bt);zt=n(dr,"A",{id:!0,class:!0,href:!0});var Zl=i(zt);Gs=n(Zl,"SPAN",{});var ed=i(Gs);y(ko.$$.fragment,ed),ed.forEach(t),Zl.forEach(t),on=m(dr),Ys=n(dr,"SPAN",{});var td=i(Ys);sn=a(td,"MobileViTFeatureExtractor"),td.forEach(t),dr.forEach(t),Aa=m(o),Ke=n(o,"DIV",{class:!0});var mo=i(Ke);y(Po.$$.fragment,mo),an=m(mo),Js=n(mo,"P",{});var od=i(Js);rn=a(od,"Constructs a MobileViT image processor."),od.forEach(t),nn=m(mo),Ot=n(mo,"DIV",{class:!0});var cr=i(Ot);y(Fo.$$.fragment,cr),ln=m(cr),Xs=n(cr,"P",{});var sd=i(Xs);dn=a(sd,"Preprocess an image or a batch of images."),sd.forEach(t),cr.forEach(t),cn=m(mo),Dt=n(mo,"DIV",{class:!0});var mr=i(Dt);y(xo.$$.fragment,mr),mn=m(mr),Co=n(mr,"P",{});var pr=i(Co);pn=a(pr,"Converts the output of "),Vs=n(pr,"A",{href:!0});var ad=i(Vs);hn=a(ad,"MobileViTForSemanticSegmentation"),ad.forEach(t),fn=a(pr,` into semantic segmentation maps. Only supports
PyTorch.`),pr.forEach(t),mr.forEach(t),mo.forEach(t),La=m(o),vt=n(o,"H2",{class:!0});var hr=i(vt);Nt=n(hr,"A",{id:!0,class:!0,href:!0});var rd=i(Nt);Qs=n(rd,"SPAN",{});var nd=i(Qs);y(jo.$$.fragment,nd),nd.forEach(t),rd.forEach(t),un=m(hr),Zs=n(hr,"SPAN",{});var id=i(Zs);gn=a(id,"MobileViTImageProcessor"),id.forEach(t),hr.forEach(t),Ra=m(o),Ge=n(o,"DIV",{class:!0});var po=i(Ge);y(So.$$.fragment,po),_n=m(po),ea=n(po,"P",{});var ld=i(ea);bn=a(ld,"Constructs a MobileViT image processor."),ld.forEach(t),vn=m(po),qt=n(po,"DIV",{class:!0});var fr=i(qt);y(zo.$$.fragment,fr),Tn=m(fr),ta=n(fr,"P",{});var dd=i(ta);wn=a(dd,"Preprocess an image or batch of images."),dd.forEach(t),fr.forEach(t),$n=m(po),At=n(po,"DIV",{class:!0});var ur=i(At);y(Oo.$$.fragment,ur),yn=m(ur),Do=n(ur,"P",{});var gr=i(Do);Mn=a(gr,"Converts the output of "),Es=n(gr,"A",{href:!0});var cd=i(Es);Vn=a(cd,"MobileViTForSemanticSegmentation"),cd.forEach(t),En=a(gr,` into semantic segmentation maps. Only supports
PyTorch.`),gr.forEach(t),ur.forEach(t),po.forEach(t),Wa=m(o),Tt=n(o,"H2",{class:!0});var _r=i(Tt);Lt=n(_r,"A",{id:!0,class:!0,href:!0});var md=i(Lt);oa=n(md,"SPAN",{});var pd=i(oa);y(No.$$.fragment,pd),pd.forEach(t),md.forEach(t),In=m(_r),sa=n(_r,"SPAN",{});var hd=i(sa);kn=a(hd,"MobileViTModel"),hd.forEach(t),_r.forEach(t),Ua=m(o),pt=n(o,"DIV",{class:!0});var qs=i(pt);y(qo.$$.fragment,qs),Pn=m(qs),Ao=n(qs,"P",{});var br=i(Ao);Fn=a(br,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Lo=n(br,"A",{href:!0,rel:!0});var fd=i(Lo);xn=a(fd,"torch.nn.Module"),fd.forEach(t),Cn=a(br,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),br.forEach(t),jn=m(qs),at=n(qs,"DIV",{class:!0});var ho=i(at);y(Ro.$$.fragment,ho),Sn=m(ho),wt=n(ho,"P",{});var As=i(wt);zn=a(As,"The "),Is=n(As,"A",{href:!0});var ud=i(Is);On=a(ud,"MobileViTModel"),ud.forEach(t),Dn=a(As," forward method, overrides the "),aa=n(As,"CODE",{});var gd=i(aa);Nn=a(gd,"__call__"),gd.forEach(t),qn=a(As," special method."),As.forEach(t),An=m(ho),y(Rt.$$.fragment,ho),Ln=m(ho),y(Wt.$$.fragment,ho),ho.forEach(t),qs.forEach(t),Ba=m(o),$t=n(o,"H2",{class:!0});var vr=i($t);Ut=n(vr,"A",{id:!0,class:!0,href:!0});var _d=i(Ut);ra=n(_d,"SPAN",{});var bd=i(ra);y(Wo.$$.fragment,bd),bd.forEach(t),_d.forEach(t),Rn=m(vr),na=n(vr,"SPAN",{});var vd=i(na);Wn=a(vd,"MobileViTForImageClassification"),vd.forEach(t),vr.forEach(t),Ha=m(o),Ye=n(o,"DIV",{class:!0});var fo=i(Ye);y(Uo.$$.fragment,fo),Un=m(fo),ia=n(fo,"P",{});var Td=i(ia);Bn=a(Td,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Td.forEach(t),Hn=m(fo),Bo=n(fo,"P",{});var Tr=i(Bo);Kn=a(Tr,"This model is a PyTorch "),Ho=n(Tr,"A",{href:!0,rel:!0});var wd=i(Ho);Gn=a(wd,"torch.nn.Module"),wd.forEach(t),Yn=a(Tr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tr.forEach(t),Jn=m(fo),rt=n(fo,"DIV",{class:!0});var uo=i(rt);y(Ko.$$.fragment,uo),Xn=m(uo),yt=n(uo,"P",{});var Ls=i(yt);Qn=a(Ls,"The "),ks=n(Ls,"A",{href:!0});var $d=i(ks);Zn=a($d,"MobileViTForImageClassification"),$d.forEach(t),ei=a(Ls," forward method, overrides the "),la=n(Ls,"CODE",{});var yd=i(la);ti=a(yd,"__call__"),yd.forEach(t),oi=a(Ls," special method."),Ls.forEach(t),si=m(uo),y(Bt.$$.fragment,uo),ai=m(uo),y(Ht.$$.fragment,uo),uo.forEach(t),fo.forEach(t),Ka=m(o),Mt=n(o,"H2",{class:!0});var wr=i(Mt);Kt=n(wr,"A",{id:!0,class:!0,href:!0});var Md=i(Kt);da=n(Md,"SPAN",{});var Vd=i(da);y(Go.$$.fragment,Vd),Vd.forEach(t),Md.forEach(t),ri=m(wr),ca=n(wr,"SPAN",{});var Ed=i(ca);ni=a(Ed,"MobileViTForSemanticSegmentation"),Ed.forEach(t),wr.forEach(t),Ga=m(o),Je=n(o,"DIV",{class:!0});var go=i(Je);y(Yo.$$.fragment,go),ii=m(go),ma=n(go,"P",{});var Id=i(ma);li=a(Id,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Id.forEach(t),di=m(go),Jo=n(go,"P",{});var $r=i(Jo);ci=a($r,"This model is a PyTorch "),Xo=n($r,"A",{href:!0,rel:!0});var kd=i(Xo);mi=a(kd,"torch.nn.Module"),kd.forEach(t),pi=a($r,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$r.forEach(t),hi=m(go),nt=n(go,"DIV",{class:!0});var _o=i(nt);y(Qo.$$.fragment,_o),fi=m(_o),Vt=n(_o,"P",{});var Rs=i(Vt);ui=a(Rs,"The "),Ps=n(Rs,"A",{href:!0});var Pd=i(Ps);gi=a(Pd,"MobileViTForSemanticSegmentation"),Pd.forEach(t),_i=a(Rs," forward method, overrides the "),pa=n(Rs,"CODE",{});var Fd=i(pa);bi=a(Fd,"__call__"),Fd.forEach(t),vi=a(Rs," special method."),Rs.forEach(t),Ti=m(_o),y(Gt.$$.fragment,_o),wi=m(_o),y(Yt.$$.fragment,_o),_o.forEach(t),go.forEach(t),Ya=m(o),Et=n(o,"H2",{class:!0});var yr=i(Et);Jt=n(yr,"A",{id:!0,class:!0,href:!0});var xd=i(Jt);ha=n(xd,"SPAN",{});var Cd=i(ha);y(Zo.$$.fragment,Cd),Cd.forEach(t),xd.forEach(t),$i=m(yr),fa=n(yr,"SPAN",{});var jd=i(fa);yi=a(jd,"TFMobileViTModel"),jd.forEach(t),yr.forEach(t),Ja=m(o),Re=n(o,"DIV",{class:!0});var ft=i(Re);y(es.$$.fragment,ft),Mi=m(ft),ts=n(ft,"P",{});var Mr=i(ts);Vi=a(Mr,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),Fs=n(Mr,"A",{href:!0});var Sd=i(Fs);Ei=a(Sd,"TFPreTrainedModel"),Sd.forEach(t),Ii=a(Mr,`. 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.)`),Mr.forEach(t),ki=m(ft),os=n(ft,"P",{});var Vr=i(os);Pi=a(Vr,"This model is also a "),ss=n(Vr,"A",{href:!0,rel:!0});var zd=i(ss);Fi=a(zd,"tf.keras.Model"),zd.forEach(t),xi=a(Vr,` 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.`),Vr.forEach(t),Ci=m(ft),y(Xt.$$.fragment,ft),ji=m(ft),it=n(ft,"DIV",{class:!0});var bo=i(it);y(as.$$.fragment,bo),Si=m(bo),It=n(bo,"P",{});var Ws=i(It);zi=a(Ws,"The "),xs=n(Ws,"A",{href:!0});var Od=i(xs);Oi=a(Od,"TFMobileViTModel"),Od.forEach(t),Di=a(Ws," forward method, overrides the "),ua=n(Ws,"CODE",{});var Dd=i(ua);Ni=a(Dd,"__call__"),Dd.forEach(t),qi=a(Ws," special method."),Ws.forEach(t),Ai=m(bo),y(Qt.$$.fragment,bo),Li=m(bo),y(Zt.$$.fragment,bo),bo.forEach(t),ft.forEach(t),Xa=m(o),kt=n(o,"H2",{class:!0});var Er=i(kt);eo=n(Er,"A",{id:!0,class:!0,href:!0});var Nd=i(eo);ga=n(Nd,"SPAN",{});var qd=i(ga);y(rs.$$.fragment,qd),qd.forEach(t),Nd.forEach(t),Ri=m(Er),_a=n(Er,"SPAN",{});var Ad=i(_a);Wi=a(Ad,"TFMobileViTForImageClassification"),Ad.forEach(t),Er.forEach(t),Qa=m(o),ue=n(o,"DIV",{class:!0});var ct=i(ue);y(ns.$$.fragment,ct),Ui=m(ct),ba=n(ct,"P",{});var Ld=i(ba);Bi=a(Ld,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ld.forEach(t),Hi=m(ct),is=n(ct,"P",{});var Ir=i(is);Ki=a(Ir,"This model inherits from "),Cs=n(Ir,"A",{href:!0});var Rd=i(Cs);Gi=a(Rd,"TFPreTrainedModel"),Rd.forEach(t),Yi=a(Ir,`. 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.)`),Ir.forEach(t),Ji=m(ct),ls=n(ct,"P",{});var kr=i(ls);Xi=a(kr,"This model is also a "),ds=n(kr,"A",{href:!0,rel:!0});var Wd=i(ds);Qi=a(Wd,"tf.keras.Model"),Wd.forEach(t),Zi=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),el=m(ct),y(to.$$.fragment,ct),tl=m(ct),lt=n(ct,"DIV",{class:!0});var vo=i(lt);y(cs.$$.fragment,vo),ol=m(vo),Pt=n(vo,"P",{});var Us=i(Pt);sl=a(Us,"The "),js=n(Us,"A",{href:!0});var Ud=i(js);al=a(Ud,"TFMobileViTForImageClassification"),Ud.forEach(t),rl=a(Us," forward method, overrides the "),va=n(Us,"CODE",{});var Bd=i(va);nl=a(Bd,"__call__"),Bd.forEach(t),il=a(Us," special method."),Us.forEach(t),ll=m(vo),y(oo.$$.fragment,vo),dl=m(vo),y(so.$$.fragment,vo),vo.forEach(t),ct.forEach(t),Za=m(o),Ft=n(o,"H2",{class:!0});var Pr=i(Ft);ao=n(Pr,"A",{id:!0,class:!0,href:!0});var Hd=i(ao);Ta=n(Hd,"SPAN",{});var Kd=i(Ta);y(ms.$$.fragment,Kd),Kd.forEach(t),Hd.forEach(t),cl=m(Pr),wa=n(Pr,"SPAN",{});var Gd=i(wa);ml=a(Gd,"TFMobileViTForSemanticSegmentation"),Gd.forEach(t),Pr.forEach(t),er=m(o),ge=n(o,"DIV",{class:!0});var mt=i(ge);y(ps.$$.fragment,mt),pl=m(mt),$a=n(mt,"P",{});var Yd=i($a);hl=a(Yd,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Yd.forEach(t),fl=m(mt),hs=n(mt,"P",{});var Fr=i(hs);ul=a(Fr,"This model inherits from "),Ss=n(Fr,"A",{href:!0});var Jd=i(Ss);gl=a(Jd,"TFPreTrainedModel"),Jd.forEach(t),_l=a(Fr,`. 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.)`),Fr.forEach(t),bl=m(mt),fs=n(mt,"P",{});var xr=i(fs);vl=a(xr,"This model is also a "),us=n(xr,"A",{href:!0,rel:!0});var Xd=i(us);Tl=a(Xd,"tf.keras.Model"),Xd.forEach(t),wl=a(xr,` 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.`),xr.forEach(t),$l=m(mt),y(ro.$$.fragment,mt),yl=m(mt),dt=n(mt,"DIV",{class:!0});var To=i(dt);y(gs.$$.fragment,To),Ml=m(To),xt=n(To,"P",{});var Bs=i(xt);Vl=a(Bs,"The "),zs=n(Bs,"A",{href:!0});var Qd=i(zs);El=a(Qd,"TFMobileViTForSemanticSegmentation"),Qd.forEach(t),Il=a(Bs," forward method, overrides the "),ya=n(Bs,"CODE",{});var Zd=i(ya);kl=a(Zd,"__call__"),Zd.forEach(t),Pl=a(Bs," special method."),Bs.forEach(t),Fl=m(To),y(no.$$.fragment,To),xl=m(To),y(io.$$.fragment,To),To.forEach(t),mt.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify($c)),h(u,"id","mobilevit"),h(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(u,"href","#mobilevit"),h(g,"class","relative group"),h(ee,"id","overview"),h(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"),h(ee,"href","#overview"),h(D,"class","relative group"),h(oe,"href","https://arxiv.org/abs/2110.02178"),h(oe,"rel","nofollow"),h(re,"href","https://keras.io/examples/vision/mobilevit"),h(re,"rel","nofollow"),h(W,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTImageProcessor"),h(G,"href","https://huggingface.co/datasets/imagenet-1k"),h(G,"rel","nofollow"),h(k,"href","https://arxiv.org/abs/1706.05587"),h(k,"rel","nofollow"),h($e,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),h($e,"rel","nofollow"),h(Ve,"href","https://www.tensorflow.org/lite"),h(Ve,"rel","nofollow"),h($o,"href","https://huggingface.co/Matthijs"),h($o,"rel","nofollow"),h(yo,"href","https://huggingface.co/sayakpaul"),h(yo,"rel","nofollow"),h(Mo,"href","https://github.com/apple/ml-cvnets"),h(Mo,"rel","nofollow"),h(jt,"id","transformers.MobileViTConfig"),h(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"),h(jt,"href","#transformers.MobileViTConfig"),h(ut,"class","relative group"),h($s,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTModel"),h(Io,"href","https://huggingface.co/apple/mobilevit-small"),h(Io,"rel","nofollow"),h(ys,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(Ms,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zt,"id","transformers.MobileViTImageProcessor"),h(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"),h(zt,"href","#transformers.MobileViTImageProcessor"),h(bt,"class","relative group"),h(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Vs,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),h(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nt,"id","transformers.MobileViTImageProcessor"),h(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"),h(Nt,"href","#transformers.MobileViTImageProcessor"),h(vt,"class","relative group"),h(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Es,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),h(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Lt,"id","transformers.MobileViTModel"),h(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"),h(Lt,"href","#transformers.MobileViTModel"),h(Tt,"class","relative group"),h(Lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Lo,"rel","nofollow"),h(Is,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTModel"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ut,"id","transformers.MobileViTForImageClassification"),h(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"),h(Ut,"href","#transformers.MobileViTForImageClassification"),h($t,"class","relative group"),h(Ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ho,"rel","nofollow"),h(ks,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTForImageClassification"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Kt,"id","transformers.MobileViTForSemanticSegmentation"),h(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"),h(Kt,"href","#transformers.MobileViTForSemanticSegmentation"),h(Mt,"class","relative group"),h(Xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Xo,"rel","nofollow"),h(Ps,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),h(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Jt,"id","transformers.TFMobileViTModel"),h(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"),h(Jt,"href","#transformers.TFMobileViTModel"),h(Et,"class","relative group"),h(Fs,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(ss,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ss,"rel","nofollow"),h(xs,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.TFMobileViTModel"),h(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(eo,"id","transformers.TFMobileViTForImageClassification"),h(eo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(eo,"href","#transformers.TFMobileViTForImageClassification"),h(kt,"class","relative group"),h(Cs,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(ds,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ds,"rel","nofollow"),h(js,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.TFMobileViTForImageClassification"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ao,"id","transformers.TFMobileViTForSemanticSegmentation"),h(ao,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ao,"href","#transformers.TFMobileViTForSemanticSegmentation"),h(Ft,"class","relative group"),h(Ss,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(us,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(us,"rel","nofollow"),h(zs,"href","/docs/transformers/v4.25.1/en/model_doc/mobilevit#transformers.TFMobileViTForSemanticSegmentation"),h(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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,b){e(document.head,d),f(o,T,b),f(o,g,b),e(g,u),e(u,v),M(l,v,null),e(g,p),e(g,F),e(F,ke),f(o,_e,b),f(o,D,b),e(D,ee),e(ee,te),M(w,te,null),e(D,Pe),e(D,H),e(H,Fe),f(o,be,b),f(o,q,b),e(q,xe),e(q,oe),e(oe,Y),e(q,Ce),f(o,ve,b),f(o,L,b),e(L,je),f(o,Te,b),f(o,R,b),e(R,ce),e(ce,Se),f(o,se,b),f(o,x,b),e(x,S),f(o,we,b),f(o,j,b),e(j,me),e(me,ae),e(ae,J),e(ae,re),e(re,ze),e(ae,z),e(j,Oe),e(j,K),e(K,ne),e(ne,De),e(ne,W),e(W,Ne),e(ne,qe),e(j,U),e(j,pe),e(pe,A),e(A,Ae),e(A,G),e(G,O),e(A,Le),e(j,N),e(j,he),e(he,X),e(X,_),e(X,k),e(k,Qe),e(X,le),e(X,$e),e($e,Ze),e(X,P),e(j,et),e(j,ye),e(ye,Me),e(Me,tt),e(Me,Ve),e(Ve,B),e(Me,Q),e(ye,ot),e(ye,We),e(We,Z),f(o,Be,b),M(Ee,o,b),f(o,Ie,b),f(o,fe,b),e(fe,de),e(fe,Ue),e(Ue,Cr),e(fe,jr),f(o,Oa,b),f(o,st,b),e(st,Sr),e(st,$o),e($o,zr),e(st,Or),e(st,yo),e(yo,Dr),e(st,Nr),e(st,Mo),e(Mo,qr),e(st,Ar),f(o,Da,b),f(o,ut,b),e(ut,jt),e(jt,Hs),M(Vo,Hs,null),e(ut,Lr),e(ut,Ks),e(Ks,Rr),f(o,Na,b),f(o,He,b),M(Eo,He,null),e(He,Wr),e(He,gt),e(gt,Ur),e(gt,$s),e($s,Br),e(gt,Hr),e(gt,Io),e(Io,Kr),e(gt,Gr),e(He,Yr),e(He,_t),e(_t,Jr),e(_t,ys),e(ys,Xr),e(_t,Qr),e(_t,Ms),e(Ms,Zr),e(_t,en),e(He,tn),M(St,He,null),f(o,qa,b),f(o,bt,b),e(bt,zt),e(zt,Gs),M(ko,Gs,null),e(bt,on),e(bt,Ys),e(Ys,sn),f(o,Aa,b),f(o,Ke,b),M(Po,Ke,null),e(Ke,an),e(Ke,Js),e(Js,rn),e(Ke,nn),e(Ke,Ot),M(Fo,Ot,null),e(Ot,ln),e(Ot,Xs),e(Xs,dn),e(Ke,cn),e(Ke,Dt),M(xo,Dt,null),e(Dt,mn),e(Dt,Co),e(Co,pn),e(Co,Vs),e(Vs,hn),e(Co,fn),f(o,La,b),f(o,vt,b),e(vt,Nt),e(Nt,Qs),M(jo,Qs,null),e(vt,un),e(vt,Zs),e(Zs,gn),f(o,Ra,b),f(o,Ge,b),M(So,Ge,null),e(Ge,_n),e(Ge,ea),e(ea,bn),e(Ge,vn),e(Ge,qt),M(zo,qt,null),e(qt,Tn),e(qt,ta),e(ta,wn),e(Ge,$n),e(Ge,At),M(Oo,At,null),e(At,yn),e(At,Do),e(Do,Mn),e(Do,Es),e(Es,Vn),e(Do,En),f(o,Wa,b),f(o,Tt,b),e(Tt,Lt),e(Lt,oa),M(No,oa,null),e(Tt,In),e(Tt,sa),e(sa,kn),f(o,Ua,b),f(o,pt,b),M(qo,pt,null),e(pt,Pn),e(pt,Ao),e(Ao,Fn),e(Ao,Lo),e(Lo,xn),e(Ao,Cn),e(pt,jn),e(pt,at),M(Ro,at,null),e(at,Sn),e(at,wt),e(wt,zn),e(wt,Is),e(Is,On),e(wt,Dn),e(wt,aa),e(aa,Nn),e(wt,qn),e(at,An),M(Rt,at,null),e(at,Ln),M(Wt,at,null),f(o,Ba,b),f(o,$t,b),e($t,Ut),e(Ut,ra),M(Wo,ra,null),e($t,Rn),e($t,na),e(na,Wn),f(o,Ha,b),f(o,Ye,b),M(Uo,Ye,null),e(Ye,Un),e(Ye,ia),e(ia,Bn),e(Ye,Hn),e(Ye,Bo),e(Bo,Kn),e(Bo,Ho),e(Ho,Gn),e(Bo,Yn),e(Ye,Jn),e(Ye,rt),M(Ko,rt,null),e(rt,Xn),e(rt,yt),e(yt,Qn),e(yt,ks),e(ks,Zn),e(yt,ei),e(yt,la),e(la,ti),e(yt,oi),e(rt,si),M(Bt,rt,null),e(rt,ai),M(Ht,rt,null),f(o,Ka,b),f(o,Mt,b),e(Mt,Kt),e(Kt,da),M(Go,da,null),e(Mt,ri),e(Mt,ca),e(ca,ni),f(o,Ga,b),f(o,Je,b),M(Yo,Je,null),e(Je,ii),e(Je,ma),e(ma,li),e(Je,di),e(Je,Jo),e(Jo,ci),e(Jo,Xo),e(Xo,mi),e(Jo,pi),e(Je,hi),e(Je,nt),M(Qo,nt,null),e(nt,fi),e(nt,Vt),e(Vt,ui),e(Vt,Ps),e(Ps,gi),e(Vt,_i),e(Vt,pa),e(pa,bi),e(Vt,vi),e(nt,Ti),M(Gt,nt,null),e(nt,wi),M(Yt,nt,null),f(o,Ya,b),f(o,Et,b),e(Et,Jt),e(Jt,ha),M(Zo,ha,null),e(Et,$i),e(Et,fa),e(fa,yi),f(o,Ja,b),f(o,Re,b),M(es,Re,null),e(Re,Mi),e(Re,ts),e(ts,Vi),e(ts,Fs),e(Fs,Ei),e(ts,Ii),e(Re,ki),e(Re,os),e(os,Pi),e(os,ss),e(ss,Fi),e(os,xi),e(Re,Ci),M(Xt,Re,null),e(Re,ji),e(Re,it),M(as,it,null),e(it,Si),e(it,It),e(It,zi),e(It,xs),e(xs,Oi),e(It,Di),e(It,ua),e(ua,Ni),e(It,qi),e(it,Ai),M(Qt,it,null),e(it,Li),M(Zt,it,null),f(o,Xa,b),f(o,kt,b),e(kt,eo),e(eo,ga),M(rs,ga,null),e(kt,Ri),e(kt,_a),e(_a,Wi),f(o,Qa,b),f(o,ue,b),M(ns,ue,null),e(ue,Ui),e(ue,ba),e(ba,Bi),e(ue,Hi),e(ue,is),e(is,Ki),e(is,Cs),e(Cs,Gi),e(is,Yi),e(ue,Ji),e(ue,ls),e(ls,Xi),e(ls,ds),e(ds,Qi),e(ls,Zi),e(ue,el),M(to,ue,null),e(ue,tl),e(ue,lt),M(cs,lt,null),e(lt,ol),e(lt,Pt),e(Pt,sl),e(Pt,js),e(js,al),e(Pt,rl),e(Pt,va),e(va,nl),e(Pt,il),e(lt,ll),M(oo,lt,null),e(lt,dl),M(so,lt,null),f(o,Za,b),f(o,Ft,b),e(Ft,ao),e(ao,Ta),M(ms,Ta,null),e(Ft,cl),e(Ft,wa),e(wa,ml),f(o,er,b),f(o,ge,b),M(ps,ge,null),e(ge,pl),e(ge,$a),e($a,hl),e(ge,fl),e(ge,hs),e(hs,ul),e(hs,Ss),e(Ss,gl),e(hs,_l),e(ge,bl),e(ge,fs),e(fs,vl),e(fs,us),e(us,Tl),e(fs,wl),e(ge,$l),M(ro,ge,null),e(ge,yl),e(ge,dt),M(gs,dt,null),e(dt,Ml),e(dt,xt),e(xt,Vl),e(xt,zs),e(zs,El),e(xt,Il),e(xt,ya),e(ya,kl),e(xt,Pl),e(dt,Fl),M(no,dt,null),e(dt,xl),M(io,dt,null),tr=!0},p(o,[b]){const _s={};b&2&&(_s.$$scope={dirty:b,ctx:o}),St.$set(_s);const Ma={};b&2&&(Ma.$$scope={dirty:b,ctx:o}),Rt.$set(Ma);const Va={};b&2&&(Va.$$scope={dirty:b,ctx:o}),Wt.$set(Va);const Ea={};b&2&&(Ea.$$scope={dirty:b,ctx:o}),Bt.$set(Ea);const bs={};b&2&&(bs.$$scope={dirty:b,ctx:o}),Ht.$set(bs);const Ia={};b&2&&(Ia.$$scope={dirty:b,ctx:o}),Gt.$set(Ia);const ka={};b&2&&(ka.$$scope={dirty:b,ctx:o}),Yt.$set(ka);const Pa={};b&2&&(Pa.$$scope={dirty:b,ctx:o}),Xt.$set(Pa);const vs={};b&2&&(vs.$$scope={dirty:b,ctx:o}),Qt.$set(vs);const Fa={};b&2&&(Fa.$$scope={dirty:b,ctx:o}),Zt.$set(Fa);const xa={};b&2&&(xa.$$scope={dirty:b,ctx:o}),to.$set(xa);const Ca={};b&2&&(Ca.$$scope={dirty:b,ctx:o}),oo.$set(Ca);const ja={};b&2&&(ja.$$scope={dirty:b,ctx:o}),so.$set(ja);const Sa={};b&2&&(Sa.$$scope={dirty:b,ctx:o}),ro.$set(Sa);const Xe={};b&2&&(Xe.$$scope={dirty:b,ctx:o}),no.$set(Xe);const za={};b&2&&(za.$$scope={dirty:b,ctx:o}),io.$set(za)},i(o){tr||(V(l.$$.fragment,o),V(w.$$.fragment,o),V(Ee.$$.fragment,o),V(Vo.$$.fragment,o),V(Eo.$$.fragment,o),V(St.$$.fragment,o),V(ko.$$.fragment,o),V(Po.$$.fragment,o),V(Fo.$$.fragment,o),V(xo.$$.fragment,o),V(jo.$$.fragment,o),V(So.$$.fragment,o),V(zo.$$.fragment,o),V(Oo.$$.fragment,o),V(No.$$.fragment,o),V(qo.$$.fragment,o),V(Ro.$$.fragment,o),V(Rt.$$.fragment,o),V(Wt.$$.fragment,o),V(Wo.$$.fragment,o),V(Uo.$$.fragment,o),V(Ko.$$.fragment,o),V(Bt.$$.fragment,o),V(Ht.$$.fragment,o),V(Go.$$.fragment,o),V(Yo.$$.fragment,o),V(Qo.$$.fragment,o),V(Gt.$$.fragment,o),V(Yt.$$.fragment,o),V(Zo.$$.fragment,o),V(es.$$.fragment,o),V(Xt.$$.fragment,o),V(as.$$.fragment,o),V(Qt.$$.fragment,o),V(Zt.$$.fragment,o),V(rs.$$.fragment,o),V(ns.$$.fragment,o),V(to.$$.fragment,o),V(cs.$$.fragment,o),V(oo.$$.fragment,o),V(so.$$.fragment,o),V(ms.$$.fragment,o),V(ps.$$.fragment,o),V(ro.$$.fragment,o),V(gs.$$.fragment,o),V(no.$$.fragment,o),V(io.$$.fragment,o),tr=!0)},o(o){E(l.$$.fragment,o),E(w.$$.fragment,o),E(Ee.$$.fragment,o),E(Vo.$$.fragment,o),E(Eo.$$.fragment,o),E(St.$$.fragment,o),E(ko.$$.fragment,o),E(Po.$$.fragment,o),E(Fo.$$.fragment,o),E(xo.$$.fragment,o),E(jo.$$.fragment,o),E(So.$$.fragment,o),E(zo.$$.fragment,o),E(Oo.$$.fragment,o),E(No.$$.fragment,o),E(qo.$$.fragment,o),E(Ro.$$.fragment,o),E(Rt.$$.fragment,o),E(Wt.$$.fragment,o),E(Wo.$$.fragment,o),E(Uo.$$.fragment,o),E(Ko.$$.fragment,o),E(Bt.$$.fragment,o),E(Ht.$$.fragment,o),E(Go.$$.fragment,o),E(Yo.$$.fragment,o),E(Qo.$$.fragment,o),E(Gt.$$.fragment,o),E(Yt.$$.fragment,o),E(Zo.$$.fragment,o),E(es.$$.fragment,o),E(Xt.$$.fragment,o),E(as.$$.fragment,o),E(Qt.$$.fragment,o),E(Zt.$$.fragment,o),E(rs.$$.fragment,o),E(ns.$$.fragment,o),E(to.$$.fragment,o),E(cs.$$.fragment,o),E(oo.$$.fragment,o),E(so.$$.fragment,o),E(ms.$$.fragment,o),E(ps.$$.fragment,o),E(ro.$$.fragment,o),E(gs.$$.fragment,o),E(no.$$.fragment,o),E(io.$$.fragment,o),tr=!1},d(o){t(d),o&&t(T),o&&t(g),I(l),o&&t(_e),o&&t(D),I(w),o&&t(be),o&&t(q),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(Be),I(Ee,o),o&&t(Ie),o&&t(fe),o&&t(Oa),o&&t(st),o&&t(Da),o&&t(ut),I(Vo),o&&t(Na),o&&t(He),I(Eo),I(St),o&&t(qa),o&&t(bt),I(ko),o&&t(Aa),o&&t(Ke),I(Po),I(Fo),I(xo),o&&t(La),o&&t(vt),I(jo),o&&t(Ra),o&&t(Ge),I(So),I(zo),I(Oo),o&&t(Wa),o&&t(Tt),I(No),o&&t(Ua),o&&t(pt),I(qo),I(Ro),I(Rt),I(Wt),o&&t(Ba),o&&t($t),I(Wo),o&&t(Ha),o&&t(Ye),I(Uo),I(Ko),I(Bt),I(Ht),o&&t(Ka),o&&t(Mt),I(Go),o&&t(Ga),o&&t(Je),I(Yo),I(Qo),I(Gt),I(Yt),o&&t(Ya),o&&t(Et),I(Zo),o&&t(Ja),o&&t(Re),I(es),I(Xt),I(as),I(Qt),I(Zt),o&&t(Xa),o&&t(kt),I(rs),o&&t(Qa),o&&t(ue),I(ns),I(to),I(cs),I(oo),I(so),o&&t(Za),o&&t(Ft),I(ms),o&&t(er),o&&t(ge),I(ps),I(ro),I(gs),I(no),I(io)}}}const $c={local:"mobilevit",sections:[{local:"overview",title:"Overview"},{local:"transformers.MobileViTConfig",title:"MobileViTConfig"},{local:"transformers.MobileViTImageProcessor",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 yc(C){return ac(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fc extends ec{constructor(d){super();tc(this,d,yc,wc,oc,{})}}export{Fc as default,$c as metadata};
