import{s as Gt,o as Ht,n as Ft}from"../chunks/scheduler.7bc62968.js";import{S as qt,i as Pt,g as i,s as n,r as f,A as Qt,h as o,f as s,c as a,j as At,u as M,x as p,k as St,y as zt,a as l,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){l(m,r,w)},d(m){m&&s(r)}}}function Lt(he){let r,m,w='Separable self-attention was not the first paper to have O(k) complexity. In Linformer, O(k) complexity for Attention was also achieved 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-1a5ry1c"&&(m.innerHTML=w),b=a(c),h=o(c,"P",{"data-svelte-h":!0}),p(h)!=="svelte-1ajshxs"&&(h.textContent=v)},m(c,j){l(c,r,j),l(c,m,j),l(c,b,j),l(c,h,j)},p:Ft,d(c){c&&(s(r),s(m),s(b),s(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,F,bt="This is a massive improvement!",_e,J,Ae,q,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"/>`,Fe,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!",qe,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,se,kt="Below is a short snippet on how to use MobileViT model to classify an image.",Le,le,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.",st,ce,lt,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}}),le=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(),F=i("p"),F.textContent=bt,_e=n(),f(J.$$.fragment),Ae=n(),q=i("p"),q.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,Fe=n(),O=i("p"),O.textContent=It,qe=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(),se=i("p"),se.textContent=kt,Le=n(),f(le.$$.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,st=n(),f(ce.$$.fragment),lt=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(s),m=a(e),w=o(e,"P",{}),At(w).forEach(s),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),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-15m63ew"&&(F.textContent=bt),_e=a(e),M(J.$$.fragment,e),Ae=a(e),q=o(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-3skqhs"&&(q.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),Fe=a(e),O=o(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-pkj3bq"&&(O.textContent=It),qe=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),se=o(e,"P",{"data-svelte-h":!0}),p(se)!=="svelte-qgp6vb"&&(se.textContent=kt),Le=a(e),M(le.$$.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),st=a(e),M(ce.$$.fragment,e),lt=a(e),fe=o(e,"P",{}),At(fe).forEach(s),this.h()},h(){St(r,"name","hf:doc:metadata"),St(r,"content",Ot)},m(e,t){zt(document.head,r),l(e,m,t),l(e,w,t),l(e,b,t),u(h,e,t),l(e,v,t),l(e,c,t),l(e,ue,t),l(e,U,t),l(e,ye,t),u(g,e,t),l(e,de,t),l(e,I,t),l(e,Te,t),l(e,x,t),l(e,we,t),l(e,$,t),l(e,be,t),u(k,e,t),l(e,Ce,t),l(e,V,t),l(e,Je,t),l(e,Z,t),l(e,ve,t),l(e,B,t),l(e,je,t),l(e,W,t),l(e,Ue,t),l(e,_,t),l(e,ge,t),u(C,e,t),l(e,Ie,t),l(e,A,t),l(e,xe,t),l(e,S,t),l(e,$e,t),l(e,N,t),l(e,ke,t),l(e,E,t),l(e,Ve,t),u(R,e,t),l(e,Ze,t),l(e,G,t),l(e,Be,t),l(e,H,t),l(e,We,t),l(e,F,t),l(e,_e,t),u(J,e,t),l(e,Ae,t),l(e,q,t),l(e,Se,t),l(e,P,t),l(e,Ne,t),l(e,Q,t),l(e,Ee,t),l(e,z,t),l(e,Re,t),u(Y,e,t),l(e,Ge,t),l(e,L,t),l(e,He,t),l(e,X,t),l(e,Fe,t),l(e,O,t),l(e,qe,t),l(e,K,t),l(e,Pe,t),u(D,e,t),l(e,Qe,t),l(e,ee,t),l(e,ze,t),u(te,e,t),l(e,Ye,t),l(e,se,t),l(e,Le,t),u(le,e,t),l(e,Xe,t),u(ne,e,t),l(e,Oe,t),l(e,ae,t),l(e,Ke,t),u(ie,e,t),l(e,De,t),l(e,oe,t),l(e,et,t),u(pe,e,t),l(e,tt,t),l(e,re,t),l(e,st,t),u(ce,e,t),l(e,lt,t),l(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(le.$$.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(le.$$.fragment,e),d(ne.$$.fragment,e),d(ie.$$.fragment,e),d(pe.$$.fragment,e),d(ce.$$.fragment,e),nt=!1},d(e){e&&(s(m),s(w),s(b),s(v),s(c),s(ue),s(U),s(ye),s(de),s(I),s(Te),s(x),s(we),s($),s(be),s(Ce),s(V),s(Je),s(Z),s(ve),s(B),s(je),s(W),s(Ue),s(_),s(ge),s(Ie),s(A),s(xe),s(S),s($e),s(N),s(ke),s(E),s(Ve),s(Ze),s(G),s(Be),s(H),s(We),s(F),s(_e),s(Ae),s(q),s(Se),s(P),s(Ne),s(Q),s(Ee),s(z),s(Re),s(Ge),s(L),s(He),s(X),s(Fe),s(O),s(qe),s(K),s(Pe),s(Qe),s(ee),s(ze),s(Ye),s(se),s(Le),s(Xe),s(Oe),s(ae),s(Ke),s(De),s(oe),s(et),s(tt),s(re),s(st),s(lt),s(fe)),s(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(le,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 ns extends qt{constructor(r){super(),Pt(this,r,Kt,Xt,Gt,{})}}export{ns as component};
