import{S as op,i as sp,s as ap,e as s,k as c,w as $,t as r,M as rp,c as a,d as t,m as p,a as i,x as y,h as n,b as m,G as e,g as f,y as M,q as E,o as V,B as k,v as np,L as Is}from"../../chunks/vendor-hf-doc-builder.js";import{T as St}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Mo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Fs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ip}from"../../chunks/PipelineTag-hf-doc-builder.js";function lp(C){let d,T,_,g,v;return g=new Mo({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=s("p"),T=r("Example:"),_=c(),$(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);T=n(h,"Example:"),h.forEach(t),_=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(g,l,h),v=!0},p:Is,i(l){v||(E(g.$$.fragment,l),v=!0)},o(l){V(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(_),k(g,l)}}}function dp(C){let d,T,_,g,v;return{c(){d=s("p"),T=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),v=r(`
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=a(l,"P",{});var h=i(d);T=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(h,"CODE",{});var P=i(_);g=n(P,"Module"),P.forEach(t),v=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function cp(C){let d,T,_,g,v;return g=new Mo({props:{code:`from transformers import AutoImageProcessor, MobileViTModel
import torch
from datasets import load_dataset

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

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

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

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

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">640</span>, <span class="hljs-number">8</span>, <span class="hljs-number">8</span>]`}}),{c(){d=s("p"),T=r("Example:"),_=c(),$(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);T=n(h,"Example:"),h.forEach(t),_=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(g,l,h),v=!0},p:Is,i(l){v||(E(g.$$.fragment,l),v=!0)},o(l){V(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(_),k(g,l)}}}function pp(C){let d,T,_,g,v;return{c(){d=s("p"),T=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),v=r(`
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=a(l,"P",{});var h=i(d);T=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(h,"CODE",{});var P=i(_);g=n(P,"Module"),P.forEach(t),v=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function mp(C){let d,T,_,g,v;return g=new Mo({props:{code:`from transformers import AutoImageProcessor, MobileViTForImageClassification
import torch
from datasets import load_dataset

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

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

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

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

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=s("p"),T=r("Example:"),_=c(),$(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);T=n(h,"Example:"),h.forEach(t),_=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,T),f(l,_,h),M(g,l,h),v=!0},p:Is,i(l){v||(E(g.$$.fragment,l),v=!0)},o(l){V(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(_),k(g,l)}}}function hp(C){let d,T,_,g,v;return{c(){d=s("p"),T=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=r("Module"),v=r(`
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=a(l,"P",{});var h=i(d);T=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(h,"CODE",{});var P=i(_);g=n(P,"Module"),P.forEach(t),v=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,T),e(d,_),e(_,g),e(d,v)},d(l){l&&t(d)}}}function fp(C){let d,T,_,g,v;return g=new Mo({props:{code:`from transformers import AutoImageProcessor, MobileViTForSemanticSegmentation
from PIL import Image
import requests

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

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

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

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

# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

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

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

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

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

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

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

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

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

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

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

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

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

outputs = model(**inputs)

# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFMobileViTForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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


model_ckpt = "apple/mobilevit-xx-small"
model = TFMobileViTForImageClassification.from_pretrained(model_ckpt)

converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [
    tf.lite.OpsSet.TFLITE_BUILTINS,
    tf.lite.OpsSet.SELECT_TF_OPS,
]
tflite_model = converter.convert()
tflite_filename = model_ckpt.split("/")[-1] + ".tflite"
with open(tflite_filename, "wb") as f:
    f.write(tflite_model)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFMobileViTForImageClassification
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf


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

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