Buckets:
| import{s as To,f as wo,o as $o,n as Je}from"../chunks/scheduler.25b97de1.js";import{S as Mo,i as Co,g as c,s as n,r as h,A as Lo,h as d,f as o,c as r,j as I,u as f,x as b,k as M,y as l,a as i,v as g,d as u,t as _,w as v}from"../chunks/index.d9030fc9.js";import{T as Dt}from"../chunks/Tip.baa67368.js";import{D as Z}from"../chunks/Docstring.e257edda.js";import{C as Mt}from"../chunks/CodeBlock.e6cd0d95.js";import{E as $t}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as xo}from"../chunks/PipelineTag.5f100392.js";import{H as V,E as Io}from"../chunks/EditOnGithub.91d95064.js";function jo($){let a,T="Example:",m,p,y;return p=new Mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExldml0Q29uZmlnJTJDJTIwTGV2aXRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBMZVZpVCUyMGxldml0LTEyOFMlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTGV2aXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbGV2aXQtMTI4UyUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwTGV2aXRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LevitConfig, LevitModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a LeViT levit-128S style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = LevitConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a model (with random weights) from the levit-128S style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = LevitModel(configuration) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Accessing the model configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = model.config`,wrap:!1}}),{c(){a=c("p"),a.textContent=T,m=n(),h(p.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),b(a)!=="svelte-11lpom8"&&(a.textContent=T),m=r(s),f(p.$$.fragment,s)},m(s,w){i(s,a,w),i(s,m,w),g(p,s,w),y=!0},p:Je,i(s){y||(u(p.$$.fragment,s),y=!0)},o(s){_(p.$$.fragment,s),y=!1},d(s){s&&(o(a),o(m)),v(p,s)}}}function zo($){let a,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){a=c("p"),a.innerHTML=T},l(m){a=d(m,"P",{"data-svelte-h":!0}),b(a)!=="svelte-fincs2"&&(a.innerHTML=T)},m(m,p){i(m,a,p)},p:Je,d(m){m&&o(a)}}}function Fo($){let a,T="Example:",m,p,y;return p=new Mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMExldml0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGbGV2aXQtMTI4UyUyMiklMEFtb2RlbCUyMCUzRCUyMExldml0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGbGV2aXQtMTI4UyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, LevitModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>model = LevitModel.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">list</span>(last_hidden_states.shape) | |
| [<span class="hljs-number">1</span>, <span class="hljs-number">16</span>, <span class="hljs-number">384</span>]`,wrap:!1}}),{c(){a=c("p"),a.textContent=T,m=n(),h(p.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),b(a)!=="svelte-11lpom8"&&(a.textContent=T),m=r(s),f(p.$$.fragment,s)},m(s,w){i(s,a,w),i(s,m,w),g(p,s,w),y=!0},p:Je,i(s){y||(u(p.$$.fragment,s),y=!0)},o(s){_(p.$$.fragment,s),y=!1},d(s){s&&(o(a),o(m)),v(p,s)}}}function Uo($){let a,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){a=c("p"),a.innerHTML=T},l(m){a=d(m,"P",{"data-svelte-h":!0}),b(a)!=="svelte-fincs2"&&(a.innerHTML=T)},m(m,p){i(m,a,p)},p:Je,d(m){m&&o(a)}}}function Wo($){let a,T="Example:",m,p,y;return p=new Mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMExldml0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZsZXZpdC0xMjhTJTIyKSUwQW1vZGVsJTIwJTNEJTIwTGV2aXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmxldml0LTEyOFMlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, LevitForImageClassification | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>model = LevitForImageClassification.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item() | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| tabby, tabby cat`,wrap:!1}}),{c(){a=c("p"),a.textContent=T,m=n(),h(p.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),b(a)!=="svelte-11lpom8"&&(a.textContent=T),m=r(s),f(p.$$.fragment,s)},m(s,w){i(s,a,w),i(s,m,w),g(p,s,w),y=!0},p:Je,i(s){y||(u(p.$$.fragment,s),y=!0)},o(s){_(p.$$.fragment,s),y=!1},d(s){s&&(o(a),o(m)),v(p,s)}}}function Jo($){let a,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){a=c("p"),a.innerHTML=T},l(m){a=d(m,"P",{"data-svelte-h":!0}),b(a)!=="svelte-fincs2"&&(a.innerHTML=T)},m(m,p){i(m,a,p)},p:Je,d(m){m&&o(a)}}}function ko($){let a,T="Example:",m,p,y;return p=new Mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMExldml0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmxldml0LTEyOFMlMjIpJTBBbW9kZWwlMjAlM0QlMjBMZXZpdEZvckltYWdlQ2xhc3NpZmljYXRpb25XaXRoVGVhY2hlci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZsZXZpdC0xMjhTJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, LevitForImageClassificationWithTeacher | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>model = LevitForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">"facebook/levit-128S"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item() | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| tabby, tabby cat`,wrap:!1}}),{c(){a=c("p"),a.textContent=T,m=n(),h(p.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),b(a)!=="svelte-11lpom8"&&(a.textContent=T),m=r(s),f(p.$$.fragment,s)},m(s,w){i(s,a,w),i(s,m,w),g(p,s,w),y=!0},p:Je,i(s){y||(u(p.$$.fragment,s),y=!0)},o(s){_(p.$$.fragment,s),y=!1},d(s){s&&(o(a),o(m)),v(p,s)}}}function Zo($){let a,T,m,p,y,s,w,Ye,te,At='The LeViT model was proposed in <a href="https://arxiv.org/abs/2104.01136" rel="nofollow">LeViT: Introducing Convolutions to Vision Transformers</a> by Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, Matthijs Douze. LeViT improves the <a href="vit">Vision Transformer (ViT)</a> in performance and efficiency by a few architectural differences such as activation maps with decreasing resolutions in Transformers and the introduction of an attention bias to integrate positional information.',De,oe,Ot="The abstract from the paper is the following:",Ae,ae,Kt=`<em>We design a family of image classification architectures that optimize the trade-off between accuracy | |
| and efficiency in a high-speed regime. Our work exploits recent findings in attention-based architectures, | |
| which are competitive on highly parallel processing hardware. We revisit principles from the extensive | |
| literature on convolutional neural networks to apply them to transformers, in particular activation maps | |
| with decreasing resolutions. We also introduce the attention bias, a new way to integrate positional information | |
| in vision transformers. As a result, we propose LeVIT: a hybrid neural network for fast inference image classification. | |
| We consider different measures of efficiency on different hardware platforms, so as to best reflect a wide range of | |
| application scenarios. Our extensive experiments empirically validate our technical choices and show they are suitable | |
| to most architectures. Overall, LeViT significantly outperforms existing convnets and vision transformers with respect | |
| to the speed/accuracy tradeoff. For example, at 80% ImageNet top-1 accuracy, LeViT is 5 times faster than EfficientNet on CPU.</em>`,Oe,E,eo,Ke,se,to='LeViT Architecture. Taken from the <a href="https://arxiv.org/abs/2104.01136">original paper</a>.',et,ne,oo='This model was contributed by <a href="https://huggingface.co/anugunj" rel="nofollow">anugunj</a>. The original code can be found <a href="https://github.com/facebookresearch/LeViT" rel="nofollow">here</a>.',tt,re,ot,ie,ao=`<li>Compared to ViT, LeViT models use an additional distillation head to effectively learn from a teacher (which, in the LeViT paper, is a ResNet like-model). The distillation head is learned through backpropagation under supervision of a ResNet like-model. They also draw inspiration from convolution neural networks to use activation maps with decreasing resolutions to increase the efficiency.</li> <li>There are 2 ways to fine-tune distilled models, either (1) in a classic way, by only placing a prediction head on top | |
| of the final hidden state and not using the distillation head, or (2) by placing both a prediction head and distillation | |
| head on top of the final hidden state. In that case, the prediction head is trained using regular cross-entropy between | |
| the prediction of the head and the ground-truth label, while the distillation prediction head is trained using hard distillation | |
| (cross-entropy between the prediction of the distillation head and the label predicted by the teacher). At inference time, | |
| one takes the average prediction between both heads as final prediction. (2) is also called “fine-tuning with distillation”, | |
| because one relies on a teacher that has already been fine-tuned on the downstream dataset. In terms of models, (1) corresponds | |
| to <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassification">LevitForImageClassification</a> and (2) corresponds to <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassificationWithTeacher">LevitForImageClassificationWithTeacher</a>.</li> <li>All released checkpoints were pre-trained and fine-tuned on <a href="https://huggingface.co/datasets/imagenet-1k" rel="nofollow">ImageNet-1k</a> | |
| (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes). only. No external data was used. This is in | |
| contrast with the original ViT model, which used external data like the JFT-300M dataset/Imagenet-21k for | |
| pre-training.</li> <li>The authors of LeViT released 5 trained LeViT models, which you can directly plug into <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitModel">LevitModel</a> or <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassification">LevitForImageClassification</a>. | |
| Techniques like data augmentation, optimization, and regularization were used in order to simulate training on a much larger dataset | |
| (while only using ImageNet-1k for pre-training). The 5 variants available are (all trained on images of size 224x224): | |
| <em>facebook/levit-128S</em>, <em>facebook/levit-128</em>, <em>facebook/levit-192</em>, <em>facebook/levit-256</em> and | |
| <em>facebook/levit-384</em>. Note that one should use <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitImageProcessor">LevitImageProcessor</a> in order to | |
| prepare images for the model.</li> <li><a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassificationWithTeacher">LevitForImageClassificationWithTeacher</a> currently supports only inference and not training or fine-tuning.</li> <li>You can check out demo notebooks regarding inference as well as fine-tuning on custom data <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">here</a> | |
| (you can just replace <a href="/docs/transformers/pr_30862/en/model_doc/vit#transformers.ViTFeatureExtractor">ViTFeatureExtractor</a> by <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitImageProcessor">LevitImageProcessor</a> and <a href="/docs/transformers/pr_30862/en/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a> by <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassification">LevitForImageClassification</a> or <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassificationWithTeacher">LevitForImageClassificationWithTeacher</a>).</li>`,at,le,st,ce,so="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with LeViT.",nt,de,rt,me,no='<li><a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassification">LevitForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',it,pe,ro="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",lt,he,ct,C,fe,Ct,ke,io=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitModel">LevitModel</a>. It is used to instantiate a LeViT | |
| 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 LeViT | |
| <a href="https://huggingface.co/facebook/levit-128S" rel="nofollow">facebook/levit-128S</a> architecture.`,Lt,Ze,lo=`Configuration objects inherit from <a href="/docs/transformers/pr_30862/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the | |
| documentation from <a href="/docs/transformers/pr_30862/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,xt,G,dt,ge,mt,P,ue,It,B,_e,jt,Ve,co="Preprocess an image or a batch of images.",pt,ve,ht,U,be,zt,Pe,mo="Constructs a LeViT image processor.",Ft,S,ye,Ut,Ne,po="Preprocess an image or batch of images to be used as input to a LeViT model.",ft,Te,gt,W,we,Wt,Re,ho=`The bare Levit model outputting raw features without any specific head on top. | |
| This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it | |
| as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,Jt,j,$e,kt,Ee,fo='The <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitModel">LevitModel</a> forward method, overrides the <code>__call__</code> special method.',Zt,H,Vt,X,ut,Me,_t,L,Ce,Pt,Ge,go=`Levit Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for | |
| ImageNet.`,Nt,Be,uo=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it | |
| as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,Rt,z,Le,Et,Se,_o='The <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassification">LevitForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Gt,q,Bt,Q,vt,xe,bt,x,Ie,St,He,vo=`LeViT Model transformer with image classification heads on top (a linear layer on top of the final hidden state and | |
| a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet. .. warning:: | |
| This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet | |
| supported.`,Ht,Xe,bo=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it | |
| as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,Xt,F,je,qt,qe,yo='The <a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitForImageClassificationWithTeacher">LevitForImageClassificationWithTeacher</a> forward method, overrides the <code>__call__</code> special method.',Qt,Y,Yt,D,yt,ze,Tt,Qe,wt;return y=new V({props:{title:"LeViT",local:"levit",headingTag:"h1"}}),w=new V({props:{title:"Overview",local:"overview",headingTag:"h2"}}),re=new V({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),le=new V({props:{title:"Resources",local:"resources",headingTag:"h2"}}),de=new xo({props:{pipeline:"image-classification"}}),he=new V({props:{title:"LevitConfig",local:"transformers.LevitConfig",headingTag:"h2"}}),fe=new Z({props:{name:"class transformers.LevitConfig",anchor:"transformers.LevitConfig",parameters:[{name:"image_size",val:" = 224"},{name:"num_channels",val:" = 3"},{name:"kernel_size",val:" = 3"},{name:"stride",val:" = 2"},{name:"padding",val:" = 1"},{name:"patch_size",val:" = 16"},{name:"hidden_sizes",val:" = [128, 256, 384]"},{name:"num_attention_heads",val:" = [4, 8, 12]"},{name:"depths",val:" = [4, 4, 4]"},{name:"key_dim",val:" = [16, 16, 16]"},{name:"drop_path_rate",val:" = 0"},{name:"mlp_ratio",val:" = [2, 2, 2]"},{name:"attention_ratio",val:" = [2, 2, 2]"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LevitConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) — | |
| The size of the input image.`,name:"image_size"},{anchor:"transformers.LevitConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| Number of channels in the input image.`,name:"num_channels"},{anchor:"transformers.LevitConfig.kernel_size",description:`<strong>kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| The kernel size for the initial convolution layers of patch embedding.`,name:"kernel_size"},{anchor:"transformers.LevitConfig.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) — | |
| The stride size for the initial convolution layers of patch embedding.`,name:"stride"},{anchor:"transformers.LevitConfig.padding",description:`<strong>padding</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The padding size for the initial convolution layers of patch embedding.`,name:"padding"},{anchor:"transformers.LevitConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — | |
| The patch size for embeddings.`,name:"patch_size"},{anchor:"transformers.LevitConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[128, 256, 384]</code>) — | |
| Dimension of each of the encoder blocks.`,name:"hidden_sizes"},{anchor:"transformers.LevitConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 8, 12]</code>) — | |
| Number of attention heads for each attention layer in each block of the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.LevitConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 4, 4]</code>) — | |
| The number of layers in each encoder block.`,name:"depths"},{anchor:"transformers.LevitConfig.key_dim",description:`<strong>key_dim</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[16, 16, 16]</code>) — | |
| The size of key in each of the encoder blocks.`,name:"key_dim"},{anchor:"transformers.LevitConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 0) — | |
| The dropout probability for stochastic depths, used in the blocks of the Transformer encoder.`,name:"drop_path_rate"},{anchor:"transformers.LevitConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 2]</code>) — | |
| Ratio of the size of the hidden layer compared to the size of the input layer of the Mix FFNs in the | |
| encoder blocks.`,name:"mlp_ratios"},{anchor:"transformers.LevitConfig.attention_ratios",description:`<strong>attention_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 2]</code>) — | |
| Ratio of the size of the output dimension compared to input dimension of attention layers.`,name:"attention_ratios"},{anchor:"transformers.LevitConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) — | |
| The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/configuration_levit.py#L30"}}),G=new $t({props:{anchor:"transformers.LevitConfig.example",$$slots:{default:[jo]},$$scope:{ctx:$}}}),ge=new V({props:{title:"LevitFeatureExtractor",local:"transformers.LevitFeatureExtractor",headingTag:"h2"}}),ue=new Z({props:{name:"class transformers.LevitFeatureExtractor",anchor:"transformers.LevitFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/feature_extraction_levit.py#L26"}}),_e=new Z({props:{name:"__call__",anchor:"transformers.LevitFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/image_processing_utils.py#L39"}}),ve=new V({props:{title:"LevitImageProcessor",local:"transformers.LevitImageProcessor",headingTag:"h2"}}),be=new Z({props:{name:"class transformers.LevitImageProcessor",anchor:"transformers.LevitImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = [0.485, 0.456, 0.406]"},{name:"image_std",val:": Union = [0.229, 0.224, 0.225]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LevitImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Wwhether to resize the shortest edge of the input to int(256/224 *<code>size</code>). Can be overridden by the | |
| <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.LevitImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{"shortest_edge" -- 224}</code>): | |
| Size of the output image after resizing. If size is a dict with keys “width” and “height”, the image will | |
| be resized to <code>(size["height"], size["width"])</code>. If size is a dict with key “shortest_edge”, the shortest | |
| edge value <code>c</code> is rescaled to <code>int(c * (256/224))</code>. The smaller edge of the image will be matched to this | |
| value i.e, if height > width, then image will be rescaled to <code>(size["shortest_egde"] * height / width, size["shortest_egde"])</code>. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.LevitImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) — | |
| Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the | |
| <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.LevitImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to center crop the input to <code>(crop_size["height"], crop_size["width"])</code>. Can be overridden | |
| by the <code>do_center_crop</code> parameter in the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.LevitImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>{"height" -- 224, "width": 224}</code>): | |
| Desired image size after <code>center_crop</code>. Can be overridden by the <code>crop_size</code> parameter in the <code>preprocess</code> | |
| method.`,name:"crop_size"},{anchor:"transformers.LevitImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Controls whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the | |
| <code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.LevitImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) — | |
| Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the | |
| <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.LevitImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Controls whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the | |
| <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.LevitImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.485, 0.456, 0.406]</code>) — | |
| Mean to use if normalizing the image. This is a float or list of floats the length of the number of | |
| channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.LevitImageProcessor.image_std",description:`<strong>image_std</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.229, 0.224, 0.225]</code>) — | |
| Standard deviation to use if normalizing the image. This is a float or list of floats the length of the | |
| number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/image_processing_levit.py#L47"}}),ye=new Z({props:{name:"preprocess",anchor:"transformers.LevitImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": Optional = None"},{name:"crop_size",val:": Optional = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Optional = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LevitImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) — | |
| Image or batch of images to preprocess. Expects a single or batch of images with pixel values ranging | |
| from 0 to 255. If passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.LevitImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) — | |
| Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.LevitImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) — | |
| Size of the output image after resizing. If size is a dict with keys “width” and “height”, the image | |
| will be resized to (height, width). If size is a dict with key “shortest_edge”, the shortest edge value | |
| <code>c</code> is rescaled to int(<code>c</code> <em> (256/224)). The smaller edge of the image will be matched to this value | |
| i.e, if height > width, then image will be rescaled to (size </em> height / width, size).`,name:"size"},{anchor:"transformers.LevitImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) — | |
| Resampling filter to use when resiizing the image.`,name:"resample"},{anchor:"transformers.LevitImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) — | |
| Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.LevitImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) — | |
| Size of the output image after center cropping. Crops images to (crop_size[“height”], | |
| crop_size[“width”]).`,name:"crop_size"},{anchor:"transformers.LevitImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) — | |
| Whether to rescale the image pixel values by <code>rescaling_factor</code> - typical to values between 0 and 1.`,name:"do_rescale"},{anchor:"transformers.LevitImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) — | |
| Factor to rescale the image pixel values by.`,name:"rescale_factor"},{anchor:"transformers.LevitImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) — | |
| Whether to normalize the image pixel values by <code>image_mean</code> and <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.LevitImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) — | |
| Mean to normalize the image pixel values by.`,name:"image_mean"},{anchor:"transformers.LevitImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) — | |
| Standard deviation to normalize the image pixel values by.`,name:"image_std"},{anchor:"transformers.LevitImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) — | |
| The type of tensors to return. Can be one of:<ul> | |
| <li>Unset: Return a list of <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.TENSORFLOW</code> or <code>'tf'</code>: Return a batch of type <code>tf.Tensor</code>.</li> | |
| <li><code>TensorType.PYTORCH</code> or <code>'pt'</code>: Return a batch of type <code>torch.Tensor</code>.</li> | |
| <li><code>TensorType.NUMPY</code> or <code>'np'</code>: Return a batch of type <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.JAX</code> or <code>'jax'</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li> | |
| </ul>`,name:"return_tensors"},{anchor:"transformers.LevitImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) — | |
| The channel dimension format for the output image. If unset, the channel dimension format of the input | |
| image is used. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.LevitImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) — | |
| The channel dimension format for the input image. If unset, the channel dimension format is inferred | |
| from the input image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| <li><code>"none"</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li> | |
| </ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/image_processing_levit.py#L191"}}),Te=new V({props:{title:"LevitModel",local:"transformers.LevitModel",headingTag:"h2"}}),we=new Z({props:{name:"class transformers.LevitModel",anchor:"transformers.LevitModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LevitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig">LevitConfig</a>) — Model configuration class with all the parameters of the model. | |
| Initializing with a config file does not load the weights associated with the model, only the | |
| configuration. Check out the <a href="/docs/transformers/pr_30862/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L531"}}),$e=new Z({props:{name:"forward",anchor:"transformers.LevitModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LevitModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30862/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_30862/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">LevitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.LevitModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.LevitModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_30862/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L544",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of | |
| <code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various | |
| elements depending on the configuration (<a | |
| href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig" | |
| >LevitConfig</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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),H=new Dt({props:{$$slots:{default:[zo]},$$scope:{ctx:$}}}),X=new $t({props:{anchor:"transformers.LevitModel.forward.example",$$slots:{default:[Fo]},$$scope:{ctx:$}}}),Me=new V({props:{title:"LevitForImageClassification",local:"transformers.LevitForImageClassification",headingTag:"h2"}}),Ce=new Z({props:{name:"class transformers.LevitForImageClassification",anchor:"transformers.LevitForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LevitForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig">LevitConfig</a>) — Model configuration class with all the parameters of the model. | |
| Initializing with a config file does not load the weights associated with the model, only the | |
| configuration. Check out the <a href="/docs/transformers/pr_30862/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L588"}}),Le=new Z({props:{name:"forward",anchor:"transformers.LevitForImageClassification.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"labels",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LevitForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30862/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_30862/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">LevitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.LevitForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.LevitForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_30862/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LevitForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| 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 > 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L612",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_30862/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention" | |
| >transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of | |
| <code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various | |
| elements depending on the configuration (<a | |
| href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig" | |
| >LevitConfig</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) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_30862/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention" | |
| >transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),q=new Dt({props:{$$slots:{default:[Uo]},$$scope:{ctx:$}}}),Q=new $t({props:{anchor:"transformers.LevitForImageClassification.forward.example",$$slots:{default:[Wo]},$$scope:{ctx:$}}}),xe=new V({props:{title:"LevitForImageClassificationWithTeacher",local:"transformers.LevitForImageClassificationWithTeacher",headingTag:"h2"}}),Ie=new Z({props:{name:"class transformers.LevitForImageClassificationWithTeacher",anchor:"transformers.LevitForImageClassificationWithTeacher",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LevitForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig">LevitConfig</a>) — Model configuration class with all the parameters of the model. | |
| Initializing with a config file does not load the weights associated with the model, only the | |
| configuration. Check out the <a href="/docs/transformers/pr_30862/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L673"}}),je=new Z({props:{name:"forward",anchor:"transformers.LevitForImageClassificationWithTeacher.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LevitForImageClassificationWithTeacher.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30862/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_30862/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">LevitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.LevitForImageClassificationWithTeacher.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.LevitForImageClassificationWithTeacher.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_30862/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30862/src/transformers/models/levit/modeling_levit.py#L704",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.levit.modeling_levit.LevitForImageClassificationWithTeacherOutput</code> or a tuple of | |
| <code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various | |
| elements depending on the configuration (<a | |
| href="/docs/transformers/pr_30862/en/model_doc/levit#transformers.LevitConfig" | |
| >LevitConfig</a>) and inputs.</p> | |
| <ul> | |
| <li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores as the average of the <code>cls_logits</code> and <code>distillation_logits</code>.</li> | |
| <li><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the | |
| class token).</li> | |
| <li><strong>distillation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the | |
| distillation token).</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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of | |
| shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer | |
| plus the initial embedding outputs.</li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.levit.modeling_levit.LevitForImageClassificationWithTeacherOutput</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),Y=new Dt({props:{$$slots:{default:[Jo]},$$scope:{ctx:$}}}),D=new $t({props:{anchor:"transformers.LevitForImageClassificationWithTeacher.forward.example",$$slots:{default:[ko]},$$scope:{ctx:$}}}),ze=new Io({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/levit.md"}}),{c(){a=c("meta"),T=n(),m=c("p"),p=n(),h(y.$$.fragment),s=n(),h(w.$$.fragment),Ye=n(),te=c("p"),te.innerHTML=At,De=n(),oe=c("p"),oe.textContent=Ot,Ae=n(),ae=c("p"),ae.innerHTML=Kt,Oe=n(),E=c("img"),Ke=n(),se=c("small"),se.innerHTML=to,et=n(),ne=c("p"),ne.innerHTML=oo,tt=n(),h(re.$$.fragment),ot=n(),ie=c("ul"),ie.innerHTML=ao,at=n(),h(le.$$.fragment),st=n(),ce=c("p"),ce.textContent=so,nt=n(),h(de.$$.fragment),rt=n(),me=c("ul"),me.innerHTML=no,it=n(),pe=c("p"),pe.textContent=ro,lt=n(),h(he.$$.fragment),ct=n(),C=c("div"),h(fe.$$.fragment),Ct=n(),ke=c("p"),ke.innerHTML=io,Lt=n(),Ze=c("p"),Ze.innerHTML=lo,xt=n(),h(G.$$.fragment),dt=n(),h(ge.$$.fragment),mt=n(),P=c("div"),h(ue.$$.fragment),It=n(),B=c("div"),h(_e.$$.fragment),jt=n(),Ve=c("p"),Ve.textContent=co,pt=n(),h(ve.$$.fragment),ht=n(),U=c("div"),h(be.$$.fragment),zt=n(),Pe=c("p"),Pe.textContent=mo,Ft=n(),S=c("div"),h(ye.$$.fragment),Ut=n(),Ne=c("p"),Ne.textContent=po,ft=n(),h(Te.$$.fragment),gt=n(),W=c("div"),h(we.$$.fragment),Wt=n(),Re=c("p"),Re.innerHTML=ho,Jt=n(),j=c("div"),h($e.$$.fragment),kt=n(),Ee=c("p"),Ee.innerHTML=fo,Zt=n(),h(H.$$.fragment),Vt=n(),h(X.$$.fragment),ut=n(),h(Me.$$.fragment),_t=n(),L=c("div"),h(Ce.$$.fragment),Pt=n(),Ge=c("p"),Ge.textContent=go,Nt=n(),Be=c("p"),Be.innerHTML=uo,Rt=n(),z=c("div"),h(Le.$$.fragment),Et=n(),Se=c("p"),Se.innerHTML=_o,Gt=n(),h(q.$$.fragment),Bt=n(),h(Q.$$.fragment),vt=n(),h(xe.$$.fragment),bt=n(),x=c("div"),h(Ie.$$.fragment),St=n(),He=c("p"),He.textContent=vo,Ht=n(),Xe=c("p"),Xe.innerHTML=bo,Xt=n(),F=c("div"),h(je.$$.fragment),qt=n(),qe=c("p"),qe.innerHTML=yo,Qt=n(),h(Y.$$.fragment),Yt=n(),h(D.$$.fragment),yt=n(),h(ze.$$.fragment),Tt=n(),Qe=c("p"),this.h()},l(e){const t=Lo("svelte-u9bgzb",document.head);a=d(t,"META",{name:!0,content:!0}),t.forEach(o),T=r(e),m=d(e,"P",{}),I(m).forEach(o),p=r(e),f(y.$$.fragment,e),s=r(e),f(w.$$.fragment,e),Ye=r(e),te=d(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-1e0lmax"&&(te.innerHTML=At),De=r(e),oe=d(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-vfdo9a"&&(oe.textContent=Ot),Ae=r(e),ae=d(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-15x7iq1"&&(ae.innerHTML=Kt),Oe=r(e),E=d(e,"IMG",{src:!0,alt:!0,width:!0}),Ke=r(e),se=d(e,"SMALL",{"data-svelte-h":!0}),b(se)!=="svelte-cyksn2"&&(se.innerHTML=to),et=r(e),ne=d(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-1usurb6"&&(ne.innerHTML=oo),tt=r(e),f(re.$$.fragment,e),ot=r(e),ie=d(e,"UL",{"data-svelte-h":!0}),b(ie)!=="svelte-117w9v9"&&(ie.innerHTML=ao),at=r(e),f(le.$$.fragment,e),st=r(e),ce=d(e,"P",{"data-svelte-h":!0}),b(ce)!=="svelte-nre2ah"&&(ce.textContent=so),nt=r(e),f(de.$$.fragment,e),rt=r(e),me=d(e,"UL",{"data-svelte-h":!0}),b(me)!=="svelte-bwn4qy"&&(me.innerHTML=no),it=r(e),pe=d(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-1xesile"&&(pe.textContent=ro),lt=r(e),f(he.$$.fragment,e),ct=r(e),C=d(e,"DIV",{class:!0});var J=I(C);f(fe.$$.fragment,J),Ct=r(J),ke=d(J,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-1pxyk6k"&&(ke.innerHTML=io),Lt=r(J),Ze=d(J,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-dt1yj"&&(Ze.innerHTML=lo),xt=r(J),f(G.$$.fragment,J),J.forEach(o),dt=r(e),f(ge.$$.fragment,e),mt=r(e),P=d(e,"DIV",{class:!0});var Fe=I(P);f(ue.$$.fragment,Fe),It=r(Fe),B=d(Fe,"DIV",{class:!0});var Ue=I(B);f(_e.$$.fragment,Ue),jt=r(Ue),Ve=d(Ue,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-khengj"&&(Ve.textContent=co),Ue.forEach(o),Fe.forEach(o),pt=r(e),f(ve.$$.fragment,e),ht=r(e),U=d(e,"DIV",{class:!0});var N=I(U);f(be.$$.fragment,N),zt=r(N),Pe=d(N,"P",{"data-svelte-h":!0}),b(Pe)!=="svelte-1qfdf74"&&(Pe.textContent=mo),Ft=r(N),S=d(N,"DIV",{class:!0});var We=I(S);f(ye.$$.fragment,We),Ut=r(We),Ne=d(We,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-1rdzd3o"&&(Ne.textContent=po),We.forEach(o),N.forEach(o),ft=r(e),f(Te.$$.fragment,e),gt=r(e),W=d(e,"DIV",{class:!0});var R=I(W);f(we.$$.fragment,R),Wt=r(R),Re=d(R,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-f0023m"&&(Re.innerHTML=ho),Jt=r(R),j=d(R,"DIV",{class:!0});var k=I(j);f($e.$$.fragment,k),kt=r(k),Ee=d(k,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1prhep0"&&(Ee.innerHTML=fo),Zt=r(k),f(H.$$.fragment,k),Vt=r(k),f(X.$$.fragment,k),k.forEach(o),R.forEach(o),ut=r(e),f(Me.$$.fragment,e),_t=r(e),L=d(e,"DIV",{class:!0});var A=I(L);f(Ce.$$.fragment,A),Pt=r(A),Ge=d(A,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-17kpmci"&&(Ge.textContent=go),Nt=r(A),Be=d(A,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-1gjh92c"&&(Be.innerHTML=uo),Rt=r(A),z=d(A,"DIV",{class:!0});var O=I(z);f(Le.$$.fragment,O),Et=r(O),Se=d(O,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-1g0o2mm"&&(Se.innerHTML=_o),Gt=r(O),f(q.$$.fragment,O),Bt=r(O),f(Q.$$.fragment,O),O.forEach(o),A.forEach(o),vt=r(e),f(xe.$$.fragment,e),bt=r(e),x=d(e,"DIV",{class:!0});var K=I(x);f(Ie.$$.fragment,K),St=r(K),He=d(K,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1xxb4nq"&&(He.textContent=vo),Ht=r(K),Xe=d(K,"P",{"data-svelte-h":!0}),b(Xe)!=="svelte-1gjh92c"&&(Xe.innerHTML=bo),Xt=r(K),F=d(K,"DIV",{class:!0});var ee=I(F);f(je.$$.fragment,ee),qt=r(ee),qe=d(ee,"P",{"data-svelte-h":!0}),b(qe)!=="svelte-1mvnitq"&&(qe.innerHTML=yo),Qt=r(ee),f(Y.$$.fragment,ee),Yt=r(ee),f(D.$$.fragment,ee),ee.forEach(o),K.forEach(o),yt=r(e),f(ze.$$.fragment,e),Tt=r(e),Qe=d(e,"P",{}),I(Qe).forEach(o),this.h()},h(){M(a,"name","hf:doc:metadata"),M(a,"content",Vo),wo(E.src,eo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/levit_architecture.png")||M(E,"src",eo),M(E,"alt","drawing"),M(E,"width","600"),M(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){l(document.head,a),i(e,T,t),i(e,m,t),i(e,p,t),g(y,e,t),i(e,s,t),g(w,e,t),i(e,Ye,t),i(e,te,t),i(e,De,t),i(e,oe,t),i(e,Ae,t),i(e,ae,t),i(e,Oe,t),i(e,E,t),i(e,Ke,t),i(e,se,t),i(e,et,t),i(e,ne,t),i(e,tt,t),g(re,e,t),i(e,ot,t),i(e,ie,t),i(e,at,t),g(le,e,t),i(e,st,t),i(e,ce,t),i(e,nt,t),g(de,e,t),i(e,rt,t),i(e,me,t),i(e,it,t),i(e,pe,t),i(e,lt,t),g(he,e,t),i(e,ct,t),i(e,C,t),g(fe,C,null),l(C,Ct),l(C,ke),l(C,Lt),l(C,Ze),l(C,xt),g(G,C,null),i(e,dt,t),g(ge,e,t),i(e,mt,t),i(e,P,t),g(ue,P,null),l(P,It),l(P,B),g(_e,B,null),l(B,jt),l(B,Ve),i(e,pt,t),g(ve,e,t),i(e,ht,t),i(e,U,t),g(be,U,null),l(U,zt),l(U,Pe),l(U,Ft),l(U,S),g(ye,S,null),l(S,Ut),l(S,Ne),i(e,ft,t),g(Te,e,t),i(e,gt,t),i(e,W,t),g(we,W,null),l(W,Wt),l(W,Re),l(W,Jt),l(W,j),g($e,j,null),l(j,kt),l(j,Ee),l(j,Zt),g(H,j,null),l(j,Vt),g(X,j,null),i(e,ut,t),g(Me,e,t),i(e,_t,t),i(e,L,t),g(Ce,L,null),l(L,Pt),l(L,Ge),l(L,Nt),l(L,Be),l(L,Rt),l(L,z),g(Le,z,null),l(z,Et),l(z,Se),l(z,Gt),g(q,z,null),l(z,Bt),g(Q,z,null),i(e,vt,t),g(xe,e,t),i(e,bt,t),i(e,x,t),g(Ie,x,null),l(x,St),l(x,He),l(x,Ht),l(x,Xe),l(x,Xt),l(x,F),g(je,F,null),l(F,qt),l(F,qe),l(F,Qt),g(Y,F,null),l(F,Yt),g(D,F,null),i(e,yt,t),g(ze,e,t),i(e,Tt,t),i(e,Qe,t),wt=!0},p(e,[t]){const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),G.$set(J);const Fe={};t&2&&(Fe.$$scope={dirty:t,ctx:e}),H.$set(Fe);const Ue={};t&2&&(Ue.$$scope={dirty:t,ctx:e}),X.$set(Ue);const N={};t&2&&(N.$$scope={dirty:t,ctx:e}),q.$set(N);const We={};t&2&&(We.$$scope={dirty:t,ctx:e}),Q.$set(We);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),Y.$set(R);const k={};t&2&&(k.$$scope={dirty:t,ctx:e}),D.$set(k)},i(e){wt||(u(y.$$.fragment,e),u(w.$$.fragment,e),u(re.$$.fragment,e),u(le.$$.fragment,e),u(de.$$.fragment,e),u(he.$$.fragment,e),u(fe.$$.fragment,e),u(G.$$.fragment,e),u(ge.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(ve.$$.fragment,e),u(be.$$.fragment,e),u(ye.$$.fragment,e),u(Te.$$.fragment,e),u(we.$$.fragment,e),u($e.$$.fragment,e),u(H.$$.fragment,e),u(X.$$.fragment,e),u(Me.$$.fragment,e),u(Ce.$$.fragment,e),u(Le.$$.fragment,e),u(q.$$.fragment,e),u(Q.$$.fragment,e),u(xe.$$.fragment,e),u(Ie.$$.fragment,e),u(je.$$.fragment,e),u(Y.$$.fragment,e),u(D.$$.fragment,e),u(ze.$$.fragment,e),wt=!0)},o(e){_(y.$$.fragment,e),_(w.$$.fragment,e),_(re.$$.fragment,e),_(le.$$.fragment,e),_(de.$$.fragment,e),_(he.$$.fragment,e),_(fe.$$.fragment,e),_(G.$$.fragment,e),_(ge.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(ve.$$.fragment,e),_(be.$$.fragment,e),_(ye.$$.fragment,e),_(Te.$$.fragment,e),_(we.$$.fragment,e),_($e.$$.fragment,e),_(H.$$.fragment,e),_(X.$$.fragment,e),_(Me.$$.fragment,e),_(Ce.$$.fragment,e),_(Le.$$.fragment,e),_(q.$$.fragment,e),_(Q.$$.fragment,e),_(xe.$$.fragment,e),_(Ie.$$.fragment,e),_(je.$$.fragment,e),_(Y.$$.fragment,e),_(D.$$.fragment,e),_(ze.$$.fragment,e),wt=!1},d(e){e&&(o(T),o(m),o(p),o(s),o(Ye),o(te),o(De),o(oe),o(Ae),o(ae),o(Oe),o(E),o(Ke),o(se),o(et),o(ne),o(tt),o(ot),o(ie),o(at),o(st),o(ce),o(nt),o(rt),o(me),o(it),o(pe),o(lt),o(ct),o(C),o(dt),o(mt),o(P),o(pt),o(ht),o(U),o(ft),o(gt),o(W),o(ut),o(_t),o(L),o(vt),o(bt),o(x),o(yt),o(Tt),o(Qe)),o(a),v(y,e),v(w,e),v(re,e),v(le,e),v(de,e),v(he,e),v(fe),v(G),v(ge,e),v(ue),v(_e),v(ve,e),v(be),v(ye),v(Te,e),v(we),v($e),v(H),v(X),v(Me,e),v(Ce),v(Le),v(q),v(Q),v(xe,e),v(Ie),v(je),v(Y),v(D),v(ze,e)}}}const Vo='{"title":"LeViT","local":"levit","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"LevitConfig","local":"transformers.LevitConfig","sections":[],"depth":2},{"title":"LevitFeatureExtractor","local":"transformers.LevitFeatureExtractor","sections":[],"depth":2},{"title":"LevitImageProcessor","local":"transformers.LevitImageProcessor","sections":[],"depth":2},{"title":"LevitModel","local":"transformers.LevitModel","sections":[],"depth":2},{"title":"LevitForImageClassification","local":"transformers.LevitForImageClassification","sections":[],"depth":2},{"title":"LevitForImageClassificationWithTeacher","local":"transformers.LevitForImageClassificationWithTeacher","sections":[],"depth":2}],"depth":1}';function Po($){return $o(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qo extends Mo{constructor(a){super(),Co(this,a,Po,Zo,To,{})}}export{qo as component}; | |
Xet Storage Details
- Size:
- 67 kB
- Xet hash:
- f81626614aeb71e9e926b584601192281dc325a092426876d4653d29dc2682f5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.