import{S as yd,i as Ed,s as Vd,e as r,k as p,w as M,t as s,M as Fd,c as n,d as t,m,a as i,x as y,h as a,b as h,G as e,g,y as E,q as V,o as F,B as x,v as xd,L as hs}from"../../chunks/vendor-hf-doc-builder.js";import{T as ut}from"../../chunks/Tip-hf-doc-builder.js";import{D as Fe}from"../../chunks/Docstring-hf-doc-builder.js";import{C as go}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as gt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ms}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function kd(I){let d,T,u,f,v;return f=new go({props:{code:`from transformers import MobileViTConfig, MobileViTModel

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

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

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileViTConfig, MobileViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a mobilevit-small style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MobileViTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the mobilevit-small style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=r("p"),T=s("Example:"),u=p(),M(f.$$.fragment)},l(l){d=n(l,"P",{});var c=i(d);T=a(c,"Example:"),c.forEach(t),u=m(l),y(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,T),g(l,u,c),E(f,l,c),v=!0},p:hs,i(l){v||(V(f.$$.fragment,l),v=!0)},o(l){F(f.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Cd(I){let d,T;return{c(){d=r("p"),T=s(`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`)},l(u){d=n(u,"P",{});var f=i(d);T=a(f,`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`),f.forEach(t)},m(u,f){g(u,d,f),e(d,T)},d(u){u&&t(d)}}}function jd(I){let d,T,u,f,v;return{c(){d=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r("code"),f=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var c=i(d);T=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(c,"CODE",{});var C=i(u);f=a(C,"Module"),C.forEach(t),v=a(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,T),e(d,u),e(u,f),e(d,v)},d(l){l&&t(d)}}}function Id(I){let d,T,u,f,v;return f=new go({props:{code:`from transformers import MobileViTFeatureExtractor, MobileViTModel
import torch
from datasets import load_dataset

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

feature_extractor = MobileViTFeatureExtractor.from_pretrained("apple/deeplabv3-mobilevit-small")
model = MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-small")

inputs = feature_extractor(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> MobileViTFeatureExtractor, 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>feature_extractor = MobileViTFeatureExtractor.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 = feature_extractor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

feature_extractor = MobileViTFeatureExtractor.from_pretrained("apple/deeplabv3-mobilevit-small")
model = TFMobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-small")

inputs = feature_extractor(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> MobileViTFeatureExtractor, 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>feature_extractor = MobileViTFeatureExtractor.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 = feature_extractor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=r("p"),T=s("Examples:"),u=p(),M(f.$$.fragment)},l(l){d=n(l,"P",{});var c=i(d);T=a(c,"Examples:"),c.forEach(t),u=m(l),y(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,T),g(l,u,c),E(f,l,c),v=!0},p:hs,i(l){v||(V(f.$$.fragment,l),v=!0)},o(l){F(f.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Hd(I){let d,T,u,f,v,l,c,C,xe,ge,A,ee,te,w,ke,H,Ce,_e,L,je,oe,Y,Ie,be,D,Pe,ve,R,de,Se,se,j,S,Te,P,ce,ae,J,re,Oe,O,ze,K,ne,Ae,B,Ne,Le,U,pe,q,qe,G,z,De,N,me,X,_,$,Xe,ie,we,Ze,k,Qe,$e,Me,et,ye,W,Z,tt,Ue,Q,He,Ee,Ve,he,le,We,fr,ur,Ea,ot,gr,_o,_r,br,bo,vr,Tr,vo,wr,$r,Va,_t,Pt,Ls,To,Mr,qs,yr,Fa,Ke,wo,Er,bt,Vr,fs,Fr,xr,$o,kr,Cr,jr,vt,Ir,us,Pr,Sr,gs,Or,zr,Ar,St,xa,Tt,Ot,Ds,Mo,Nr,Rs,Lr,ka,Re,yo,qr,Bs,Dr,Rr,Eo,Br,_s,Ur,Wr,Hr,mt,Vo,Kr,Us,Gr,Yr,zt,Jr,At,Fo,Xr,xo,Zr,bs,Qr,en,Ca,wt,Nt,Ws,ko,tn,Hs,on,ja,pt,Co,sn,jo,an,Io,rn,nn,ln,st,Po,dn,$t,cn,vs,pn,mn,Ks,hn,fn,un,Lt,gn,qt,Ia,Mt,Dt,Gs,So,_n,Ys,bn,Pa,Ge,Oo,vn,Js,Tn,wn,zo,$n,Ao,Mn,yn,En,at,No,Vn,yt,Fn,Ts,xn,kn,Xs,Cn,jn,In,Rt,Pn,Bt,Sa,Et,Ut,Zs,Lo,Sn,Qs,On,Oa,Ye,qo,zn,ea,An,Nn,Do,Ln,Ro,qn,Dn,Rn,rt,Bo,Bn,Vt,Un,ws,Wn,Hn,ta,Kn,Gn,Yn,Wt,Jn,Ht,za,Ft,Kt,oa,Uo,Xn,sa,Zn,Aa,Be,Wo,Qn,Ho,ei,$s,ti,oi,si,Ko,ai,Go,ri,ni,ii,Gt,li,nt,Yo,di,xt,ci,Ms,pi,mi,aa,hi,fi,ui,Yt,gi,Jt,Na,kt,Xt,ra,Jo,_i,na,bi,La,fe,Xo,vi,ia,Ti,wi,Zo,$i,ys,Mi,yi,Ei,Qo,Vi,es,Fi,xi,ki,Zt,Ci,it,ts,ji,Ct,Ii,Es,Pi,Si,la,Oi,zi,Ai,Qt,Ni,eo,qa,jt,to,da,os,Li,ca,qi,Da,ue,ss,Di,pa,Ri,Bi,as,Ui,Vs,Wi,Hi,Ki,rs,Gi,ns,Yi,Ji,Xi,oo,Zi,lt,is,Qi,It,el,Fs,tl,ol,ma,sl,al,rl,so,nl,ao,Ra;return l=new gt({}),w=new gt({}),Ee=new go({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)`}}),To=new gt({}),wo=new Fe({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/vr_19907/src/transformers/models/mobilevit/configuration_mobilevit.py#L46"}}),St=new ms({props:{anchor:"transformers.MobileViTConfig.example",$$slots:{default:[kd]},$$scope:{ctx:I}}}),Mo=new gt({}),yo=new Fe({props:{name:"class transformers.MobileViTFeatureExtractor",anchor:"transformers.MobileViTFeatureExtractor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = 288"},{name:"resample",val:" = <Resampling.BILINEAR: 2>"},{name:"do_center_crop",val:" = True"},{name:"crop_size",val:" = 256"},{name:"do_flip_channel_order",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTFeatureExtractor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.MobileViTFeatureExtractor.size",description:`<strong>size</strong> (<code>int</code> or <code>Tuple(int)</code>, <em>optional</em>, defaults to 288) &#x2014;
Resize the input to the given size. If a tuple is provided, it should be (width, height). If only an
integer is provided, then the input will be resized to match the shorter side. Only has an effect if
<code>do_resize</code> is set to <code>True</code>.`,name:"size"},{anchor:"transformers.MobileViTFeatureExtractor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BILINEAR</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.MobileViTFeatureExtractor.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.`,name:"do_center_crop"},{anchor:"transformers.MobileViTFeatureExtractor.crop_size",description:`<strong>crop_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Desired output size when applying center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.MobileViTFeatureExtractor.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.`,name:"do_flip_channel_order"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L35"}}),Vo=new Fe({props:{name:"__call__",anchor:"transformers.MobileViTFeatureExtractor.__call__",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:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTFeatureExtractor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.MobileViTFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_19907/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>, defaults to <code>&apos;np&apos;</code>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L83",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model, of shape (batch_size, num_channels, height,
width).</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),zt=new ut({props:{warning:!0,$$slots:{default:[Cd]},$$scope:{ctx:I}}}),Fo=new Fe({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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/feature_extraction_mobilevit.py#L161",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>
`}}),ko=new gt({}),Co=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L709"}}),Po=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L746",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/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>
`}}),Lt=new ut({props:{$$slots:{default:[jd]},$$scope:{ctx:I}}}),qt=new ms({props:{anchor:"transformers.MobileViTModel.forward.example",$$slots:{default:[Id]},$$scope:{ctx:I}}}),So=new gt({}),Oo=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L804"}}),No=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L820",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rt=new ut({props:{$$slots:{default:[Pd]},$$scope:{ctx:I}}}),Bt=new ms({props:{anchor:"transformers.MobileViTForImageClassification.forward.example",$$slots:{default:[Sd]},$$scope:{ctx:I}}}),Lo=new gt({}),qo=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L1000"}}),Bo=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_mobilevit.py#L1011",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wt=new ut({props:{$$slots:{default:[Od]},$$scope:{ctx:I}}}),Ht=new ms({props:{anchor:"transformers.MobileViTForSemanticSegmentation.forward.example",$$slots:{default:[zd]},$$scope:{ctx:I}}}),Uo=new gt({}),Wo=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L831"}}),Gt=new ut({props:{$$slots:{default:[Ad]},$$scope:{ctx:I}}}),Yo=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L839",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Yt=new ut({props:{$$slots:{default:[Nd]},$$scope:{ctx:I}}}),Jt=new ms({props:{anchor:"transformers.TFMobileViTModel.call.example",$$slots:{default:[Ld]},$$scope:{ctx:I}}}),Jo=new gt({}),Xo=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L876"}}),Zt=new ut({props:{$$slots:{default:[qd]},$$scope:{ctx:I}}}),ts=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L889",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/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>
`}}),Qt=new ut({props:{$$slots:{default:[Dd]},$$scope:{ctx:I}}}),eo=new ms({props:{anchor:"transformers.TFMobileViTForImageClassification.call.example",$$slots:{default:[Rd]},$$scope:{ctx:I}}}),os=new gt({}),ss=new Fe({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1057"}}),oo=new ut({props:{$$slots:{default:[Bd]},$$scope:{ctx:I}}}),is=new Fe({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/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor">MobileViTFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">MobileViTFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/mobilevit/modeling_tf_mobilevit.py#L1085",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/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>
`}}),so=new ut({props:{$$slots:{default:[Ud]},$$scope:{ctx:I}}}),ao=new ms({props:{anchor:"transformers.TFMobileViTForSemanticSegmentation.call.example",$$slots:{default:[Wd]},$$scope:{ctx:I}}}),{c(){d=r("meta"),T=p(),u=r("h1"),f=r("a"),v=r("span"),M(l.$$.fragment),c=p(),C=r("span"),xe=s("MobileViT"),ge=p(),A=r("h2"),ee=r("a"),te=r("span"),M(w.$$.fragment),ke=p(),H=r("span"),Ce=s("Overview"),_e=p(),L=r("p"),je=s("The MobileViT model was proposed in "),oe=r("a"),Y=s("MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),Ie=s(" by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),be=p(),D=r("p"),Pe=s("The abstract from the paper is the following:"),ve=p(),R=r("p"),de=r("em"),Se=s("Light-weight convolutional neural networks (CNNs) are the de-facto for mobile vision tasks. Their spatial inductive biases allow them to learn representations with fewer parameters across different vision tasks. However, these networks are spatially local. To learn global representations, self-attention-based vision trans-formers (ViTs) have been adopted. Unlike CNNs, ViTs are heavy-weight. In this paper, we ask the following question: is it possible to combine the strengths of CNNs and ViTs to build a light-weight and low latency network for mobile vision tasks? Towards this end, we introduce MobileViT, a light-weight and general-purpose vision transformer for mobile devices. MobileViT presents a different perspective for the global processing of information with transformers, i.e., transformers as convolutions. Our results show that MobileViT significantly outperforms CNN- and ViT-based networks across different tasks and datasets. On the ImageNet-1k dataset, MobileViT achieves top-1 accuracy of 78.4% with about 6 million parameters, which is 3.2% and 6.2% more accurate than MobileNetv3 (CNN-based) and DeIT (ViT-based) for a similar number of parameters. On the MS-COCO object detection task, MobileViT is 5.7% more accurate than MobileNetv3 for a similar number of parameters."),se=p(),j=r("p"),S=s("Tips:"),Te=p(),P=r("ul"),ce=r("li"),ae=r("p"),J=s("MobileViT is more like a CNN than a Transformer model. It does not work on sequence data but on batches of images. Unlike ViT, there are no embeddings. The backbone model outputs a feature map. You can follow "),re=r("a"),Oe=s("this tutorial"),O=s(" for a lightweight introduction."),ze=p(),K=r("li"),ne=r("p"),Ae=s("One can use "),B=r("a"),Ne=s("MobileViTFeatureExtractor"),Le=s(" to prepare images for the model. Note that if you do your own preprocessing, the pretrained checkpoints expect images to be in BGR pixel order (not RGB)."),U=p(),pe=r("li"),q=r("p"),qe=s("The available image classification checkpoints are pre-trained on "),G=r("a"),z=s("ImageNet-1k"),De=s(" (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),N=p(),me=r("li"),X=r("p"),_=s("The segmentation model uses a "),$=r("a"),Xe=s("DeepLabV3"),ie=s(" head. The available semantic segmentation checkpoints are pre-trained on "),we=r("a"),Ze=s("PASCAL VOC"),k=s("."),Qe=p(),$e=r("li"),Me=r("p"),et=s("As the name suggests MobileViT was desgined to be performant and efficient on mobile phones. The TensorFlow versions of the MobileViT models are fully compatible with "),ye=r("a"),W=s("TensorFlow Lite"),Z=s("."),tt=p(),Ue=r("p"),Q=s(`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),He=p(),M(Ee.$$.fragment),Ve=p(),he=r("p"),le=s("The resulting model will be just "),We=r("strong"),fr=s("about an MB"),ur=s(` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Ea=p(),ot=r("p"),gr=s("This model was contributed by "),_o=r("a"),_r=s("matthijs"),br=s(". The TensorFlow version of the model was contributed by "),bo=r("a"),vr=s("sayakpaul"),Tr=s(". The original code and weights can be found "),vo=r("a"),wr=s("here"),$r=s("."),Va=p(),_t=r("h2"),Pt=r("a"),Ls=r("span"),M(To.$$.fragment),Mr=p(),qs=r("span"),yr=s("MobileViTConfig"),Fa=p(),Ke=r("div"),M(wo.$$.fragment),Er=p(),bt=r("p"),Vr=s("This is the configuration class to store the configuration of a "),fs=r("a"),Fr=s("MobileViTModel"),xr=s(`. It is used to instantiate a
MobileViT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileViT
`),$o=r("a"),kr=s("apple/mobilevit-small"),Cr=s(" architecture."),jr=p(),vt=r("p"),Ir=s("Configuration objects inherit from "),us=r("a"),Pr=s("PretrainedConfig"),Sr=s(` and can be used to control the model outputs. Read the
documentation from `),gs=r("a"),Or=s("PretrainedConfig"),zr=s(" for more information."),Ar=p(),M(St.$$.fragment),xa=p(),Tt=r("h2"),Ot=r("a"),Ds=r("span"),M(Mo.$$.fragment),Nr=p(),Rs=r("span"),Lr=s("MobileViTFeatureExtractor"),ka=p(),Re=r("div"),M(yo.$$.fragment),qr=p(),Bs=r("p"),Dr=s("Constructs a MobileViT feature extractor."),Rr=p(),Eo=r("p"),Br=s("This feature extractor inherits from "),_s=r("a"),Ur=s("FeatureExtractionMixin"),Wr=s(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Hr=p(),mt=r("div"),M(Vo.$$.fragment),Kr=p(),Us=r("p"),Gr=s("Main method to prepare for the model one or several image(s)."),Yr=p(),M(zt.$$.fragment),Jr=p(),At=r("div"),M(Fo.$$.fragment),Xr=p(),xo=r("p"),Zr=s("Converts the output of "),bs=r("a"),Qr=s("MobileViTForSemanticSegmentation"),en=s(` into semantic segmentation maps. Only supports
PyTorch.`),Ca=p(),wt=r("h2"),Nt=r("a"),Ws=r("span"),M(ko.$$.fragment),tn=p(),Hs=r("span"),on=s("MobileViTModel"),ja=p(),pt=r("div"),M(Co.$$.fragment),sn=p(),jo=r("p"),an=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Io=r("a"),rn=s("torch.nn.Module"),nn=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ln=p(),st=r("div"),M(Po.$$.fragment),dn=p(),$t=r("p"),cn=s("The "),vs=r("a"),pn=s("MobileViTModel"),mn=s(" forward method, overrides the "),Ks=r("code"),hn=s("__call__"),fn=s(" special method."),un=p(),M(Lt.$$.fragment),gn=p(),M(qt.$$.fragment),Ia=p(),Mt=r("h2"),Dt=r("a"),Gs=r("span"),M(So.$$.fragment),_n=p(),Ys=r("span"),bn=s("MobileViTForImageClassification"),Pa=p(),Ge=r("div"),M(Oo.$$.fragment),vn=p(),Js=r("p"),Tn=s(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),wn=p(),zo=r("p"),$n=s("This model is a PyTorch "),Ao=r("a"),Mn=s("torch.nn.Module"),yn=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),En=p(),at=r("div"),M(No.$$.fragment),Vn=p(),yt=r("p"),Fn=s("The "),Ts=r("a"),xn=s("MobileViTForImageClassification"),kn=s(" forward method, overrides the "),Xs=r("code"),Cn=s("__call__"),jn=s(" special method."),In=p(),M(Rt.$$.fragment),Pn=p(),M(Bt.$$.fragment),Sa=p(),Et=r("h2"),Ut=r("a"),Zs=r("span"),M(Lo.$$.fragment),Sn=p(),Qs=r("span"),On=s("MobileViTForSemanticSegmentation"),Oa=p(),Ye=r("div"),M(qo.$$.fragment),zn=p(),ea=r("p"),An=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Nn=p(),Do=r("p"),Ln=s("This model is a PyTorch "),Ro=r("a"),qn=s("torch.nn.Module"),Dn=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Rn=p(),rt=r("div"),M(Bo.$$.fragment),Bn=p(),Vt=r("p"),Un=s("The "),ws=r("a"),Wn=s("MobileViTForSemanticSegmentation"),Hn=s(" forward method, overrides the "),ta=r("code"),Kn=s("__call__"),Gn=s(" special method."),Yn=p(),M(Wt.$$.fragment),Jn=p(),M(Ht.$$.fragment),za=p(),Ft=r("h2"),Kt=r("a"),oa=r("span"),M(Uo.$$.fragment),Xn=p(),sa=r("span"),Zn=s("TFMobileViTModel"),Aa=p(),Be=r("div"),M(Wo.$$.fragment),Qn=p(),Ho=r("p"),ei=s(`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),$s=r("a"),ti=s("TFPreTrainedModel"),oi=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),si=p(),Ko=r("p"),ai=s("This model is also a "),Go=r("a"),ri=s("tf.keras.Model"),ni=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ii=p(),M(Gt.$$.fragment),li=p(),nt=r("div"),M(Yo.$$.fragment),di=p(),xt=r("p"),ci=s("The "),Ms=r("a"),pi=s("TFMobileViTModel"),mi=s(" forward method, overrides the "),aa=r("code"),hi=s("__call__"),fi=s(" special method."),ui=p(),M(Yt.$$.fragment),gi=p(),M(Jt.$$.fragment),Na=p(),kt=r("h2"),Xt=r("a"),ra=r("span"),M(Jo.$$.fragment),_i=p(),na=r("span"),bi=s("TFMobileViTForImageClassification"),La=p(),fe=r("div"),M(Xo.$$.fragment),vi=p(),ia=r("p"),Ti=s(`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),wi=p(),Zo=r("p"),$i=s("This model inherits from "),ys=r("a"),Mi=s("TFPreTrainedModel"),yi=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ei=p(),Qo=r("p"),Vi=s("This model is also a "),es=r("a"),Fi=s("tf.keras.Model"),xi=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ki=p(),M(Zt.$$.fragment),Ci=p(),it=r("div"),M(ts.$$.fragment),ji=p(),Ct=r("p"),Ii=s("The "),Es=r("a"),Pi=s("TFMobileViTForImageClassification"),Si=s(" forward method, overrides the "),la=r("code"),Oi=s("__call__"),zi=s(" special method."),Ai=p(),M(Qt.$$.fragment),Ni=p(),M(eo.$$.fragment),qa=p(),jt=r("h2"),to=r("a"),da=r("span"),M(os.$$.fragment),Li=p(),ca=r("span"),qi=s("TFMobileViTForSemanticSegmentation"),Da=p(),ue=r("div"),M(ss.$$.fragment),Di=p(),pa=r("p"),Ri=s("MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Bi=p(),as=r("p"),Ui=s("This model inherits from "),Vs=r("a"),Wi=s("TFPreTrainedModel"),Hi=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ki=p(),rs=r("p"),Gi=s("This model is also a "),ns=r("a"),Yi=s("tf.keras.Model"),Ji=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Xi=p(),M(oo.$$.fragment),Zi=p(),lt=r("div"),M(is.$$.fragment),Qi=p(),It=r("p"),el=s("The "),Fs=r("a"),tl=s("TFMobileViTForSemanticSegmentation"),ol=s(" forward method, overrides the "),ma=r("code"),sl=s("__call__"),al=s(" special method."),rl=p(),M(so.$$.fragment),nl=p(),M(ao.$$.fragment),this.h()},l(o){const b=Fd('[data-svelte="svelte-1phssyn"]',document.head);d=n(b,"META",{name:!0,content:!0}),b.forEach(t),T=m(o),u=n(o,"H1",{class:!0});var ls=i(u);f=n(ls,"A",{id:!0,class:!0,href:!0});var ha=i(f);v=n(ha,"SPAN",{});var fa=i(v);y(l.$$.fragment,fa),fa.forEach(t),ha.forEach(t),c=m(ls),C=n(ls,"SPAN",{});var ua=i(C);xe=a(ua,"MobileViT"),ua.forEach(t),ls.forEach(t),ge=m(o),A=n(o,"H2",{class:!0});var ds=i(A);ee=n(ds,"A",{id:!0,class:!0,href:!0});var ga=i(ee);te=n(ga,"SPAN",{});var _a=i(te);y(w.$$.fragment,_a),_a.forEach(t),ga.forEach(t),ke=m(ds),H=n(ds,"SPAN",{});var ba=i(H);Ce=a(ba,"Overview"),ba.forEach(t),ds.forEach(t),_e=m(o),L=n(o,"P",{});var cs=i(L);je=a(cs,"The MobileViT model was proposed in "),oe=n(cs,"A",{href:!0,rel:!0});var va=i(oe);Y=a(va,"MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer"),va.forEach(t),Ie=a(cs," by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers."),cs.forEach(t),be=m(o),D=n(o,"P",{});var Ta=i(D);Pe=a(Ta,"The abstract from the paper is the following:"),Ta.forEach(t),ve=m(o),R=n(o,"P",{});var wa=i(R);de=n(wa,"EM",{});var $a=i(de);Se=a($a,"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."),$a.forEach(t),wa.forEach(t),se=m(o),j=n(o,"P",{});var Ma=i(j);S=a(Ma,"Tips:"),Ma.forEach(t),Te=m(o),P=n(o,"UL",{});var Je=i(P);ce=n(Je,"LI",{});var ya=i(ce);ae=n(ya,"P",{});var ps=i(ae);J=a(ps,"MobileViT is more like a CNN than a Transformer model. It does not work on sequence data but on batches of images. Unlike ViT, there are no embeddings. The backbone model outputs a feature map. You can follow "),re=n(ps,"A",{href:!0,rel:!0});var il=i(re);Oe=a(il,"this tutorial"),il.forEach(t),O=a(ps," for a lightweight introduction."),ps.forEach(t),ya.forEach(t),ze=m(Je),K=n(Je,"LI",{});var ll=i(K);ne=n(ll,"P",{});var Ba=i(ne);Ae=a(Ba,"One can use "),B=n(Ba,"A",{href:!0});var dl=i(B);Ne=a(dl,"MobileViTFeatureExtractor"),dl.forEach(t),Le=a(Ba," 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)."),Ba.forEach(t),ll.forEach(t),U=m(Je),pe=n(Je,"LI",{});var cl=i(pe);q=n(cl,"P",{});var Ua=i(q);qe=a(Ua,"The available image classification checkpoints are pre-trained on "),G=n(Ua,"A",{href:!0,rel:!0});var pl=i(G);z=a(pl,"ImageNet-1k"),pl.forEach(t),De=a(Ua," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),Ua.forEach(t),cl.forEach(t),N=m(Je),me=n(Je,"LI",{});var ml=i(me);X=n(ml,"P",{});var xs=i(X);_=a(xs,"The segmentation model uses a "),$=n(xs,"A",{href:!0,rel:!0});var hl=i($);Xe=a(hl,"DeepLabV3"),hl.forEach(t),ie=a(xs," head. The available semantic segmentation checkpoints are pre-trained on "),we=n(xs,"A",{href:!0,rel:!0});var fl=i(we);Ze=a(fl,"PASCAL VOC"),fl.forEach(t),k=a(xs,"."),xs.forEach(t),ml.forEach(t),Qe=m(Je),$e=n(Je,"LI",{});var Wa=i($e);Me=n(Wa,"P",{});var Ha=i(Me);et=a(Ha,"As the name suggests MobileViT was desgined to be performant and efficient on mobile phones. The TensorFlow versions of the MobileViT models are fully compatible with "),ye=n(Ha,"A",{href:!0,rel:!0});var ul=i(ye);W=a(ul,"TensorFlow Lite"),ul.forEach(t),Z=a(Ha,"."),Ha.forEach(t),tt=m(Wa),Ue=n(Wa,"P",{});var gl=i(Ue);Q=a(gl,`You can use the following code to convert a MobileViT checkpoint (be it image classification or semantic segmentation) to generate a
TensorFlow Lite model:`),gl.forEach(t),Wa.forEach(t),Je.forEach(t),He=m(o),y(Ee.$$.fragment,o),Ve=m(o),he=n(o,"P",{});var Ka=i(he);le=a(Ka,"The resulting model will be just "),We=n(Ka,"STRONG",{});var _l=i(We);fr=a(_l,"about an MB"),_l.forEach(t),ur=a(Ka,` making it a good fit for mobile applications where resources and network
bandwidth can be constrained.`),Ka.forEach(t),Ea=m(o),ot=n(o,"P",{});var ro=i(ot);gr=a(ro,"This model was contributed by "),_o=n(ro,"A",{href:!0,rel:!0});var bl=i(_o);_r=a(bl,"matthijs"),bl.forEach(t),br=a(ro,". The TensorFlow version of the model was contributed by "),bo=n(ro,"A",{href:!0,rel:!0});var vl=i(bo);vr=a(vl,"sayakpaul"),vl.forEach(t),Tr=a(ro,". The original code and weights can be found "),vo=n(ro,"A",{href:!0,rel:!0});var Tl=i(vo);wr=a(Tl,"here"),Tl.forEach(t),$r=a(ro,"."),ro.forEach(t),Va=m(o),_t=n(o,"H2",{class:!0});var Ga=i(_t);Pt=n(Ga,"A",{id:!0,class:!0,href:!0});var wl=i(Pt);Ls=n(wl,"SPAN",{});var $l=i(Ls);y(To.$$.fragment,$l),$l.forEach(t),wl.forEach(t),Mr=m(Ga),qs=n(Ga,"SPAN",{});var Ml=i(qs);yr=a(Ml,"MobileViTConfig"),Ml.forEach(t),Ga.forEach(t),Fa=m(o),Ke=n(o,"DIV",{class:!0});var no=i(Ke);y(wo.$$.fragment,no),Er=m(no),bt=n(no,"P",{});var ks=i(bt);Vr=a(ks,"This is the configuration class to store the configuration of a "),fs=n(ks,"A",{href:!0});var yl=i(fs);Fr=a(yl,"MobileViTModel"),yl.forEach(t),xr=a(ks,`. It is used to instantiate a
MobileViT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileViT
`),$o=n(ks,"A",{href:!0,rel:!0});var El=i($o);kr=a(El,"apple/mobilevit-small"),El.forEach(t),Cr=a(ks," architecture."),ks.forEach(t),jr=m(no),vt=n(no,"P",{});var Cs=i(vt);Ir=a(Cs,"Configuration objects inherit from "),us=n(Cs,"A",{href:!0});var Vl=i(us);Pr=a(Vl,"PretrainedConfig"),Vl.forEach(t),Sr=a(Cs,` and can be used to control the model outputs. Read the
documentation from `),gs=n(Cs,"A",{href:!0});var Fl=i(gs);Or=a(Fl,"PretrainedConfig"),Fl.forEach(t),zr=a(Cs," for more information."),Cs.forEach(t),Ar=m(no),y(St.$$.fragment,no),no.forEach(t),xa=m(o),Tt=n(o,"H2",{class:!0});var Ya=i(Tt);Ot=n(Ya,"A",{id:!0,class:!0,href:!0});var xl=i(Ot);Ds=n(xl,"SPAN",{});var kl=i(Ds);y(Mo.$$.fragment,kl),kl.forEach(t),xl.forEach(t),Nr=m(Ya),Rs=n(Ya,"SPAN",{});var Cl=i(Rs);Lr=a(Cl,"MobileViTFeatureExtractor"),Cl.forEach(t),Ya.forEach(t),ka=m(o),Re=n(o,"DIV",{class:!0});var ht=i(Re);y(yo.$$.fragment,ht),qr=m(ht),Bs=n(ht,"P",{});var jl=i(Bs);Dr=a(jl,"Constructs a MobileViT feature extractor."),jl.forEach(t),Rr=m(ht),Eo=n(ht,"P",{});var Ja=i(Eo);Br=a(Ja,"This feature extractor inherits from "),_s=n(Ja,"A",{href:!0});var Il=i(_s);Ur=a(Il,"FeatureExtractionMixin"),Il.forEach(t),Wr=a(Ja,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Ja.forEach(t),Hr=m(ht),mt=n(ht,"DIV",{class:!0});var js=i(mt);y(Vo.$$.fragment,js),Kr=m(js),Us=n(js,"P",{});var Pl=i(Us);Gr=a(Pl,"Main method to prepare for the model one or several image(s)."),Pl.forEach(t),Yr=m(js),y(zt.$$.fragment,js),js.forEach(t),Jr=m(ht),At=n(ht,"DIV",{class:!0});var Xa=i(At);y(Fo.$$.fragment,Xa),Xr=m(Xa),xo=n(Xa,"P",{});var Za=i(xo);Zr=a(Za,"Converts the output of "),bs=n(Za,"A",{href:!0});var Sl=i(bs);Qr=a(Sl,"MobileViTForSemanticSegmentation"),Sl.forEach(t),en=a(Za,` into semantic segmentation maps. Only supports
PyTorch.`),Za.forEach(t),Xa.forEach(t),ht.forEach(t),Ca=m(o),wt=n(o,"H2",{class:!0});var Qa=i(wt);Nt=n(Qa,"A",{id:!0,class:!0,href:!0});var Ol=i(Nt);Ws=n(Ol,"SPAN",{});var zl=i(Ws);y(ko.$$.fragment,zl),zl.forEach(t),Ol.forEach(t),tn=m(Qa),Hs=n(Qa,"SPAN",{});var Al=i(Hs);on=a(Al,"MobileViTModel"),Al.forEach(t),Qa.forEach(t),ja=m(o),pt=n(o,"DIV",{class:!0});var Is=i(pt);y(Co.$$.fragment,Is),sn=m(Is),jo=n(Is,"P",{});var er=i(jo);an=a(er,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Io=n(er,"A",{href:!0,rel:!0});var Nl=i(Io);rn=a(Nl,"torch.nn.Module"),Nl.forEach(t),nn=a(er,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),er.forEach(t),ln=m(Is),st=n(Is,"DIV",{class:!0});var io=i(st);y(Po.$$.fragment,io),dn=m(io),$t=n(io,"P",{});var Ps=i($t);cn=a(Ps,"The "),vs=n(Ps,"A",{href:!0});var Ll=i(vs);pn=a(Ll,"MobileViTModel"),Ll.forEach(t),mn=a(Ps," forward method, overrides the "),Ks=n(Ps,"CODE",{});var ql=i(Ks);hn=a(ql,"__call__"),ql.forEach(t),fn=a(Ps," special method."),Ps.forEach(t),un=m(io),y(Lt.$$.fragment,io),gn=m(io),y(qt.$$.fragment,io),io.forEach(t),Is.forEach(t),Ia=m(o),Mt=n(o,"H2",{class:!0});var tr=i(Mt);Dt=n(tr,"A",{id:!0,class:!0,href:!0});var Dl=i(Dt);Gs=n(Dl,"SPAN",{});var Rl=i(Gs);y(So.$$.fragment,Rl),Rl.forEach(t),Dl.forEach(t),_n=m(tr),Ys=n(tr,"SPAN",{});var Bl=i(Ys);bn=a(Bl,"MobileViTForImageClassification"),Bl.forEach(t),tr.forEach(t),Pa=m(o),Ge=n(o,"DIV",{class:!0});var lo=i(Ge);y(Oo.$$.fragment,lo),vn=m(lo),Js=n(lo,"P",{});var Ul=i(Js);Tn=a(Ul,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ul.forEach(t),wn=m(lo),zo=n(lo,"P",{});var or=i(zo);$n=a(or,"This model is a PyTorch "),Ao=n(or,"A",{href:!0,rel:!0});var Wl=i(Ao);Mn=a(Wl,"torch.nn.Module"),Wl.forEach(t),yn=a(or,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),or.forEach(t),En=m(lo),at=n(lo,"DIV",{class:!0});var co=i(at);y(No.$$.fragment,co),Vn=m(co),yt=n(co,"P",{});var Ss=i(yt);Fn=a(Ss,"The "),Ts=n(Ss,"A",{href:!0});var Hl=i(Ts);xn=a(Hl,"MobileViTForImageClassification"),Hl.forEach(t),kn=a(Ss," forward method, overrides the "),Xs=n(Ss,"CODE",{});var Kl=i(Xs);Cn=a(Kl,"__call__"),Kl.forEach(t),jn=a(Ss," special method."),Ss.forEach(t),In=m(co),y(Rt.$$.fragment,co),Pn=m(co),y(Bt.$$.fragment,co),co.forEach(t),lo.forEach(t),Sa=m(o),Et=n(o,"H2",{class:!0});var sr=i(Et);Ut=n(sr,"A",{id:!0,class:!0,href:!0});var Gl=i(Ut);Zs=n(Gl,"SPAN",{});var Yl=i(Zs);y(Lo.$$.fragment,Yl),Yl.forEach(t),Gl.forEach(t),Sn=m(sr),Qs=n(sr,"SPAN",{});var Jl=i(Qs);On=a(Jl,"MobileViTForSemanticSegmentation"),Jl.forEach(t),sr.forEach(t),Oa=m(o),Ye=n(o,"DIV",{class:!0});var po=i(Ye);y(qo.$$.fragment,po),zn=m(po),ea=n(po,"P",{});var Xl=i(ea);An=a(Xl,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),Xl.forEach(t),Nn=m(po),Do=n(po,"P",{});var ar=i(Do);Ln=a(ar,"This model is a PyTorch "),Ro=n(ar,"A",{href:!0,rel:!0});var Zl=i(Ro);qn=a(Zl,"torch.nn.Module"),Zl.forEach(t),Dn=a(ar,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ar.forEach(t),Rn=m(po),rt=n(po,"DIV",{class:!0});var mo=i(rt);y(Bo.$$.fragment,mo),Bn=m(mo),Vt=n(mo,"P",{});var Os=i(Vt);Un=a(Os,"The "),ws=n(Os,"A",{href:!0});var Ql=i(ws);Wn=a(Ql,"MobileViTForSemanticSegmentation"),Ql.forEach(t),Hn=a(Os," forward method, overrides the "),ta=n(Os,"CODE",{});var ed=i(ta);Kn=a(ed,"__call__"),ed.forEach(t),Gn=a(Os," special method."),Os.forEach(t),Yn=m(mo),y(Wt.$$.fragment,mo),Jn=m(mo),y(Ht.$$.fragment,mo),mo.forEach(t),po.forEach(t),za=m(o),Ft=n(o,"H2",{class:!0});var rr=i(Ft);Kt=n(rr,"A",{id:!0,class:!0,href:!0});var td=i(Kt);oa=n(td,"SPAN",{});var od=i(oa);y(Uo.$$.fragment,od),od.forEach(t),td.forEach(t),Xn=m(rr),sa=n(rr,"SPAN",{});var sd=i(sa);Zn=a(sd,"TFMobileViTModel"),sd.forEach(t),rr.forEach(t),Aa=m(o),Be=n(o,"DIV",{class:!0});var ft=i(Be);y(Wo.$$.fragment,ft),Qn=m(ft),Ho=n(ft,"P",{});var nr=i(Ho);ei=a(nr,`The bare MobileViT model outputting raw hidden-states without any specific head on top.
This model inherits from `),$s=n(nr,"A",{href:!0});var ad=i($s);ti=a(ad,"TFPreTrainedModel"),ad.forEach(t),oi=a(nr,`. 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.)`),nr.forEach(t),si=m(ft),Ko=n(ft,"P",{});var ir=i(Ko);ai=a(ir,"This model is also a "),Go=n(ir,"A",{href:!0,rel:!0});var rd=i(Go);ri=a(rd,"tf.keras.Model"),rd.forEach(t),ni=a(ir,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ir.forEach(t),ii=m(ft),y(Gt.$$.fragment,ft),li=m(ft),nt=n(ft,"DIV",{class:!0});var ho=i(nt);y(Yo.$$.fragment,ho),di=m(ho),xt=n(ho,"P",{});var zs=i(xt);ci=a(zs,"The "),Ms=n(zs,"A",{href:!0});var nd=i(Ms);pi=a(nd,"TFMobileViTModel"),nd.forEach(t),mi=a(zs," forward method, overrides the "),aa=n(zs,"CODE",{});var id=i(aa);hi=a(id,"__call__"),id.forEach(t),fi=a(zs," special method."),zs.forEach(t),ui=m(ho),y(Yt.$$.fragment,ho),gi=m(ho),y(Jt.$$.fragment,ho),ho.forEach(t),ft.forEach(t),Na=m(o),kt=n(o,"H2",{class:!0});var lr=i(kt);Xt=n(lr,"A",{id:!0,class:!0,href:!0});var ld=i(Xt);ra=n(ld,"SPAN",{});var dd=i(ra);y(Jo.$$.fragment,dd),dd.forEach(t),ld.forEach(t),_i=m(lr),na=n(lr,"SPAN",{});var cd=i(na);bi=a(cd,"TFMobileViTForImageClassification"),cd.forEach(t),lr.forEach(t),La=m(o),fe=n(o,"DIV",{class:!0});var dt=i(fe);y(Xo.$$.fragment,dt),vi=m(dt),ia=n(dt,"P",{});var pd=i(ia);Ti=a(pd,`MobileViT model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),pd.forEach(t),wi=m(dt),Zo=n(dt,"P",{});var dr=i(Zo);$i=a(dr,"This model inherits from "),ys=n(dr,"A",{href:!0});var md=i(ys);Mi=a(md,"TFPreTrainedModel"),md.forEach(t),yi=a(dr,`. 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.)`),dr.forEach(t),Ei=m(dt),Qo=n(dt,"P",{});var cr=i(Qo);Vi=a(cr,"This model is also a "),es=n(cr,"A",{href:!0,rel:!0});var hd=i(es);Fi=a(hd,"tf.keras.Model"),hd.forEach(t),xi=a(cr,` 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.`),cr.forEach(t),ki=m(dt),y(Zt.$$.fragment,dt),Ci=m(dt),it=n(dt,"DIV",{class:!0});var fo=i(it);y(ts.$$.fragment,fo),ji=m(fo),Ct=n(fo,"P",{});var As=i(Ct);Ii=a(As,"The "),Es=n(As,"A",{href:!0});var fd=i(Es);Pi=a(fd,"TFMobileViTForImageClassification"),fd.forEach(t),Si=a(As," forward method, overrides the "),la=n(As,"CODE",{});var ud=i(la);Oi=a(ud,"__call__"),ud.forEach(t),zi=a(As," special method."),As.forEach(t),Ai=m(fo),y(Qt.$$.fragment,fo),Ni=m(fo),y(eo.$$.fragment,fo),fo.forEach(t),dt.forEach(t),qa=m(o),jt=n(o,"H2",{class:!0});var pr=i(jt);to=n(pr,"A",{id:!0,class:!0,href:!0});var gd=i(to);da=n(gd,"SPAN",{});var _d=i(da);y(os.$$.fragment,_d),_d.forEach(t),gd.forEach(t),Li=m(pr),ca=n(pr,"SPAN",{});var bd=i(ca);qi=a(bd,"TFMobileViTForSemanticSegmentation"),bd.forEach(t),pr.forEach(t),Da=m(o),ue=n(o,"DIV",{class:!0});var ct=i(ue);y(ss.$$.fragment,ct),Di=m(ct),pa=n(ct,"P",{});var vd=i(pa);Ri=a(vd,"MobileViT model with a semantic segmentation head on top, e.g. for Pascal VOC."),vd.forEach(t),Bi=m(ct),as=n(ct,"P",{});var mr=i(as);Ui=a(mr,"This model inherits from "),Vs=n(mr,"A",{href:!0});var Td=i(Vs);Wi=a(Td,"TFPreTrainedModel"),Td.forEach(t),Hi=a(mr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),mr.forEach(t),Ki=m(ct),rs=n(ct,"P",{});var hr=i(rs);Gi=a(hr,"This model is also a "),ns=n(hr,"A",{href:!0,rel:!0});var wd=i(ns);Yi=a(wd,"tf.keras.Model"),wd.forEach(t),Ji=a(hr,` 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.`),hr.forEach(t),Xi=m(ct),y(oo.$$.fragment,ct),Zi=m(ct),lt=n(ct,"DIV",{class:!0});var uo=i(lt);y(is.$$.fragment,uo),Qi=m(uo),It=n(uo,"P",{});var Ns=i(It);el=a(Ns,"The "),Fs=n(Ns,"A",{href:!0});var $d=i(Fs);tl=a($d,"TFMobileViTForSemanticSegmentation"),$d.forEach(t),ol=a(Ns," forward method, overrides the "),ma=n(Ns,"CODE",{});var Md=i(ma);sl=a(Md,"__call__"),Md.forEach(t),al=a(Ns," special method."),Ns.forEach(t),rl=m(uo),y(so.$$.fragment,uo),nl=m(uo),y(ao.$$.fragment,uo),uo.forEach(t),ct.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(Kd)),h(f,"id","mobilevit"),h(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(f,"href","#mobilevit"),h(u,"class","relative group"),h(ee,"id","overview"),h(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ee,"href","#overview"),h(A,"class","relative group"),h(oe,"href","https://arxiv.org/abs/2110.02178"),h(oe,"rel","nofollow"),h(re,"href","https://keras.io/examples/vision/mobilevit"),h(re,"rel","nofollow"),h(B,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor"),h(G,"href","https://huggingface.co/datasets/imagenet-1k"),h(G,"rel","nofollow"),h($,"href","https://arxiv.org/abs/1706.05587"),h($,"rel","nofollow"),h(we,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),h(we,"rel","nofollow"),h(ye,"href","https://www.tensorflow.org/lite"),h(ye,"rel","nofollow"),h(_o,"href","https://huggingface.co/Matthijs"),h(_o,"rel","nofollow"),h(bo,"href","https://huggingface.co/sayakpaul"),h(bo,"rel","nofollow"),h(vo,"href","https://github.com/apple/ml-cvnets"),h(vo,"rel","nofollow"),h(Pt,"id","transformers.MobileViTConfig"),h(Pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Pt,"href","#transformers.MobileViTConfig"),h(_t,"class","relative group"),h(fs,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTModel"),h($o,"href","https://huggingface.co/apple/mobilevit-small"),h($o,"rel","nofollow"),h(us,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),h(gs,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),h(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ot,"id","transformers.MobileViTFeatureExtractor"),h(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"),h(Ot,"href","#transformers.MobileViTFeatureExtractor"),h(Tt,"class","relative group"),h(_s,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin"),h(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(bs,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),h(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nt,"id","transformers.MobileViTModel"),h(Nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Nt,"href","#transformers.MobileViTModel"),h(wt,"class","relative group"),h(Io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Io,"rel","nofollow"),h(vs,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTModel"),h(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Dt,"id","transformers.MobileViTForImageClassification"),h(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"),h(Dt,"href","#transformers.MobileViTForImageClassification"),h(Mt,"class","relative group"),h(Ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ao,"rel","nofollow"),h(Ts,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTForImageClassification"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ut,"id","transformers.MobileViTForSemanticSegmentation"),h(Ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ut,"href","#transformers.MobileViTForSemanticSegmentation"),h(Et,"class","relative group"),h(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ro,"rel","nofollow"),h(ws,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.MobileViTForSemanticSegmentation"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Kt,"id","transformers.TFMobileViTModel"),h(Kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Kt,"href","#transformers.TFMobileViTModel"),h(Ft,"class","relative group"),h($s,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),h(Go,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Go,"rel","nofollow"),h(Ms,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.TFMobileViTModel"),h(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Xt,"id","transformers.TFMobileViTForImageClassification"),h(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"),h(Xt,"href","#transformers.TFMobileViTForImageClassification"),h(kt,"class","relative group"),h(ys,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),h(es,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(es,"rel","nofollow"),h(Es,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.TFMobileViTForImageClassification"),h(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(to,"id","transformers.TFMobileViTForSemanticSegmentation"),h(to,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(to,"href","#transformers.TFMobileViTForSemanticSegmentation"),h(jt,"class","relative group"),h(Vs,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),h(ns,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ns,"rel","nofollow"),h(Fs,"href","/docs/transformers/pr_19907/en/model_doc/mobilevit#transformers.TFMobileViTForSemanticSegmentation"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,b){e(document.head,d),g(o,T,b),g(o,u,b),e(u,f),e(f,v),E(l,v,null),e(u,c),e(u,C),e(C,xe),g(o,ge,b),g(o,A,b),e(A,ee),e(ee,te),E(w,te,null),e(A,ke),e(A,H),e(H,Ce),g(o,_e,b),g(o,L,b),e(L,je),e(L,oe),e(oe,Y),e(L,Ie),g(o,be,b),g(o,D,b),e(D,Pe),g(o,ve,b),g(o,R,b),e(R,de),e(de,Se),g(o,se,b),g(o,j,b),e(j,S),g(o,Te,b),g(o,P,b),e(P,ce),e(ce,ae),e(ae,J),e(ae,re),e(re,Oe),e(ae,O),e(P,ze),e(P,K),e(K,ne),e(ne,Ae),e(ne,B),e(B,Ne),e(ne,Le),e(P,U),e(P,pe),e(pe,q),e(q,qe),e(q,G),e(G,z),e(q,De),e(P,N),e(P,me),e(me,X),e(X,_),e(X,$),e($,Xe),e(X,ie),e(X,we),e(we,Ze),e(X,k),e(P,Qe),e(P,$e),e($e,Me),e(Me,et),e(Me,ye),e(ye,W),e(Me,Z),e($e,tt),e($e,Ue),e(Ue,Q),g(o,He,b),E(Ee,o,b),g(o,Ve,b),g(o,he,b),e(he,le),e(he,We),e(We,fr),e(he,ur),g(o,Ea,b),g(o,ot,b),e(ot,gr),e(ot,_o),e(_o,_r),e(ot,br),e(ot,bo),e(bo,vr),e(ot,Tr),e(ot,vo),e(vo,wr),e(ot,$r),g(o,Va,b),g(o,_t,b),e(_t,Pt),e(Pt,Ls),E(To,Ls,null),e(_t,Mr),e(_t,qs),e(qs,yr),g(o,Fa,b),g(o,Ke,b),E(wo,Ke,null),e(Ke,Er),e(Ke,bt),e(bt,Vr),e(bt,fs),e(fs,Fr),e(bt,xr),e(bt,$o),e($o,kr),e(bt,Cr),e(Ke,jr),e(Ke,vt),e(vt,Ir),e(vt,us),e(us,Pr),e(vt,Sr),e(vt,gs),e(gs,Or),e(vt,zr),e(Ke,Ar),E(St,Ke,null),g(o,xa,b),g(o,Tt,b),e(Tt,Ot),e(Ot,Ds),E(Mo,Ds,null),e(Tt,Nr),e(Tt,Rs),e(Rs,Lr),g(o,ka,b),g(o,Re,b),E(yo,Re,null),e(Re,qr),e(Re,Bs),e(Bs,Dr),e(Re,Rr),e(Re,Eo),e(Eo,Br),e(Eo,_s),e(_s,Ur),e(Eo,Wr),e(Re,Hr),e(Re,mt),E(Vo,mt,null),e(mt,Kr),e(mt,Us),e(Us,Gr),e(mt,Yr),E(zt,mt,null),e(Re,Jr),e(Re,At),E(Fo,At,null),e(At,Xr),e(At,xo),e(xo,Zr),e(xo,bs),e(bs,Qr),e(xo,en),g(o,Ca,b),g(o,wt,b),e(wt,Nt),e(Nt,Ws),E(ko,Ws,null),e(wt,tn),e(wt,Hs),e(Hs,on),g(o,ja,b),g(o,pt,b),E(Co,pt,null),e(pt,sn),e(pt,jo),e(jo,an),e(jo,Io),e(Io,rn),e(jo,nn),e(pt,ln),e(pt,st),E(Po,st,null),e(st,dn),e(st,$t),e($t,cn),e($t,vs),e(vs,pn),e($t,mn),e($t,Ks),e(Ks,hn),e($t,fn),e(st,un),E(Lt,st,null),e(st,gn),E(qt,st,null),g(o,Ia,b),g(o,Mt,b),e(Mt,Dt),e(Dt,Gs),E(So,Gs,null),e(Mt,_n),e(Mt,Ys),e(Ys,bn),g(o,Pa,b),g(o,Ge,b),E(Oo,Ge,null),e(Ge,vn),e(Ge,Js),e(Js,Tn),e(Ge,wn),e(Ge,zo),e(zo,$n),e(zo,Ao),e(Ao,Mn),e(zo,yn),e(Ge,En),e(Ge,at),E(No,at,null),e(at,Vn),e(at,yt),e(yt,Fn),e(yt,Ts),e(Ts,xn),e(yt,kn),e(yt,Xs),e(Xs,Cn),e(yt,jn),e(at,In),E(Rt,at,null),e(at,Pn),E(Bt,at,null),g(o,Sa,b),g(o,Et,b),e(Et,Ut),e(Ut,Zs),E(Lo,Zs,null),e(Et,Sn),e(Et,Qs),e(Qs,On),g(o,Oa,b),g(o,Ye,b),E(qo,Ye,null),e(Ye,zn),e(Ye,ea),e(ea,An),e(Ye,Nn),e(Ye,Do),e(Do,Ln),e(Do,Ro),e(Ro,qn),e(Do,Dn),e(Ye,Rn),e(Ye,rt),E(Bo,rt,null),e(rt,Bn),e(rt,Vt),e(Vt,Un),e(Vt,ws),e(ws,Wn),e(Vt,Hn),e(Vt,ta),e(ta,Kn),e(Vt,Gn),e(rt,Yn),E(Wt,rt,null),e(rt,Jn),E(Ht,rt,null),g(o,za,b),g(o,Ft,b),e(Ft,Kt),e(Kt,oa),E(Uo,oa,null),e(Ft,Xn),e(Ft,sa),e(sa,Zn),g(o,Aa,b),g(o,Be,b),E(Wo,Be,null),e(Be,Qn),e(Be,Ho),e(Ho,ei),e(Ho,$s),e($s,ti),e(Ho,oi),e(Be,si),e(Be,Ko),e(Ko,ai),e(Ko,Go),e(Go,ri),e(Ko,ni),e(Be,ii),E(Gt,Be,null),e(Be,li),e(Be,nt),E(Yo,nt,null),e(nt,di),e(nt,xt),e(xt,ci),e(xt,Ms),e(Ms,pi),e(xt,mi),e(xt,aa),e(aa,hi),e(xt,fi),e(nt,ui),E(Yt,nt,null),e(nt,gi),E(Jt,nt,null),g(o,Na,b),g(o,kt,b),e(kt,Xt),e(Xt,ra),E(Jo,ra,null),e(kt,_i),e(kt,na),e(na,bi),g(o,La,b),g(o,fe,b),E(Xo,fe,null),e(fe,vi),e(fe,ia),e(ia,Ti),e(fe,wi),e(fe,Zo),e(Zo,$i),e(Zo,ys),e(ys,Mi),e(Zo,yi),e(fe,Ei),e(fe,Qo),e(Qo,Vi),e(Qo,es),e(es,Fi),e(Qo,xi),e(fe,ki),E(Zt,fe,null),e(fe,Ci),e(fe,it),E(ts,it,null),e(it,ji),e(it,Ct),e(Ct,Ii),e(Ct,Es),e(Es,Pi),e(Ct,Si),e(Ct,la),e(la,Oi),e(Ct,zi),e(it,Ai),E(Qt,it,null),e(it,Ni),E(eo,it,null),g(o,qa,b),g(o,jt,b),e(jt,to),e(to,da),E(os,da,null),e(jt,Li),e(jt,ca),e(ca,qi),g(o,Da,b),g(o,ue,b),E(ss,ue,null),e(ue,Di),e(ue,pa),e(pa,Ri),e(ue,Bi),e(ue,as),e(as,Ui),e(as,Vs),e(Vs,Wi),e(as,Hi),e(ue,Ki),e(ue,rs),e(rs,Gi),e(rs,ns),e(ns,Yi),e(rs,Ji),e(ue,Xi),E(oo,ue,null),e(ue,Zi),e(ue,lt),E(is,lt,null),e(lt,Qi),e(lt,It),e(It,el),e(It,Fs),e(Fs,tl),e(It,ol),e(It,ma),e(ma,sl),e(It,al),e(lt,rl),E(so,lt,null),e(lt,nl),E(ao,lt,null),Ra=!0},p(o,[b]){const ls={};b&2&&(ls.$$scope={dirty:b,ctx:o}),St.$set(ls);const ha={};b&2&&(ha.$$scope={dirty:b,ctx:o}),zt.$set(ha);const fa={};b&2&&(fa.$$scope={dirty:b,ctx:o}),Lt.$set(fa);const ua={};b&2&&(ua.$$scope={dirty:b,ctx:o}),qt.$set(ua);const ds={};b&2&&(ds.$$scope={dirty:b,ctx:o}),Rt.$set(ds);const ga={};b&2&&(ga.$$scope={dirty:b,ctx:o}),Bt.$set(ga);const _a={};b&2&&(_a.$$scope={dirty:b,ctx:o}),Wt.$set(_a);const ba={};b&2&&(ba.$$scope={dirty:b,ctx:o}),Ht.$set(ba);const cs={};b&2&&(cs.$$scope={dirty:b,ctx:o}),Gt.$set(cs);const va={};b&2&&(va.$$scope={dirty:b,ctx:o}),Yt.$set(va);const Ta={};b&2&&(Ta.$$scope={dirty:b,ctx:o}),Jt.$set(Ta);const wa={};b&2&&(wa.$$scope={dirty:b,ctx:o}),Zt.$set(wa);const $a={};b&2&&($a.$$scope={dirty:b,ctx:o}),Qt.$set($a);const Ma={};b&2&&(Ma.$$scope={dirty:b,ctx:o}),eo.$set(Ma);const Je={};b&2&&(Je.$$scope={dirty:b,ctx:o}),oo.$set(Je);const ya={};b&2&&(ya.$$scope={dirty:b,ctx:o}),so.$set(ya);const ps={};b&2&&(ps.$$scope={dirty:b,ctx:o}),ao.$set(ps)},i(o){Ra||(V(l.$$.fragment,o),V(w.$$.fragment,o),V(Ee.$$.fragment,o),V(To.$$.fragment,o),V(wo.$$.fragment,o),V(St.$$.fragment,o),V(Mo.$$.fragment,o),V(yo.$$.fragment,o),V(Vo.$$.fragment,o),V(zt.$$.fragment,o),V(Fo.$$.fragment,o),V(ko.$$.fragment,o),V(Co.$$.fragment,o),V(Po.$$.fragment,o),V(Lt.$$.fragment,o),V(qt.$$.fragment,o),V(So.$$.fragment,o),V(Oo.$$.fragment,o),V(No.$$.fragment,o),V(Rt.$$.fragment,o),V(Bt.$$.fragment,o),V(Lo.$$.fragment,o),V(qo.$$.fragment,o),V(Bo.$$.fragment,o),V(Wt.$$.fragment,o),V(Ht.$$.fragment,o),V(Uo.$$.fragment,o),V(Wo.$$.fragment,o),V(Gt.$$.fragment,o),V(Yo.$$.fragment,o),V(Yt.$$.fragment,o),V(Jt.$$.fragment,o),V(Jo.$$.fragment,o),V(Xo.$$.fragment,o),V(Zt.$$.fragment,o),V(ts.$$.fragment,o),V(Qt.$$.fragment,o),V(eo.$$.fragment,o),V(os.$$.fragment,o),V(ss.$$.fragment,o),V(oo.$$.fragment,o),V(is.$$.fragment,o),V(so.$$.fragment,o),V(ao.$$.fragment,o),Ra=!0)},o(o){F(l.$$.fragment,o),F(w.$$.fragment,o),F(Ee.$$.fragment,o),F(To.$$.fragment,o),F(wo.$$.fragment,o),F(St.$$.fragment,o),F(Mo.$$.fragment,o),F(yo.$$.fragment,o),F(Vo.$$.fragment,o),F(zt.$$.fragment,o),F(Fo.$$.fragment,o),F(ko.$$.fragment,o),F(Co.$$.fragment,o),F(Po.$$.fragment,o),F(Lt.$$.fragment,o),F(qt.$$.fragment,o),F(So.$$.fragment,o),F(Oo.$$.fragment,o),F(No.$$.fragment,o),F(Rt.$$.fragment,o),F(Bt.$$.fragment,o),F(Lo.$$.fragment,o),F(qo.$$.fragment,o),F(Bo.$$.fragment,o),F(Wt.$$.fragment,o),F(Ht.$$.fragment,o),F(Uo.$$.fragment,o),F(Wo.$$.fragment,o),F(Gt.$$.fragment,o),F(Yo.$$.fragment,o),F(Yt.$$.fragment,o),F(Jt.$$.fragment,o),F(Jo.$$.fragment,o),F(Xo.$$.fragment,o),F(Zt.$$.fragment,o),F(ts.$$.fragment,o),F(Qt.$$.fragment,o),F(eo.$$.fragment,o),F(os.$$.fragment,o),F(ss.$$.fragment,o),F(oo.$$.fragment,o),F(is.$$.fragment,o),F(so.$$.fragment,o),F(ao.$$.fragment,o),Ra=!1},d(o){t(d),o&&t(T),o&&t(u),x(l),o&&t(ge),o&&t(A),x(w),o&&t(_e),o&&t(L),o&&t(be),o&&t(D),o&&t(ve),o&&t(R),o&&t(se),o&&t(j),o&&t(Te),o&&t(P),o&&t(He),x(Ee,o),o&&t(Ve),o&&t(he),o&&t(Ea),o&&t(ot),o&&t(Va),o&&t(_t),x(To),o&&t(Fa),o&&t(Ke),x(wo),x(St),o&&t(xa),o&&t(Tt),x(Mo),o&&t(ka),o&&t(Re),x(yo),x(Vo),x(zt),x(Fo),o&&t(Ca),o&&t(wt),x(ko),o&&t(ja),o&&t(pt),x(Co),x(Po),x(Lt),x(qt),o&&t(Ia),o&&t(Mt),x(So),o&&t(Pa),o&&t(Ge),x(Oo),x(No),x(Rt),x(Bt),o&&t(Sa),o&&t(Et),x(Lo),o&&t(Oa),o&&t(Ye),x(qo),x(Bo),x(Wt),x(Ht),o&&t(za),o&&t(Ft),x(Uo),o&&t(Aa),o&&t(Be),x(Wo),x(Gt),x(Yo),x(Yt),x(Jt),o&&t(Na),o&&t(kt),x(Jo),o&&t(La),o&&t(fe),x(Xo),x(Zt),x(ts),x(Qt),x(eo),o&&t(qa),o&&t(jt),x(os),o&&t(Da),o&&t(ue),x(ss),x(oo),x(is),x(so),x(ao)}}}const Kd={local:"mobilevit",sections:[{local:"overview",title:"Overview"},{local:"transformers.MobileViTConfig",title:"MobileViTConfig"},{local:"transformers.MobileViTFeatureExtractor",title:"MobileViTFeatureExtractor"},{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 Gd(I){return xd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tc extends yd{constructor(d){super();Ed(this,d,Gd,Hd,Vd,{})}}export{tc as default,Kd as metadata};
