import{s as Pt,o as Qt,n as zt}from"../chunks/scheduler.35aab934.js";import{S as Yt,i as Lt,e as i,s as n,c as h,h as Xt,a as o,d as s,b as a,f as Gt,g as f,j as p,k as Rt,l as Ot,m as l,n as u,t as M,o as y,p as d,q as qt,r as Ft}from"../chunks/index.de17b971.js";import{T as Ht}from"../chunks/Tip.514d77c4.js";import{C as Kt}from"../chunks/CopyLLMTxtMenu.48bc5cc2.js";import{C as ye}from"../chunks/CodeBlock.c1f62de5.js";import{H as fe,E as Dt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8fdece89.js";function es(ue){let r;return{c(){r=qt("A receptive field is the size of a region in an input space that affects the features of a particular layer.")},l(m){r=Ft(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 ts(ue){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,T,j="However, it still used costly operations like batch-wise matrix multiplications.";return{c(){r=qt(`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(),T=i("p"),T.textContent=j},l(c){r=Ft(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),T=o(c,"P",{"data-svelte-h":!0}),p(T)!=="svelte-1ajshxs"&&(T.textContent=j)},m(c,C){l(c,r,C),l(c,m,C),l(c,b,C),l(c,T,C)},p:zt,d(c){c&&(s(r),s(m),s(b),s(T))}}}function ss(ue){let r,m,w,b,T,j,c,C,U,pt="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.",de,g,rt="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.",Te,$,we,I,ct=`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"/>`,be,x,mt="Some of this should look similar to the previous chapter. The MobileNet blocks, nxn convolutions, downsampling, global pooling, and the final linear layer.",Ce,k,ht="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.",ve,V,Je,Z,ft="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,B,ut=`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"/>`,Ue,W,Mt="Okay, that’s a lot to take in. Let’s break that down.",ge,_,yt="<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>",$e,A,dt="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.",Ie,v,xe,S,Tt=`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"/>`,ke,N,wt="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.",Ve,E,bt="Multi-head self-attention also requires costly operations like batch-wise matrix multiplications, which can impact latency on resource-constrained devices.",Ze,G,Ct="These same authors wrote another paper on exactly how to make attention operate faster. They’ve called it separable self-attention.",Be,R,We,H,vt="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.",_e,q,Jt="In addition, the attention method does not use any batch-wise matrix multiplications, which helps reduce latency on resource-constrained devices like mobile phones.",Ae,F,jt="This is a massive improvement!",Se,J,Ne,P,Ut=`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"/>`,Ee,Q,gt="The image above gives a comparison of each of the individual types of attention between the Transformer, Linformer, and MobileViT v2 architectures.",Ge,z,$t="For example, in both the transformer and Linformer architectures, the attention computations perform two batch-wise matrix multiplications.",Re,Y,It="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.",He,L,qe,X,xt="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.",Fe,O,kt=`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"/>`,Pe,K,Vt="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,D,Zt="Overall, the MobileViT Architecture is an extraordinarily powerful architecture for resource-limited vision tasks that provides fast inference and high accuracy.",ze,ee,Ye,te,Bt="If you want to try out MobileViTv2 locally, you can use it from HuggingFace’s <code>transformers</code> library, here’s how:",Le,se,Xe,le,Wt="Below is a short snippet on how to use MobileViT model to classify an image.",Oe,ne,Ke,ae,De,ie,_t=`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.`,et,oe,tt,pe,At="We can do the same with javascript like following.",st,re,lt,ce,St="Finally, we can query inference API through curl.",nt,me,at,he,it,Me,ot;return T=new Kt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),c=new fe({props:{title:"MobileViT v2",local:"mobilevit-v2",headingTag:"h1"}}),$=new fe({props:{title:"MobileViT Architecture",local:"mobilevit-architecture",headingTag:"h2"}}),V=new fe({props:{title:"MobileViT Block",local:"mobilevit-block",headingTag:"h2"}}),v=new Ht({props:{$$slots:{default:[es]},$$scope:{ctx:ue}}}),R=new fe({props:{title:"Separable Self-attention",local:"separable-self-attention",headingTag:"h1"}}),J=new Ht({props:{$$slots:{default:[ts]},$$scope:{ctx:ue}}}),L=new fe({props:{title:"Conclusion",local:"conclusion",headingTag:"h1"}}),ee=new fe({props:{title:"Transformers Library",local:"transformers-library",headingTag:"h1"}}),se=new ye({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycw==",highlighted:"pip install transformers",wrap:!1}}),ne=new ye({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}}),ae=new fe({props:{title:"Inference API",local:"inference-api",headingTag:"h1"}}),oe=new ye({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}}),re=new ye({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}}),me=new ye({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}}),he=new Dt({props:{source:"https://github.com/huggingface/computer-vision-course/blob/main/chapters/en/unit3/vision-transformers/mobilevit.mdx"}}),{c(){r=i("meta"),m=n(),w=i("p"),b=n(),h(T.$$.fragment),j=n(),h(c.$$.fragment),C=n(),U=i("p"),U.textContent=pt,de=n(),g=i("p"),g.textContent=rt,Te=n(),h($.$$.fragment),we=n(),I=i("p"),I.innerHTML=ct,be=n(),x=i("p"),x.textContent=mt,Ce=n(),k=i("p"),k.textContent=ht,ve=n(),h(V.$$.fragment),Je=n(),Z=i("p"),Z.textContent=ft,je=n(),B=i("p"),B.innerHTML=ut,Ue=n(),W=i("p"),W.textContent=Mt,ge=n(),_=i("ul"),_.innerHTML=yt,$e=n(),A=i("p"),A.textContent=dt,Ie=n(),h(v.$$.fragment),xe=n(),S=i("p"),S.innerHTML=Tt,ke=n(),N=i("p"),N.textContent=wt,Ve=n(),E=i("p"),E.textContent=bt,Ze=n(),G=i("p"),G.textContent=Ct,Be=n(),h(R.$$.fragment),We=n(),H=i("p"),H.textContent=vt,_e=n(),q=i("p"),q.textContent=Jt,Ae=n(),F=i("p"),F.textContent=jt,Se=n(),h(J.$$.fragment),Ne=n(),P=i("p"),P.innerHTML=Ut,Ee=n(),Q=i("p"),Q.textContent=gt,Ge=n(),z=i("p"),z.textContent=$t,Re=n(),Y=i("p"),Y.textContent=It,He=n(),h(L.$$.fragment),qe=n(),X=i("p"),X.textContent=xt,Fe=n(),O=i("p"),O.innerHTML=kt,Pe=n(),K=i("p"),K.textContent=Vt,Qe=n(),D=i("p"),D.textContent=Zt,ze=n(),h(ee.$$.fragment),Ye=n(),te=i("p"),te.innerHTML=Bt,Le=n(),h(se.$$.fragment),Xe=n(),le=i("p"),le.textContent=Wt,Oe=n(),h(ne.$$.fragment),Ke=n(),h(ae.$$.fragment),De=n(),ie=i("p"),ie.textContent=_t,et=n(),h(oe.$$.fragment),tt=n(),pe=i("p"),pe.textContent=At,st=n(),h(re.$$.fragment),lt=n(),ce=i("p"),ce.textContent=St,nt=n(),h(me.$$.fragment),at=n(),h(he.$$.fragment),it=n(),Me=i("p"),this.h()},l(e){const t=Xt("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(s),m=a(e),w=o(e,"P",{}),Gt(w).forEach(s),b=a(e),f(T.$$.fragment,e),j=a(e),f(c.$$.fragment,e),C=a(e),U=o(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-a5sr6t"&&(U.textContent=pt),de=a(e),g=o(e,"P",{"data-svelte-h":!0}),p(g)!=="svelte-10z2vs1"&&(g.textContent=rt),Te=a(e),f($.$$.fragment,e),we=a(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-bmj0ue"&&(I.innerHTML=ct),be=a(e),x=o(e,"P",{"data-svelte-h":!0}),p(x)!=="svelte-13qcall"&&(x.textContent=mt),Ce=a(e),k=o(e,"P",{"data-svelte-h":!0}),p(k)!=="svelte-1ev9nks"&&(k.textContent=ht),ve=a(e),f(V.$$.fragment,e),Je=a(e),Z=o(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-16bokny"&&(Z.textContent=ft),je=a(e),B=o(e,"P",{"data-svelte-h":!0}),p(B)!=="svelte-1ty6jj8"&&(B.innerHTML=ut),Ue=a(e),W=o(e,"P",{"data-svelte-h":!0}),p(W)!=="svelte-18vonjn"&&(W.textContent=Mt),ge=a(e),_=o(e,"UL",{"data-svelte-h":!0}),p(_)!=="svelte-85swkx"&&(_.innerHTML=yt),$e=a(e),A=o(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-1ks87bx"&&(A.textContent=dt),Ie=a(e),f(v.$$.fragment,e),xe=a(e),S=o(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-10ehg4e"&&(S.innerHTML=Tt),ke=a(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1jrpgtq"&&(N.textContent=wt),Ve=a(e),E=o(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-1w3wo1k"&&(E.textContent=bt),Ze=a(e),G=o(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-svxq7o"&&(G.textContent=Ct),Be=a(e),f(R.$$.fragment,e),We=a(e),H=o(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-1cmet3s"&&(H.textContent=vt),_e=a(e),q=o(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-zdrtnh"&&(q.textContent=Jt),Ae=a(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-15m63ew"&&(F.textContent=jt),Se=a(e),f(J.$$.fragment,e),Ne=a(e),P=o(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-3skqhs"&&(P.innerHTML=Ut),Ee=a(e),Q=o(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-17i0vc"&&(Q.textContent=gt),Ge=a(e),z=o(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1pddr69"&&(z.textContent=$t),Re=a(e),Y=o(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1gc2js8"&&(Y.textContent=It),He=a(e),f(L.$$.fragment,e),qe=a(e),X=o(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-1lfv2sg"&&(X.textContent=xt),Fe=a(e),O=o(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-5csdhs"&&(O.innerHTML=kt),Pe=a(e),K=o(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-pkj3bq"&&(K.textContent=Vt),Qe=a(e),D=o(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-qdo4d3"&&(D.textContent=Zt),ze=a(e),f(ee.$$.fragment,e),Ye=a(e),te=o(e,"P",{"data-svelte-h":!0}),p(te)!=="svelte-2kyg2y"&&(te.innerHTML=Bt),Le=a(e),f(se.$$.fragment,e),Xe=a(e),le=o(e,"P",{"data-svelte-h":!0}),p(le)!=="svelte-qgp6vb"&&(le.textContent=Wt),Oe=a(e),f(ne.$$.fragment,e),Ke=a(e),f(ae.$$.fragment,e),De=a(e),ie=o(e,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-1iqg6dj"&&(ie.textContent=_t),et=a(e),f(oe.$$.fragment,e),tt=a(e),pe=o(e,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-1fv3ued"&&(pe.textContent=At),st=a(e),f(re.$$.fragment,e),lt=a(e),ce=o(e,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-6diubf"&&(ce.textContent=St),nt=a(e),f(me.$$.fragment,e),at=a(e),f(he.$$.fragment,e),it=a(e),Me=o(e,"P",{}),Gt(Me).forEach(s),this.h()},h(){Rt(r,"name","hf:doc:metadata"),Rt(r,"content",ls)},m(e,t){Ot(document.head,r),l(e,m,t),l(e,w,t),l(e,b,t),u(T,e,t),l(e,j,t),u(c,e,t),l(e,C,t),l(e,U,t),l(e,de,t),l(e,g,t),l(e,Te,t),u($,e,t),l(e,we,t),l(e,I,t),l(e,be,t),l(e,x,t),l(e,Ce,t),l(e,k,t),l(e,ve,t),u(V,e,t),l(e,Je,t),l(e,Z,t),l(e,je,t),l(e,B,t),l(e,Ue,t),l(e,W,t),l(e,ge,t),l(e,_,t),l(e,$e,t),l(e,A,t),l(e,Ie,t),u(v,e,t),l(e,xe,t),l(e,S,t),l(e,ke,t),l(e,N,t),l(e,Ve,t),l(e,E,t),l(e,Ze,t),l(e,G,t),l(e,Be,t),u(R,e,t),l(e,We,t),l(e,H,t),l(e,_e,t),l(e,q,t),l(e,Ae,t),l(e,F,t),l(e,Se,t),u(J,e,t),l(e,Ne,t),l(e,P,t),l(e,Ee,t),l(e,Q,t),l(e,Ge,t),l(e,z,t),l(e,Re,t),l(e,Y,t),l(e,He,t),u(L,e,t),l(e,qe,t),l(e,X,t),l(e,Fe,t),l(e,O,t),l(e,Pe,t),l(e,K,t),l(e,Qe,t),l(e,D,t),l(e,ze,t),u(ee,e,t),l(e,Ye,t),l(e,te,t),l(e,Le,t),u(se,e,t),l(e,Xe,t),l(e,le,t),l(e,Oe,t),u(ne,e,t),l(e,Ke,t),u(ae,e,t),l(e,De,t),l(e,ie,t),l(e,et,t),u(oe,e,t),l(e,tt,t),l(e,pe,t),l(e,st,t),u(re,e,t),l(e,lt,t),l(e,ce,t),l(e,nt,t),u(me,e,t),l(e,at,t),u(he,e,t),l(e,it,t),l(e,Me,t),ot=!0},p(e,[t]){const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),v.$set(Nt);const Et={};t&2&&(Et.$$scope={dirty:t,ctx:e}),J.$set(Et)},i(e){ot||(M(T.$$.fragment,e),M(c.$$.fragment,e),M($.$$.fragment,e),M(V.$$.fragment,e),M(v.$$.fragment,e),M(R.$$.fragment,e),M(J.$$.fragment,e),M(L.$$.fragment,e),M(ee.$$.fragment,e),M(se.$$.fragment,e),M(ne.$$.fragment,e),M(ae.$$.fragment,e),M(oe.$$.fragment,e),M(re.$$.fragment,e),M(me.$$.fragment,e),M(he.$$.fragment,e),ot=!0)},o(e){y(T.$$.fragment,e),y(c.$$.fragment,e),y($.$$.fragment,e),y(V.$$.fragment,e),y(v.$$.fragment,e),y(R.$$.fragment,e),y(J.$$.fragment,e),y(L.$$.fragment,e),y(ee.$$.fragment,e),y(se.$$.fragment,e),y(ne.$$.fragment,e),y(ae.$$.fragment,e),y(oe.$$.fragment,e),y(re.$$.fragment,e),y(me.$$.fragment,e),y(he.$$.fragment,e),ot=!1},d(e){e&&(s(m),s(w),s(b),s(j),s(C),s(U),s(de),s(g),s(Te),s(we),s(I),s(be),s(x),s(Ce),s(k),s(ve),s(Je),s(Z),s(je),s(B),s(Ue),s(W),s(ge),s(_),s($e),s(A),s(Ie),s(xe),s(S),s(ke),s(N),s(Ve),s(E),s(Ze),s(G),s(Be),s(We),s(H),s(_e),s(q),s(Ae),s(F),s(Se),s(Ne),s(P),s(Ee),s(Q),s(Ge),s(z),s(Re),s(Y),s(He),s(qe),s(X),s(Fe),s(O),s(Pe),s(K),s(Qe),s(D),s(ze),s(Ye),s(te),s(Le),s(Xe),s(le),s(Oe),s(Ke),s(De),s(ie),s(et),s(tt),s(pe),s(st),s(lt),s(ce),s(nt),s(at),s(it),s(Me)),s(r),d(T,e),d(c,e),d($,e),d(V,e),d(v,e),d(R,e),d(J,e),d(L,e),d(ee,e),d(se,e),d(ne,e),d(ae,e),d(oe,e),d(re,e),d(me,e),d(he,e)}}}const ls='{"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 ns(ue){return Qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ms extends Yt{constructor(r){super(),Lt(this,r,ns,ss,Pt,{})}}export{ms as component};
