import{S as $n,i as bn,s as Nn,e as a,k as u,w as $,t as l,M as yn,c as r,d as s,m as g,a as n,x as b,h as i,b as c,N as Rn,G as t,g as p,y as N,q as y,o as R,B as T,v as Tn,L as hs}from"../../chunks/vendor-hf-doc-builder.js";import{T as eo}from"../../chunks/Tip-hf-doc-builder.js";import{D as ee}from"../../chunks/Docstring-hf-doc-builder.js";import{C as us}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ce}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ps}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Cn}from"../../chunks/PipelineTag-hf-doc-builder.js";function Fn(C){let d,v,_,h,w;return h=new us({props:{code:`from transformers import ResNetConfig, ResNetModel

# Initializing a ResNet resnet-50 style configuration
configuration = ResNetConfig()

# Initializing a model (with random weights) from the resnet-50 style configuration
model = ResNetModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ResNetConfig, ResNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ResNet resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ResNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetModel(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(){d=a("p"),v=l("Example:"),_=u(),$(h.$$.fragment)},l(o){d=r(o,"P",{});var m=n(d);v=i(m,"Example:"),m.forEach(s),_=g(o),b(h.$$.fragment,o)},m(o,m){p(o,d,m),t(d,v),p(o,_,m),N(h,o,m),w=!0},p:hs,i(o){w||(y(h.$$.fragment,o),w=!0)},o(o){R(h.$$.fragment,o),w=!1},d(o){o&&s(d),o&&s(_),T(h,o)}}}function In(C){let d,v,_,h,w;return{c(){d=a("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=l("Module"),w=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(o){d=r(o,"P",{});var m=n(d);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var F=n(_);h=i(F,"Module"),F.forEach(s),w=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(s)},m(o,m){p(o,d,m),t(d,v),t(d,_),t(_,h),t(d,w)},d(o){o&&s(d)}}}function En(C){let d,v,_,h,w;return h=new us({props:{code:`from transformers import AutoImageProcessor, ResNetModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = ResNetModel.from_pretrained("microsoft/resnet-50")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ResNetModel
<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;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&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">2048</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){d=a("p"),v=l("Example:"),_=u(),$(h.$$.fragment)},l(o){d=r(o,"P",{});var m=n(d);v=i(m,"Example:"),m.forEach(s),_=g(o),b(h.$$.fragment,o)},m(o,m){p(o,d,m),t(d,v),p(o,_,m),N(h,o,m),w=!0},p:hs,i(o){w||(y(h.$$.fragment,o),w=!0)},o(o){R(h.$$.fragment,o),w=!1},d(o){o&&s(d),o&&s(_),T(h,o)}}}function jn(C){let d,v,_,h,w;return{c(){d=a("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=l("Module"),w=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(o){d=r(o,"P",{});var m=n(d);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var F=n(_);h=i(F,"Module"),F.forEach(s),w=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(s)},m(o,m){p(o,d,m),t(d,v),t(d,_),t(_,h),t(d,w)},d(o){o&&s(d)}}}function xn(C){let d,v,_,h,w;return h=new us({props:{code:`from transformers import AutoImageProcessor, ResNetForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ResNetForImageClassification
<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;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&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])
tiger cat`}}),{c(){d=a("p"),v=l("Example:"),_=u(),$(h.$$.fragment)},l(o){d=r(o,"P",{});var m=n(d);v=i(m,"Example:"),m.forEach(s),_=g(o),b(h.$$.fragment,o)},m(o,m){p(o,d,m),t(d,v),p(o,_,m),N(h,o,m),w=!0},p:hs,i(o){w||(y(h.$$.fragment,o),w=!0)},o(o){R(h.$$.fragment,o),w=!1},d(o){o&&s(d),o&&s(_),T(h,o)}}}function Pn(C){let d,v,_,h,w;return{c(){d=a("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=l("Module"),w=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(o){d=r(o,"P",{});var m=n(d);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var F=n(_);h=i(F,"Module"),F.forEach(s),w=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(s)},m(o,m){p(o,d,m),t(d,v),t(d,_),t(_,h),t(d,w)},d(o){o&&s(d)}}}function kn(C){let d,v,_,h,w;return h=new us({props:{code:`from transformers import AutoImageProcessor, TFResNetModel
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = TFResNetModel.from_pretrained("microsoft/resnet-50")

inputs = image_processor(image, return_tensors="tf")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFResNetModel
<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;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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">2048</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){d=a("p"),v=l("Example:"),_=u(),$(h.$$.fragment)},l(o){d=r(o,"P",{});var m=n(d);v=i(m,"Example:"),m.forEach(s),_=g(o),b(h.$$.fragment,o)},m(o,m){p(o,d,m),t(d,v),p(o,_,m),N(h,o,m),w=!0},p:hs,i(o){w||(y(h.$$.fragment,o),w=!0)},o(o){R(h.$$.fragment,o),w=!1},d(o){o&&s(d),o&&s(_),T(h,o)}}}function An(C){let d,v,_,h,w;return{c(){d=a("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=l("Module"),w=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(o){d=r(o,"P",{});var m=n(d);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var F=n(_);h=i(F,"Module"),F.forEach(s),w=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(s)},m(o,m){p(o,d,m),t(d,v),t(d,_),t(_,h),t(d,w)},d(o){o&&s(d)}}}function Mn(C){let d,v,_,h,w;return h=new us({props:{code:`from transformers import AutoImageProcessor, TFResNetForImageClassification
import tensorflow as tf
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = TFResNetForImageClassification.from_pretrained("microsoft/resnet-50")

inputs = image_processor(image, return_tensors="tf")
logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFResNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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 = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tiger cat`}}),{c(){d=a("p"),v=l("Example:"),_=u(),$(h.$$.fragment)},l(o){d=r(o,"P",{});var m=n(d);v=i(m,"Example:"),m.forEach(s),_=g(o),b(h.$$.fragment,o)},m(o,m){p(o,d,m),t(d,v),p(o,_,m),N(h,o,m),w=!0},p:hs,i(o){w||(y(h.$$.fragment,o),w=!0)},o(o){R(h.$$.fragment,o),w=!1},d(o){o&&s(d),o&&s(_),T(h,o)}}}function qn(C){let d,v,_,h,w,o,m,F,to,gs,L,te,Ot,Fe,so,Dt,oo,_s,I,ao,Ie,ro,no,Ee,lo,io,St,co,fo,zt,mo,po,Lt,ho,uo,ws,mt,go,vs,pt,_o,$s,ht,Wt,wo,bs,ut,vo,Ns,gt,je,$o,_t,bo,No,ys,se,yo,xe,Ro,To,Rs,Pe,hr,Ts,k,Co,ke,Fo,Io,Ae,Eo,jo,Me,xo,Po,Cs,W,oe,Ht,qe,ko,Vt,Ao,Fs,wt,Mo,Is,Oe,Es,vt,z,$t,qo,Oo,De,Do,So,Se,zo,Lo,js,bt,Wo,xs,H,ae,Ut,ze,Ho,Bt,Vo,Ps,j,Le,Uo,V,Bo,Nt,Go,Jo,We,Ko,Xo,Zo,U,Qo,yt,Yo,ea,Rt,ta,sa,oa,re,ks,B,ne,Gt,He,aa,Jt,ra,As,D,Ve,na,Ue,la,Be,ia,da,ca,A,Ge,fa,G,ma,Tt,pa,ha,Kt,ua,ga,_a,le,wa,ie,Ms,J,de,Xt,Je,va,Zt,$a,qs,x,Ke,ba,Qt,Na,ya,Xe,Ra,Ze,Ta,Ca,Fa,M,Qe,Ia,K,Ea,Ct,ja,xa,Yt,Pa,ka,Aa,ce,Ma,fe,Os,X,me,es,Ye,qa,ts,Oa,Ds,S,et,Da,tt,Sa,st,za,La,Wa,q,ot,Ha,Z,Va,Ft,Ua,Ba,ss,Ga,Ja,Ka,pe,Xa,he,Ss,Q,ue,os,at,Za,as,Qa,zs,P,rt,Ya,rs,er,tr,nt,sr,lt,or,ar,rr,O,it,nr,Y,lr,It,ir,dr,ns,cr,fr,mr,ge,pr,_e,Ls;return o=new Ce({}),Fe=new Ce({}),qe=new Ce({}),Oe=new Cn({props:{pipeline:"image-classification"}}),ze=new Ce({}),Le=new ee({props:{name:"class transformers.ResNetConfig",anchor:"transformers.ResNetConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"embedding_size",val:" = 64"},{name:"hidden_sizes",val:" = [256, 512, 1024, 2048]"},{name:"depths",val:" = [3, 4, 6, 3]"},{name:"layer_type",val:" = 'bottleneck'"},{name:"hidden_act",val:" = 'relu'"},{name:"downsample_in_first_stage",val:" = False"},{name:"out_features",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ResNetConfig.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.ResNetConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality (hidden size) for the embedding layer.`,name:"embedding_size"},{anchor:"transformers.ResNetConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[256, 512, 1024, 2048]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.ResNetConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 4, 6, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.ResNetConfig.layer_type",description:`<strong>layer_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;bottleneck&quot;</code>) &#x2014;
The layer to use, it can be either <code>&quot;basic&quot;</code> (used for smaller models, like resnet-18 or resnet-34) or
<code>&quot;bottleneck&quot;</code> (used for larger models like resnet-50 and above).`,name:"layer_type"},{anchor:"transformers.ResNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function 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.ResNetConfig.downsample_in_first_stage",description:`<strong>downsample_in_first_stage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the first stage will downsample the inputs using a <code>stride</code> of 2.`,name:"downsample_in_first_stage"},{anchor:"transformers.ResNetConfig.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). Will default to the last stage if unset.`,name:"out_features"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/configuration_resnet.py#L34"}}),re=new ps({props:{anchor:"transformers.ResNetConfig.example",$$slots:{default:[Fn]},$$scope:{ctx:C}}}),He=new Ce({}),Ve=new ee({props:{name:"class transformers.ResNetModel",anchor:"transformers.ResNetModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</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/resnet/modeling_resnet.py#L302"}}),Ge=new ee({props:{name:"forward",anchor:"transformers.ResNetModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ResNetModel.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/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetModel.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.ResNetModel.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/resnet/modeling_resnet.py#L312",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/main/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</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>
`}}),le=new eo({props:{$$slots:{default:[In]},$$scope:{ctx:C}}}),ie=new ps({props:{anchor:"transformers.ResNetModel.forward.example",$$slots:{default:[En]},$$scope:{ctx:C}}}),Je=new Ce({}),Ke=new ee({props:{name:"class transformers.ResNetForImageClassification",anchor:"transformers.ResNetForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</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/resnet/modeling_resnet.py#L355"}}),Qe=new ee({props:{name:"forward",anchor:"transformers.ResNetForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.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.ResNetForImageClassification.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/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetForImageClassification.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.ResNetForImageClassification.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.ResNetForImageClassification.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 &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_resnet.py#L368",returnDescription:`
<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/resnet#transformers.ResNetConfig"
>ResNetConfig</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/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new eo({props:{$$slots:{default:[jn]},$$scope:{ctx:C}}}),fe=new ps({props:{anchor:"transformers.ResNetForImageClassification.forward.example",$$slots:{default:[xn]},$$scope:{ctx:C}}}),Ye=new Ce({}),et=new ee({props:{name:"class transformers.TFResNetModel",anchor:"transformers.TFResNetModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</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.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L388"}}),ot=new ee({props:{name:"call",anchor:"transformers.TFResNetModel.call",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetModel.call.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.TFResNetModel.call.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/resnet/modeling_tf_resnet.py#L393",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</code> or a tuple of <code>tf.Tensor</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/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),pe=new eo({props:{$$slots:{default:[Pn]},$$scope:{ctx:C}}}),he=new ps({props:{anchor:"transformers.TFResNetModel.call.example",$$slots:{default:[kn]},$$scope:{ctx:C}}}),at=new Ce({}),rt=new ee({props:{name:"class transformers.TFResNetForImageClassification",anchor:"transformers.TFResNetForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</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.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L440"}}),it=new ee({props:{name:"call",anchor:"transformers.TFResNetForImageClassification.call",parameters:[{name:"pixel_values",val:": Tensor = None"},{name:"labels",val:": Tensor = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:": bool = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetForImageClassification.call.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.TFResNetForImageClassification.call.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.TFResNetForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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 &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L457",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</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/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ge=new eo({props:{$$slots:{default:[An]},$$scope:{ctx:C}}}),_e=new ps({props:{anchor:"transformers.TFResNetForImageClassification.call.example",$$slots:{default:[Mn]},$$scope:{ctx:C}}}),{c(){d=a("meta"),v=u(),_=a("h1"),h=a("a"),w=a("span"),$(o.$$.fragment),m=u(),F=a("span"),to=l("ResNet"),gs=u(),L=a("h2"),te=a("a"),Ot=a("span"),$(Fe.$$.fragment),so=u(),Dt=a("span"),oo=l("Overview"),_s=u(),I=a("p"),ao=l("The ResNet model was proposed in "),Ie=a("a"),ro=l("Deep Residual Learning for Image Recognition"),no=l(" by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),Ee=a("a"),lo=l("Nvidia"),io=l(", we apply the "),St=a("code"),co=l("stride=2"),fo=l(" for downsampling in bottleneck\u2019s "),zt=a("code"),mo=l("3x3"),po=l(" conv and not in the first "),Lt=a("code"),ho=l("1x1"),uo=l(". This is generally known as \u201CResNet v1.5\u201D."),ws=u(),mt=a("p"),go=l("ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),vs=u(),pt=a("p"),_o=l("The abstract from the paper is the following:"),$s=u(),ht=a("p"),Wt=a("em"),wo=l(`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),bs=u(),ut=a("p"),vo=l("Tips:"),Ns=u(),gt=a("ul"),je=a("li"),$o=l("One can use "),_t=a("a"),bo=l("AutoImageProcessor"),No=l(" to prepare images for the model."),ys=u(),se=a("p"),yo=l("The figure below illustrates the architecture of ResNet. Taken from the "),xe=a("a"),Ro=l("original paper"),To=l("."),Rs=u(),Pe=a("img"),Ts=u(),k=a("p"),Co=l("This model was contributed by "),ke=a("a"),Fo=l("Francesco"),Io=l(". The TensorFlow version of this model was added by "),Ae=a("a"),Eo=l("amyeroberts"),jo=l(". The original code can be found "),Me=a("a"),xo=l("here"),Po=l("."),Cs=u(),W=a("h2"),oe=a("a"),Ht=a("span"),$(qe.$$.fragment),ko=u(),Vt=a("span"),Ao=l("Resources"),Fs=u(),wt=a("p"),Mo=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),Is=u(),$(Oe.$$.fragment),Es=u(),vt=a("ul"),z=a("li"),$t=a("a"),qo=l("ResNetForImageClassification"),Oo=l(" is supported by this "),De=a("a"),Do=l("example script"),So=l(" and "),Se=a("a"),zo=l("notebook"),Lo=l("."),js=u(),bt=a("p"),Wo=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."),xs=u(),H=a("h2"),ae=a("a"),Ut=a("span"),$(ze.$$.fragment),Ho=u(),Bt=a("span"),Vo=l("ResNetConfig"),Ps=u(),j=a("div"),$(Le.$$.fragment),Uo=u(),V=a("p"),Bo=l("This is the configuration class to store the configuration of a "),Nt=a("a"),Go=l("ResNetModel"),Jo=l(`. It is used to instantiate an
ResNet 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 ResNet
`),We=a("a"),Ko=l("microsoft/resnet-50"),Xo=l(" architecture."),Zo=u(),U=a("p"),Qo=l("Configuration objects inherit from "),yt=a("a"),Yo=l("PretrainedConfig"),ea=l(` and can be used to control the model outputs. Read the
documentation from `),Rt=a("a"),ta=l("PretrainedConfig"),sa=l(" for more information."),oa=u(),$(re.$$.fragment),ks=u(),B=a("h2"),ne=a("a"),Gt=a("span"),$(He.$$.fragment),aa=u(),Jt=a("span"),ra=l("ResNetModel"),As=u(),D=a("div"),$(Ve.$$.fragment),na=u(),Ue=a("p"),la=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),Be=a("a"),ia=l("torch.nn.Module"),da=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ca=u(),A=a("div"),$(Ge.$$.fragment),fa=u(),G=a("p"),ma=l("The "),Tt=a("a"),pa=l("ResNetModel"),ha=l(" forward method, overrides the "),Kt=a("code"),ua=l("__call__"),ga=l(" special method."),_a=u(),$(le.$$.fragment),wa=u(),$(ie.$$.fragment),Ms=u(),J=a("h2"),de=a("a"),Xt=a("span"),$(Je.$$.fragment),va=u(),Zt=a("span"),$a=l("ResNetForImageClassification"),qs=u(),x=a("div"),$(Ke.$$.fragment),ba=u(),Qt=a("p"),Na=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),ya=u(),Xe=a("p"),Ra=l("This model is a PyTorch "),Ze=a("a"),Ta=l("torch.nn.Module"),Ca=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fa=u(),M=a("div"),$(Qe.$$.fragment),Ia=u(),K=a("p"),Ea=l("The "),Ct=a("a"),ja=l("ResNetForImageClassification"),xa=l(" forward method, overrides the "),Yt=a("code"),Pa=l("__call__"),ka=l(" special method."),Aa=u(),$(ce.$$.fragment),Ma=u(),$(fe.$$.fragment),Os=u(),X=a("h2"),me=a("a"),es=a("span"),$(Ye.$$.fragment),qa=u(),ts=a("span"),Oa=l("TFResNetModel"),Ds=u(),S=a("div"),$(et.$$.fragment),Da=u(),tt=a("p"),Sa=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),st=a("a"),za=l("tf.keras.layers.Layer"),La=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Wa=u(),q=a("div"),$(ot.$$.fragment),Ha=u(),Z=a("p"),Va=l("The "),Ft=a("a"),Ua=l("TFResNetModel"),Ba=l(" forward method, overrides the "),ss=a("code"),Ga=l("__call__"),Ja=l(" special method."),Ka=u(),$(pe.$$.fragment),Xa=u(),$(he.$$.fragment),Ss=u(),Q=a("h2"),ue=a("a"),os=a("span"),$(at.$$.fragment),Za=u(),as=a("span"),Qa=l("TFResNetForImageClassification"),zs=u(),P=a("div"),$(rt.$$.fragment),Ya=u(),rs=a("p"),er=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),tr=u(),nt=a("p"),sr=l(`This model is a TensorFlow
`),lt=a("a"),or=l("tf.keras.layers.Layer"),ar=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),rr=u(),O=a("div"),$(it.$$.fragment),nr=u(),Y=a("p"),lr=l("The "),It=a("a"),ir=l("TFResNetForImageClassification"),dr=l(" forward method, overrides the "),ns=a("code"),cr=l("__call__"),fr=l(" special method."),mr=u(),$(ge.$$.fragment),pr=u(),$(_e.$$.fragment),this.h()},l(e){const f=yn('[data-svelte="svelte-1phssyn"]',document.head);d=r(f,"META",{name:!0,content:!0}),f.forEach(s),v=g(e),_=r(e,"H1",{class:!0});var dt=n(_);h=r(dt,"A",{id:!0,class:!0,href:!0});var ls=n(h);w=r(ls,"SPAN",{});var is=n(w);b(o.$$.fragment,is),is.forEach(s),ls.forEach(s),m=g(dt),F=r(dt,"SPAN",{});var ds=n(F);to=i(ds,"ResNet"),ds.forEach(s),dt.forEach(s),gs=g(e),L=r(e,"H2",{class:!0});var ct=n(L);te=r(ct,"A",{id:!0,class:!0,href:!0});var cs=n(te);Ot=r(cs,"SPAN",{});var fs=n(Ot);b(Fe.$$.fragment,fs),fs.forEach(s),cs.forEach(s),so=g(ct),Dt=r(ct,"SPAN",{});var ms=n(Dt);oo=i(ms,"Overview"),ms.forEach(s),ct.forEach(s),_s=g(e),I=r(e,"P",{});var E=n(I);ao=i(E,"The ResNet model was proposed in "),Ie=r(E,"A",{href:!0,rel:!0});var ur=n(Ie);ro=i(ur,"Deep Residual Learning for Image Recognition"),ur.forEach(s),no=i(E," by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),Ee=r(E,"A",{href:!0,rel:!0});var gr=n(Ee);lo=i(gr,"Nvidia"),gr.forEach(s),io=i(E,", we apply the "),St=r(E,"CODE",{});var _r=n(St);co=i(_r,"stride=2"),_r.forEach(s),fo=i(E," for downsampling in bottleneck\u2019s "),zt=r(E,"CODE",{});var wr=n(zt);mo=i(wr,"3x3"),wr.forEach(s),po=i(E," conv and not in the first "),Lt=r(E,"CODE",{});var vr=n(Lt);ho=i(vr,"1x1"),vr.forEach(s),uo=i(E,". This is generally known as \u201CResNet v1.5\u201D."),E.forEach(s),ws=g(e),mt=r(e,"P",{});var $r=n(mt);go=i($r,"ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),$r.forEach(s),vs=g(e),pt=r(e,"P",{});var br=n(pt);_o=i(br,"The abstract from the paper is the following:"),br.forEach(s),$s=g(e),ht=r(e,"P",{});var Nr=n(ht);Wt=r(Nr,"EM",{});var yr=n(Wt);wo=i(yr,`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),yr.forEach(s),Nr.forEach(s),bs=g(e),ut=r(e,"P",{});var Rr=n(ut);vo=i(Rr,"Tips:"),Rr.forEach(s),Ns=g(e),gt=r(e,"UL",{});var Tr=n(gt);je=r(Tr,"LI",{});var Ws=n(je);$o=i(Ws,"One can use "),_t=r(Ws,"A",{href:!0});var Cr=n(_t);bo=i(Cr,"AutoImageProcessor"),Cr.forEach(s),No=i(Ws," to prepare images for the model."),Ws.forEach(s),Tr.forEach(s),ys=g(e),se=r(e,"P",{});var Hs=n(se);yo=i(Hs,"The figure below illustrates the architecture of ResNet. Taken from the "),xe=r(Hs,"A",{href:!0,rel:!0});var Fr=n(xe);Ro=i(Fr,"original paper"),Fr.forEach(s),To=i(Hs,"."),Hs.forEach(s),Rs=g(e),Pe=r(e,"IMG",{width:!0,src:!0}),Ts=g(e),k=r(e,"P",{});var we=n(k);Co=i(we,"This model was contributed by "),ke=r(we,"A",{href:!0,rel:!0});var Ir=n(ke);Fo=i(Ir,"Francesco"),Ir.forEach(s),Io=i(we,". The TensorFlow version of this model was added by "),Ae=r(we,"A",{href:!0,rel:!0});var Er=n(Ae);Eo=i(Er,"amyeroberts"),Er.forEach(s),jo=i(we,". The original code can be found "),Me=r(we,"A",{href:!0,rel:!0});var jr=n(Me);xo=i(jr,"here"),jr.forEach(s),Po=i(we,"."),we.forEach(s),Cs=g(e),W=r(e,"H2",{class:!0});var Vs=n(W);oe=r(Vs,"A",{id:!0,class:!0,href:!0});var xr=n(oe);Ht=r(xr,"SPAN",{});var Pr=n(Ht);b(qe.$$.fragment,Pr),Pr.forEach(s),xr.forEach(s),ko=g(Vs),Vt=r(Vs,"SPAN",{});var kr=n(Vt);Ao=i(kr,"Resources"),kr.forEach(s),Vs.forEach(s),Fs=g(e),wt=r(e,"P",{});var Ar=n(wt);Mo=i(Ar,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),Ar.forEach(s),Is=g(e),b(Oe.$$.fragment,e),Es=g(e),vt=r(e,"UL",{});var Mr=n(vt);z=r(Mr,"LI",{});var ft=n(z);$t=r(ft,"A",{href:!0});var qr=n($t);qo=i(qr,"ResNetForImageClassification"),qr.forEach(s),Oo=i(ft," is supported by this "),De=r(ft,"A",{href:!0,rel:!0});var Or=n(De);Do=i(Or,"example script"),Or.forEach(s),So=i(ft," and "),Se=r(ft,"A",{href:!0,rel:!0});var Dr=n(Se);zo=i(Dr,"notebook"),Dr.forEach(s),Lo=i(ft,"."),ft.forEach(s),Mr.forEach(s),js=g(e),bt=r(e,"P",{});var Sr=n(bt);Wo=i(Sr,"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."),Sr.forEach(s),xs=g(e),H=r(e,"H2",{class:!0});var Us=n(H);ae=r(Us,"A",{id:!0,class:!0,href:!0});var zr=n(ae);Ut=r(zr,"SPAN",{});var Lr=n(Ut);b(ze.$$.fragment,Lr),Lr.forEach(s),zr.forEach(s),Ho=g(Us),Bt=r(Us,"SPAN",{});var Wr=n(Bt);Vo=i(Wr,"ResNetConfig"),Wr.forEach(s),Us.forEach(s),Ps=g(e),j=r(e,"DIV",{class:!0});var ve=n(j);b(Le.$$.fragment,ve),Uo=g(ve),V=r(ve,"P",{});var Et=n(V);Bo=i(Et,"This is the configuration class to store the configuration of a "),Nt=r(Et,"A",{href:!0});var Hr=n(Nt);Go=i(Hr,"ResNetModel"),Hr.forEach(s),Jo=i(Et,`. It is used to instantiate an
ResNet 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 ResNet
`),We=r(Et,"A",{href:!0,rel:!0});var Vr=n(We);Ko=i(Vr,"microsoft/resnet-50"),Vr.forEach(s),Xo=i(Et," architecture."),Et.forEach(s),Zo=g(ve),U=r(ve,"P",{});var jt=n(U);Qo=i(jt,"Configuration objects inherit from "),yt=r(jt,"A",{href:!0});var Ur=n(yt);Yo=i(Ur,"PretrainedConfig"),Ur.forEach(s),ea=i(jt,` and can be used to control the model outputs. Read the
documentation from `),Rt=r(jt,"A",{href:!0});var Br=n(Rt);ta=i(Br,"PretrainedConfig"),Br.forEach(s),sa=i(jt," for more information."),jt.forEach(s),oa=g(ve),b(re.$$.fragment,ve),ve.forEach(s),ks=g(e),B=r(e,"H2",{class:!0});var Bs=n(B);ne=r(Bs,"A",{id:!0,class:!0,href:!0});var Gr=n(ne);Gt=r(Gr,"SPAN",{});var Jr=n(Gt);b(He.$$.fragment,Jr),Jr.forEach(s),Gr.forEach(s),aa=g(Bs),Jt=r(Bs,"SPAN",{});var Kr=n(Jt);ra=i(Kr,"ResNetModel"),Kr.forEach(s),Bs.forEach(s),As=g(e),D=r(e,"DIV",{class:!0});var xt=n(D);b(Ve.$$.fragment,xt),na=g(xt),Ue=r(xt,"P",{});var Gs=n(Ue);la=i(Gs,`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),Be=r(Gs,"A",{href:!0,rel:!0});var Xr=n(Be);ia=i(Xr,"torch.nn.Module"),Xr.forEach(s),da=i(Gs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gs.forEach(s),ca=g(xt),A=r(xt,"DIV",{class:!0});var $e=n(A);b(Ge.$$.fragment,$e),fa=g($e),G=r($e,"P",{});var Pt=n(G);ma=i(Pt,"The "),Tt=r(Pt,"A",{href:!0});var Zr=n(Tt);pa=i(Zr,"ResNetModel"),Zr.forEach(s),ha=i(Pt," forward method, overrides the "),Kt=r(Pt,"CODE",{});var Qr=n(Kt);ua=i(Qr,"__call__"),Qr.forEach(s),ga=i(Pt," special method."),Pt.forEach(s),_a=g($e),b(le.$$.fragment,$e),wa=g($e),b(ie.$$.fragment,$e),$e.forEach(s),xt.forEach(s),Ms=g(e),J=r(e,"H2",{class:!0});var Js=n(J);de=r(Js,"A",{id:!0,class:!0,href:!0});var Yr=n(de);Xt=r(Yr,"SPAN",{});var en=n(Xt);b(Je.$$.fragment,en),en.forEach(s),Yr.forEach(s),va=g(Js),Zt=r(Js,"SPAN",{});var tn=n(Zt);$a=i(tn,"ResNetForImageClassification"),tn.forEach(s),Js.forEach(s),qs=g(e),x=r(e,"DIV",{class:!0});var be=n(x);b(Ke.$$.fragment,be),ba=g(be),Qt=r(be,"P",{});var sn=n(Qt);Na=i(sn,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),sn.forEach(s),ya=g(be),Xe=r(be,"P",{});var Ks=n(Xe);Ra=i(Ks,"This model is a PyTorch "),Ze=r(Ks,"A",{href:!0,rel:!0});var on=n(Ze);Ta=i(on,"torch.nn.Module"),on.forEach(s),Ca=i(Ks,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ks.forEach(s),Fa=g(be),M=r(be,"DIV",{class:!0});var Ne=n(M);b(Qe.$$.fragment,Ne),Ia=g(Ne),K=r(Ne,"P",{});var kt=n(K);Ea=i(kt,"The "),Ct=r(kt,"A",{href:!0});var an=n(Ct);ja=i(an,"ResNetForImageClassification"),an.forEach(s),xa=i(kt," forward method, overrides the "),Yt=r(kt,"CODE",{});var rn=n(Yt);Pa=i(rn,"__call__"),rn.forEach(s),ka=i(kt," special method."),kt.forEach(s),Aa=g(Ne),b(ce.$$.fragment,Ne),Ma=g(Ne),b(fe.$$.fragment,Ne),Ne.forEach(s),be.forEach(s),Os=g(e),X=r(e,"H2",{class:!0});var Xs=n(X);me=r(Xs,"A",{id:!0,class:!0,href:!0});var nn=n(me);es=r(nn,"SPAN",{});var ln=n(es);b(Ye.$$.fragment,ln),ln.forEach(s),nn.forEach(s),qa=g(Xs),ts=r(Xs,"SPAN",{});var dn=n(ts);Oa=i(dn,"TFResNetModel"),dn.forEach(s),Xs.forEach(s),Ds=g(e),S=r(e,"DIV",{class:!0});var At=n(S);b(et.$$.fragment,At),Da=g(At),tt=r(At,"P",{});var Zs=n(tt);Sa=i(Zs,`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),st=r(Zs,"A",{href:!0,rel:!0});var cn=n(st);za=i(cn,"tf.keras.layers.Layer"),cn.forEach(s),La=i(Zs,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Zs.forEach(s),Wa=g(At),q=r(At,"DIV",{class:!0});var ye=n(q);b(ot.$$.fragment,ye),Ha=g(ye),Z=r(ye,"P",{});var Mt=n(Z);Va=i(Mt,"The "),Ft=r(Mt,"A",{href:!0});var fn=n(Ft);Ua=i(fn,"TFResNetModel"),fn.forEach(s),Ba=i(Mt," forward method, overrides the "),ss=r(Mt,"CODE",{});var mn=n(ss);Ga=i(mn,"__call__"),mn.forEach(s),Ja=i(Mt," special method."),Mt.forEach(s),Ka=g(ye),b(pe.$$.fragment,ye),Xa=g(ye),b(he.$$.fragment,ye),ye.forEach(s),At.forEach(s),Ss=g(e),Q=r(e,"H2",{class:!0});var Qs=n(Q);ue=r(Qs,"A",{id:!0,class:!0,href:!0});var pn=n(ue);os=r(pn,"SPAN",{});var hn=n(os);b(at.$$.fragment,hn),hn.forEach(s),pn.forEach(s),Za=g(Qs),as=r(Qs,"SPAN",{});var un=n(as);Qa=i(un,"TFResNetForImageClassification"),un.forEach(s),Qs.forEach(s),zs=g(e),P=r(e,"DIV",{class:!0});var Re=n(P);b(rt.$$.fragment,Re),Ya=g(Re),rs=r(Re,"P",{});var gn=n(rs);er=i(gn,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),gn.forEach(s),tr=g(Re),nt=r(Re,"P",{});var Ys=n(nt);sr=i(Ys,`This model is a TensorFlow
`),lt=r(Ys,"A",{href:!0,rel:!0});var _n=n(lt);or=i(_n,"tf.keras.layers.Layer"),_n.forEach(s),ar=i(Ys,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ys.forEach(s),rr=g(Re),O=r(Re,"DIV",{class:!0});var Te=n(O);b(it.$$.fragment,Te),nr=g(Te),Y=r(Te,"P",{});var qt=n(Y);lr=i(qt,"The "),It=r(qt,"A",{href:!0});var wn=n(It);ir=i(wn,"TFResNetForImageClassification"),wn.forEach(s),dr=i(qt," forward method, overrides the "),ns=r(qt,"CODE",{});var vn=n(ns);cr=i(vn,"__call__"),vn.forEach(s),fr=i(qt," special method."),qt.forEach(s),mr=g(Te),b(ge.$$.fragment,Te),pr=g(Te),b(_e.$$.fragment,Te),Te.forEach(s),Re.forEach(s),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(On)),c(h,"id","resnet"),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","#resnet"),c(_,"class","relative group"),c(te,"id","overview"),c(te,"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(te,"href","#overview"),c(L,"class","relative group"),c(Ie,"href","https://arxiv.org/abs/1512.03385"),c(Ie,"rel","nofollow"),c(Ee,"href","https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch"),c(Ee,"rel","nofollow"),c(_t,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor"),c(xe,"href","https://arxiv.org/abs/1512.03385"),c(xe,"rel","nofollow"),c(Pe,"width","600"),Rn(Pe.src,hr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png")||c(Pe,"src",hr),c(ke,"href","https://huggingface.co/Francesco"),c(ke,"rel","nofollow"),c(Ae,"href","https://huggingface.co/amyeroberts"),c(Ae,"rel","nofollow"),c(Me,"href","https://github.com/KaimingHe/deep-residual-networks"),c(Me,"rel","nofollow"),c(oe,"id","resources"),c(oe,"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(oe,"href","#resources"),c(W,"class","relative group"),c($t,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetForImageClassification"),c(De,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(De,"rel","nofollow"),c(Se,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(Se,"rel","nofollow"),c(ae,"id","transformers.ResNetConfig"),c(ae,"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(ae,"href","#transformers.ResNetConfig"),c(H,"class","relative group"),c(Nt,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetModel"),c(We,"href","https://huggingface.co/microsoft/resnet-50"),c(We,"rel","nofollow"),c(yt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Rt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(ne,"id","transformers.ResNetModel"),c(ne,"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(ne,"href","#transformers.ResNetModel"),c(B,"class","relative group"),c(Be,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Be,"rel","nofollow"),c(Tt,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetModel"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"id","transformers.ResNetForImageClassification"),c(de,"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(de,"href","#transformers.ResNetForImageClassification"),c(J,"class","relative group"),c(Ze,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ze,"rel","nofollow"),c(Ct,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetForImageClassification"),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(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"id","transformers.TFResNetModel"),c(me,"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(me,"href","#transformers.TFResNetModel"),c(X,"class","relative group"),c(st,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(st,"rel","nofollow"),c(Ft,"href","/docs/transformers/main/en/model_doc/resnet#transformers.TFResNetModel"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"id","transformers.TFResNetForImageClassification"),c(ue,"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(ue,"href","#transformers.TFResNetForImageClassification"),c(Q,"class","relative group"),c(lt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(lt,"rel","nofollow"),c(It,"href","/docs/transformers/main/en/model_doc/resnet#transformers.TFResNetForImageClassification"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(e,f){t(document.head,d),p(e,v,f),p(e,_,f),t(_,h),t(h,w),N(o,w,null),t(_,m),t(_,F),t(F,to),p(e,gs,f),p(e,L,f),t(L,te),t(te,Ot),N(Fe,Ot,null),t(L,so),t(L,Dt),t(Dt,oo),p(e,_s,f),p(e,I,f),t(I,ao),t(I,Ie),t(Ie,ro),t(I,no),t(I,Ee),t(Ee,lo),t(I,io),t(I,St),t(St,co),t(I,fo),t(I,zt),t(zt,mo),t(I,po),t(I,Lt),t(Lt,ho),t(I,uo),p(e,ws,f),p(e,mt,f),t(mt,go),p(e,vs,f),p(e,pt,f),t(pt,_o),p(e,$s,f),p(e,ht,f),t(ht,Wt),t(Wt,wo),p(e,bs,f),p(e,ut,f),t(ut,vo),p(e,Ns,f),p(e,gt,f),t(gt,je),t(je,$o),t(je,_t),t(_t,bo),t(je,No),p(e,ys,f),p(e,se,f),t(se,yo),t(se,xe),t(xe,Ro),t(se,To),p(e,Rs,f),p(e,Pe,f),p(e,Ts,f),p(e,k,f),t(k,Co),t(k,ke),t(ke,Fo),t(k,Io),t(k,Ae),t(Ae,Eo),t(k,jo),t(k,Me),t(Me,xo),t(k,Po),p(e,Cs,f),p(e,W,f),t(W,oe),t(oe,Ht),N(qe,Ht,null),t(W,ko),t(W,Vt),t(Vt,Ao),p(e,Fs,f),p(e,wt,f),t(wt,Mo),p(e,Is,f),N(Oe,e,f),p(e,Es,f),p(e,vt,f),t(vt,z),t(z,$t),t($t,qo),t(z,Oo),t(z,De),t(De,Do),t(z,So),t(z,Se),t(Se,zo),t(z,Lo),p(e,js,f),p(e,bt,f),t(bt,Wo),p(e,xs,f),p(e,H,f),t(H,ae),t(ae,Ut),N(ze,Ut,null),t(H,Ho),t(H,Bt),t(Bt,Vo),p(e,Ps,f),p(e,j,f),N(Le,j,null),t(j,Uo),t(j,V),t(V,Bo),t(V,Nt),t(Nt,Go),t(V,Jo),t(V,We),t(We,Ko),t(V,Xo),t(j,Zo),t(j,U),t(U,Qo),t(U,yt),t(yt,Yo),t(U,ea),t(U,Rt),t(Rt,ta),t(U,sa),t(j,oa),N(re,j,null),p(e,ks,f),p(e,B,f),t(B,ne),t(ne,Gt),N(He,Gt,null),t(B,aa),t(B,Jt),t(Jt,ra),p(e,As,f),p(e,D,f),N(Ve,D,null),t(D,na),t(D,Ue),t(Ue,la),t(Ue,Be),t(Be,ia),t(Ue,da),t(D,ca),t(D,A),N(Ge,A,null),t(A,fa),t(A,G),t(G,ma),t(G,Tt),t(Tt,pa),t(G,ha),t(G,Kt),t(Kt,ua),t(G,ga),t(A,_a),N(le,A,null),t(A,wa),N(ie,A,null),p(e,Ms,f),p(e,J,f),t(J,de),t(de,Xt),N(Je,Xt,null),t(J,va),t(J,Zt),t(Zt,$a),p(e,qs,f),p(e,x,f),N(Ke,x,null),t(x,ba),t(x,Qt),t(Qt,Na),t(x,ya),t(x,Xe),t(Xe,Ra),t(Xe,Ze),t(Ze,Ta),t(Xe,Ca),t(x,Fa),t(x,M),N(Qe,M,null),t(M,Ia),t(M,K),t(K,Ea),t(K,Ct),t(Ct,ja),t(K,xa),t(K,Yt),t(Yt,Pa),t(K,ka),t(M,Aa),N(ce,M,null),t(M,Ma),N(fe,M,null),p(e,Os,f),p(e,X,f),t(X,me),t(me,es),N(Ye,es,null),t(X,qa),t(X,ts),t(ts,Oa),p(e,Ds,f),p(e,S,f),N(et,S,null),t(S,Da),t(S,tt),t(tt,Sa),t(tt,st),t(st,za),t(tt,La),t(S,Wa),t(S,q),N(ot,q,null),t(q,Ha),t(q,Z),t(Z,Va),t(Z,Ft),t(Ft,Ua),t(Z,Ba),t(Z,ss),t(ss,Ga),t(Z,Ja),t(q,Ka),N(pe,q,null),t(q,Xa),N(he,q,null),p(e,Ss,f),p(e,Q,f),t(Q,ue),t(ue,os),N(at,os,null),t(Q,Za),t(Q,as),t(as,Qa),p(e,zs,f),p(e,P,f),N(rt,P,null),t(P,Ya),t(P,rs),t(rs,er),t(P,tr),t(P,nt),t(nt,sr),t(nt,lt),t(lt,or),t(nt,ar),t(P,rr),t(P,O),N(it,O,null),t(O,nr),t(O,Y),t(Y,lr),t(Y,It),t(It,ir),t(Y,dr),t(Y,ns),t(ns,cr),t(Y,fr),t(O,mr),N(ge,O,null),t(O,pr),N(_e,O,null),Ls=!0},p(e,[f]){const dt={};f&2&&(dt.$$scope={dirty:f,ctx:e}),re.$set(dt);const ls={};f&2&&(ls.$$scope={dirty:f,ctx:e}),le.$set(ls);const is={};f&2&&(is.$$scope={dirty:f,ctx:e}),ie.$set(is);const ds={};f&2&&(ds.$$scope={dirty:f,ctx:e}),ce.$set(ds);const ct={};f&2&&(ct.$$scope={dirty:f,ctx:e}),fe.$set(ct);const cs={};f&2&&(cs.$$scope={dirty:f,ctx:e}),pe.$set(cs);const fs={};f&2&&(fs.$$scope={dirty:f,ctx:e}),he.$set(fs);const ms={};f&2&&(ms.$$scope={dirty:f,ctx:e}),ge.$set(ms);const E={};f&2&&(E.$$scope={dirty:f,ctx:e}),_e.$set(E)},i(e){Ls||(y(o.$$.fragment,e),y(Fe.$$.fragment,e),y(qe.$$.fragment,e),y(Oe.$$.fragment,e),y(ze.$$.fragment,e),y(Le.$$.fragment,e),y(re.$$.fragment,e),y(He.$$.fragment,e),y(Ve.$$.fragment,e),y(Ge.$$.fragment,e),y(le.$$.fragment,e),y(ie.$$.fragment,e),y(Je.$$.fragment,e),y(Ke.$$.fragment,e),y(Qe.$$.fragment,e),y(ce.$$.fragment,e),y(fe.$$.fragment,e),y(Ye.$$.fragment,e),y(et.$$.fragment,e),y(ot.$$.fragment,e),y(pe.$$.fragment,e),y(he.$$.fragment,e),y(at.$$.fragment,e),y(rt.$$.fragment,e),y(it.$$.fragment,e),y(ge.$$.fragment,e),y(_e.$$.fragment,e),Ls=!0)},o(e){R(o.$$.fragment,e),R(Fe.$$.fragment,e),R(qe.$$.fragment,e),R(Oe.$$.fragment,e),R(ze.$$.fragment,e),R(Le.$$.fragment,e),R(re.$$.fragment,e),R(He.$$.fragment,e),R(Ve.$$.fragment,e),R(Ge.$$.fragment,e),R(le.$$.fragment,e),R(ie.$$.fragment,e),R(Je.$$.fragment,e),R(Ke.$$.fragment,e),R(Qe.$$.fragment,e),R(ce.$$.fragment,e),R(fe.$$.fragment,e),R(Ye.$$.fragment,e),R(et.$$.fragment,e),R(ot.$$.fragment,e),R(pe.$$.fragment,e),R(he.$$.fragment,e),R(at.$$.fragment,e),R(rt.$$.fragment,e),R(it.$$.fragment,e),R(ge.$$.fragment,e),R(_e.$$.fragment,e),Ls=!1},d(e){s(d),e&&s(v),e&&s(_),T(o),e&&s(gs),e&&s(L),T(Fe),e&&s(_s),e&&s(I),e&&s(ws),e&&s(mt),e&&s(vs),e&&s(pt),e&&s($s),e&&s(ht),e&&s(bs),e&&s(ut),e&&s(Ns),e&&s(gt),e&&s(ys),e&&s(se),e&&s(Rs),e&&s(Pe),e&&s(Ts),e&&s(k),e&&s(Cs),e&&s(W),T(qe),e&&s(Fs),e&&s(wt),e&&s(Is),T(Oe,e),e&&s(Es),e&&s(vt),e&&s(js),e&&s(bt),e&&s(xs),e&&s(H),T(ze),e&&s(Ps),e&&s(j),T(Le),T(re),e&&s(ks),e&&s(B),T(He),e&&s(As),e&&s(D),T(Ve),T(Ge),T(le),T(ie),e&&s(Ms),e&&s(J),T(Je),e&&s(qs),e&&s(x),T(Ke),T(Qe),T(ce),T(fe),e&&s(Os),e&&s(X),T(Ye),e&&s(Ds),e&&s(S),T(et),T(ot),T(pe),T(he),e&&s(Ss),e&&s(Q),T(at),e&&s(zs),e&&s(P),T(rt),T(it),T(ge),T(_e)}}}const On={local:"resnet",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ResNetConfig",title:"ResNetConfig"},{local:"transformers.ResNetModel",title:"ResNetModel"},{local:"transformers.ResNetForImageClassification",title:"ResNetForImageClassification"},{local:"transformers.TFResNetModel",title:"TFResNetModel"},{local:"transformers.TFResNetForImageClassification",title:"TFResNetForImageClassification"}],title:"ResNet"};function Dn(C){return Tn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bn extends $n{constructor(d){super();bn(this,d,Dn,qn,Nn,{})}}export{Bn as default,On as metadata};
