import{s as xt,f as yt,o as Mt,n as _e}from"../chunks/scheduler.9bc65507.js";import{S as wt,i as $t,g as d,s as r,r as u,A as Tt,h as m,f as n,c as l,j as le,u as g,x as h,k,y as p,a,v,d as _,t as b,w as C}from"../chunks/index.707bf1b6.js";import{T as Ct}from"../chunks/Tip.c2ecdbf4.js";import{D as ve}from"../chunks/Docstring.17db21ae.js";import{C as tt}from"../chunks/CodeBlock.54a9f38d.js";import{E as et}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as Nt}from"../chunks/PipelineTag.44585822.js";import{H as ue}from"../chunks/Heading.342b1fa6.js";function Vt($){let o,x="Example:",i,c,f;return c=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENvbnZOZVhUVjJDb25maWclMkMlMjBDb252TmV4dFYyTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ29udk5lWFRWMiUyMGNvbnZuZXh0djItdGlueS0xay0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ29udk5lWFRWMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb252bmV4dHYyLXRpbnktMWstMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDb252TmV4dFYyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ConvNeXTV2Config, ConvNextV2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ConvNeXTV2 convnextv2-tiny-1k-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ConvNeXTV2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the convnextv2-tiny-1k-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ConvNextV2Model(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){o=d("p"),o.textContent=x,i=r(),u(c.$$.fragment)},l(s){o=m(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=x),i=l(s),g(c.$$.fragment,s)},m(s,y){a(s,o,y),a(s,i,y),v(c,s,y),f=!0},p:_e,i(s){f||(_(c.$$.fragment,s),f=!0)},o(s){b(c.$$.fragment,s),f=!1},d(s){s&&(n(o),n(i)),C(c,s)}}}function jt($){let o,x=`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(){o=d("p"),o.innerHTML=x},l(i){o=m(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=x)},m(i,c){a(i,o,c)},p:_e,d(i){i&&n(o)}}}function It($){let o,x="Example:",i,c,f;return c=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMENvbnZOZXh0VjJNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjb252bmV4dHYyLXRpbnktMWstMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwQ29udk5leHRWMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNvbnZuZXh0djItdGlueS0xay0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ConvNextV2Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/convnextv2-tiny-1k-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ConvNextV2Model.from_pretrained(<span class="hljs-string">&quot;facebook/convnextv2-tiny-1k-224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">768</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`,wrap:!1}}),{c(){o=d("p"),o.textContent=x,i=r(),u(c.$$.fragment)},l(s){o=m(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=x),i=l(s),g(c.$$.fragment,s)},m(s,y){a(s,o,y),a(s,i,y),v(c,s,y),f=!0},p:_e,i(s){f||(_(c.$$.fragment,s),f=!0)},o(s){b(c.$$.fragment,s),f=!1},d(s){s&&(n(o),n(i)),C(c,s)}}}function Jt($){let o,x=`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(){o=d("p"),o.innerHTML=x},l(i){o=m(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=x)},m(i,c){a(i,o,c)},p:_e,d(i){i&&n(o)}}}function Wt($){let o,x="Example:",i,c,f;return c=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMENvbnZOZXh0VjJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNvbnZuZXh0djItdGlueS0xay0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDb252TmV4dFYyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjb252bmV4dHYyLXRpbnktMWstMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ConvNextV2ForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/convnextv2-tiny-1k-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ConvNextV2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/convnextv2-tiny-1k-224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,wrap:!1}}),{c(){o=d("p"),o.textContent=x,i=r(),u(c.$$.fragment)},l(s){o=m(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=x),i=l(s),g(c.$$.fragment,s)},m(s,y){a(s,o,y),a(s,i,y),v(c,s,y),f=!0},p:_e,i(s){f||(_(c.$$.fragment,s),f=!0)},o(s){b(c.$$.fragment,s),f=!1},d(s){s&&(n(o),n(i)),C(c,s)}}}function kt($){let o,x,i,c,f,s,y,be,H,nt=`The ConvNeXt V2 model was proposed in <a href="https://arxiv.org/abs/2301.00808" rel="nofollow">ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders</a> by Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon, Saining Xie.
ConvNeXt V2 is a pure convolutional model (ConvNet), inspired by the design of Vision Transformers, and a successor of <a href="convnext">ConvNeXT</a>.`,Ce,R,ot="The abstract from the paper is the following:",xe,E,st="<em>Driven by improved architectures and better representation learning frameworks, the field of visual recognition has enjoyed rapid modernization and performance boost in the early 2020s. For example, modern ConvNets, represented by ConvNeXt, have demonstrated strong performance in various scenarios. While these models were originally designed for supervised learning with ImageNet labels, they can also potentially benefit from self-supervised learning techniques such as masked  autoencoders (MAE). However, we found that simply combining these two approaches leads to subpar performance. In this paper, we propose a fully convolutional masked autoencoder framework and a new Global Response Normalization (GRN) layer that can be added to the ConvNeXt architecture to enhance inter-channel feature competition. This co-design of self-supervised learning techniques and architectural improvement results in a new model family called ConvNeXt V2, which significantly improves the performance of pure ConvNets on various recognition benchmarks, including ImageNet classification, COCO detection, and ADE20K segmentation. We also provide pre-trained ConvNeXt V2 models of various sizes, ranging from an efficient 3.7M-parameter Atto model with 76.7% top-1 accuracy on ImageNet, to a 650M Huge model that achieves a state-of-the-art 88.9% accuracy using only public training data.</em>",ye,P,at="Tips:",Me,L,rt="<li>See the code examples below each model regarding usage.</li>",we,F,lt,$e,q,it='ConvNeXt V2 architecture. Taken from the <a href="https://arxiv.org/abs/2301.00808">original paper</a>.',Te,Y,ct='This model was contributed by <a href="https://huggingface.co/adirik" rel="nofollow">adirik</a>. The original code can be found <a href="https://github.com/facebookresearch/ConvNeXt-V2" rel="nofollow">here</a>.',Ne,S,Ve,Q,dt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with ConvNeXt V2.",je,A,Ie,D,mt='<li><a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2ForImageClassification">ConvNextV2ForImageClassification</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>',Je,O,pt="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.",We,K,ke,M,ee,Xe,ie,ft=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2Model">ConvNextV2Model</a>. It is used to instantiate an
ConvNeXTV2 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 ConvNeXTV2
<a href="https://huggingface.co/facebook/convnextv2-tiny-1k-224" rel="nofollow">facebook/convnextv2-tiny-1k-224</a> architecture.`,He,ce,ht=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Re,U,Ze,te,Fe,V,ne,Ee,de,ut=`The bare ConvNextV2 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.`,Pe,T,oe,Le,me,gt='The <a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2Model">ConvNextV2Model</a> forward method, overrides the <code>__call__</code> special method.',qe,z,Ye,B,Ue,se,ze,w,ae,Se,pe,vt=`ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,Qe,fe,_t=`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.`,Ae,N,re,De,he,bt='The <a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2ForImageClassification">ConvNextV2ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Oe,G,Ke,X,Be,ge,Ge;return f=new ue({props:{title:"ConvNeXt V2",local:"convnext-v2",headingTag:"h1"}}),y=new ue({props:{title:"Overview",local:"overview",headingTag:"h2"}}),S=new ue({props:{title:"Resources",local:"resources",headingTag:"h2"}}),A=new Nt({props:{pipeline:"image-classification"}}),K=new ue({props:{title:"ConvNextV2Config",local:"transformers.ConvNextV2Config",headingTag:"h2"}}),ee=new ve({props:{name:"class transformers.ConvNextV2Config",anchor:"transformers.ConvNextV2Config",parameters:[{name:"num_channels",val:" = 3"},{name:"patch_size",val:" = 4"},{name:"num_stages",val:" = 4"},{name:"hidden_sizes",val:" = None"},{name:"depths",val:" = None"},{name:"hidden_act",val:" = 'gelu'"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"drop_path_rate",val:" = 0.0"},{name:"image_size",val:" = 224"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConvNextV2Config.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.ConvNextV2Config.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, optional, defaults to 4) &#x2014;
Patch size to use in the patch embedding layer.`,name:"patch_size"},{anchor:"transformers.ConvNextV2Config.num_stages",description:`<strong>num_stages</strong> (<code>int</code>, optional, defaults to 4) &#x2014;
The number of stages in the model.`,name:"num_stages"},{anchor:"transformers.ConvNextV2Config.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[96, 192, 384, 768]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.ConvNextV2Config.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 9, 3]</code>) &#x2014;
Depth (number of blocks) for each stage.`,name:"depths"},{anchor:"transformers.ConvNextV2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in each block. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ConvNextV2Config.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ConvNextV2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ConvNextV2Config.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The drop rate for stochastic depth.`,name:"drop_path_rate"},{anchor:"transformers.ConvNextV2Config.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage.`,name:"out_features"},{anchor:"transformers.ConvNextV2Config.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/convnextv2/configuration_convnextv2.py#L30"}}),U=new et({props:{anchor:"transformers.ConvNextV2Config.example",$$slots:{default:[Vt]},$$scope:{ctx:$}}}),te=new ue({props:{title:"ConvNextV2Model",local:"transformers.ConvNextV2Model",headingTag:"h2"}}),ne=new ve({props:{name:"class transformers.ConvNextV2Model",anchor:"transformers.ConvNextV2Model",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ConvNextV2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2Config">ConvNextV2Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/convnextv2/modeling_convnextv2.py#L354"}}),oe=new ve({props:{name:"forward",anchor:"transformers.ConvNextV2Model.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ConvNextV2Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/convnext#transformers.ConvNextImageProcessor">ConvNextImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ConvNextV2Model.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ConvNextV2Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/convnextv2/modeling_convnextv2.py#L368",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/main/en/model_doc/convnextv2#transformers.ConvNextV2Config"
>ConvNextV2Config</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>
`}}),z=new Ct({props:{$$slots:{default:[jt]},$$scope:{ctx:$}}}),B=new et({props:{anchor:"transformers.ConvNextV2Model.forward.example",$$slots:{default:[It]},$$scope:{ctx:$}}}),se=new ue({props:{title:"ConvNextV2ForImageClassification",local:"transformers.ConvNextV2ForImageClassification",headingTag:"h2"}}),ae=new ve({props:{name:"class transformers.ConvNextV2ForImageClassification",anchor:"transformers.ConvNextV2ForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ConvNextV2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2Config">ConvNextV2Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/convnextv2/modeling_convnextv2.py#L421"}}),re=new ve({props:{name:"forward",anchor:"transformers.ConvNextV2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ConvNextV2ForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/convnext#transformers.ConvNextImageProcessor">ConvNextImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ConvNextV2ForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ConvNextV2ForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ConvNextV2ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/convnextv2/modeling_convnextv2.py#L436",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/convnextv2#transformers.ConvNextV2Config"
>ConvNextV2Config</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/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new Ct({props:{$$slots:{default:[Jt]},$$scope:{ctx:$}}}),X=new et({props:{anchor:"transformers.ConvNextV2ForImageClassification.forward.example",$$slots:{default:[Wt]},$$scope:{ctx:$}}}),{c(){o=d("meta"),x=r(),i=d("p"),c=r(),u(f.$$.fragment),s=r(),u(y.$$.fragment),be=r(),H=d("p"),H.innerHTML=nt,Ce=r(),R=d("p"),R.textContent=ot,xe=r(),E=d("p"),E.innerHTML=st,ye=r(),P=d("p"),P.textContent=at,Me=r(),L=d("ul"),L.innerHTML=rt,we=r(),F=d("img"),$e=r(),q=d("small"),q.innerHTML=it,Te=r(),Y=d("p"),Y.innerHTML=ct,Ne=r(),u(S.$$.fragment),Ve=r(),Q=d("p"),Q.textContent=dt,je=r(),u(A.$$.fragment),Ie=r(),D=d("ul"),D.innerHTML=mt,Je=r(),O=d("p"),O.textContent=pt,We=r(),u(K.$$.fragment),ke=r(),M=d("div"),u(ee.$$.fragment),Xe=r(),ie=d("p"),ie.innerHTML=ft,He=r(),ce=d("p"),ce.innerHTML=ht,Re=r(),u(U.$$.fragment),Ze=r(),u(te.$$.fragment),Fe=r(),V=d("div"),u(ne.$$.fragment),Ee=r(),de=d("p"),de.innerHTML=ut,Pe=r(),T=d("div"),u(oe.$$.fragment),Le=r(),me=d("p"),me.innerHTML=gt,qe=r(),u(z.$$.fragment),Ye=r(),u(B.$$.fragment),Ue=r(),u(se.$$.fragment),ze=r(),w=d("div"),u(ae.$$.fragment),Se=r(),pe=d("p"),pe.textContent=vt,Qe=r(),fe=d("p"),fe.innerHTML=_t,Ae=r(),N=d("div"),u(re.$$.fragment),De=r(),he=d("p"),he.innerHTML=bt,Oe=r(),u(G.$$.fragment),Ke=r(),u(X.$$.fragment),Be=r(),ge=d("p"),this.h()},l(e){const t=Tt("svelte-u9bgzb",document.head);o=m(t,"META",{name:!0,content:!0}),t.forEach(n),x=l(e),i=m(e,"P",{}),le(i).forEach(n),c=l(e),g(f.$$.fragment,e),s=l(e),g(y.$$.fragment,e),be=l(e),H=m(e,"P",{"data-svelte-h":!0}),h(H)!=="svelte-wq6ps0"&&(H.innerHTML=nt),Ce=l(e),R=m(e,"P",{"data-svelte-h":!0}),h(R)!=="svelte-vfdo9a"&&(R.textContent=ot),xe=l(e),E=m(e,"P",{"data-svelte-h":!0}),h(E)!=="svelte-9q4js6"&&(E.innerHTML=st),ye=l(e),P=m(e,"P",{"data-svelte-h":!0}),h(P)!=="svelte-axv494"&&(P.textContent=at),Me=l(e),L=m(e,"UL",{"data-svelte-h":!0}),h(L)!=="svelte-n2rynk"&&(L.innerHTML=rt),we=l(e),F=m(e,"IMG",{src:!0,alt:!0,width:!0}),$e=l(e),q=m(e,"SMALL",{"data-svelte-h":!0}),h(q)!=="svelte-10q852d"&&(q.innerHTML=it),Te=l(e),Y=m(e,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-kiq3o2"&&(Y.innerHTML=ct),Ne=l(e),g(S.$$.fragment,e),Ve=l(e),Q=m(e,"P",{"data-svelte-h":!0}),h(Q)!=="svelte-16akdts"&&(Q.textContent=dt),je=l(e),g(A.$$.fragment,e),Ie=l(e),D=m(e,"UL",{"data-svelte-h":!0}),h(D)!=="svelte-15g5zdk"&&(D.innerHTML=mt),Je=l(e),O=m(e,"P",{"data-svelte-h":!0}),h(O)!=="svelte-1xesile"&&(O.textContent=pt),We=l(e),g(K.$$.fragment,e),ke=l(e),M=m(e,"DIV",{class:!0});var j=le(M);g(ee.$$.fragment,j),Xe=l(j),ie=m(j,"P",{"data-svelte-h":!0}),h(ie)!=="svelte-1f50dy8"&&(ie.innerHTML=ft),He=l(j),ce=m(j,"P",{"data-svelte-h":!0}),h(ce)!=="svelte-o55m63"&&(ce.innerHTML=ht),Re=l(j),g(U.$$.fragment,j),j.forEach(n),Ze=l(e),g(te.$$.fragment,e),Fe=l(e),V=m(e,"DIV",{class:!0});var Z=le(V);g(ne.$$.fragment,Z),Ee=l(Z),de=m(Z,"P",{"data-svelte-h":!0}),h(de)!=="svelte-vxpmpx"&&(de.innerHTML=ut),Pe=l(Z),T=m(Z,"DIV",{class:!0});var I=le(T);g(oe.$$.fragment,I),Le=l(I),me=m(I,"P",{"data-svelte-h":!0}),h(me)!=="svelte-3v038a"&&(me.innerHTML=gt),qe=l(I),g(z.$$.fragment,I),Ye=l(I),g(B.$$.fragment,I),I.forEach(n),Z.forEach(n),Ue=l(e),g(se.$$.fragment,e),ze=l(e),w=m(e,"DIV",{class:!0});var J=le(w);g(ae.$$.fragment,J),Se=l(J),pe=m(J,"P",{"data-svelte-h":!0}),h(pe)!=="svelte-14zttn9"&&(pe.textContent=vt),Qe=l(J),fe=m(J,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-1gjh92c"&&(fe.innerHTML=_t),Ae=l(J),N=m(J,"DIV",{class:!0});var W=le(N);g(re.$$.fragment,W),De=l(W),he=m(W,"P",{"data-svelte-h":!0}),h(he)!=="svelte-t1fmv8"&&(he.innerHTML=bt),Oe=l(W),g(G.$$.fragment,W),Ke=l(W),g(X.$$.fragment,W),W.forEach(n),J.forEach(n),Be=l(e),ge=m(e,"P",{}),le(ge).forEach(n),this.h()},h(){k(o,"name","hf:doc:metadata"),k(o,"content",Zt),yt(F.src,lt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/convnextv2_architecture.png")||k(F,"src",lt),k(F,"alt","drawing"),k(F,"width","600"),k(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(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(e,t){p(document.head,o),a(e,x,t),a(e,i,t),a(e,c,t),v(f,e,t),a(e,s,t),v(y,e,t),a(e,be,t),a(e,H,t),a(e,Ce,t),a(e,R,t),a(e,xe,t),a(e,E,t),a(e,ye,t),a(e,P,t),a(e,Me,t),a(e,L,t),a(e,we,t),a(e,F,t),a(e,$e,t),a(e,q,t),a(e,Te,t),a(e,Y,t),a(e,Ne,t),v(S,e,t),a(e,Ve,t),a(e,Q,t),a(e,je,t),v(A,e,t),a(e,Ie,t),a(e,D,t),a(e,Je,t),a(e,O,t),a(e,We,t),v(K,e,t),a(e,ke,t),a(e,M,t),v(ee,M,null),p(M,Xe),p(M,ie),p(M,He),p(M,ce),p(M,Re),v(U,M,null),a(e,Ze,t),v(te,e,t),a(e,Fe,t),a(e,V,t),v(ne,V,null),p(V,Ee),p(V,de),p(V,Pe),p(V,T),v(oe,T,null),p(T,Le),p(T,me),p(T,qe),v(z,T,null),p(T,Ye),v(B,T,null),a(e,Ue,t),v(se,e,t),a(e,ze,t),a(e,w,t),v(ae,w,null),p(w,Se),p(w,pe),p(w,Qe),p(w,fe),p(w,Ae),p(w,N),v(re,N,null),p(N,De),p(N,he),p(N,Oe),v(G,N,null),p(N,Ke),v(X,N,null),a(e,Be,t),a(e,ge,t),Ge=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),U.$set(j);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),z.$set(Z);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),B.$set(I);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),G.$set(J);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),X.$set(W)},i(e){Ge||(_(f.$$.fragment,e),_(y.$$.fragment,e),_(S.$$.fragment,e),_(A.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(U.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(oe.$$.fragment,e),_(z.$$.fragment,e),_(B.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(G.$$.fragment,e),_(X.$$.fragment,e),Ge=!0)},o(e){b(f.$$.fragment,e),b(y.$$.fragment,e),b(S.$$.fragment,e),b(A.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(U.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(oe.$$.fragment,e),b(z.$$.fragment,e),b(B.$$.fragment,e),b(se.$$.fragment,e),b(ae.$$.fragment,e),b(re.$$.fragment,e),b(G.$$.fragment,e),b(X.$$.fragment,e),Ge=!1},d(e){e&&(n(x),n(i),n(c),n(s),n(be),n(H),n(Ce),n(R),n(xe),n(E),n(ye),n(P),n(Me),n(L),n(we),n(F),n($e),n(q),n(Te),n(Y),n(Ne),n(Ve),n(Q),n(je),n(Ie),n(D),n(Je),n(O),n(We),n(ke),n(M),n(Ze),n(Fe),n(V),n(Ue),n(ze),n(w),n(Be),n(ge)),n(o),C(f,e),C(y,e),C(S,e),C(A,e),C(K,e),C(ee),C(U),C(te,e),C(ne),C(oe),C(z),C(B),C(se,e),C(ae),C(re),C(G),C(X)}}}const Zt='{"title":"ConvNeXt V2","local":"convnext-v2","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"ConvNextV2Config","local":"transformers.ConvNextV2Config","sections":[],"depth":2},{"title":"ConvNextV2Model","local":"transformers.ConvNextV2Model","sections":[],"depth":2},{"title":"ConvNextV2ForImageClassification","local":"transformers.ConvNextV2ForImageClassification","sections":[],"depth":2}],"depth":1}';function Ft($){return Mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pt extends wt{constructor(o){super(),$t(this,o,Ft,kt,xt,{})}}export{Pt as component};
