import{S as ha,i as pa,s as ma,e as n,k as p,w as y,t as l,M as ua,c as a,d as o,m,a as s,x as w,h as i,b as c,N as ga,G as t,g as f,y as C,q as N,o as x,B as $,v as va,L as bn}from"../../chunks/vendor-hf-doc-builder.js";import{T as fa}from"../../chunks/Tip-hf-doc-builder.js";import{D as _t}from"../../chunks/Docstring-hf-doc-builder.js";import{C as yn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _n}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as _a}from"../../chunks/PipelineTag-hf-doc-builder.js";function ba(V){let h,b,v,u,_;return u=new yn({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`}}),{c(){h=n("p"),b=l("Example:"),v=p(),y(u.$$.fragment)},l(r){h=a(r,"P",{});var g=s(h);b=i(g,"Example:"),g.forEach(o),v=m(r),w(u.$$.fragment,r)},m(r,g){f(r,h,g),t(h,b),f(r,v,g),C(u,r,g),_=!0},p:bn,i(r){_||(N(u.$$.fragment,r),_=!0)},o(r){x(u.$$.fragment,r),_=!1},d(r){r&&o(h),r&&o(v),$(u,r)}}}function ya(V){let h,b,v,u,_;return{c(){h=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),u=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){h=a(r,"P",{});var g=s(h);b=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=a(g,"CODE",{});var I=s(v);u=i(I,"Module"),I.forEach(o),_=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(r,g){f(r,h,g),t(h,b),t(h,v),t(v,u),t(h,_)},d(r){r&&o(h)}}}function wa(V){let h,b,v,u,_;return u=new yn({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>]`}}),{c(){h=n("p"),b=l("Example:"),v=p(),y(u.$$.fragment)},l(r){h=a(r,"P",{});var g=s(h);b=i(g,"Example:"),g.forEach(o),v=m(r),w(u.$$.fragment,r)},m(r,g){f(r,h,g),t(h,b),f(r,v,g),C(u,r,g),_=!0},p:bn,i(r){_||(N(u.$$.fragment,r),_=!0)},o(r){x(u.$$.fragment,r),_=!1},d(r){r&&o(h),r&&o(v),$(u,r)}}}function Ca(V){let h,b,v,u,_;return{c(){h=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),u=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){h=a(r,"P",{});var g=s(h);b=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=a(g,"CODE",{});var I=s(v);u=i(I,"Module"),I.forEach(o),_=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(r,g){f(r,h,g),t(h,b),t(h,v),t(v,u),t(h,_)},d(r){r&&o(h)}}}function Na(V){let h,b,v,u,_;return u=new yn({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`}}),{c(){h=n("p"),b=l("Example:"),v=p(),y(u.$$.fragment)},l(r){h=a(r,"P",{});var g=s(h);b=i(g,"Example:"),g.forEach(o),v=m(r),w(u.$$.fragment,r)},m(r,g){f(r,h,g),t(h,b),f(r,v,g),C(u,r,g),_=!0},p:bn,i(r){_||(N(u.$$.fragment,r),_=!0)},o(r){x(u.$$.fragment,r),_=!1},d(r){r&&o(h),r&&o(v),$(u,r)}}}function xa(V){let h,b,v,u,_,r,g,I,Yt,bt,F,S,et,le,Ht,tt,Qt,yt,J,Dt,ie,Lt,Ot,Ie,Kt,eo,wt,ke,to,Ct,Je,ot,oo,Nt,We,no,xt,Ze,nt,ao,$t,q,wn,Mt,Y,so,Fe,ro,lo,Tt,W,io,ce,co,fo,de,ho,po,Vt,U,H,at,fe,mo,st,uo,Et,Ue,go,jt,he,It,Xe,Z,Pe,vo,_o,pe,bo,yo,me,wo,Co,kt,Ge,No,Jt,X,Q,rt,ue,xo,lt,$o,Wt,M,ge,Mo,P,To,Be,Vo,Eo,ve,jo,Io,ko,G,Jo,ze,Wo,Zo,Re,Fo,Uo,Xo,D,Zt,B,L,it,_e,Po,ct,Go,Ft,k,be,Bo,ye,zo,we,Ro,Ao,So,E,Ce,qo,z,Yo,Ae,Ho,Qo,dt,Do,Lo,Oo,O,Ko,K,Ut,R,ee,ft,Ne,en,ht,tn,Xt,T,xe,on,pt,nn,an,$e,sn,Me,rn,ln,cn,j,Te,dn,A,fn,Se,hn,pn,mt,mn,un,gn,te,vn,oe,Pt;return r=new Ke({}),le=new Ke({}),fe=new Ke({}),he=new _a({props:{pipeline:"image-classification"}}),ue=new Ke({}),ge=new _t({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/v4.31.0/src/transformers/models/convnextv2/configuration_convnextv2.py#L30"}}),D=new _n({props:{anchor:"transformers.ConvNextV2Config.example",$$slots:{default:[ba]},$$scope:{ctx:V}}}),_e=new Ke({}),be=new _t({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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/convnextv2/modeling_convnextv2.py#L354"}}),Ce=new _t({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/v4.31.0/en/model_doc/convnext#transformers.ConvNextImageProcessor">ConvNextImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/convnextv2/modeling_convnextv2.py#L368",returnDescription:`
<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/v4.31.0/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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new fa({props:{$$slots:{default:[ya]},$$scope:{ctx:V}}}),K=new _n({props:{anchor:"transformers.ConvNextV2Model.forward.example",$$slots:{default:[wa]},$$scope:{ctx:V}}}),Ne=new Ke({}),xe=new _t({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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/convnextv2/modeling_convnextv2.py#L421"}}),Te=new _t({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/v4.31.0/en/model_doc/convnext#transformers.ConvNextImageProcessor">ConvNextImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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/v4.31.0/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/v4.31.0/src/transformers/models/convnextv2/modeling_convnextv2.py#L436",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new fa({props:{$$slots:{default:[Ca]},$$scope:{ctx:V}}}),oe=new _n({props:{anchor:"transformers.ConvNextV2ForImageClassification.forward.example",$$slots:{default:[Na]},$$scope:{ctx:V}}}),{c(){h=n("meta"),b=p(),v=n("h1"),u=n("a"),_=n("span"),y(r.$$.fragment),g=p(),I=n("span"),Yt=l("ConvNeXt V2"),bt=p(),F=n("h2"),S=n("a"),et=n("span"),y(le.$$.fragment),Ht=p(),tt=n("span"),Qt=l("Overview"),yt=p(),J=n("p"),Dt=l("The ConvNeXt V2 model was proposed in "),ie=n("a"),Lt=l("ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders"),Ot=l(` 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 `),Ie=n("a"),Kt=l("ConvNeXT"),eo=l("."),wt=p(),ke=n("p"),to=l("The abstract from the paper is the following:"),Ct=p(),Je=n("p"),ot=n("em"),oo=l("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."),Nt=p(),We=n("p"),no=l("Tips:"),xt=p(),Ze=n("ul"),nt=n("li"),ao=l("See the code examples below each model regarding usage."),$t=p(),q=n("img"),Mt=p(),Y=n("small"),so=l("ConvNeXt V2 architecture. Taken from the "),Fe=n("a"),ro=l("original paper"),lo=l("."),Tt=p(),W=n("p"),io=l("This model was contributed by "),ce=n("a"),co=l("adirik"),fo=l(". The original code can be found "),de=n("a"),ho=l("here"),po=l("."),Vt=p(),U=n("h2"),H=n("a"),at=n("span"),y(fe.$$.fragment),mo=p(),st=n("span"),uo=l("Resources"),Et=p(),Ue=n("p"),go=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ConvNeXt V2."),jt=p(),y(he.$$.fragment),It=p(),Xe=n("ul"),Z=n("li"),Pe=n("a"),vo=l("ConvNextV2ForImageClassification"),_o=l(" is supported by this "),pe=n("a"),bo=l("example script"),yo=l(" and "),me=n("a"),wo=l("notebook"),Co=l("."),kt=p(),Ge=n("p"),No=l("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Jt=p(),X=n("h2"),Q=n("a"),rt=n("span"),y(ue.$$.fragment),xo=p(),lt=n("span"),$o=l("ConvNextV2Config"),Wt=p(),M=n("div"),y(ge.$$.fragment),Mo=p(),P=n("p"),To=l("This is the configuration class to store the configuration of a "),Be=n("a"),Vo=l("ConvNextV2Model"),Eo=l(`. 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
`),ve=n("a"),jo=l("facebook/convnextv2-tiny-1k-224"),Io=l(" architecture."),ko=p(),G=n("p"),Jo=l("Configuration objects inherit from "),ze=n("a"),Wo=l("PretrainedConfig"),Zo=l(` and can be used to control the model outputs. Read the
documentation from `),Re=n("a"),Fo=l("PretrainedConfig"),Uo=l(" for more information."),Xo=p(),y(D.$$.fragment),Zt=p(),B=n("h2"),L=n("a"),it=n("span"),y(_e.$$.fragment),Po=p(),ct=n("span"),Go=l("ConvNextV2Model"),Ft=p(),k=n("div"),y(be.$$.fragment),Bo=p(),ye=n("p"),zo=l(`The bare ConvNextV2 model outputting raw features without any specific head on top.
This model is a PyTorch `),we=n("a"),Ro=l("torch.nn.Module"),Ao=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),So=p(),E=n("div"),y(Ce.$$.fragment),qo=p(),z=n("p"),Yo=l("The "),Ae=n("a"),Ho=l("ConvNextV2Model"),Qo=l(" forward method, overrides the "),dt=n("code"),Do=l("__call__"),Lo=l(" special method."),Oo=p(),y(O.$$.fragment),Ko=p(),y(K.$$.fragment),Ut=p(),R=n("h2"),ee=n("a"),ft=n("span"),y(Ne.$$.fragment),en=p(),ht=n("span"),tn=l("ConvNextV2ForImageClassification"),Xt=p(),T=n("div"),y(xe.$$.fragment),on=p(),pt=n("p"),nn=l(`ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),an=p(),$e=n("p"),sn=l("This model is a PyTorch "),Me=n("a"),rn=l("torch.nn.Module"),ln=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),cn=p(),j=n("div"),y(Te.$$.fragment),dn=p(),A=n("p"),fn=l("The "),Se=n("a"),hn=l("ConvNextV2ForImageClassification"),pn=l(" forward method, overrides the "),mt=n("code"),mn=l("__call__"),un=l(" special method."),gn=p(),y(te.$$.fragment),vn=p(),y(oe.$$.fragment),this.h()},l(e){const d=ua('[data-svelte="svelte-1phssyn"]',document.head);h=a(d,"META",{name:!0,content:!0}),d.forEach(o),b=m(e),v=a(e,"H1",{class:!0});var Ve=s(v);u=a(Ve,"A",{id:!0,class:!0,href:!0});var ut=s(u);_=a(ut,"SPAN",{});var gt=s(_);w(r.$$.fragment,gt),gt.forEach(o),ut.forEach(o),g=m(Ve),I=a(Ve,"SPAN",{});var vt=s(I);Yt=i(vt,"ConvNeXt V2"),vt.forEach(o),Ve.forEach(o),bt=m(e),F=a(e,"H2",{class:!0});var Ee=s(F);S=a(Ee,"A",{id:!0,class:!0,href:!0});var Cn=s(S);et=a(Cn,"SPAN",{});var Nn=s(et);w(le.$$.fragment,Nn),Nn.forEach(o),Cn.forEach(o),Ht=m(Ee),tt=a(Ee,"SPAN",{});var xn=s(tt);Qt=i(xn,"Overview"),xn.forEach(o),Ee.forEach(o),yt=m(e),J=a(e,"P",{});var qe=s(J);Dt=i(qe,"The ConvNeXt V2 model was proposed in "),ie=a(qe,"A",{href:!0,rel:!0});var $n=s(ie);Lt=i($n,"ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders"),$n.forEach(o),Ot=i(qe,` 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 `),Ie=a(qe,"A",{href:!0});var Mn=s(Ie);Kt=i(Mn,"ConvNeXT"),Mn.forEach(o),eo=i(qe,"."),qe.forEach(o),wt=m(e),ke=a(e,"P",{});var Tn=s(ke);to=i(Tn,"The abstract from the paper is the following:"),Tn.forEach(o),Ct=m(e),Je=a(e,"P",{});var Vn=s(Je);ot=a(Vn,"EM",{});var En=s(ot);oo=i(En,"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."),En.forEach(o),Vn.forEach(o),Nt=m(e),We=a(e,"P",{});var jn=s(We);no=i(jn,"Tips:"),jn.forEach(o),xt=m(e),Ze=a(e,"UL",{});var In=s(Ze);nt=a(In,"LI",{});var kn=s(nt);ao=i(kn,"See the code examples below each model regarding usage."),kn.forEach(o),In.forEach(o),$t=m(e),q=a(e,"IMG",{src:!0,alt:!0,width:!0}),Mt=m(e),Y=a(e,"SMALL",{});var Gt=s(Y);so=i(Gt,"ConvNeXt V2 architecture. Taken from the "),Fe=a(Gt,"A",{href:!0});var Jn=s(Fe);ro=i(Jn,"original paper"),Jn.forEach(o),lo=i(Gt,"."),Gt.forEach(o),Tt=m(e),W=a(e,"P",{});var Ye=s(W);io=i(Ye,"This model was contributed by "),ce=a(Ye,"A",{href:!0,rel:!0});var Wn=s(ce);co=i(Wn,"adirik"),Wn.forEach(o),fo=i(Ye,". The original code can be found "),de=a(Ye,"A",{href:!0,rel:!0});var Zn=s(de);ho=i(Zn,"here"),Zn.forEach(o),po=i(Ye,"."),Ye.forEach(o),Vt=m(e),U=a(e,"H2",{class:!0});var Bt=s(U);H=a(Bt,"A",{id:!0,class:!0,href:!0});var Fn=s(H);at=a(Fn,"SPAN",{});var Un=s(at);w(fe.$$.fragment,Un),Un.forEach(o),Fn.forEach(o),mo=m(Bt),st=a(Bt,"SPAN",{});var Xn=s(st);uo=i(Xn,"Resources"),Xn.forEach(o),Bt.forEach(o),Et=m(e),Ue=a(e,"P",{});var Pn=s(Ue);go=i(Pn,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ConvNeXt V2."),Pn.forEach(o),jt=m(e),w(he.$$.fragment,e),It=m(e),Xe=a(e,"UL",{});var Gn=s(Xe);Z=a(Gn,"LI",{});var je=s(Z);Pe=a(je,"A",{href:!0});var Bn=s(Pe);vo=i(Bn,"ConvNextV2ForImageClassification"),Bn.forEach(o),_o=i(je," is supported by this "),pe=a(je,"A",{href:!0,rel:!0});var zn=s(pe);bo=i(zn,"example script"),zn.forEach(o),yo=i(je," and "),me=a(je,"A",{href:!0,rel:!0});var Rn=s(me);wo=i(Rn,"notebook"),Rn.forEach(o),Co=i(je,"."),je.forEach(o),Gn.forEach(o),kt=m(e),Ge=a(e,"P",{});var An=s(Ge);No=i(An,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),An.forEach(o),Jt=m(e),X=a(e,"H2",{class:!0});var zt=s(X);Q=a(zt,"A",{id:!0,class:!0,href:!0});var Sn=s(Q);rt=a(Sn,"SPAN",{});var qn=s(rt);w(ue.$$.fragment,qn),qn.forEach(o),Sn.forEach(o),xo=m(zt),lt=a(zt,"SPAN",{});var Yn=s(lt);$o=i(Yn,"ConvNextV2Config"),Yn.forEach(o),zt.forEach(o),Wt=m(e),M=a(e,"DIV",{class:!0});var ne=s(M);w(ge.$$.fragment,ne),Mo=m(ne),P=a(ne,"P",{});var He=s(P);To=i(He,"This is the configuration class to store the configuration of a "),Be=a(He,"A",{href:!0});var Hn=s(Be);Vo=i(Hn,"ConvNextV2Model"),Hn.forEach(o),Eo=i(He,`. 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
`),ve=a(He,"A",{href:!0,rel:!0});var Qn=s(ve);jo=i(Qn,"facebook/convnextv2-tiny-1k-224"),Qn.forEach(o),Io=i(He," architecture."),He.forEach(o),ko=m(ne),G=a(ne,"P",{});var Qe=s(G);Jo=i(Qe,"Configuration objects inherit from "),ze=a(Qe,"A",{href:!0});var Dn=s(ze);Wo=i(Dn,"PretrainedConfig"),Dn.forEach(o),Zo=i(Qe,` and can be used to control the model outputs. Read the
documentation from `),Re=a(Qe,"A",{href:!0});var Ln=s(Re);Fo=i(Ln,"PretrainedConfig"),Ln.forEach(o),Uo=i(Qe," for more information."),Qe.forEach(o),Xo=m(ne),w(D.$$.fragment,ne),ne.forEach(o),Zt=m(e),B=a(e,"H2",{class:!0});var Rt=s(B);L=a(Rt,"A",{id:!0,class:!0,href:!0});var On=s(L);it=a(On,"SPAN",{});var Kn=s(it);w(_e.$$.fragment,Kn),Kn.forEach(o),On.forEach(o),Po=m(Rt),ct=a(Rt,"SPAN",{});var ea=s(ct);Go=i(ea,"ConvNextV2Model"),ea.forEach(o),Rt.forEach(o),Ft=m(e),k=a(e,"DIV",{class:!0});var De=s(k);w(be.$$.fragment,De),Bo=m(De),ye=a(De,"P",{});var At=s(ye);zo=i(At,`The bare ConvNextV2 model outputting raw features without any specific head on top.
This model is a PyTorch `),we=a(At,"A",{href:!0,rel:!0});var ta=s(we);Ro=i(ta,"torch.nn.Module"),ta.forEach(o),Ao=i(At,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),At.forEach(o),So=m(De),E=a(De,"DIV",{class:!0});var ae=s(E);w(Ce.$$.fragment,ae),qo=m(ae),z=a(ae,"P",{});var Le=s(z);Yo=i(Le,"The "),Ae=a(Le,"A",{href:!0});var oa=s(Ae);Ho=i(oa,"ConvNextV2Model"),oa.forEach(o),Qo=i(Le," forward method, overrides the "),dt=a(Le,"CODE",{});var na=s(dt);Do=i(na,"__call__"),na.forEach(o),Lo=i(Le," special method."),Le.forEach(o),Oo=m(ae),w(O.$$.fragment,ae),Ko=m(ae),w(K.$$.fragment,ae),ae.forEach(o),De.forEach(o),Ut=m(e),R=a(e,"H2",{class:!0});var St=s(R);ee=a(St,"A",{id:!0,class:!0,href:!0});var aa=s(ee);ft=a(aa,"SPAN",{});var sa=s(ft);w(Ne.$$.fragment,sa),sa.forEach(o),aa.forEach(o),en=m(St),ht=a(St,"SPAN",{});var ra=s(ht);tn=i(ra,"ConvNextV2ForImageClassification"),ra.forEach(o),St.forEach(o),Xt=m(e),T=a(e,"DIV",{class:!0});var se=s(T);w(xe.$$.fragment,se),on=m(se),pt=a(se,"P",{});var la=s(pt);nn=i(la,`ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),la.forEach(o),an=m(se),$e=a(se,"P",{});var qt=s($e);sn=i(qt,"This model is a PyTorch "),Me=a(qt,"A",{href:!0,rel:!0});var ia=s(Me);rn=i(ia,"torch.nn.Module"),ia.forEach(o),ln=i(qt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qt.forEach(o),cn=m(se),j=a(se,"DIV",{class:!0});var re=s(j);w(Te.$$.fragment,re),dn=m(re),A=a(re,"P",{});var Oe=s(A);fn=i(Oe,"The "),Se=a(Oe,"A",{href:!0});var ca=s(Se);hn=i(ca,"ConvNextV2ForImageClassification"),ca.forEach(o),pn=i(Oe," forward method, overrides the "),mt=a(Oe,"CODE",{});var da=s(mt);mn=i(da,"__call__"),da.forEach(o),un=i(Oe," special method."),Oe.forEach(o),gn=m(re),w(te.$$.fragment,re),vn=m(re),w(oe.$$.fragment,re),re.forEach(o),se.forEach(o),this.h()},h(){c(h,"name","hf:doc:metadata"),c(h,"content",JSON.stringify($a)),c(u,"id","convnext-v2"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#convnext-v2"),c(v,"class","relative group"),c(S,"id","overview"),c(S,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(S,"href","#overview"),c(F,"class","relative group"),c(ie,"href","https://arxiv.org/abs/2301.00808"),c(ie,"rel","nofollow"),c(Ie,"href","convnext"),ga(q.src,wn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/convnextv2_architecture.png")||c(q,"src",wn),c(q,"alt","drawing"),c(q,"width","600"),c(Fe,"href","https://arxiv.org/abs/2301.00808"),c(ce,"href","https://huggingface.co/adirik"),c(ce,"rel","nofollow"),c(de,"href","https://github.com/facebookresearch/ConvNeXt-V2"),c(de,"rel","nofollow"),c(H,"id","resources"),c(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(H,"href","#resources"),c(U,"class","relative group"),c(Pe,"href","/docs/transformers/v4.31.0/en/model_doc/convnextv2#transformers.ConvNextV2ForImageClassification"),c(pe,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(pe,"rel","nofollow"),c(me,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(me,"rel","nofollow"),c(Q,"id","transformers.ConvNextV2Config"),c(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Q,"href","#transformers.ConvNextV2Config"),c(X,"class","relative group"),c(Be,"href","/docs/transformers/v4.31.0/en/model_doc/convnextv2#transformers.ConvNextV2Model"),c(ve,"href","https://huggingface.co/facebook/convnextv2-tiny-1k-224"),c(ve,"rel","nofollow"),c(ze,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Re,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"id","transformers.ConvNextV2Model"),c(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(L,"href","#transformers.ConvNextV2Model"),c(B,"class","relative group"),c(we,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(we,"rel","nofollow"),c(Ae,"href","/docs/transformers/v4.31.0/en/model_doc/convnextv2#transformers.ConvNextV2Model"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"id","transformers.ConvNextV2ForImageClassification"),c(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ee,"href","#transformers.ConvNextV2ForImageClassification"),c(R,"class","relative group"),c(Me,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Me,"rel","nofollow"),c(Se,"href","/docs/transformers/v4.31.0/en/model_doc/convnextv2#transformers.ConvNextV2ForImageClassification"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"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,d){t(document.head,h),f(e,b,d),f(e,v,d),t(v,u),t(u,_),C(r,_,null),t(v,g),t(v,I),t(I,Yt),f(e,bt,d),f(e,F,d),t(F,S),t(S,et),C(le,et,null),t(F,Ht),t(F,tt),t(tt,Qt),f(e,yt,d),f(e,J,d),t(J,Dt),t(J,ie),t(ie,Lt),t(J,Ot),t(J,Ie),t(Ie,Kt),t(J,eo),f(e,wt,d),f(e,ke,d),t(ke,to),f(e,Ct,d),f(e,Je,d),t(Je,ot),t(ot,oo),f(e,Nt,d),f(e,We,d),t(We,no),f(e,xt,d),f(e,Ze,d),t(Ze,nt),t(nt,ao),f(e,$t,d),f(e,q,d),f(e,Mt,d),f(e,Y,d),t(Y,so),t(Y,Fe),t(Fe,ro),t(Y,lo),f(e,Tt,d),f(e,W,d),t(W,io),t(W,ce),t(ce,co),t(W,fo),t(W,de),t(de,ho),t(W,po),f(e,Vt,d),f(e,U,d),t(U,H),t(H,at),C(fe,at,null),t(U,mo),t(U,st),t(st,uo),f(e,Et,d),f(e,Ue,d),t(Ue,go),f(e,jt,d),C(he,e,d),f(e,It,d),f(e,Xe,d),t(Xe,Z),t(Z,Pe),t(Pe,vo),t(Z,_o),t(Z,pe),t(pe,bo),t(Z,yo),t(Z,me),t(me,wo),t(Z,Co),f(e,kt,d),f(e,Ge,d),t(Ge,No),f(e,Jt,d),f(e,X,d),t(X,Q),t(Q,rt),C(ue,rt,null),t(X,xo),t(X,lt),t(lt,$o),f(e,Wt,d),f(e,M,d),C(ge,M,null),t(M,Mo),t(M,P),t(P,To),t(P,Be),t(Be,Vo),t(P,Eo),t(P,ve),t(ve,jo),t(P,Io),t(M,ko),t(M,G),t(G,Jo),t(G,ze),t(ze,Wo),t(G,Zo),t(G,Re),t(Re,Fo),t(G,Uo),t(M,Xo),C(D,M,null),f(e,Zt,d),f(e,B,d),t(B,L),t(L,it),C(_e,it,null),t(B,Po),t(B,ct),t(ct,Go),f(e,Ft,d),f(e,k,d),C(be,k,null),t(k,Bo),t(k,ye),t(ye,zo),t(ye,we),t(we,Ro),t(ye,Ao),t(k,So),t(k,E),C(Ce,E,null),t(E,qo),t(E,z),t(z,Yo),t(z,Ae),t(Ae,Ho),t(z,Qo),t(z,dt),t(dt,Do),t(z,Lo),t(E,Oo),C(O,E,null),t(E,Ko),C(K,E,null),f(e,Ut,d),f(e,R,d),t(R,ee),t(ee,ft),C(Ne,ft,null),t(R,en),t(R,ht),t(ht,tn),f(e,Xt,d),f(e,T,d),C(xe,T,null),t(T,on),t(T,pt),t(pt,nn),t(T,an),t(T,$e),t($e,sn),t($e,Me),t(Me,rn),t($e,ln),t(T,cn),t(T,j),C(Te,j,null),t(j,dn),t(j,A),t(A,fn),t(A,Se),t(Se,hn),t(A,pn),t(A,mt),t(mt,mn),t(A,un),t(j,gn),C(te,j,null),t(j,vn),C(oe,j,null),Pt=!0},p(e,[d]){const Ve={};d&2&&(Ve.$$scope={dirty:d,ctx:e}),D.$set(Ve);const ut={};d&2&&(ut.$$scope={dirty:d,ctx:e}),O.$set(ut);const gt={};d&2&&(gt.$$scope={dirty:d,ctx:e}),K.$set(gt);const vt={};d&2&&(vt.$$scope={dirty:d,ctx:e}),te.$set(vt);const Ee={};d&2&&(Ee.$$scope={dirty:d,ctx:e}),oe.$set(Ee)},i(e){Pt||(N(r.$$.fragment,e),N(le.$$.fragment,e),N(fe.$$.fragment,e),N(he.$$.fragment,e),N(ue.$$.fragment,e),N(ge.$$.fragment,e),N(D.$$.fragment,e),N(_e.$$.fragment,e),N(be.$$.fragment,e),N(Ce.$$.fragment,e),N(O.$$.fragment,e),N(K.$$.fragment,e),N(Ne.$$.fragment,e),N(xe.$$.fragment,e),N(Te.$$.fragment,e),N(te.$$.fragment,e),N(oe.$$.fragment,e),Pt=!0)},o(e){x(r.$$.fragment,e),x(le.$$.fragment,e),x(fe.$$.fragment,e),x(he.$$.fragment,e),x(ue.$$.fragment,e),x(ge.$$.fragment,e),x(D.$$.fragment,e),x(_e.$$.fragment,e),x(be.$$.fragment,e),x(Ce.$$.fragment,e),x(O.$$.fragment,e),x(K.$$.fragment,e),x(Ne.$$.fragment,e),x(xe.$$.fragment,e),x(Te.$$.fragment,e),x(te.$$.fragment,e),x(oe.$$.fragment,e),Pt=!1},d(e){o(h),e&&o(b),e&&o(v),$(r),e&&o(bt),e&&o(F),$(le),e&&o(yt),e&&o(J),e&&o(wt),e&&o(ke),e&&o(Ct),e&&o(Je),e&&o(Nt),e&&o(We),e&&o(xt),e&&o(Ze),e&&o($t),e&&o(q),e&&o(Mt),e&&o(Y),e&&o(Tt),e&&o(W),e&&o(Vt),e&&o(U),$(fe),e&&o(Et),e&&o(Ue),e&&o(jt),$(he,e),e&&o(It),e&&o(Xe),e&&o(kt),e&&o(Ge),e&&o(Jt),e&&o(X),$(ue),e&&o(Wt),e&&o(M),$(ge),$(D),e&&o(Zt),e&&o(B),$(_e),e&&o(Ft),e&&o(k),$(be),$(Ce),$(O),$(K),e&&o(Ut),e&&o(R),$(Ne),e&&o(Xt),e&&o(T),$(xe),$(Te),$(te),$(oe)}}}const $a={local:"convnext-v2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ConvNextV2Config",title:"ConvNextV2Config"},{local:"transformers.ConvNextV2Model",title:"ConvNextV2Model"},{local:"transformers.ConvNextV2ForImageClassification",title:"ConvNextV2ForImageClassification"}],title:"ConvNeXt V2"};function Ma(V){return va(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wa extends ha{constructor(h){super();pa(this,h,Ma,xa,ma,{})}}export{Wa as default,$a as metadata};
