import{S as Ss,i as Ns,s as Bs,e as s,k as f,w as M,t as i,M as Ps,c as n,d as o,m as u,a as r,x as T,h as l,b as d,G as e,g as b,y as V,q as w,o as y,B as $,v as Gs,L as ro}from"../../chunks/vendor-hf-doc-builder.js";import{T as qa}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ae}from"../../chunks/Docstring-hf-doc-builder.js";import{C as io}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ct}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as no}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zs(j){let c,v,g,m,_;return m=new io({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1vYmlsZVZpVFYyQ29uZmlnJTJDJTIwTW9iaWxlVmlUVjJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2JpbGV2aXR2Mi1zbWFsbCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNb2JpbGVWaVRWMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMG1vYmlsZXZpdHYyLXNtYWxsJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVWaVRWMk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileViTV2Config, MobileViTV2Model

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=s("p"),v=i("Example:"),g=f(),M(m.$$.fragment)},l(a){c=n(a,"P",{});var p=r(c);v=l(p,"Example:"),p.forEach(o),g=u(a),T(m.$$.fragment,a)},m(a,p){b(a,c,p),e(c,v),b(a,g,p),V(m,a,p),_=!0},p:ro,i(a){_||(w(m.$$.fragment,a),_=!0)},o(a){y(m.$$.fragment,a),_=!1},d(a){a&&o(c),a&&o(g),$(m,a)}}}function As(j){let c,v,g,m,_;return{c(){c=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),m=i("Module"),_=i(`
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(a){c=n(a,"P",{});var p=r(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(p,"CODE",{});var C=r(g);m=l(C,"Module"),C.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){b(a,c,p),e(c,v),e(c,g),e(g,m),e(c,_)},d(a){a&&o(c)}}}function Rs(j){let c,v,g,m,_;return m=new io({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVFYyTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmFwcGxlJTJGbW9iaWxldml0djItMS4wLWltYWdlbmV0MWstMjU2JTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlVmlUVjJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYXBwbGUlMkZtb2JpbGV2aXR2Mi0xLjAtaW1hZ2VuZXQxay0yNTYlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTV2Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2Model.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileViTV2ForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){c=s("p"),v=i("Examples:"),g=f(),M(m.$$.fragment)},l(a){c=n(a,"P",{});var p=r(c);v=l(p,"Examples:"),p.forEach(o),g=u(a),T(m.$$.fragment,a)},m(a,p){b(a,c,p),e(c,v),b(a,g,p),V(m,a,p),_=!0},p:ro,i(a){_||(w(m.$$.fragment,a),_=!0)},o(a){y(m.$$.fragment,a),_=!1},d(a){a&&o(c),a&&o(g),$(m,a)}}}function qs(j){let c,v,g,m,_,a,p,C,lo,Et,S,O,dt,fe,co,mt,mo,xt,q,po,ue,ho,fo,Ut,Re,uo,Zt,Xe,go,Ft,Ye,pt,bo,St,Qe,_o,Nt,W,ht,vo,Mo,ge,To,Oe,Vo,wo,yo,be,$o,_e,jo,Co,ko,N,Jo,ve,Io,Wo,Me,Eo,xo,Bt,F,Uo,Te,Zo,Fo,Ve,So,No,Pt,B,H,ft,we,Bo,ut,Po,Gt,k,ye,Go,P,zo,qe,Ao,Ro,$e,Xo,Yo,Qo,G,Oo,He,qo,Ho,Le,Lo,Do,Ko,L,zt,z,D,gt,je,ea,bt,ta,At,Z,Ce,oa,ke,aa,Je,sa,na,ra,E,Ie,ia,A,la,De,ca,da,_t,ma,pa,ha,K,fa,ee,Rt,R,te,vt,We,ua,Mt,ga,Xt,J,Ee,ba,Tt,_a,va,xe,Ma,Ue,Ta,Va,wa,x,Ze,ya,X,$a,Ke,ja,Ca,Vt,ka,Ja,Ia,oe,Wa,ae,Yt,Y,se,wt,Fe,Ea,yt,xa,Qt,I,Se,Ua,$t,Za,Fa,Ne,Sa,Be,Na,Ba,Pa,U,Pe,Ga,Q,za,et,Aa,Ra,jt,Xa,Ya,Qa,ne,Oa,re,Ot;return a=new ct({}),fe=new ct({}),we=new ct({}),ye=new Ae({props:{name:"class transformers.MobileViTV2Config",anchor:"transformers.MobileViTV2Config",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 256"},{name:"patch_size",val:" = 2"},{name:"expand_ratio",val:" = 2.0"},{name:"hidden_act",val:" = 'swish'"},{name:"conv_kernel_size",val:" = 3"},{name:"output_stride",val:" = 32"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"aspp_out_channels",val:" = 512"},{name:"atrous_rates",val:" = [6, 12, 18]"},{name:"aspp_dropout_prob",val:" = 0.1"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"n_attn_blocks",val:" = [2, 4, 3]"},{name:"base_attn_unit_dims",val:" = [128, 192, 256]"},{name:"width_multiplier",val:" = 1.0"},{name:"ffn_multiplier",val:" = 2"},{name:"attn_dropout",val:" = 0.0"},{name:"ffn_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.expand_ratio",description:`<strong>expand_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Expansion factor for the MobileNetv2 layers.`,name:"expand_ratio"},{anchor:"transformers.MobileViTV2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;swish&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the Transformer encoder and convolution layers.`,name:"hidden_act"},{anchor:"transformers.MobileViTV2Config.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 MobileViTV2 layer.`,name:"conv_kernel_size"},{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.aspp_out_channels",description:`<strong>aspp_out_channels</strong> (<code>int</code>, <code>optional</code>, defaults to 512) &#x2014;
Number of output channels used in the ASPP layer for semantic segmentation.`,name:"aspp_out_channels"},{anchor:"transformers.MobileViTV2Config.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.MobileViTV2Config.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.MobileViTV2Config.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"},{anchor:"transformers.MobileViTV2Config.n_attn_blocks",description:`<strong>n_attn_blocks</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 4, 3]</code>) &#x2014;
The number of attention blocks in each MobileViTV2Layer`,name:"n_attn_blocks"},{anchor:"transformers.MobileViTV2Config.base_attn_unit_dims",description:`<strong>base_attn_unit_dims</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[128, 192, 256]</code>) &#x2014;
The base multiplier for dimensions of attention blocks in each MobileViTV2Layer`,name:"base_attn_unit_dims"},{anchor:"transformers.MobileViTV2Config.width_multiplier",description:`<strong>width_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The width multiplier for MobileViTV2.`,name:"width_multiplier"},{anchor:"transformers.MobileViTV2Config.ffn_multiplier",description:`<strong>ffn_multiplier</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The FFN multiplier for MobileViTV2.`,name:"ffn_multiplier"},{anchor:"transformers.MobileViTV2Config.attn_dropout",description:`<strong>attn_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout in the attention layer.`,name:"attn_dropout"},{anchor:"transformers.MobileViTV2Config.ffn_dropout",description:`<strong>ffn_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout between FFN layers.`,name:"ffn_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py#L34"}}),L=new no({props:{anchor:"transformers.MobileViTV2Config.example",$$slots:{default:[zs]},$$scope:{ctx:j}}}),je=new ct({}),Ce=new Ae({props:{name:"class transformers.MobileViTV2Model",anchor:"transformers.MobileViTV2Model",parameters:[{name:"config",val:": MobileViTV2Config"},{name:"expand_output",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileViTV2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L665"}}),Ie=new Ae({props:{name:"forward",anchor:"transformers.MobileViTV2Model.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.MobileViTV2Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2Model.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.MobileViTV2Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L699",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</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>
`}}),K=new qa({props:{$$slots:{default:[As]},$$scope:{ctx:j}}}),ee=new no({props:{anchor:"transformers.MobileViTV2Model.forward.example",$$slots:{default:[Rs]},$$scope:{ctx:j}}}),We=new ct({}),Ee=new Ae({props:{name:"class transformers.MobileViTV2ForImageClassification",anchor:"transformers.MobileViTV2ForImageClassification",parameters:[{name:"config",val:": MobileViTV2Config"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L756"}}),Ze=new Ae({props:{name:"forward",anchor:"transformers.MobileViTV2ForImageClassification.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.MobileViTV2ForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2ForImageClassification.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.MobileViTV2ForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTV2ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L774",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new qa({props:{$$slots:{default:[Xs]},$$scope:{ctx:j}}}),ae=new no({props:{anchor:"transformers.MobileViTV2ForImageClassification.forward.example",$$slots:{default:[Ys]},$$scope:{ctx:j}}}),Fe=new ct({}),Se=new Ae({props:{name:"class transformers.MobileViTV2ForSemanticSegmentation",anchor:"transformers.MobileViTV2ForSemanticSegmentation",parameters:[{name:"config",val:": MobileViTV2Config"}],parametersDescription:[{anchor:"transformers.MobileViTV2ForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config">MobileViTV2Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L956"}}),Pe=new Ae({props:{name:"forward",anchor:"transformers.MobileViTV2ForSemanticSegmentation.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.MobileViTV2ForSemanticSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">MobileViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileViTV2ForSemanticSegmentation.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.MobileViTV2ForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileViTV2ForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py#L967",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Config"
>MobileViTV2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new qa({props:{$$slots:{default:[Qs]},$$scope:{ctx:j}}}),re=new no({props:{anchor:"transformers.MobileViTV2ForSemanticSegmentation.forward.example",$$slots:{default:[Os]},$$scope:{ctx:j}}}),{c(){c=s("meta"),v=f(),g=s("h1"),m=s("a"),_=s("span"),M(a.$$.fragment),p=f(),C=s("span"),lo=i("MobileViTV2"),Et=f(),S=s("h2"),O=s("a"),dt=s("span"),M(fe.$$.fragment),co=f(),mt=s("span"),mo=i("Overview"),xt=f(),q=s("p"),po=i("The MobileViTV2 model was proposed in "),ue=s("a"),ho=i("Separable Self-attention for Mobile Vision Transformers"),fo=i(" by Sachin Mehta and Mohammad Rastegari."),Ut=f(),Re=s("p"),uo=i("MobileViTV2 is the second version of MobileViT, constructed by replacing the multi-headed self-attention in MobileViT with separable self-attention."),Zt=f(),Xe=s("p"),go=i("The abstract from the paper is the following:"),Ft=f(),Ye=s("p"),pt=s("em"),bo=i("Mobile vision transformers (MobileViT) can achieve state-of-the-art performance across several mobile vision tasks, including classification and detection. Though these models have fewer parameters, they have high latency as compared to convolutional neural network-based models. The main efficiency bottleneck in MobileViT is the multi-headed self-attention (MHA) in transformers, which requires O(k2) time complexity with respect to the number of tokens (or patches) k. Moreover, MHA requires costly operations (e.g., batch-wise matrix multiplication) for computing self-attention, impacting latency on resource-constrained devices. This paper introduces a separable self-attention method with linear complexity, i.e. O(k). A simple yet effective characteristic of the proposed method is that it uses element-wise operations for computing self-attention, making it a good choice for resource-constrained devices. The improved model, MobileViTV2, is state-of-the-art on several mobile vision tasks, including ImageNet object classification and MS-COCO object detection. With about three million parameters, MobileViTV2 achieves a top-1 accuracy of 75.6% on the ImageNet dataset, outperforming MobileViT by about 1% while running 3.2\xD7 faster on a mobile device."),St=f(),Qe=s("p"),_o=i("Tips:"),Nt=f(),W=s("ul"),ht=s("li"),vo=i("MobileViTV2 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."),Mo=f(),ge=s("li"),To=i("One can use "),Oe=s("a"),Vo=i("MobileViTImageProcessor"),wo=i(" 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)."),yo=f(),be=s("li"),$o=i("The available image classification checkpoints are pre-trained on "),_e=s("a"),jo=i("ImageNet-1k"),Co=i(" (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),ko=f(),N=s("li"),Jo=i("The segmentation model uses a "),ve=s("a"),Io=i("DeepLabV3"),Wo=i(" head. The available semantic segmentation checkpoints are pre-trained on "),Me=s("a"),Eo=i("PASCAL VOC"),xo=i("."),Bt=f(),F=s("p"),Uo=i("This model was contributed by "),Te=s("a"),Zo=i("shehan97"),Fo=i(`.
The original code can be found `),Ve=s("a"),So=i("here"),No=i("."),Pt=f(),B=s("h2"),H=s("a"),ft=s("span"),M(we.$$.fragment),Bo=f(),ut=s("span"),Po=i("MobileViTV2Config"),Gt=f(),k=s("div"),M(ye.$$.fragment),Go=f(),P=s("p"),zo=i("This is the configuration class to store the configuration of a "),qe=s("a"),Ao=i("MobileViTV2Model"),Ro=i(`. It is used to instantiate a
MobileViTV2 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 MobileViTV2
`),$e=s("a"),Xo=i("apple/mobilevitv2-1.0"),Yo=i(" architecture."),Qo=f(),G=s("p"),Oo=i("Configuration objects inherit from "),He=s("a"),qo=i("PretrainedConfig"),Ho=i(` and can be used to control the model outputs. Read the
documentation from `),Le=s("a"),Lo=i("PretrainedConfig"),Do=i(" for more information."),Ko=f(),M(L.$$.fragment),zt=f(),z=s("h2"),D=s("a"),gt=s("span"),M(je.$$.fragment),ea=f(),bt=s("span"),ta=i("MobileViTV2Model"),At=f(),Z=s("div"),M(Ce.$$.fragment),oa=f(),ke=s("p"),aa=i(`The bare MobileViTV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Je=s("a"),sa=i("torch.nn.Module"),na=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ra=f(),E=s("div"),M(Ie.$$.fragment),ia=f(),A=s("p"),la=i("The "),De=s("a"),ca=i("MobileViTV2Model"),da=i(" forward method, overrides the "),_t=s("code"),ma=i("__call__"),pa=i(" special method."),ha=f(),M(K.$$.fragment),fa=f(),M(ee.$$.fragment),Rt=f(),R=s("h2"),te=s("a"),vt=s("span"),M(We.$$.fragment),ua=f(),Mt=s("span"),ga=i("MobileViTV2ForImageClassification"),Xt=f(),J=s("div"),M(Ee.$$.fragment),ba=f(),Tt=s("p"),_a=i(`MobileViTV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),va=f(),xe=s("p"),Ma=i("This model is a PyTorch "),Ue=s("a"),Ta=i("torch.nn.Module"),Va=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wa=f(),x=s("div"),M(Ze.$$.fragment),ya=f(),X=s("p"),$a=i("The "),Ke=s("a"),ja=i("MobileViTV2ForImageClassification"),Ca=i(" forward method, overrides the "),Vt=s("code"),ka=i("__call__"),Ja=i(" special method."),Ia=f(),M(oe.$$.fragment),Wa=f(),M(ae.$$.fragment),Yt=f(),Y=s("h2"),se=s("a"),wt=s("span"),M(Fe.$$.fragment),Ea=f(),yt=s("span"),xa=i("MobileViTV2ForSemanticSegmentation"),Qt=f(),I=s("div"),M(Se.$$.fragment),Ua=f(),$t=s("p"),Za=i("MobileViTV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),Fa=f(),Ne=s("p"),Sa=i("This model is a PyTorch "),Be=s("a"),Na=i("torch.nn.Module"),Ba=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pa=f(),U=s("div"),M(Pe.$$.fragment),Ga=f(),Q=s("p"),za=i("The "),et=s("a"),Aa=i("MobileViTV2ForSemanticSegmentation"),Ra=i(" forward method, overrides the "),jt=s("code"),Xa=i("__call__"),Ya=i(" special method."),Qa=f(),M(ne.$$.fragment),Oa=f(),M(re.$$.fragment),this.h()},l(t){const h=Ps('[data-svelte="svelte-1phssyn"]',document.head);c=n(h,"META",{name:!0,content:!0}),h.forEach(o),v=u(t),g=n(t,"H1",{class:!0});var Ge=r(g);m=n(Ge,"A",{id:!0,class:!0,href:!0});var Ct=r(m);_=n(Ct,"SPAN",{});var kt=r(_);T(a.$$.fragment,kt),kt.forEach(o),Ct.forEach(o),p=u(Ge),C=n(Ge,"SPAN",{});var Jt=r(C);lo=l(Jt,"MobileViTV2"),Jt.forEach(o),Ge.forEach(o),Et=u(t),S=n(t,"H2",{class:!0});var ze=r(S);O=n(ze,"A",{id:!0,class:!0,href:!0});var It=r(O);dt=n(It,"SPAN",{});var Wt=r(dt);T(fe.$$.fragment,Wt),Wt.forEach(o),It.forEach(o),co=u(ze),mt=n(ze,"SPAN",{});var Ha=r(mt);mo=l(Ha,"Overview"),Ha.forEach(o),ze.forEach(o),xt=u(t),q=n(t,"P",{});var qt=r(q);po=l(qt,"The MobileViTV2 model was proposed in "),ue=n(qt,"A",{href:!0,rel:!0});var La=r(ue);ho=l(La,"Separable Self-attention for Mobile Vision Transformers"),La.forEach(o),fo=l(qt," by Sachin Mehta and Mohammad Rastegari."),qt.forEach(o),Ut=u(t),Re=n(t,"P",{});var Da=r(Re);uo=l(Da,"MobileViTV2 is the second version of MobileViT, constructed by replacing the multi-headed self-attention in MobileViT with separable self-attention."),Da.forEach(o),Zt=u(t),Xe=n(t,"P",{});var Ka=r(Xe);go=l(Ka,"The abstract from the paper is the following:"),Ka.forEach(o),Ft=u(t),Ye=n(t,"P",{});var es=r(Ye);pt=n(es,"EM",{});var ts=r(pt);bo=l(ts,"Mobile vision transformers (MobileViT) can achieve state-of-the-art performance across several mobile vision tasks, including classification and detection. Though these models have fewer parameters, they have high latency as compared to convolutional neural network-based models. The main efficiency bottleneck in MobileViT is the multi-headed self-attention (MHA) in transformers, which requires O(k2) time complexity with respect to the number of tokens (or patches) k. Moreover, MHA requires costly operations (e.g., batch-wise matrix multiplication) for computing self-attention, impacting latency on resource-constrained devices. This paper introduces a separable self-attention method with linear complexity, i.e. O(k). A simple yet effective characteristic of the proposed method is that it uses element-wise operations for computing self-attention, making it a good choice for resource-constrained devices. The improved model, MobileViTV2, is state-of-the-art on several mobile vision tasks, including ImageNet object classification and MS-COCO object detection. With about three million parameters, MobileViTV2 achieves a top-1 accuracy of 75.6% on the ImageNet dataset, outperforming MobileViT by about 1% while running 3.2\xD7 faster on a mobile device."),ts.forEach(o),es.forEach(o),St=u(t),Qe=n(t,"P",{});var os=r(Qe);_o=l(os,"Tips:"),os.forEach(o),Nt=u(t),W=n(t,"UL",{});var ie=r(W);ht=n(ie,"LI",{});var as=r(ht);vo=l(as,"MobileViTV2 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."),as.forEach(o),Mo=u(ie),ge=n(ie,"LI",{});var Ht=r(ge);To=l(Ht,"One can use "),Oe=n(Ht,"A",{href:!0});var ss=r(Oe);Vo=l(ss,"MobileViTImageProcessor"),ss.forEach(o),wo=l(Ht," 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)."),Ht.forEach(o),yo=u(ie),be=n(ie,"LI",{});var Lt=r(be);$o=l(Lt,"The available image classification checkpoints are pre-trained on "),_e=n(Lt,"A",{href:!0,rel:!0});var ns=r(_e);jo=l(ns,"ImageNet-1k"),ns.forEach(o),Co=l(Lt," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes)."),Lt.forEach(o),ko=u(ie),N=n(ie,"LI",{});var tt=r(N);Jo=l(tt,"The segmentation model uses a "),ve=n(tt,"A",{href:!0,rel:!0});var rs=r(ve);Io=l(rs,"DeepLabV3"),rs.forEach(o),Wo=l(tt," head. The available semantic segmentation checkpoints are pre-trained on "),Me=n(tt,"A",{href:!0,rel:!0});var is=r(Me);Eo=l(is,"PASCAL VOC"),is.forEach(o),xo=l(tt,"."),tt.forEach(o),ie.forEach(o),Bt=u(t),F=n(t,"P",{});var ot=r(F);Uo=l(ot,"This model was contributed by "),Te=n(ot,"A",{href:!0,rel:!0});var ls=r(Te);Zo=l(ls,"shehan97"),ls.forEach(o),Fo=l(ot,`.
The original code can be found `),Ve=n(ot,"A",{href:!0,rel:!0});var cs=r(Ve);So=l(cs,"here"),cs.forEach(o),No=l(ot,"."),ot.forEach(o),Pt=u(t),B=n(t,"H2",{class:!0});var Dt=r(B);H=n(Dt,"A",{id:!0,class:!0,href:!0});var ds=r(H);ft=n(ds,"SPAN",{});var ms=r(ft);T(we.$$.fragment,ms),ms.forEach(o),ds.forEach(o),Bo=u(Dt),ut=n(Dt,"SPAN",{});var ps=r(ut);Po=l(ps,"MobileViTV2Config"),ps.forEach(o),Dt.forEach(o),Gt=u(t),k=n(t,"DIV",{class:!0});var le=r(k);T(ye.$$.fragment,le),Go=u(le),P=n(le,"P",{});var at=r(P);zo=l(at,"This is the configuration class to store the configuration of a "),qe=n(at,"A",{href:!0});var hs=r(qe);Ao=l(hs,"MobileViTV2Model"),hs.forEach(o),Ro=l(at,`. It is used to instantiate a
MobileViTV2 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 MobileViTV2
`),$e=n(at,"A",{href:!0,rel:!0});var fs=r($e);Xo=l(fs,"apple/mobilevitv2-1.0"),fs.forEach(o),Yo=l(at," architecture."),at.forEach(o),Qo=u(le),G=n(le,"P",{});var st=r(G);Oo=l(st,"Configuration objects inherit from "),He=n(st,"A",{href:!0});var us=r(He);qo=l(us,"PretrainedConfig"),us.forEach(o),Ho=l(st,` and can be used to control the model outputs. Read the
documentation from `),Le=n(st,"A",{href:!0});var gs=r(Le);Lo=l(gs,"PretrainedConfig"),gs.forEach(o),Do=l(st," for more information."),st.forEach(o),Ko=u(le),T(L.$$.fragment,le),le.forEach(o),zt=u(t),z=n(t,"H2",{class:!0});var Kt=r(z);D=n(Kt,"A",{id:!0,class:!0,href:!0});var bs=r(D);gt=n(bs,"SPAN",{});var _s=r(gt);T(je.$$.fragment,_s),_s.forEach(o),bs.forEach(o),ea=u(Kt),bt=n(Kt,"SPAN",{});var vs=r(bt);ta=l(vs,"MobileViTV2Model"),vs.forEach(o),Kt.forEach(o),At=u(t),Z=n(t,"DIV",{class:!0});var nt=r(Z);T(Ce.$$.fragment,nt),oa=u(nt),ke=n(nt,"P",{});var eo=r(ke);aa=l(eo,`The bare MobileViTV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Je=n(eo,"A",{href:!0,rel:!0});var Ms=r(Je);sa=l(Ms,"torch.nn.Module"),Ms.forEach(o),na=l(eo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),eo.forEach(o),ra=u(nt),E=n(nt,"DIV",{class:!0});var ce=r(E);T(Ie.$$.fragment,ce),ia=u(ce),A=n(ce,"P",{});var rt=r(A);la=l(rt,"The "),De=n(rt,"A",{href:!0});var Ts=r(De);ca=l(Ts,"MobileViTV2Model"),Ts.forEach(o),da=l(rt," forward method, overrides the "),_t=n(rt,"CODE",{});var Vs=r(_t);ma=l(Vs,"__call__"),Vs.forEach(o),pa=l(rt," special method."),rt.forEach(o),ha=u(ce),T(K.$$.fragment,ce),fa=u(ce),T(ee.$$.fragment,ce),ce.forEach(o),nt.forEach(o),Rt=u(t),R=n(t,"H2",{class:!0});var to=r(R);te=n(to,"A",{id:!0,class:!0,href:!0});var ws=r(te);vt=n(ws,"SPAN",{});var ys=r(vt);T(We.$$.fragment,ys),ys.forEach(o),ws.forEach(o),ua=u(to),Mt=n(to,"SPAN",{});var $s=r(Mt);ga=l($s,"MobileViTV2ForImageClassification"),$s.forEach(o),to.forEach(o),Xt=u(t),J=n(t,"DIV",{class:!0});var de=r(J);T(Ee.$$.fragment,de),ba=u(de),Tt=n(de,"P",{});var js=r(Tt);_a=l(js,`MobileViTV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),js.forEach(o),va=u(de),xe=n(de,"P",{});var oo=r(xe);Ma=l(oo,"This model is a PyTorch "),Ue=n(oo,"A",{href:!0,rel:!0});var Cs=r(Ue);Ta=l(Cs,"torch.nn.Module"),Cs.forEach(o),Va=l(oo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),oo.forEach(o),wa=u(de),x=n(de,"DIV",{class:!0});var me=r(x);T(Ze.$$.fragment,me),ya=u(me),X=n(me,"P",{});var it=r(X);$a=l(it,"The "),Ke=n(it,"A",{href:!0});var ks=r(Ke);ja=l(ks,"MobileViTV2ForImageClassification"),ks.forEach(o),Ca=l(it," forward method, overrides the "),Vt=n(it,"CODE",{});var Js=r(Vt);ka=l(Js,"__call__"),Js.forEach(o),Ja=l(it," special method."),it.forEach(o),Ia=u(me),T(oe.$$.fragment,me),Wa=u(me),T(ae.$$.fragment,me),me.forEach(o),de.forEach(o),Yt=u(t),Y=n(t,"H2",{class:!0});var ao=r(Y);se=n(ao,"A",{id:!0,class:!0,href:!0});var Is=r(se);wt=n(Is,"SPAN",{});var Ws=r(wt);T(Fe.$$.fragment,Ws),Ws.forEach(o),Is.forEach(o),Ea=u(ao),yt=n(ao,"SPAN",{});var Es=r(yt);xa=l(Es,"MobileViTV2ForSemanticSegmentation"),Es.forEach(o),ao.forEach(o),Qt=u(t),I=n(t,"DIV",{class:!0});var pe=r(I);T(Se.$$.fragment,pe),Ua=u(pe),$t=n(pe,"P",{});var xs=r($t);Za=l(xs,"MobileViTV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),xs.forEach(o),Fa=u(pe),Ne=n(pe,"P",{});var so=r(Ne);Sa=l(so,"This model is a PyTorch "),Be=n(so,"A",{href:!0,rel:!0});var Us=r(Be);Na=l(Us,"torch.nn.Module"),Us.forEach(o),Ba=l(so,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),so.forEach(o),Pa=u(pe),U=n(pe,"DIV",{class:!0});var he=r(U);T(Pe.$$.fragment,he),Ga=u(he),Q=n(he,"P",{});var lt=r(Q);za=l(lt,"The "),et=n(lt,"A",{href:!0});var Zs=r(et);Aa=l(Zs,"MobileViTV2ForSemanticSegmentation"),Zs.forEach(o),Ra=l(lt," forward method, overrides the "),jt=n(lt,"CODE",{});var Fs=r(jt);Xa=l(Fs,"__call__"),Fs.forEach(o),Ya=l(lt," special method."),lt.forEach(o),Qa=u(he),T(ne.$$.fragment,he),Oa=u(he),T(re.$$.fragment,he),he.forEach(o),pe.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Hs)),d(m,"id","mobilevitv2"),d(m,"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"),d(m,"href","#mobilevitv2"),d(g,"class","relative group"),d(O,"id","overview"),d(O,"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"),d(O,"href","#overview"),d(S,"class","relative group"),d(ue,"href","https://arxiv.org/abs/2206.02680"),d(ue,"rel","nofollow"),d(Oe,"href","/docs/transformers/main/en/model_doc/mobilevit#transformers.MobileViTImageProcessor"),d(_e,"href","https://huggingface.co/datasets/imagenet-1k"),d(_e,"rel","nofollow"),d(ve,"href","https://arxiv.org/abs/1706.05587"),d(ve,"rel","nofollow"),d(Me,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),d(Me,"rel","nofollow"),d(Te,"href","https://huggingface.co/shehan97"),d(Te,"rel","nofollow"),d(Ve,"href","https://github.com/apple/ml-cvnets"),d(Ve,"rel","nofollow"),d(H,"id","transformers.MobileViTV2Config"),d(H,"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"),d(H,"href","#transformers.MobileViTV2Config"),d(B,"class","relative group"),d(qe,"href","/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Model"),d($e,"href","https://huggingface.co/apple/mobilevitv2-1.0"),d($e,"rel","nofollow"),d(He,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Le,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"id","transformers.MobileViTV2Model"),d(D,"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"),d(D,"href","#transformers.MobileViTV2Model"),d(z,"class","relative group"),d(Je,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Je,"rel","nofollow"),d(De,"href","/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2Model"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"id","transformers.MobileViTV2ForImageClassification"),d(te,"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"),d(te,"href","#transformers.MobileViTV2ForImageClassification"),d(R,"class","relative group"),d(Ue,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ue,"rel","nofollow"),d(Ke,"href","/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2ForImageClassification"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"id","transformers.MobileViTV2ForSemanticSegmentation"),d(se,"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"),d(se,"href","#transformers.MobileViTV2ForSemanticSegmentation"),d(Y,"class","relative group"),d(Be,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Be,"rel","nofollow"),d(et,"href","/docs/transformers/main/en/model_doc/mobilevitv2#transformers.MobileViTV2ForSemanticSegmentation"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,c),b(t,v,h),b(t,g,h),e(g,m),e(m,_),V(a,_,null),e(g,p),e(g,C),e(C,lo),b(t,Et,h),b(t,S,h),e(S,O),e(O,dt),V(fe,dt,null),e(S,co),e(S,mt),e(mt,mo),b(t,xt,h),b(t,q,h),e(q,po),e(q,ue),e(ue,ho),e(q,fo),b(t,Ut,h),b(t,Re,h),e(Re,uo),b(t,Zt,h),b(t,Xe,h),e(Xe,go),b(t,Ft,h),b(t,Ye,h),e(Ye,pt),e(pt,bo),b(t,St,h),b(t,Qe,h),e(Qe,_o),b(t,Nt,h),b(t,W,h),e(W,ht),e(ht,vo),e(W,Mo),e(W,ge),e(ge,To),e(ge,Oe),e(Oe,Vo),e(ge,wo),e(W,yo),e(W,be),e(be,$o),e(be,_e),e(_e,jo),e(be,Co),e(W,ko),e(W,N),e(N,Jo),e(N,ve),e(ve,Io),e(N,Wo),e(N,Me),e(Me,Eo),e(N,xo),b(t,Bt,h),b(t,F,h),e(F,Uo),e(F,Te),e(Te,Zo),e(F,Fo),e(F,Ve),e(Ve,So),e(F,No),b(t,Pt,h),b(t,B,h),e(B,H),e(H,ft),V(we,ft,null),e(B,Bo),e(B,ut),e(ut,Po),b(t,Gt,h),b(t,k,h),V(ye,k,null),e(k,Go),e(k,P),e(P,zo),e(P,qe),e(qe,Ao),e(P,Ro),e(P,$e),e($e,Xo),e(P,Yo),e(k,Qo),e(k,G),e(G,Oo),e(G,He),e(He,qo),e(G,Ho),e(G,Le),e(Le,Lo),e(G,Do),e(k,Ko),V(L,k,null),b(t,zt,h),b(t,z,h),e(z,D),e(D,gt),V(je,gt,null),e(z,ea),e(z,bt),e(bt,ta),b(t,At,h),b(t,Z,h),V(Ce,Z,null),e(Z,oa),e(Z,ke),e(ke,aa),e(ke,Je),e(Je,sa),e(ke,na),e(Z,ra),e(Z,E),V(Ie,E,null),e(E,ia),e(E,A),e(A,la),e(A,De),e(De,ca),e(A,da),e(A,_t),e(_t,ma),e(A,pa),e(E,ha),V(K,E,null),e(E,fa),V(ee,E,null),b(t,Rt,h),b(t,R,h),e(R,te),e(te,vt),V(We,vt,null),e(R,ua),e(R,Mt),e(Mt,ga),b(t,Xt,h),b(t,J,h),V(Ee,J,null),e(J,ba),e(J,Tt),e(Tt,_a),e(J,va),e(J,xe),e(xe,Ma),e(xe,Ue),e(Ue,Ta),e(xe,Va),e(J,wa),e(J,x),V(Ze,x,null),e(x,ya),e(x,X),e(X,$a),e(X,Ke),e(Ke,ja),e(X,Ca),e(X,Vt),e(Vt,ka),e(X,Ja),e(x,Ia),V(oe,x,null),e(x,Wa),V(ae,x,null),b(t,Yt,h),b(t,Y,h),e(Y,se),e(se,wt),V(Fe,wt,null),e(Y,Ea),e(Y,yt),e(yt,xa),b(t,Qt,h),b(t,I,h),V(Se,I,null),e(I,Ua),e(I,$t),e($t,Za),e(I,Fa),e(I,Ne),e(Ne,Sa),e(Ne,Be),e(Be,Na),e(Ne,Ba),e(I,Pa),e(I,U),V(Pe,U,null),e(U,Ga),e(U,Q),e(Q,za),e(Q,et),e(et,Aa),e(Q,Ra),e(Q,jt),e(jt,Xa),e(Q,Ya),e(U,Qa),V(ne,U,null),e(U,Oa),V(re,U,null),Ot=!0},p(t,[h]){const Ge={};h&2&&(Ge.$$scope={dirty:h,ctx:t}),L.$set(Ge);const Ct={};h&2&&(Ct.$$scope={dirty:h,ctx:t}),K.$set(Ct);const kt={};h&2&&(kt.$$scope={dirty:h,ctx:t}),ee.$set(kt);const Jt={};h&2&&(Jt.$$scope={dirty:h,ctx:t}),oe.$set(Jt);const ze={};h&2&&(ze.$$scope={dirty:h,ctx:t}),ae.$set(ze);const It={};h&2&&(It.$$scope={dirty:h,ctx:t}),ne.$set(It);const Wt={};h&2&&(Wt.$$scope={dirty:h,ctx:t}),re.$set(Wt)},i(t){Ot||(w(a.$$.fragment,t),w(fe.$$.fragment,t),w(we.$$.fragment,t),w(ye.$$.fragment,t),w(L.$$.fragment,t),w(je.$$.fragment,t),w(Ce.$$.fragment,t),w(Ie.$$.fragment,t),w(K.$$.fragment,t),w(ee.$$.fragment,t),w(We.$$.fragment,t),w(Ee.$$.fragment,t),w(Ze.$$.fragment,t),w(oe.$$.fragment,t),w(ae.$$.fragment,t),w(Fe.$$.fragment,t),w(Se.$$.fragment,t),w(Pe.$$.fragment,t),w(ne.$$.fragment,t),w(re.$$.fragment,t),Ot=!0)},o(t){y(a.$$.fragment,t),y(fe.$$.fragment,t),y(we.$$.fragment,t),y(ye.$$.fragment,t),y(L.$$.fragment,t),y(je.$$.fragment,t),y(Ce.$$.fragment,t),y(Ie.$$.fragment,t),y(K.$$.fragment,t),y(ee.$$.fragment,t),y(We.$$.fragment,t),y(Ee.$$.fragment,t),y(Ze.$$.fragment,t),y(oe.$$.fragment,t),y(ae.$$.fragment,t),y(Fe.$$.fragment,t),y(Se.$$.fragment,t),y(Pe.$$.fragment,t),y(ne.$$.fragment,t),y(re.$$.fragment,t),Ot=!1},d(t){o(c),t&&o(v),t&&o(g),$(a),t&&o(Et),t&&o(S),$(fe),t&&o(xt),t&&o(q),t&&o(Ut),t&&o(Re),t&&o(Zt),t&&o(Xe),t&&o(Ft),t&&o(Ye),t&&o(St),t&&o(Qe),t&&o(Nt),t&&o(W),t&&o(Bt),t&&o(F),t&&o(Pt),t&&o(B),$(we),t&&o(Gt),t&&o(k),$(ye),$(L),t&&o(zt),t&&o(z),$(je),t&&o(At),t&&o(Z),$(Ce),$(Ie),$(K),$(ee),t&&o(Rt),t&&o(R),$(We),t&&o(Xt),t&&o(J),$(Ee),$(Ze),$(oe),$(ae),t&&o(Yt),t&&o(Y),$(Fe),t&&o(Qt),t&&o(I),$(Se),$(Pe),$(ne),$(re)}}}const Hs={local:"mobilevitv2",sections:[{local:"overview",title:"Overview"},{local:"transformers.MobileViTV2Config",title:"MobileViTV2Config"},{local:"transformers.MobileViTV2Model",title:"MobileViTV2Model"},{local:"transformers.MobileViTV2ForImageClassification",title:"MobileViTV2ForImageClassification"},{local:"transformers.MobileViTV2ForSemanticSegmentation",title:"MobileViTV2ForSemanticSegmentation"}],title:"MobileViTV2"};function Ls(j){return Gs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sn extends Ss{constructor(c){super();Ns(this,c,Ls,qs,Bs,{})}}export{sn as default,Hs as metadata};
