import{s as Gt,o as Ht,n as qt}from"../chunks/scheduler.7bc62968.js";import{S as Ft,i as Pt,g as i,s as n,r as f,A as Qt,h as o,f as l,c as a,j as At,u as M,x as p,k as St,y as zt,a as s,v as u,d as y,t as d,w as T,m as Et,n as Rt}from"../chunks/index.2f8492b0.js";import{T as Nt}from"../chunks/Tip.016f38d9.js";import{C as Me}from"../chunks/CodeBlock.4e96d6f7.js";import{H as me}from"../chunks/Heading.14fb2476.js";function Yt(he){let r;return{c(){r=Et("A receptive field is the size of a region in an input space that affects the features of a particular layer.")},l(m){r=Rt(m,"A receptive field is the size of a region in an input space that affects the features of a particular layer.")},m(m,w){s(m,r,w)},d(m){m&&l(r)}}}function Lt(he){let r,m,w='Separable self-attention was also not the first paper to have O(k) complexity. In Linformer, O(k) complexity for Attention was also achived in <a href="https://arxiv.org/abs/2006.04768" rel="nofollow">Linformer</a> before separable self-attention.',b,h,v="However, it still used costly operations like batch-wise matrix multiplications";return{c(){r=Et(`There have been many other forms of Attention such that complexity has ranged from O(k), O(k*sqrt(k)), O(k*log(k)).
`),m=i("p"),m.innerHTML=w,b=n(),h=i("p"),h.textContent=v},l(c){r=Rt(c,`There have been many other forms of Attention such that complexity has ranged from O(k), O(k*sqrt(k)), O(k*log(k)).
`),m=o(c,"P",{"data-svelte-h":!0}),p(m)!=="svelte-p9d7mq"&&(m.innerHTML=w),b=a(c),h=o(c,"P",{"data-svelte-h":!0}),p(h)!=="svelte-et1xcu"&&(h.textContent=v)},m(c,j){s(c,r,j),s(c,m,j),s(c,b,j),s(c,h,j)},p:qt,d(c){c&&(l(r),l(m),l(b),l(h))}}}function Xt(he){let r,m,w,b,h,v,c,j="The previously discussed Vision Transformer architectures are computationally intensive and hard to run on mobile devices. The previous state-of-the-art architecture used CNNs for mobile vision tasks. However, CNNs cannot learn global representations, and as a result they perform worse than their transformer counterparts.",ue,U,at="The MobileViT architecture aims to solve the required problems for vision mobile tasks, such as low-latency and lightweight architecture, while providing the advantages of transformers and CNNs. The mobileViT Architecture was developed by Apple and builds MobileNet from Google’s research team. The MobileViT architecture builds upon the previous MobileNet architecture by adding the MobileViT Block and separable self-attention. These two features allow for lightning-fast latency, reduction of parameters, computational complexity, and deployment of vision ML models on resource-constrained devices.",ye,g,de,I,it=`The architecture of MobileViT presented in the paper “MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer” by Sachin Mehta and Mohammad Rastegari is as follows:
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/MobileViT-Architecture.png" alt="MobileViT Architecture"/>`,Te,x,ot="Some of this should look similar to the previous chapter. The MobileNet blocks, nxn convolutions, downsampling, global pooling, and the final linear layer.",we,$,pt="As seen by the global pooling layer and the linear layer, the model shown here is for classification. However, the same blocks introduced in this paper can be used for a variety of vision applications.",be,k,Ce,V,rt="The MobileViT block combines CNN’s local processing and global processing, as seen in transformers. It uses a combination of convolutions and a transformer layer, allowing it to capture spatially local information and global dependencies in the data.",Je,Z,ct=`A diagram of the MobileViT Block is shown below:
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/MobileViT-MobileViTBlock.png" alt="MobileViT Block"/>`,ve,B,mt="Okay, that’s a lot to take in. Let’s break that down.",je,W,ht="<li>The block takes in an image with multiple channels. Let’s say for an RGB image 3 channels, so the block takes in a three channeled image.</li> <li>It then performs a N by N convolution on the channels appending them to the existing channels</li> <li>The block then creates a linear combination of these channels and adds them to the existing stack of channels.</li> <li>For each channel these images are unfolded into flattened patches.</li> <li>Then these flattened patches are passed through a transformer to project them into new patches.</li> <li>These patches are then folded back together to create an image with d dimensions.</li> <li>Afterwards a pointwise convolution is overlayed on the stitched image.</li> <li>And then the stitched image is then recombined with the original RGB images.</li>",Ue,_,ft="This approach allows for a receptive field of H x W (the entire input size) while modeling non-local dependencies and local dependencies through retaining patch locational information. This can be seen in the unfolding and refolding of the patches.",ge,C,Ie,A,Mt=`This compound approach allows MobileViT to have fewer parameters than traditional CNNs and even better accuracy!
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/MobileViT-CNNPreformance.png" alt="MobileViT CNNPreformance"/>`,xe,S,ut="The main efficiency bottleneck in the original MobileViT architecture is the multi-head self-attention in Transformers, which requires O(k^2) time complexity concerning the input tokens.",$e,N,yt="Multi-head self-attention also requires costly operations like batch-wise matrix multiplications, which can impact latency on resource-constrained devices.",ke,E,dt="These same authors wrote another paper on exactly how to make attention operate faster. They’ve called it separable self-attention.",Ve,R,Ze,G,Tt="In traditional multihead attention, the big O concerning input tokens is quadratic (O(k^2)). Separable self-attention introduced in this paper has a complexity of O(k) concerning input tokens.",Be,H,wt="In addition, the attention method does not use any batch-wise matrix multiplications, which helps reduce latency on resource-constrained devices like mobile phones.",We,q,bt="This is a massive improvement!",_e,J,Ae,F,Ct=`A comparison between the attention mechanisms in Transformer, Linformer, and MobileViT is shown below:
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/MobileViT-Attention.png" alt="Attention Comparison"/>`,Se,P,Jt="The image above gives a comparison of each of the individual types of attention between the Transformer, Linformer, and MobileViT v2 architectures.",Ne,Q,vt="For example, in both the transformer and Linformer architectures, the attention computations perform two batch-wise matrix multiplications.",Ee,z,jt="However, in the case of separable self-attention, these two batch-wise multiplications are replaced by two separate linear computations. This allows for further boosted inference speed.",Re,Y,Ge,L,Ut="MobileViT blocks retain spatially local information while developing global representations, combining the strengths of Transformers and CNNs. They provide a receptive field that encompasses the entire image.",He,X,gt=`The introduction of separable self-attention into this existing architecture even further boosted both accuracy and inference speed.
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/MobileViT-Inference.png" alt="Inference Tests"/>`,qe,O,It="Tests performed with different architectures on the iPhone 12s exhibited a large jump in performance with the introduction of separable attention, as shown above!",Fe,K,xt="Overall, the MobileViT Architecture is an extraordinarily powerful architecture for resource-limited vision tasks that provides fast inference and high accuracy.",Pe,D,Qe,ee,$t="If you want to try out MobileViTv2 locally, you can use it from HuggingFace’s <code>transformers</code> library, here’s how:",ze,te,Ye,le,kt="Below is a short snippet on how to use MobileViT model to classify an image.",Le,se,Xe,ne,Oe,ae,Vt=`For an even lighter computer vision setup, you can use the Hugging Face Inference API with MobileViTv2.
Inference API is an API to interact with many models available on Hugging Face Hub.
We can query Inference API like following through Python.`,Ke,ie,De,oe,Zt="We can do the same with javascript like following.",et,pe,tt,re,Bt="Finally, we can query inference API through curl.",lt,ce,st,fe,nt;return h=new me({props:{title:"MobileViT v2",local:"mobilevit-v2",headingTag:"h1"}}),g=new me({props:{title:"MobileViT Architecture",local:"mobilevit-architecture",headingTag:"h2"}}),k=new me({props:{title:"MobileViT Block",local:"mobilevit-block",headingTag:"h2"}}),C=new Nt({props:{$$slots:{default:[Yt]},$$scope:{ctx:he}}}),R=new me({props:{title:"Separable Self-attention",local:"separable-self-attention",headingTag:"h1"}}),J=new Nt({props:{$$slots:{default:[Lt]},$$scope:{ctx:he}}}),Y=new me({props:{title:"Conclusion",local:"conclusion",headingTag:"h1"}}),D=new me({props:{title:"Transformers Library",local:"transformers-library",headingTag:"h1"}}),te=new Me({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycw==",highlighted:"pip install transformers",wrap:!1}}),se=new Me({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZVZpVFYyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmFwcGxlJTJGbW9iaWxldml0djItMS4wLWltYWdlbmV0MWstMjU2JTIyJTBBKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlVmlUVjJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJhcHBsZSUyRm1vYmlsZXZpdHYyLTEuMC1pbWFnZW5ldDFrLTI1NiUyMiUwQSklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileViTV2ForImageClassification
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

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

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

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

logits = model(**inputs).logits

<span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])`,wrap:!1}}),ne=new me({props:{title:"Inference API",local:"inference-api",headingTag:"h1"}}),ie=new Me({props:{code:"aW1wb3J0JTIwanNvbiUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBaGVhZGVycyUyMCUzRCUyMCU3QiUyMkF1dGhvcml6YXRpb24lMjIlM0ElMjBmJTIyQmVhcmVyJTIwJTdCQVBJX1RPS0VOJTdEJTIyJTdEJTBBQVBJX1VSTCUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmFwaS1pbmZlcmVuY2UuaHVnZ2luZ2ZhY2UuY28lMkZtb2RlbHMlMkZhcHBsZSUyRm1vYmlsZXZpdHYyLTEuMC1pbWFnZW5ldDFrLTI1NiUyMiUwQSklMEElMEElMEFkZWYlMjBxdWVyeShmaWxlbmFtZSklM0ElMEElMjAlMjAlMjAlMjB3aXRoJTIwb3BlbihmaWxlbmFtZSUyQyUyMCUyMnJiJTIyKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGRhdGElMjAlM0QlMjBmLnJlYWQoKSUwQSUyMCUyMCUyMCUyMHJlc3BvbnNlJTIwJTNEJTIwcmVxdWVzdHMucmVxdWVzdCglMjJQT1NUJTIyJTJDJTIwQVBJX1VSTCUyQyUyMGhlYWRlcnMlM0RoZWFkZXJzJTJDJTIwZGF0YSUzRGRhdGEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwanNvbi5sb2FkcyhyZXNwb25zZS5jb250ZW50LmRlY29kZSglMjJ1dGYtOCUyMikpJTBBJTBBJTBBZGF0YSUyMCUzRCUyMHF1ZXJ5KCUyMmNhdHMuanBnJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> json
<span class="hljs-keyword">import</span> requests

headers = {<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{API_TOKEN}</span>&quot;</span>}
API_URL = (
    <span class="hljs-string">&quot;https://api-inference.huggingface.co/models/apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>
)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">query</span>(<span class="hljs-params">filename</span>):
    <span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(filename, <span class="hljs-string">&quot;rb&quot;</span>) <span class="hljs-keyword">as</span> f:
        data = f.read()
    response = requests.request(<span class="hljs-string">&quot;POST&quot;</span>, API_URL, headers=headers, data=data)
    <span class="hljs-keyword">return</span> json.loads(response.content.decode(<span class="hljs-string">&quot;utf-8&quot;</span>))


data = query(<span class="hljs-string">&quot;cats.jpg&quot;</span>)`,wrap:!1}}),pe=new Me({props:{code:"aW1wb3J0JTIwZmV0Y2glMjBmcm9tJTIwJTIybm9kZS1mZXRjaCUyMiUzQiUwQWltcG9ydCUyMGZzJTIwZnJvbSUyMCUyMmZzJTIyJTNCJTBBYXN5bmMlMjBmdW5jdGlvbiUyMHF1ZXJ5KGZpbGVuYW1lKSUyMCU3QiUwQSUyMCUyMCUyMCUyMGNvbnN0JTIwZGF0YSUyMCUzRCUyMGZzLnJlYWRGaWxlU3luYyhmaWxlbmFtZSklM0IlMEElMjAlMjAlMjAlMjBjb25zdCUyMHJlc3BvbnNlJTIwJTNEJTIwYXdhaXQlMjBmZXRjaCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmFwaS1pbmZlcmVuY2UuaHVnZ2luZ2ZhY2UuY28lMkZtb2RlbHMlMkZhcHBsZSUyRm1vYmlsZXZpdHYyLTEuMC1pbWFnZW5ldDFrLTI1NiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGhlYWRlcnMlM0ElMjAlN0IlMjBBdXRob3JpemF0aW9uJTNBJTIwJTYwQmVhcmVyJTIwJTI0JTdCQVBJX1RPS0VOJTdEJTYwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWV0aG9kJTNBJTIwJTIyUE9TVCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJvZHklM0ElMjBkYXRhJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwKSUzQiUwQSUyMCUyMCUyMCUyMGNvbnN0JTIwcmVzdWx0JTIwJTNEJTIwYXdhaXQlMjByZXNwb25zZS5qc29uKCklM0IlMEElMjAlMjAlMjAlMjByZXR1cm4lMjByZXN1bHQlM0IlMEElN0QlMEFxdWVyeSglMjJjYXRzLmpwZyUyMikudGhlbigocmVzcG9uc2UpJTIwJTNEJTNFJTIwJTdCJTBBJTIwJTIwJTIwJTIwY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkocmVzcG9uc2UpKSUzQiUwQSU3RCklM0I=",highlighted:`<span class="hljs-keyword">import</span> fetch <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;node-fetch&quot;</span>;
<span class="hljs-keyword">import</span> fs <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;fs&quot;</span>;
<span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">query</span>(<span class="hljs-params">filename</span>) {
    <span class="hljs-keyword">const</span> data = fs.<span class="hljs-title function_">readFileSync</span>(filename);
    <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> <span class="hljs-title function_">fetch</span>(
        <span class="hljs-string">&quot;https://api-inference.huggingface.co/models/apple/mobilevitv2-1.0-imagenet1k-256&quot;</span>,
        {
            <span class="hljs-attr">headers</span>: { <span class="hljs-title class_">Authorization</span>: <span class="hljs-string">\`Bearer <span class="hljs-subst">\${API_TOKEN}</span>\`</span> },
            <span class="hljs-attr">method</span>: <span class="hljs-string">&quot;POST&quot;</span>,
            <span class="hljs-attr">body</span>: data,
        }
    );
    <span class="hljs-keyword">const</span> result = <span class="hljs-keyword">await</span> response.<span class="hljs-title function_">json</span>();
    <span class="hljs-keyword">return</span> result;
}
<span class="hljs-title function_">query</span>(<span class="hljs-string">&quot;cats.jpg&quot;</span>).<span class="hljs-title function_">then</span>(<span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-title class_">JSON</span>.<span class="hljs-title function_">stringify</span>(response));
});`,wrap:!1}}),ce=new Me({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGYXBpLWluZmVyZW5jZS5odWdnaW5nZmFjZS5jbyUyRm1vZGVscyUyRmFwcGxlJTJGbW9iaWxldml0djItMS4wLWltYWdlbmV0MWstMjU2JTIwJTVDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLVglMjBQT1NUJTIwJTVDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLS1kYXRhLWJpbmFyeSUyMCclNDBjYXRzLmpwZyclMjAlNUMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjQlN0JIRl9BUElfVE9LRU4lN0QlMjI=",highlighted:`curl https://api-inference.huggingface.co/models/apple/mobilevitv2-1.0-imagenet1k-256 \\
        -X POST \\
        --data-binary <span class="hljs-string">&#x27;@cats.jpg&#x27;</span> \\
        -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">\${HF_API_TOKEN}</span>&quot;</span>`,wrap:!1}}),{c(){r=i("meta"),m=n(),w=i("p"),b=n(),f(h.$$.fragment),v=n(),c=i("p"),c.textContent=j,ue=n(),U=i("p"),U.textContent=at,ye=n(),f(g.$$.fragment),de=n(),I=i("p"),I.innerHTML=it,Te=n(),x=i("p"),x.textContent=ot,we=n(),$=i("p"),$.textContent=pt,be=n(),f(k.$$.fragment),Ce=n(),V=i("p"),V.textContent=rt,Je=n(),Z=i("p"),Z.innerHTML=ct,ve=n(),B=i("p"),B.textContent=mt,je=n(),W=i("ul"),W.innerHTML=ht,Ue=n(),_=i("p"),_.textContent=ft,ge=n(),f(C.$$.fragment),Ie=n(),A=i("p"),A.innerHTML=Mt,xe=n(),S=i("p"),S.textContent=ut,$e=n(),N=i("p"),N.textContent=yt,ke=n(),E=i("p"),E.textContent=dt,Ve=n(),f(R.$$.fragment),Ze=n(),G=i("p"),G.textContent=Tt,Be=n(),H=i("p"),H.textContent=wt,We=n(),q=i("p"),q.textContent=bt,_e=n(),f(J.$$.fragment),Ae=n(),F=i("p"),F.innerHTML=Ct,Se=n(),P=i("p"),P.textContent=Jt,Ne=n(),Q=i("p"),Q.textContent=vt,Ee=n(),z=i("p"),z.textContent=jt,Re=n(),f(Y.$$.fragment),Ge=n(),L=i("p"),L.textContent=Ut,He=n(),X=i("p"),X.innerHTML=gt,qe=n(),O=i("p"),O.textContent=It,Fe=n(),K=i("p"),K.textContent=xt,Pe=n(),f(D.$$.fragment),Qe=n(),ee=i("p"),ee.innerHTML=$t,ze=n(),f(te.$$.fragment),Ye=n(),le=i("p"),le.textContent=kt,Le=n(),f(se.$$.fragment),Xe=n(),f(ne.$$.fragment),Oe=n(),ae=i("p"),ae.textContent=Vt,Ke=n(),f(ie.$$.fragment),De=n(),oe=i("p"),oe.textContent=Zt,et=n(),f(pe.$$.fragment),tt=n(),re=i("p"),re.textContent=Bt,lt=n(),f(ce.$$.fragment),st=n(),fe=i("p"),this.h()},l(e){const t=Qt("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(l),m=a(e),w=o(e,"P",{}),At(w).forEach(l),b=a(e),M(h.$$.fragment,e),v=a(e),c=o(e,"P",{"data-svelte-h":!0}),p(c)!=="svelte-a5sr6t"&&(c.textContent=j),ue=a(e),U=o(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-10z2vs1"&&(U.textContent=at),ye=a(e),M(g.$$.fragment,e),de=a(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-bmj0ue"&&(I.innerHTML=it),Te=a(e),x=o(e,"P",{"data-svelte-h":!0}),p(x)!=="svelte-13qcall"&&(x.textContent=ot),we=a(e),$=o(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-1ev9nks"&&($.textContent=pt),be=a(e),M(k.$$.fragment,e),Ce=a(e),V=o(e,"P",{"data-svelte-h":!0}),p(V)!=="svelte-16bokny"&&(V.textContent=rt),Je=a(e),Z=o(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-1ty6jj8"&&(Z.innerHTML=ct),ve=a(e),B=o(e,"P",{"data-svelte-h":!0}),p(B)!=="svelte-18vonjn"&&(B.textContent=mt),je=a(e),W=o(e,"UL",{"data-svelte-h":!0}),p(W)!=="svelte-ywalfj"&&(W.innerHTML=ht),Ue=a(e),_=o(e,"P",{"data-svelte-h":!0}),p(_)!=="svelte-1ks87bx"&&(_.textContent=ft),ge=a(e),M(C.$$.fragment,e),Ie=a(e),A=o(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-10ehg4e"&&(A.innerHTML=Mt),xe=a(e),S=o(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-1jrpgtq"&&(S.textContent=ut),$e=a(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1w3wo1k"&&(N.textContent=yt),ke=a(e),E=o(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-svxq7o"&&(E.textContent=dt),Ve=a(e),M(R.$$.fragment,e),Ze=a(e),G=o(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-1cmet3s"&&(G.textContent=Tt),Be=a(e),H=o(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-zdrtnh"&&(H.textContent=wt),We=a(e),q=o(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-15m63ew"&&(q.textContent=bt),_e=a(e),M(J.$$.fragment,e),Ae=a(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-3skqhs"&&(F.innerHTML=Ct),Se=a(e),P=o(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-17i0vc"&&(P.textContent=Jt),Ne=a(e),Q=o(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-1pddr69"&&(Q.textContent=vt),Ee=a(e),z=o(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1gc2js8"&&(z.textContent=jt),Re=a(e),M(Y.$$.fragment,e),Ge=a(e),L=o(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-1lfv2sg"&&(L.textContent=Ut),He=a(e),X=o(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-5csdhs"&&(X.innerHTML=gt),qe=a(e),O=o(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-pkj3bq"&&(O.textContent=It),Fe=a(e),K=o(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-qdo4d3"&&(K.textContent=xt),Pe=a(e),M(D.$$.fragment,e),Qe=a(e),ee=o(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-2kyg2y"&&(ee.innerHTML=$t),ze=a(e),M(te.$$.fragment,e),Ye=a(e),le=o(e,"P",{"data-svelte-h":!0}),p(le)!=="svelte-qgp6vb"&&(le.textContent=kt),Le=a(e),M(se.$$.fragment,e),Xe=a(e),M(ne.$$.fragment,e),Oe=a(e),ae=o(e,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-1iqg6dj"&&(ae.textContent=Vt),Ke=a(e),M(ie.$$.fragment,e),De=a(e),oe=o(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-1fv3ued"&&(oe.textContent=Zt),et=a(e),M(pe.$$.fragment,e),tt=a(e),re=o(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-6diubf"&&(re.textContent=Bt),lt=a(e),M(ce.$$.fragment,e),st=a(e),fe=o(e,"P",{}),At(fe).forEach(l),this.h()},h(){St(r,"name","hf:doc:metadata"),St(r,"content",Ot)},m(e,t){zt(document.head,r),s(e,m,t),s(e,w,t),s(e,b,t),u(h,e,t),s(e,v,t),s(e,c,t),s(e,ue,t),s(e,U,t),s(e,ye,t),u(g,e,t),s(e,de,t),s(e,I,t),s(e,Te,t),s(e,x,t),s(e,we,t),s(e,$,t),s(e,be,t),u(k,e,t),s(e,Ce,t),s(e,V,t),s(e,Je,t),s(e,Z,t),s(e,ve,t),s(e,B,t),s(e,je,t),s(e,W,t),s(e,Ue,t),s(e,_,t),s(e,ge,t),u(C,e,t),s(e,Ie,t),s(e,A,t),s(e,xe,t),s(e,S,t),s(e,$e,t),s(e,N,t),s(e,ke,t),s(e,E,t),s(e,Ve,t),u(R,e,t),s(e,Ze,t),s(e,G,t),s(e,Be,t),s(e,H,t),s(e,We,t),s(e,q,t),s(e,_e,t),u(J,e,t),s(e,Ae,t),s(e,F,t),s(e,Se,t),s(e,P,t),s(e,Ne,t),s(e,Q,t),s(e,Ee,t),s(e,z,t),s(e,Re,t),u(Y,e,t),s(e,Ge,t),s(e,L,t),s(e,He,t),s(e,X,t),s(e,qe,t),s(e,O,t),s(e,Fe,t),s(e,K,t),s(e,Pe,t),u(D,e,t),s(e,Qe,t),s(e,ee,t),s(e,ze,t),u(te,e,t),s(e,Ye,t),s(e,le,t),s(e,Le,t),u(se,e,t),s(e,Xe,t),u(ne,e,t),s(e,Oe,t),s(e,ae,t),s(e,Ke,t),u(ie,e,t),s(e,De,t),s(e,oe,t),s(e,et,t),u(pe,e,t),s(e,tt,t),s(e,re,t),s(e,lt,t),u(ce,e,t),s(e,st,t),s(e,fe,t),nt=!0},p(e,[t]){const Wt={};t&2&&(Wt.$$scope={dirty:t,ctx:e}),C.$set(Wt);const _t={};t&2&&(_t.$$scope={dirty:t,ctx:e}),J.$set(_t)},i(e){nt||(y(h.$$.fragment,e),y(g.$$.fragment,e),y(k.$$.fragment,e),y(C.$$.fragment,e),y(R.$$.fragment,e),y(J.$$.fragment,e),y(Y.$$.fragment,e),y(D.$$.fragment,e),y(te.$$.fragment,e),y(se.$$.fragment,e),y(ne.$$.fragment,e),y(ie.$$.fragment,e),y(pe.$$.fragment,e),y(ce.$$.fragment,e),nt=!0)},o(e){d(h.$$.fragment,e),d(g.$$.fragment,e),d(k.$$.fragment,e),d(C.$$.fragment,e),d(R.$$.fragment,e),d(J.$$.fragment,e),d(Y.$$.fragment,e),d(D.$$.fragment,e),d(te.$$.fragment,e),d(se.$$.fragment,e),d(ne.$$.fragment,e),d(ie.$$.fragment,e),d(pe.$$.fragment,e),d(ce.$$.fragment,e),nt=!1},d(e){e&&(l(m),l(w),l(b),l(v),l(c),l(ue),l(U),l(ye),l(de),l(I),l(Te),l(x),l(we),l($),l(be),l(Ce),l(V),l(Je),l(Z),l(ve),l(B),l(je),l(W),l(Ue),l(_),l(ge),l(Ie),l(A),l(xe),l(S),l($e),l(N),l(ke),l(E),l(Ve),l(Ze),l(G),l(Be),l(H),l(We),l(q),l(_e),l(Ae),l(F),l(Se),l(P),l(Ne),l(Q),l(Ee),l(z),l(Re),l(Ge),l(L),l(He),l(X),l(qe),l(O),l(Fe),l(K),l(Pe),l(Qe),l(ee),l(ze),l(Ye),l(le),l(Le),l(Xe),l(Oe),l(ae),l(Ke),l(De),l(oe),l(et),l(tt),l(re),l(lt),l(st),l(fe)),l(r),T(h,e),T(g,e),T(k,e),T(C,e),T(R,e),T(J,e),T(Y,e),T(D,e),T(te,e),T(se,e),T(ne,e),T(ie,e),T(pe,e),T(ce,e)}}}const Ot='{"title":"MobileViT v2","local":"mobilevit-v2","sections":[{"title":"MobileViT Architecture","local":"mobilevit-architecture","sections":[],"depth":2},{"title":"MobileViT Block","local":"mobilevit-block","sections":[],"depth":2}],"depth":1}';function Kt(he){return Ht(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nl extends Ft{constructor(r){super(),Pt(this,r,Kt,Xt,Gt,{})}}export{nl as component};
