import{S as Fn,i as In,s as En,e as o,k as m,w as $,t as l,M as jn,c as a,d as s,m as h,a as n,x as b,h as i,b as d,N as xn,G as t,g as u,y as N,q as y,o as R,B as T,v as kn,L as gs}from"../../chunks/vendor-hf-doc-builder.js";import{T as oo}from"../../chunks/Tip-hf-doc-builder.js";import{D as ee}from"../../chunks/Docstring-hf-doc-builder.js";import{C as _s}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Fe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as us}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Pn}from"../../chunks/PipelineTag-hf-doc-builder.js";function An(C){let c,w,_,g,v;return g=new _s({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(){c=o("p"),w=l("Example:"),_=m(),$(g.$$.fragment)},l(r){c=a(r,"P",{});var p=n(c);w=i(p,"Example:"),p.forEach(s),_=h(r),b(g.$$.fragment,r)},m(r,p){u(r,c,p),t(c,w),u(r,_,p),N(g,r,p),v=!0},p:gs,i(r){v||(y(g.$$.fragment,r),v=!0)},o(r){R(g.$$.fragment,r),v=!1},d(r){r&&s(c),r&&s(_),T(g,r)}}}function Mn(C){let c,w,_,g,v;return{c(){c=o("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=l("Module"),v=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){c=a(r,"P",{});var p=n(c);w=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var F=n(_);g=i(F,"Module"),F.forEach(s),v=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(r,p){u(r,c,p),t(c,w),t(c,_),t(_,g),t(c,v)},d(r){r&&s(c)}}}function qn(C){let c,w,_,g,v;return g=new _s({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(){c=o("p"),w=l("Example:"),_=m(),$(g.$$.fragment)},l(r){c=a(r,"P",{});var p=n(c);w=i(p,"Example:"),p.forEach(s),_=h(r),b(g.$$.fragment,r)},m(r,p){u(r,c,p),t(c,w),u(r,_,p),N(g,r,p),v=!0},p:gs,i(r){v||(y(g.$$.fragment,r),v=!0)},o(r){R(g.$$.fragment,r),v=!1},d(r){r&&s(c),r&&s(_),T(g,r)}}}function On(C){let c,w,_,g,v;return{c(){c=o("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=l("Module"),v=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){c=a(r,"P",{});var p=n(c);w=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var F=n(_);g=i(F,"Module"),F.forEach(s),v=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(r,p){u(r,c,p),t(c,w),t(c,_),t(_,g),t(c,v)},d(r){r&&s(c)}}}function Sn(C){let c,w,_,g,v;return g=new _s({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(){c=o("p"),w=l("Example:"),_=m(),$(g.$$.fragment)},l(r){c=a(r,"P",{});var p=n(c);w=i(p,"Example:"),p.forEach(s),_=h(r),b(g.$$.fragment,r)},m(r,p){u(r,c,p),t(c,w),u(r,_,p),N(g,r,p),v=!0},p:gs,i(r){v||(y(g.$$.fragment,r),v=!0)},o(r){R(g.$$.fragment,r),v=!1},d(r){r&&s(c),r&&s(_),T(g,r)}}}function Dn(C){let c,w,_,g,v;return{c(){c=o("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=l("Module"),v=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){c=a(r,"P",{});var p=n(c);w=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var F=n(_);g=i(F,"Module"),F.forEach(s),v=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(r,p){u(r,c,p),t(c,w),t(c,_),t(_,g),t(c,v)},d(r){r&&s(c)}}}function zn(C){let c,w,_,g,v;return g=new _s({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(){c=o("p"),w=l("Example:"),_=m(),$(g.$$.fragment)},l(r){c=a(r,"P",{});var p=n(c);w=i(p,"Example:"),p.forEach(s),_=h(r),b(g.$$.fragment,r)},m(r,p){u(r,c,p),t(c,w),u(r,_,p),N(g,r,p),v=!0},p:gs,i(r){v||(y(g.$$.fragment,r),v=!0)},o(r){R(g.$$.fragment,r),v=!1},d(r){r&&s(c),r&&s(_),T(g,r)}}}function Ln(C){let c,w,_,g,v;return{c(){c=o("p"),w=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=l("Module"),v=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){c=a(r,"P",{});var p=n(c);w=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var F=n(_);g=i(F,"Module"),F.forEach(s),v=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(r,p){u(r,c,p),t(c,w),t(c,_),t(_,g),t(c,v)},d(r){r&&s(c)}}}function Wn(C){let c,w,_,g,v;return g=new _s({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(){c=o("p"),w=l("Example:"),_=m(),$(g.$$.fragment)},l(r){c=a(r,"P",{});var p=n(c);w=i(p,"Example:"),p.forEach(s),_=h(r),b(g.$$.fragment,r)},m(r,p){u(r,c,p),t(c,w),u(r,_,p),N(g,r,p),v=!0},p:gs,i(r){v||(y(g.$$.fragment,r),v=!0)},o(r){R(g.$$.fragment,r),v=!1},d(r){r&&s(c),r&&s(_),T(g,r)}}}function Vn(C){let c,w,_,g,v,r,p,F,ao,vs,L,te,Dt,Ie,ro,zt,no,ws,I,lo,Ee,io,co,je,fo,po,Lt,mo,ho,Wt,uo,go,Vt,_o,vo,$s,mt,wo,bs,ht,$o,Ns,ut,Ht,bo,ys,gt,No,Rs,_t,xe,yo,vt,Ro,To,Ts,se,Co,ke,Fo,Io,Cs,Pe,br,Fs,P,Eo,Ae,jo,xo,Me,ko,Po,qe,Ao,Mo,Is,W,oe,Ut,Oe,qo,Bt,Oo,Es,wt,So,js,Se,xs,ae,z,$t,Do,zo,De,Lo,Wo,ze,Vo,Ho,Uo,bt,Bo,Nt,Go,ks,yt,Jo,Ps,V,re,Gt,Le,Ko,Jt,Xo,As,j,We,Zo,H,Qo,Rt,Yo,ea,Ve,ta,sa,oa,U,aa,Tt,ra,na,Ct,la,ia,da,ne,Ms,B,le,Kt,He,ca,Xt,fa,qs,S,Ue,pa,Be,ma,Ge,ha,ua,ga,A,Je,_a,G,va,Ft,wa,$a,Zt,ba,Na,ya,ie,Ra,de,Os,J,ce,Qt,Ke,Ta,Yt,Ca,Ss,x,Xe,Fa,es,Ia,Ea,Ze,ja,Qe,xa,ka,Pa,M,Ye,Aa,K,Ma,It,qa,Oa,ts,Sa,Da,za,fe,La,pe,Ds,X,me,ss,et,Wa,os,Va,zs,D,tt,Ha,st,Ua,ot,Ba,Ga,Ja,q,at,Ka,Z,Xa,Et,Za,Qa,as,Ya,er,tr,he,sr,ue,Ls,Q,ge,rs,rt,or,ns,ar,Ws,k,nt,rr,ls,nr,lr,lt,ir,it,dr,cr,fr,O,dt,pr,Y,mr,jt,hr,ur,is,gr,_r,vr,_e,wr,ve,Vs;return r=new Fe({}),Ie=new Fe({}),Oe=new Fe({}),Se=new Pn({props:{pipeline:"image-classification"}}),Le=new Fe({}),We=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/v4.27.1/src/transformers/models/resnet/configuration_resnet.py#L34"}}),ne=new us({props:{anchor:"transformers.ResNetConfig.example",$$slots:{default:[An]},$$scope:{ctx:C}}}),He=new Fe({}),Ue=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/v4.27.1/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/v4.27.1/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.27.1/src/transformers/models/resnet/modeling_resnet.py#L302"}}),Je=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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.27.1/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/v4.27.1/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>
`}}),ie=new oo({props:{$$slots:{default:[Mn]},$$scope:{ctx:C}}}),de=new us({props:{anchor:"transformers.ResNetModel.forward.example",$$slots:{default:[qn]},$$scope:{ctx:C}}}),Ke=new Fe({}),Xe=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/v4.27.1/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/v4.27.1/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.27.1/src/transformers/models/resnet/modeling_resnet.py#L355"}}),Ye=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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/v4.27.1/src/transformers/models/resnet/modeling_resnet.py#L368",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new oo({props:{$$slots:{default:[On]},$$scope:{ctx:C}}}),pe=new us({props:{anchor:"transformers.ResNetForImageClassification.forward.example",$$slots:{default:[Sn]},$$scope:{ctx:C}}}),et=new Fe({}),tt=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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/resnet/modeling_tf_resnet.py#L388"}}),at=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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.27.1/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/v4.27.1/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>
`}}),he=new oo({props:{$$slots:{default:[Dn]},$$scope:{ctx:C}}}),ue=new us({props:{anchor:"transformers.TFResNetModel.call.example",$$slots:{default:[zn]},$$scope:{ctx:C}}}),rt=new Fe({}),nt=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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/resnet/modeling_tf_resnet.py#L440"}}),dt=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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/v4.27.1/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/v4.27.1/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>
`}}),_e=new oo({props:{$$slots:{default:[Ln]},$$scope:{ctx:C}}}),ve=new us({props:{anchor:"transformers.TFResNetForImageClassification.call.example",$$slots:{default:[Wn]},$$scope:{ctx:C}}}),{c(){c=o("meta"),w=m(),_=o("h1"),g=o("a"),v=o("span"),$(r.$$.fragment),p=m(),F=o("span"),ao=l("ResNet"),vs=m(),L=o("h2"),te=o("a"),Dt=o("span"),$(Ie.$$.fragment),ro=m(),zt=o("span"),no=l("Overview"),ws=m(),I=o("p"),lo=l("The ResNet model was proposed in "),Ee=o("a"),io=l("Deep Residual Learning for Image Recognition"),co=l(" by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),je=o("a"),fo=l("Nvidia"),po=l(", we apply the "),Lt=o("code"),mo=l("stride=2"),ho=l(" for downsampling in bottleneck\u2019s "),Wt=o("code"),uo=l("3x3"),go=l(" conv and not in the first "),Vt=o("code"),_o=l("1x1"),vo=l(". This is generally known as \u201CResNet v1.5\u201D."),$s=m(),mt=o("p"),wo=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."),bs=m(),ht=o("p"),$o=l("The abstract from the paper is the following:"),Ns=m(),ut=o("p"),Ht=o("em"),bo=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.`),ys=m(),gt=o("p"),No=l("Tips:"),Rs=m(),_t=o("ul"),xe=o("li"),yo=l("One can use "),vt=o("a"),Ro=l("AutoImageProcessor"),To=l(" to prepare images for the model."),Ts=m(),se=o("p"),Co=l("The figure below illustrates the architecture of ResNet. Taken from the "),ke=o("a"),Fo=l("original paper"),Io=l("."),Cs=m(),Pe=o("img"),Fs=m(),P=o("p"),Eo=l("This model was contributed by "),Ae=o("a"),jo=l("Francesco"),xo=l(". The TensorFlow version of this model was added by "),Me=o("a"),ko=l("amyeroberts"),Po=l(". The original code can be found "),qe=o("a"),Ao=l("here"),Mo=l("."),Is=m(),W=o("h2"),oe=o("a"),Ut=o("span"),$(Oe.$$.fragment),qo=m(),Bt=o("span"),Oo=l("Resources"),Es=m(),wt=o("p"),So=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),js=m(),$(Se.$$.fragment),xs=m(),ae=o("ul"),z=o("li"),$t=o("a"),Do=l("ResNetForImageClassification"),zo=l(" is supported by this "),De=o("a"),Lo=l("example script"),Wo=l(" and "),ze=o("a"),Vo=l("notebook"),Ho=l("."),Uo=m(),bt=o("li"),Bo=l("See also: "),Nt=o("a"),Go=l("Image classification task guide"),ks=m(),yt=o("p"),Jo=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."),Ps=m(),V=o("h2"),re=o("a"),Gt=o("span"),$(Le.$$.fragment),Ko=m(),Jt=o("span"),Xo=l("ResNetConfig"),As=m(),j=o("div"),$(We.$$.fragment),Zo=m(),H=o("p"),Qo=l("This is the configuration class to store the configuration of a "),Rt=o("a"),Yo=l("ResNetModel"),ea=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
`),Ve=o("a"),ta=l("microsoft/resnet-50"),sa=l(" architecture."),oa=m(),U=o("p"),aa=l("Configuration objects inherit from "),Tt=o("a"),ra=l("PretrainedConfig"),na=l(` and can be used to control the model outputs. Read the
documentation from `),Ct=o("a"),la=l("PretrainedConfig"),ia=l(" for more information."),da=m(),$(ne.$$.fragment),Ms=m(),B=o("h2"),le=o("a"),Kt=o("span"),$(He.$$.fragment),ca=m(),Xt=o("span"),fa=l("ResNetModel"),qs=m(),S=o("div"),$(Ue.$$.fragment),pa=m(),Be=o("p"),ma=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),Ge=o("a"),ha=l("torch.nn.Module"),ua=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ga=m(),A=o("div"),$(Je.$$.fragment),_a=m(),G=o("p"),va=l("The "),Ft=o("a"),wa=l("ResNetModel"),$a=l(" forward method, overrides the "),Zt=o("code"),ba=l("__call__"),Na=l(" special method."),ya=m(),$(ie.$$.fragment),Ra=m(),$(de.$$.fragment),Os=m(),J=o("h2"),ce=o("a"),Qt=o("span"),$(Ke.$$.fragment),Ta=m(),Yt=o("span"),Ca=l("ResNetForImageClassification"),Ss=m(),x=o("div"),$(Xe.$$.fragment),Fa=m(),es=o("p"),Ia=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ea=m(),Ze=o("p"),ja=l("This model is a PyTorch "),Qe=o("a"),xa=l("torch.nn.Module"),ka=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pa=m(),M=o("div"),$(Ye.$$.fragment),Aa=m(),K=o("p"),Ma=l("The "),It=o("a"),qa=l("ResNetForImageClassification"),Oa=l(" forward method, overrides the "),ts=o("code"),Sa=l("__call__"),Da=l(" special method."),za=m(),$(fe.$$.fragment),La=m(),$(pe.$$.fragment),Ds=m(),X=o("h2"),me=o("a"),ss=o("span"),$(et.$$.fragment),Wa=m(),os=o("span"),Va=l("TFResNetModel"),zs=m(),D=o("div"),$(tt.$$.fragment),Ha=m(),st=o("p"),Ua=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),ot=o("a"),Ba=l("tf.keras.layers.Layer"),Ga=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.`),Ja=m(),q=o("div"),$(at.$$.fragment),Ka=m(),Z=o("p"),Xa=l("The "),Et=o("a"),Za=l("TFResNetModel"),Qa=l(" forward method, overrides the "),as=o("code"),Ya=l("__call__"),er=l(" special method."),tr=m(),$(he.$$.fragment),sr=m(),$(ue.$$.fragment),Ls=m(),Q=o("h2"),ge=o("a"),rs=o("span"),$(rt.$$.fragment),or=m(),ns=o("span"),ar=l("TFResNetForImageClassification"),Ws=m(),k=o("div"),$(nt.$$.fragment),rr=m(),ls=o("p"),nr=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),lr=m(),lt=o("p"),ir=l(`This model is a TensorFlow
`),it=o("a"),dr=l("tf.keras.layers.Layer"),cr=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.`),fr=m(),O=o("div"),$(dt.$$.fragment),pr=m(),Y=o("p"),mr=l("The "),jt=o("a"),hr=l("TFResNetForImageClassification"),ur=l(" forward method, overrides the "),is=o("code"),gr=l("__call__"),_r=l(" special method."),vr=m(),$(_e.$$.fragment),wr=m(),$(ve.$$.fragment),this.h()},l(e){const f=jn('[data-svelte="svelte-1phssyn"]',document.head);c=a(f,"META",{name:!0,content:!0}),f.forEach(s),w=h(e),_=a(e,"H1",{class:!0});var ct=n(_);g=a(ct,"A",{id:!0,class:!0,href:!0});var ds=n(g);v=a(ds,"SPAN",{});var cs=n(v);b(r.$$.fragment,cs),cs.forEach(s),ds.forEach(s),p=h(ct),F=a(ct,"SPAN",{});var fs=n(F);ao=i(fs,"ResNet"),fs.forEach(s),ct.forEach(s),vs=h(e),L=a(e,"H2",{class:!0});var ft=n(L);te=a(ft,"A",{id:!0,class:!0,href:!0});var ps=n(te);Dt=a(ps,"SPAN",{});var ms=n(Dt);b(Ie.$$.fragment,ms),ms.forEach(s),ps.forEach(s),ro=h(ft),zt=a(ft,"SPAN",{});var hs=n(zt);no=i(hs,"Overview"),hs.forEach(s),ft.forEach(s),ws=h(e),I=a(e,"P",{});var E=n(I);lo=i(E,"The ResNet model was proposed in "),Ee=a(E,"A",{href:!0,rel:!0});var Nr=n(Ee);io=i(Nr,"Deep Residual Learning for Image Recognition"),Nr.forEach(s),co=i(E," by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),je=a(E,"A",{href:!0,rel:!0});var yr=n(je);fo=i(yr,"Nvidia"),yr.forEach(s),po=i(E,", we apply the "),Lt=a(E,"CODE",{});var Rr=n(Lt);mo=i(Rr,"stride=2"),Rr.forEach(s),ho=i(E," for downsampling in bottleneck\u2019s "),Wt=a(E,"CODE",{});var Tr=n(Wt);uo=i(Tr,"3x3"),Tr.forEach(s),go=i(E," conv and not in the first "),Vt=a(E,"CODE",{});var Cr=n(Vt);_o=i(Cr,"1x1"),Cr.forEach(s),vo=i(E,". This is generally known as \u201CResNet v1.5\u201D."),E.forEach(s),$s=h(e),mt=a(e,"P",{});var Fr=n(mt);wo=i(Fr,"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."),Fr.forEach(s),bs=h(e),ht=a(e,"P",{});var Ir=n(ht);$o=i(Ir,"The abstract from the paper is the following:"),Ir.forEach(s),Ns=h(e),ut=a(e,"P",{});var Er=n(ut);Ht=a(Er,"EM",{});var jr=n(Ht);bo=i(jr,`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.`),jr.forEach(s),Er.forEach(s),ys=h(e),gt=a(e,"P",{});var xr=n(gt);No=i(xr,"Tips:"),xr.forEach(s),Rs=h(e),_t=a(e,"UL",{});var kr=n(_t);xe=a(kr,"LI",{});var Hs=n(xe);yo=i(Hs,"One can use "),vt=a(Hs,"A",{href:!0});var Pr=n(vt);Ro=i(Pr,"AutoImageProcessor"),Pr.forEach(s),To=i(Hs," to prepare images for the model."),Hs.forEach(s),kr.forEach(s),Ts=h(e),se=a(e,"P",{});var Us=n(se);Co=i(Us,"The figure below illustrates the architecture of ResNet. Taken from the "),ke=a(Us,"A",{href:!0,rel:!0});var Ar=n(ke);Fo=i(Ar,"original paper"),Ar.forEach(s),Io=i(Us,"."),Us.forEach(s),Cs=h(e),Pe=a(e,"IMG",{width:!0,src:!0}),Fs=h(e),P=a(e,"P",{});var we=n(P);Eo=i(we,"This model was contributed by "),Ae=a(we,"A",{href:!0,rel:!0});var Mr=n(Ae);jo=i(Mr,"Francesco"),Mr.forEach(s),xo=i(we,". The TensorFlow version of this model was added by "),Me=a(we,"A",{href:!0,rel:!0});var qr=n(Me);ko=i(qr,"amyeroberts"),qr.forEach(s),Po=i(we,". The original code can be found "),qe=a(we,"A",{href:!0,rel:!0});var Or=n(qe);Ao=i(Or,"here"),Or.forEach(s),Mo=i(we,"."),we.forEach(s),Is=h(e),W=a(e,"H2",{class:!0});var Bs=n(W);oe=a(Bs,"A",{id:!0,class:!0,href:!0});var Sr=n(oe);Ut=a(Sr,"SPAN",{});var Dr=n(Ut);b(Oe.$$.fragment,Dr),Dr.forEach(s),Sr.forEach(s),qo=h(Bs),Bt=a(Bs,"SPAN",{});var zr=n(Bt);Oo=i(zr,"Resources"),zr.forEach(s),Bs.forEach(s),Es=h(e),wt=a(e,"P",{});var Lr=n(wt);So=i(Lr,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),Lr.forEach(s),js=h(e),b(Se.$$.fragment,e),xs=h(e),ae=a(e,"UL",{});var Gs=n(ae);z=a(Gs,"LI",{});var pt=n(z);$t=a(pt,"A",{href:!0});var Wr=n($t);Do=i(Wr,"ResNetForImageClassification"),Wr.forEach(s),zo=i(pt," is supported by this "),De=a(pt,"A",{href:!0,rel:!0});var Vr=n(De);Lo=i(Vr,"example script"),Vr.forEach(s),Wo=i(pt," and "),ze=a(pt,"A",{href:!0,rel:!0});var Hr=n(ze);Vo=i(Hr,"notebook"),Hr.forEach(s),Ho=i(pt,"."),pt.forEach(s),Uo=h(Gs),bt=a(Gs,"LI",{});var $r=n(bt);Bo=i($r,"See also: "),Nt=a($r,"A",{href:!0});var Ur=n(Nt);Go=i(Ur,"Image classification task guide"),Ur.forEach(s),$r.forEach(s),Gs.forEach(s),ks=h(e),yt=a(e,"P",{});var Br=n(yt);Jo=i(Br,"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."),Br.forEach(s),Ps=h(e),V=a(e,"H2",{class:!0});var Js=n(V);re=a(Js,"A",{id:!0,class:!0,href:!0});var Gr=n(re);Gt=a(Gr,"SPAN",{});var Jr=n(Gt);b(Le.$$.fragment,Jr),Jr.forEach(s),Gr.forEach(s),Ko=h(Js),Jt=a(Js,"SPAN",{});var Kr=n(Jt);Xo=i(Kr,"ResNetConfig"),Kr.forEach(s),Js.forEach(s),As=h(e),j=a(e,"DIV",{class:!0});var $e=n(j);b(We.$$.fragment,$e),Zo=h($e),H=a($e,"P",{});var xt=n(H);Qo=i(xt,"This is the configuration class to store the configuration of a "),Rt=a(xt,"A",{href:!0});var Xr=n(Rt);Yo=i(Xr,"ResNetModel"),Xr.forEach(s),ea=i(xt,`. 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
`),Ve=a(xt,"A",{href:!0,rel:!0});var Zr=n(Ve);ta=i(Zr,"microsoft/resnet-50"),Zr.forEach(s),sa=i(xt," architecture."),xt.forEach(s),oa=h($e),U=a($e,"P",{});var kt=n(U);aa=i(kt,"Configuration objects inherit from "),Tt=a(kt,"A",{href:!0});var Qr=n(Tt);ra=i(Qr,"PretrainedConfig"),Qr.forEach(s),na=i(kt,` and can be used to control the model outputs. Read the
documentation from `),Ct=a(kt,"A",{href:!0});var Yr=n(Ct);la=i(Yr,"PretrainedConfig"),Yr.forEach(s),ia=i(kt," for more information."),kt.forEach(s),da=h($e),b(ne.$$.fragment,$e),$e.forEach(s),Ms=h(e),B=a(e,"H2",{class:!0});var Ks=n(B);le=a(Ks,"A",{id:!0,class:!0,href:!0});var en=n(le);Kt=a(en,"SPAN",{});var tn=n(Kt);b(He.$$.fragment,tn),tn.forEach(s),en.forEach(s),ca=h(Ks),Xt=a(Ks,"SPAN",{});var sn=n(Xt);fa=i(sn,"ResNetModel"),sn.forEach(s),Ks.forEach(s),qs=h(e),S=a(e,"DIV",{class:!0});var Pt=n(S);b(Ue.$$.fragment,Pt),pa=h(Pt),Be=a(Pt,"P",{});var Xs=n(Be);ma=i(Xs,`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),Ge=a(Xs,"A",{href:!0,rel:!0});var on=n(Ge);ha=i(on,"torch.nn.Module"),on.forEach(s),ua=i(Xs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xs.forEach(s),ga=h(Pt),A=a(Pt,"DIV",{class:!0});var be=n(A);b(Je.$$.fragment,be),_a=h(be),G=a(be,"P",{});var At=n(G);va=i(At,"The "),Ft=a(At,"A",{href:!0});var an=n(Ft);wa=i(an,"ResNetModel"),an.forEach(s),$a=i(At," forward method, overrides the "),Zt=a(At,"CODE",{});var rn=n(Zt);ba=i(rn,"__call__"),rn.forEach(s),Na=i(At," special method."),At.forEach(s),ya=h(be),b(ie.$$.fragment,be),Ra=h(be),b(de.$$.fragment,be),be.forEach(s),Pt.forEach(s),Os=h(e),J=a(e,"H2",{class:!0});var Zs=n(J);ce=a(Zs,"A",{id:!0,class:!0,href:!0});var nn=n(ce);Qt=a(nn,"SPAN",{});var ln=n(Qt);b(Ke.$$.fragment,ln),ln.forEach(s),nn.forEach(s),Ta=h(Zs),Yt=a(Zs,"SPAN",{});var dn=n(Yt);Ca=i(dn,"ResNetForImageClassification"),dn.forEach(s),Zs.forEach(s),Ss=h(e),x=a(e,"DIV",{class:!0});var Ne=n(x);b(Xe.$$.fragment,Ne),Fa=h(Ne),es=a(Ne,"P",{});var cn=n(es);Ia=i(cn,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),cn.forEach(s),Ea=h(Ne),Ze=a(Ne,"P",{});var Qs=n(Ze);ja=i(Qs,"This model is a PyTorch "),Qe=a(Qs,"A",{href:!0,rel:!0});var fn=n(Qe);xa=i(fn,"torch.nn.Module"),fn.forEach(s),ka=i(Qs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qs.forEach(s),Pa=h(Ne),M=a(Ne,"DIV",{class:!0});var ye=n(M);b(Ye.$$.fragment,ye),Aa=h(ye),K=a(ye,"P",{});var Mt=n(K);Ma=i(Mt,"The "),It=a(Mt,"A",{href:!0});var pn=n(It);qa=i(pn,"ResNetForImageClassification"),pn.forEach(s),Oa=i(Mt," forward method, overrides the "),ts=a(Mt,"CODE",{});var mn=n(ts);Sa=i(mn,"__call__"),mn.forEach(s),Da=i(Mt," special method."),Mt.forEach(s),za=h(ye),b(fe.$$.fragment,ye),La=h(ye),b(pe.$$.fragment,ye),ye.forEach(s),Ne.forEach(s),Ds=h(e),X=a(e,"H2",{class:!0});var Ys=n(X);me=a(Ys,"A",{id:!0,class:!0,href:!0});var hn=n(me);ss=a(hn,"SPAN",{});var un=n(ss);b(et.$$.fragment,un),un.forEach(s),hn.forEach(s),Wa=h(Ys),os=a(Ys,"SPAN",{});var gn=n(os);Va=i(gn,"TFResNetModel"),gn.forEach(s),Ys.forEach(s),zs=h(e),D=a(e,"DIV",{class:!0});var qt=n(D);b(tt.$$.fragment,qt),Ha=h(qt),st=a(qt,"P",{});var eo=n(st);Ua=i(eo,`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),ot=a(eo,"A",{href:!0,rel:!0});var _n=n(ot);Ba=i(_n,"tf.keras.layers.Layer"),_n.forEach(s),Ga=i(eo,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),eo.forEach(s),Ja=h(qt),q=a(qt,"DIV",{class:!0});var Re=n(q);b(at.$$.fragment,Re),Ka=h(Re),Z=a(Re,"P",{});var Ot=n(Z);Xa=i(Ot,"The "),Et=a(Ot,"A",{href:!0});var vn=n(Et);Za=i(vn,"TFResNetModel"),vn.forEach(s),Qa=i(Ot," forward method, overrides the "),as=a(Ot,"CODE",{});var wn=n(as);Ya=i(wn,"__call__"),wn.forEach(s),er=i(Ot," special method."),Ot.forEach(s),tr=h(Re),b(he.$$.fragment,Re),sr=h(Re),b(ue.$$.fragment,Re),Re.forEach(s),qt.forEach(s),Ls=h(e),Q=a(e,"H2",{class:!0});var to=n(Q);ge=a(to,"A",{id:!0,class:!0,href:!0});var $n=n(ge);rs=a($n,"SPAN",{});var bn=n(rs);b(rt.$$.fragment,bn),bn.forEach(s),$n.forEach(s),or=h(to),ns=a(to,"SPAN",{});var Nn=n(ns);ar=i(Nn,"TFResNetForImageClassification"),Nn.forEach(s),to.forEach(s),Ws=h(e),k=a(e,"DIV",{class:!0});var Te=n(k);b(nt.$$.fragment,Te),rr=h(Te),ls=a(Te,"P",{});var yn=n(ls);nr=i(yn,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),yn.forEach(s),lr=h(Te),lt=a(Te,"P",{});var so=n(lt);ir=i(so,`This model is a TensorFlow
`),it=a(so,"A",{href:!0,rel:!0});var Rn=n(it);dr=i(Rn,"tf.keras.layers.Layer"),Rn.forEach(s),cr=i(so,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),so.forEach(s),fr=h(Te),O=a(Te,"DIV",{class:!0});var Ce=n(O);b(dt.$$.fragment,Ce),pr=h(Ce),Y=a(Ce,"P",{});var St=n(Y);mr=i(St,"The "),jt=a(St,"A",{href:!0});var Tn=n(jt);hr=i(Tn,"TFResNetForImageClassification"),Tn.forEach(s),ur=i(St," forward method, overrides the "),is=a(St,"CODE",{});var Cn=n(is);gr=i(Cn,"__call__"),Cn.forEach(s),_r=i(St," special method."),St.forEach(s),vr=h(Ce),b(_e.$$.fragment,Ce),wr=h(Ce),b(ve.$$.fragment,Ce),Ce.forEach(s),Te.forEach(s),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Hn)),d(g,"id","resnet"),d(g,"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"),d(g,"href","#resnet"),d(_,"class","relative group"),d(te,"id","overview"),d(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"),d(te,"href","#overview"),d(L,"class","relative group"),d(Ee,"href","https://arxiv.org/abs/1512.03385"),d(Ee,"rel","nofollow"),d(je,"href","https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch"),d(je,"rel","nofollow"),d(vt,"href","/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor"),d(ke,"href","https://arxiv.org/abs/1512.03385"),d(ke,"rel","nofollow"),d(Pe,"width","600"),xn(Pe.src,br="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png")||d(Pe,"src",br),d(Ae,"href","https://huggingface.co/Francesco"),d(Ae,"rel","nofollow"),d(Me,"href","https://huggingface.co/amyeroberts"),d(Me,"rel","nofollow"),d(qe,"href","https://github.com/KaimingHe/deep-residual-networks"),d(qe,"rel","nofollow"),d(oe,"id","resources"),d(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"),d(oe,"href","#resources"),d(W,"class","relative group"),d($t,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(De,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(De,"rel","nofollow"),d(ze,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(ze,"rel","nofollow"),d(Nt,"href","./tasks/image_classification"),d(re,"id","transformers.ResNetConfig"),d(re,"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"),d(re,"href","#transformers.ResNetConfig"),d(V,"class","relative group"),d(Rt,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.ResNetModel"),d(Ve,"href","https://huggingface.co/microsoft/resnet-50"),d(Ve,"rel","nofollow"),d(Tt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ct,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"id","transformers.ResNetModel"),d(le,"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"),d(le,"href","#transformers.ResNetModel"),d(B,"class","relative group"),d(Ge,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ge,"rel","nofollow"),d(Ft,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.ResNetModel"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ce,"id","transformers.ResNetForImageClassification"),d(ce,"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"),d(ce,"href","#transformers.ResNetForImageClassification"),d(J,"class","relative group"),d(Qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Qe,"rel","nofollow"),d(It,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(me,"id","transformers.TFResNetModel"),d(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"),d(me,"href","#transformers.TFResNetModel"),d(X,"class","relative group"),d(ot,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(ot,"rel","nofollow"),d(Et,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.TFResNetModel"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"id","transformers.TFResNetForImageClassification"),d(ge,"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"),d(ge,"href","#transformers.TFResNetForImageClassification"),d(Q,"class","relative group"),d(it,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(it,"rel","nofollow"),d(jt,"href","/docs/transformers/v4.27.1/en/model_doc/resnet#transformers.TFResNetForImageClassification"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(k,"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,c),u(e,w,f),u(e,_,f),t(_,g),t(g,v),N(r,v,null),t(_,p),t(_,F),t(F,ao),u(e,vs,f),u(e,L,f),t(L,te),t(te,Dt),N(Ie,Dt,null),t(L,ro),t(L,zt),t(zt,no),u(e,ws,f),u(e,I,f),t(I,lo),t(I,Ee),t(Ee,io),t(I,co),t(I,je),t(je,fo),t(I,po),t(I,Lt),t(Lt,mo),t(I,ho),t(I,Wt),t(Wt,uo),t(I,go),t(I,Vt),t(Vt,_o),t(I,vo),u(e,$s,f),u(e,mt,f),t(mt,wo),u(e,bs,f),u(e,ht,f),t(ht,$o),u(e,Ns,f),u(e,ut,f),t(ut,Ht),t(Ht,bo),u(e,ys,f),u(e,gt,f),t(gt,No),u(e,Rs,f),u(e,_t,f),t(_t,xe),t(xe,yo),t(xe,vt),t(vt,Ro),t(xe,To),u(e,Ts,f),u(e,se,f),t(se,Co),t(se,ke),t(ke,Fo),t(se,Io),u(e,Cs,f),u(e,Pe,f),u(e,Fs,f),u(e,P,f),t(P,Eo),t(P,Ae),t(Ae,jo),t(P,xo),t(P,Me),t(Me,ko),t(P,Po),t(P,qe),t(qe,Ao),t(P,Mo),u(e,Is,f),u(e,W,f),t(W,oe),t(oe,Ut),N(Oe,Ut,null),t(W,qo),t(W,Bt),t(Bt,Oo),u(e,Es,f),u(e,wt,f),t(wt,So),u(e,js,f),N(Se,e,f),u(e,xs,f),u(e,ae,f),t(ae,z),t(z,$t),t($t,Do),t(z,zo),t(z,De),t(De,Lo),t(z,Wo),t(z,ze),t(ze,Vo),t(z,Ho),t(ae,Uo),t(ae,bt),t(bt,Bo),t(bt,Nt),t(Nt,Go),u(e,ks,f),u(e,yt,f),t(yt,Jo),u(e,Ps,f),u(e,V,f),t(V,re),t(re,Gt),N(Le,Gt,null),t(V,Ko),t(V,Jt),t(Jt,Xo),u(e,As,f),u(e,j,f),N(We,j,null),t(j,Zo),t(j,H),t(H,Qo),t(H,Rt),t(Rt,Yo),t(H,ea),t(H,Ve),t(Ve,ta),t(H,sa),t(j,oa),t(j,U),t(U,aa),t(U,Tt),t(Tt,ra),t(U,na),t(U,Ct),t(Ct,la),t(U,ia),t(j,da),N(ne,j,null),u(e,Ms,f),u(e,B,f),t(B,le),t(le,Kt),N(He,Kt,null),t(B,ca),t(B,Xt),t(Xt,fa),u(e,qs,f),u(e,S,f),N(Ue,S,null),t(S,pa),t(S,Be),t(Be,ma),t(Be,Ge),t(Ge,ha),t(Be,ua),t(S,ga),t(S,A),N(Je,A,null),t(A,_a),t(A,G),t(G,va),t(G,Ft),t(Ft,wa),t(G,$a),t(G,Zt),t(Zt,ba),t(G,Na),t(A,ya),N(ie,A,null),t(A,Ra),N(de,A,null),u(e,Os,f),u(e,J,f),t(J,ce),t(ce,Qt),N(Ke,Qt,null),t(J,Ta),t(J,Yt),t(Yt,Ca),u(e,Ss,f),u(e,x,f),N(Xe,x,null),t(x,Fa),t(x,es),t(es,Ia),t(x,Ea),t(x,Ze),t(Ze,ja),t(Ze,Qe),t(Qe,xa),t(Ze,ka),t(x,Pa),t(x,M),N(Ye,M,null),t(M,Aa),t(M,K),t(K,Ma),t(K,It),t(It,qa),t(K,Oa),t(K,ts),t(ts,Sa),t(K,Da),t(M,za),N(fe,M,null),t(M,La),N(pe,M,null),u(e,Ds,f),u(e,X,f),t(X,me),t(me,ss),N(et,ss,null),t(X,Wa),t(X,os),t(os,Va),u(e,zs,f),u(e,D,f),N(tt,D,null),t(D,Ha),t(D,st),t(st,Ua),t(st,ot),t(ot,Ba),t(st,Ga),t(D,Ja),t(D,q),N(at,q,null),t(q,Ka),t(q,Z),t(Z,Xa),t(Z,Et),t(Et,Za),t(Z,Qa),t(Z,as),t(as,Ya),t(Z,er),t(q,tr),N(he,q,null),t(q,sr),N(ue,q,null),u(e,Ls,f),u(e,Q,f),t(Q,ge),t(ge,rs),N(rt,rs,null),t(Q,or),t(Q,ns),t(ns,ar),u(e,Ws,f),u(e,k,f),N(nt,k,null),t(k,rr),t(k,ls),t(ls,nr),t(k,lr),t(k,lt),t(lt,ir),t(lt,it),t(it,dr),t(lt,cr),t(k,fr),t(k,O),N(dt,O,null),t(O,pr),t(O,Y),t(Y,mr),t(Y,jt),t(jt,hr),t(Y,ur),t(Y,is),t(is,gr),t(Y,_r),t(O,vr),N(_e,O,null),t(O,wr),N(ve,O,null),Vs=!0},p(e,[f]){const ct={};f&2&&(ct.$$scope={dirty:f,ctx:e}),ne.$set(ct);const ds={};f&2&&(ds.$$scope={dirty:f,ctx:e}),ie.$set(ds);const cs={};f&2&&(cs.$$scope={dirty:f,ctx:e}),de.$set(cs);const fs={};f&2&&(fs.$$scope={dirty:f,ctx:e}),fe.$set(fs);const ft={};f&2&&(ft.$$scope={dirty:f,ctx:e}),pe.$set(ft);const ps={};f&2&&(ps.$$scope={dirty:f,ctx:e}),he.$set(ps);const ms={};f&2&&(ms.$$scope={dirty:f,ctx:e}),ue.$set(ms);const hs={};f&2&&(hs.$$scope={dirty:f,ctx:e}),_e.$set(hs);const E={};f&2&&(E.$$scope={dirty:f,ctx:e}),ve.$set(E)},i(e){Vs||(y(r.$$.fragment,e),y(Ie.$$.fragment,e),y(Oe.$$.fragment,e),y(Se.$$.fragment,e),y(Le.$$.fragment,e),y(We.$$.fragment,e),y(ne.$$.fragment,e),y(He.$$.fragment,e),y(Ue.$$.fragment,e),y(Je.$$.fragment,e),y(ie.$$.fragment,e),y(de.$$.fragment,e),y(Ke.$$.fragment,e),y(Xe.$$.fragment,e),y(Ye.$$.fragment,e),y(fe.$$.fragment,e),y(pe.$$.fragment,e),y(et.$$.fragment,e),y(tt.$$.fragment,e),y(at.$$.fragment,e),y(he.$$.fragment,e),y(ue.$$.fragment,e),y(rt.$$.fragment,e),y(nt.$$.fragment,e),y(dt.$$.fragment,e),y(_e.$$.fragment,e),y(ve.$$.fragment,e),Vs=!0)},o(e){R(r.$$.fragment,e),R(Ie.$$.fragment,e),R(Oe.$$.fragment,e),R(Se.$$.fragment,e),R(Le.$$.fragment,e),R(We.$$.fragment,e),R(ne.$$.fragment,e),R(He.$$.fragment,e),R(Ue.$$.fragment,e),R(Je.$$.fragment,e),R(ie.$$.fragment,e),R(de.$$.fragment,e),R(Ke.$$.fragment,e),R(Xe.$$.fragment,e),R(Ye.$$.fragment,e),R(fe.$$.fragment,e),R(pe.$$.fragment,e),R(et.$$.fragment,e),R(tt.$$.fragment,e),R(at.$$.fragment,e),R(he.$$.fragment,e),R(ue.$$.fragment,e),R(rt.$$.fragment,e),R(nt.$$.fragment,e),R(dt.$$.fragment,e),R(_e.$$.fragment,e),R(ve.$$.fragment,e),Vs=!1},d(e){s(c),e&&s(w),e&&s(_),T(r),e&&s(vs),e&&s(L),T(Ie),e&&s(ws),e&&s(I),e&&s($s),e&&s(mt),e&&s(bs),e&&s(ht),e&&s(Ns),e&&s(ut),e&&s(ys),e&&s(gt),e&&s(Rs),e&&s(_t),e&&s(Ts),e&&s(se),e&&s(Cs),e&&s(Pe),e&&s(Fs),e&&s(P),e&&s(Is),e&&s(W),T(Oe),e&&s(Es),e&&s(wt),e&&s(js),T(Se,e),e&&s(xs),e&&s(ae),e&&s(ks),e&&s(yt),e&&s(Ps),e&&s(V),T(Le),e&&s(As),e&&s(j),T(We),T(ne),e&&s(Ms),e&&s(B),T(He),e&&s(qs),e&&s(S),T(Ue),T(Je),T(ie),T(de),e&&s(Os),e&&s(J),T(Ke),e&&s(Ss),e&&s(x),T(Xe),T(Ye),T(fe),T(pe),e&&s(Ds),e&&s(X),T(et),e&&s(zs),e&&s(D),T(tt),T(at),T(he),T(ue),e&&s(Ls),e&&s(Q),T(rt),e&&s(Ws),e&&s(k),T(nt),T(dt),T(_e),T(ve)}}}const Hn={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 Un(C){return kn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yn extends Fn{constructor(c){super();In(this,c,Un,Vn,En,{})}}export{Yn as default,Hn as metadata};
