import{S as Al,i as jl,s as Ll,e as r,k as d,w as v,t as n,M as Dl,c as a,d as o,m,a as s,x as w,h as i,b as l,G as e,g as h,y,q as N,o as M,B as $,v as Ol,L as oa}from"../../chunks/vendor-hf-doc-builder.js";import{T as ai}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ra}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ta}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ql}from"../../chunks/PipelineTag-hf-doc-builder.js";function Rl(V){let f,T,_,g,b;return g=new ra({props:{code:`from transformers import MobileNetV2Config, MobileNetV2Model

# Initializing a "mobilenet_v2_1.0_224" style configuration
configuration = MobileNetV2Config()

# Initializing a model from the "mobilenet_v2_1.0_224" style configuration
model = MobileNetV2Model(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> MobileNetV2Config, MobileNetV2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a &quot;mobilenet_v2_1.0_224&quot; style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MobileNetV2Config()

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

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

image_processor = AutoImageProcessor.from_pretrained("google/mobilenet_v2_1.0_224")
model = MobileNetV2Model.from_pretrained("google/mobilenet_v2_1.0_224")

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, MobileNetV2Model
<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;google/mobilenet_v2_1.0_224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileNetV2Model.from_pretrained(<span class="hljs-string">&quot;google/mobilenet_v2_1.0_224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1280</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){f=r("p"),T=n("Example:"),_=d(),v(g.$$.fragment)},l(c){f=a(c,"P",{});var u=s(f);T=i(u,"Example:"),u.forEach(o),_=m(c),w(g.$$.fragment,c)},m(c,u){h(c,f,u),e(f,T),h(c,_,u),y(g,c,u),b=!0},p:oa,i(c){b||(N(g.$$.fragment,c),b=!0)},o(c){M(g.$$.fragment,c),b=!1},d(c){c&&o(f),c&&o(_),$(g,c)}}}function Hl(V){let f,T,_,g,b;return{c(){f=r("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),b=n(`
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(c){f=a(c,"P",{});var u=s(f);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var I=s(_);g=i(I,"Module"),I.forEach(o),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(c,u){h(c,f,u),e(f,T),e(f,_),e(_,g),e(f,b)},d(c){c&&o(f)}}}function Bl(V){let f,T,_,g,b;return g=new ra({props:{code:`from transformers import AutoImageProcessor, MobileNetV2ForImageClassification
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("google/mobilenet_v2_1.0_224")
model = MobileNetV2ForImageClassification.from_pretrained("google/mobilenet_v2_1.0_224")

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, MobileNetV2ForImageClassification
<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;google/mobilenet_v2_1.0_224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileNetV2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilenet_v2_1.0_224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){f=r("p"),T=n("Example:"),_=d(),v(g.$$.fragment)},l(c){f=a(c,"P",{});var u=s(f);T=i(u,"Example:"),u.forEach(o),_=m(c),w(g.$$.fragment,c)},m(c,u){h(c,f,u),e(f,T),h(c,_,u),y(g,c,u),b=!0},p:oa,i(c){b||(N(g.$$.fragment,c),b=!0)},o(c){M(g.$$.fragment,c),b=!1},d(c){c&&o(f),c&&o(_),$(g,c)}}}function Gl(V){let f,T,_,g,b;return{c(){f=r("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),b=n(`
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(c){f=a(c,"P",{});var u=s(f);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var I=s(_);g=i(I,"Module"),I.forEach(o),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(c,u){h(c,f,u),e(f,T),e(f,_),e(_,g),e(f,b)},d(c){c&&o(f)}}}function Yl(V){let f,T,_,g,b;return g=new ra({props:{code:`from transformers import AutoImageProcessor, MobileNetV2ForSemanticSegmentation
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("google/deeplabv3_mobilenet_v2_1.0_513")
model = MobileNetV2ForSemanticSegmentation.from_pretrained("google/deeplabv3_mobilenet_v2_1.0_513")

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

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

# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileNetV2ForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;google/deeplabv3_mobilenet_v2_1.0_513&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileNetV2ForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;google/deeplabv3_mobilenet_v2_1.0_513&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){f=r("p"),T=n("Examples:"),_=d(),v(g.$$.fragment)},l(c){f=a(c,"P",{});var u=s(f);T=i(u,"Examples:"),u.forEach(o),_=m(c),w(g.$$.fragment,c)},m(c,u){h(c,f,u),e(f,T),h(c,_,u),y(g,c,u),b=!0},p:oa,i(c){b||(N(g.$$.fragment,c),b=!0)},o(c){M(g.$$.fragment,c),b=!1},d(c){c&&o(f),c&&o(_),$(g,c)}}}function Zl(V){let f,T,_,g,b,c,u,I,aa,sr,H,ie,io,je,sa,lo,na,nr,le,ia,Le,la,ca,ir,zt,da,lr,Ct,co,ma,cr,Ft,mo,pa,dr,St,ha,mr,x,po,E,fa,ce,ga,ho,ua,_a,fo,ba,va,go,wa,ya,uo,Na,Ma,_o,$a,Ta,Va,bo,vo,xa,Ia,wo,De,Ea,kt,Pa,za,Ca,yo,Oe,Fa,qe,Sa,ka,Aa,No,B,ja,Re,La,Da,We,Oa,qa,Ra,Mo,G,Wa,At,Ua,Ha,$o,Ba,Ga,pr,jt,Ya,hr,k,To,Ue,Za,Lt,Ja,Qa,Xa,Vo,xo,Ka,es,Io,He,ts,Eo,os,rs,as,Po,Be,ss,Dt,ns,is,fr,A,ls,Ge,cs,ds,Ye,ms,ps,Ze,hs,fs,gr,Y,de,zo,Je,gs,Co,us,ur,Ot,_s,_r,Qe,br,qt,W,Rt,bs,vs,Xe,ws,ys,Ke,Ns,Ms,vr,Wt,$s,wr,Z,me,Fo,et,Ts,So,Vs,yr,P,tt,xs,J,Is,Ut,Es,Ps,ot,zs,Cs,Fs,Q,Ss,Ht,ks,As,Bt,js,Ls,Ds,pe,Nr,X,he,ko,rt,Os,Ao,qs,Mr,q,at,Rs,fe,st,Ws,jo,Us,Hs,ge,nt,Bs,it,Gs,Gt,Ys,Zs,$r,K,ue,Lo,lt,Js,Do,Qs,Tr,z,ct,Xs,Oo,Ks,en,_e,dt,tn,qo,on,rn,be,mt,an,pt,sn,Yt,nn,ln,Vr,ee,ve,Ro,ht,cn,Wo,dn,xr,R,ft,mn,gt,pn,ut,hn,fn,gn,j,_t,un,te,_n,Zt,bn,vn,Uo,wn,yn,Nn,we,Mn,ye,Ir,oe,Ne,Ho,bt,$n,Bo,Tn,Er,C,vt,Vn,Go,xn,In,wt,En,yt,Pn,zn,Cn,L,Nt,Fn,re,Sn,Jt,kn,An,Yo,jn,Ln,Dn,Me,On,$e,Pr,ae,Te,Zo,Mt,qn,Jo,Rn,zr,F,$t,Wn,Qo,Un,Hn,Tt,Bn,Vt,Gn,Yn,Zn,D,xt,Jn,se,Qn,Qt,Xn,Kn,Xo,ei,ti,oi,Ve,ri,xe,Cr;return c=new ne({}),je=new ne({}),Je=new ne({}),Qe=new ql({props:{pipeline:"image-classification"}}),et=new ne({}),tt=new S({props:{name:"class transformers.MobileNetV2Config",anchor:"transformers.MobileNetV2Config",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"depth_multiplier",val:" = 1.0"},{name:"depth_divisible_by",val:" = 8"},{name:"min_depth",val:" = 8"},{name:"expand_ratio",val:" = 6"},{name:"output_stride",val:" = 32"},{name:"first_layer_is_expansion",val:" = True"},{name:"finegrained_output",val:" = True"},{name:"hidden_act",val:" = 'relu6'"},{name:"tf_padding",val:" = True"},{name:"classifier_dropout_prob",val:" = 0.8"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 0.001"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV2Config.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.MobileNetV2Config.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.MobileNetV2Config.depth_multiplier",description:`<strong>depth_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Shrinks or expands the number of channels in each layer. Default is 1.0, which starts the network with 32
channels. This is sometimes also called &#x201C;alpha&#x201D; or &#x201C;width multiplier&#x201D;.`,name:"depth_multiplier"},{anchor:"transformers.MobileNetV2Config.depth_divisible_by",description:`<strong>depth_divisible_by</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The number of channels in each layer will always be a multiple of this number.`,name:"depth_divisible_by"},{anchor:"transformers.MobileNetV2Config.min_depth",description:`<strong>min_depth</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
All layers will have at least this many channels.`,name:"min_depth"},{anchor:"transformers.MobileNetV2Config.expand_ratio",description:`<strong>expand_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 6.0) &#x2014;
The number of output channels of the first layer in each block is input channels times expansion ratio.`,name:"expand_ratio"},{anchor:"transformers.MobileNetV2Config.output_stride",description:`<strong>output_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The ratio between the spatial resolution of the input and output feature maps. By default the model reduces
the input dimensions by a factor of 32. If <code>output_stride</code> is 8 or 16, the model uses dilated convolutions
on the depthwise layers instead of regular convolutions, so that the feature maps never become more than 8x
or 16x smaller than the input image.`,name:"output_stride"},{anchor:"transformers.MobileNetV2Config.first_layer_is_expansion",description:`<strong>first_layer_is_expansion</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>True</code>) &#x2014;
True if the very first convolution layer is also the expansion layer for the first expansion block.`,name:"first_layer_is_expansion"},{anchor:"transformers.MobileNetV2Config.finegrained_output",description:`<strong>finegrained_output</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>True</code>) &#x2014;
If true, the number of output channels in the final convolution layer will stay large (1280) even if
<code>depth_multiplier</code> is less than 1.`,name:"finegrained_output"},{anchor:"transformers.MobileNetV2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu6&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the Transformer encoder and convolution layers.`,name:"hidden_act"},{anchor:"transformers.MobileNetV2Config.tf_padding",description:`<strong>tf_padding</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>True</code>) &#x2014;
Whether to use TensorFlow padding rules on the convolution layers.`,name:"tf_padding"},{anchor:"transformers.MobileNetV2Config.classifier_dropout_prob",description:`<strong>classifier_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.999) &#x2014;
The dropout ratio for attached classifiers.`,name:"classifier_dropout_prob"},{anchor:"transformers.MobileNetV2Config.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.MobileNetV2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 0.001) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MobileNetV2Config.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py#L38"}}),pe=new ta({props:{anchor:"transformers.MobileNetV2Config.example",$$slots:{default:[Rl]},$$scope:{ctx:V}}}),rt=new ne({}),at=new S({props:{name:"class transformers.MobileNetV2FeatureExtractor",anchor:"transformers.MobileNetV2FeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/feature_extraction_mobilenet_v2.py#L26"}}),st=new S({props:{name:"preprocess",anchor:"transformers.MobileNetV2FeatureExtractor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
<code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BILINEAR</code>. Only has
an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.MobileNetV2FeatureExtractor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L227"}}),nt=new S({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileNetV2FeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileNetV2FeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation">MobileNetV2ForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileNetV2FeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
A list of length <code>batch_size</code>, where each item is a <code>Tuple[int, int]</code> corresponding to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L338",returnDescription:`
<p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width)
corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each
<code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p><code>List[torch.Tensor]</code></p>
`}}),lt=new ne({}),ct=new S({props:{name:"class transformers.MobileNetV2ImageProcessor",anchor:"transformers.MobileNetV2ImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV2ImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.MobileNetV2ImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 256}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.MobileNetV2ImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.MobileNetV2ImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by the <code>do_center_crop</code> parameter in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.MobileNetV2ImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size when applying center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.
Can be overridden by the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.MobileNetV2ImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.MobileNetV2ImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.MobileNetV2ImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.MobileNetV2ImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L53"}}),dt=new S({props:{name:"preprocess",anchor:"transformers.MobileNetV2ImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
<code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BILINEAR</code>. Only has
an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.MobileNetV2ImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L227"}}),mt=new S({props:{name:"post_process_semantic_segmentation",anchor:"transformers.MobileNetV2ImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.MobileNetV2ImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation">MobileNetV2ForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.MobileNetV2ImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code>, <em>optional</em>) &#x2014;
A list of length <code>batch_size</code>, where each item is a <code>Tuple[int, int]</code> corresponding to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L338",returnDescription:`
<p>A list of length <code>batch_size</code>, where each item is a semantic segmentation map of shape (height, width)
corresponding to the target_sizes entry (if <code>target_sizes</code> is specified). Each entry of each
<code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p><code>List[torch.Tensor]</code></p>
`}}),ht=new ne({}),ft=new S({props:{name:"class transformers.MobileNetV2Model",anchor:"transformers.MobileNetV2Model",parameters:[{name:"config",val:": MobileNetV2Config"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileNetV2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config">MobileNetV2Config</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/mobilenet_v2/modeling_mobilenet_v2.py#L502"}}),_t=new S({props:{name:"forward",anchor:"transformers.MobileNetV2Model.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileNetV2Model.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__">MobileNetV2ImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileNetV2Model.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.MobileNetV2Model.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/mobilenet_v2/modeling_mobilenet_v2.py#L566",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/mobilenet_v2#transformers.MobileNetV2Config"
>MobileNetV2Config</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>
`}}),we=new ai({props:{$$slots:{default:[Wl]},$$scope:{ctx:V}}}),ye=new ta({props:{anchor:"transformers.MobileNetV2Model.forward.example",$$slots:{default:[Ul]},$$scope:{ctx:V}}}),bt=new ne({}),vt=new S({props:{name:"class transformers.MobileNetV2ForImageClassification",anchor:"transformers.MobileNetV2ForImageClassification",parameters:[{name:"config",val:": MobileNetV2Config"}],parametersDescription:[{anchor:"transformers.MobileNetV2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config">MobileNetV2Config</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/mobilenet_v2/modeling_mobilenet_v2.py#L622"}}),Nt=new S({props:{name:"forward",anchor:"transformers.MobileNetV2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileNetV2ForImageClassification.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__">MobileNetV2ImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileNetV2ForImageClassification.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.MobileNetV2ForImageClassification.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.MobileNetV2ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L638",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/mobilenet_v2#transformers.MobileNetV2Config"
>MobileNetV2Config</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>
`}}),Me=new ai({props:{$$slots:{default:[Hl]},$$scope:{ctx:V}}}),$e=new ta({props:{anchor:"transformers.MobileNetV2ForImageClassification.forward.example",$$slots:{default:[Bl]},$$scope:{ctx:V}}}),Mt=new ne({}),$t=new S({props:{name:"class transformers.MobileNetV2ForSemanticSegmentation",anchor:"transformers.MobileNetV2ForSemanticSegmentation",parameters:[{name:"config",val:": MobileNetV2Config"}],parametersDescription:[{anchor:"transformers.MobileNetV2ForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config">MobileNetV2Config</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/mobilenet_v2/modeling_mobilenet_v2.py#L781"}}),xt=new S({props:{name:"forward",anchor:"transformers.MobileNetV2ForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileNetV2ForSemanticSegmentation.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__">MobileNetV2ImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileNetV2ForSemanticSegmentation.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.MobileNetV2ForSemanticSegmentation.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.MobileNetV2ForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the 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/mobilenet_v2/modeling_mobilenet_v2.py#L792",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</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/mobilenet_v2#transformers.MobileNetV2Config"
>MobileNetV2Config</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</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, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new ai({props:{$$slots:{default:[Gl]},$$scope:{ctx:V}}}),xe=new ta({props:{anchor:"transformers.MobileNetV2ForSemanticSegmentation.forward.example",$$slots:{default:[Yl]},$$scope:{ctx:V}}}),{c(){f=r("meta"),T=d(),_=r("h1"),g=r("a"),b=r("span"),v(c.$$.fragment),u=d(),I=r("span"),aa=n("MobileNet V2"),sr=d(),H=r("h2"),ie=r("a"),io=r("span"),v(je.$$.fragment),sa=d(),lo=r("span"),na=n("Overview"),nr=d(),le=r("p"),ia=n("The MobileNet model was proposed in "),Le=r("a"),la=n("MobileNetV2: Inverted Residuals and Linear Bottlenecks"),ca=n(" by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen."),ir=d(),zt=r("p"),da=n("The abstract from the paper is the following:"),lr=d(),Ct=r("p"),co=r("em"),ma=n("In this paper we describe a new mobile architecture, MobileNetV2, that improves the state of the art performance of mobile models on multiple tasks and benchmarks as well as across a spectrum of different model sizes. We also describe efficient ways of applying these mobile models to object detection in a novel framework we call SSDLite. Additionally, we demonstrate how to build mobile semantic segmentation models through a reduced form of DeepLabv3 which we call Mobile DeepLabv3."),cr=d(),Ft=r("p"),mo=r("em"),pa=n("The MobileNetV2 architecture is based on an inverted residual structure where the input and output of the residual block are thin bottleneck layers opposite to traditional residual models which use expanded representations in the input an MobileNetV2 uses lightweight depthwise convolutions to filter features in the intermediate expansion layer. Additionally, we find that it is important to remove non-linearities in the narrow layers in order to maintain representational power. We demonstrate that this improves performance and provide an intuition that led to this design. Finally, our approach allows decoupling of the input/output domains from the expressiveness of the transformation, which provides a convenient framework for further analysis. We measure our performance on Imagenet classification, COCO object detection, VOC image segmentation. We evaluate the trade-offs between accuracy, and number of operations measured by multiply-adds (MAdd), as well as the number of parameters."),dr=d(),St=r("p"),ha=n("Tips:"),mr=d(),x=r("ul"),po=r("li"),E=r("p"),fa=n("The checkpoints are named "),ce=r("strong"),ga=n("mobilenet_v2_"),ho=r("em"),ua=n("depth"),_a=n("_"),fo=r("em"),ba=n("size"),va=n(", for example "),go=r("strong"),wa=n("mobilenet_v2_1.0_224"),ya=n(", where "),uo=r("strong"),Na=n("1.0"),Ma=n(" is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),_o=r("strong"),$a=n("224"),Ta=n(" is the resolution of the input images the model was trained on."),Va=d(),bo=r("li"),vo=r("p"),xa=n("Even though the checkpoint is trained on images of specific size, the model will work on images of any size. The smallest supported image size is 32x32."),Ia=d(),wo=r("li"),De=r("p"),Ea=n("One can use "),kt=r("a"),Pa=n("MobileNetV2ImageProcessor"),za=n(" to prepare images for the model."),Ca=d(),yo=r("li"),Oe=r("p"),Fa=n("The available image classification checkpoints are pre-trained on "),qe=r("a"),Sa=n("ImageNet-1k"),ka=n(" (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes). However, the model predicts 1001 classes: the 1000 classes from ImageNet plus an extra \u201Cbackground\u201D class (index 0)."),Aa=d(),No=r("li"),B=r("p"),ja=n("The segmentation model uses a "),Re=r("a"),La=n("DeepLabV3+"),Da=n(" head. The available semantic segmentation checkpoints are pre-trained on "),We=r("a"),Oa=n("PASCAL VOC"),qa=n("."),Ra=d(),Mo=r("li"),G=r("p"),Wa=n("The original TensorFlow checkpoints use different padding rules than PyTorch, requiring the model to determine the padding amount at inference time, since this depends on the input image size. To use native PyTorch padding behavior, create a "),At=r("a"),Ua=n("MobileNetV2Config"),Ha=n(" with "),$o=r("code"),Ba=n("tf_padding = False"),Ga=n("."),pr=d(),jt=r("p"),Ya=n("Unsupported features:"),hr=d(),k=r("ul"),To=r("li"),Ue=r("p"),Za=n("The "),Lt=r("a"),Ja=n("MobileNetV2Model"),Qa=n(" outputs a globally pooled version of the last hidden state. In the original model it is possible to use an average pooling layer with a fixed 7x7 window and stride 1 instead of global pooling. For inputs that are larger than the recommended image size, this gives a pooled output that is larger than 1x1. The Hugging Face implementation does not support this."),Xa=d(),Vo=r("li"),xo=r("p"),Ka=n("The original TensorFlow checkpoints include quantized models. We do not support these models as they include additional \u201CFakeQuantization\u201D operations to unquantize the weights."),es=d(),Io=r("li"),He=r("p"),ts=n("It\u2019s common to extract the output from the expansion layers at indices 10 and 13, as well as the output from the final 1x1 convolution layer, for downstream purposes. Using "),Eo=r("code"),os=n("output_hidden_states=True"),rs=n(" returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),as=d(),Po=r("li"),Be=r("p"),ss=n("The DeepLabV3+ segmentation head does not use the final convolution layer from the backbone, but this layer gets computed anyway. There is currently no way to tell "),Dt=r("a"),ns=n("MobileNetV2Model"),is=n(" up to which layer it should run."),fr=d(),A=r("p"),ls=n("This model was contributed by "),Ge=r("a"),cs=n("matthijs"),ds=n(". The original code and weights can be found "),Ye=r("a"),ms=n("here for the main model"),ps=n(" and "),Ze=r("a"),hs=n("here for DeepLabV3+"),fs=n("."),gr=d(),Y=r("h2"),de=r("a"),zo=r("span"),v(Je.$$.fragment),gs=d(),Co=r("span"),us=n("Resources"),ur=d(),Ot=r("p"),_s=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV2."),_r=d(),v(Qe.$$.fragment),br=d(),qt=r("ul"),W=r("li"),Rt=r("a"),bs=n("MobileNetV2ForImageClassification"),vs=n(" is supported by this "),Xe=r("a"),ws=n("example script"),ys=n(" and "),Ke=r("a"),Ns=n("notebook"),Ms=n("."),vr=d(),Wt=r("p"),$s=n("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."),wr=d(),Z=r("h2"),me=r("a"),Fo=r("span"),v(et.$$.fragment),Ts=d(),So=r("span"),Vs=n("MobileNetV2Config"),yr=d(),P=r("div"),v(tt.$$.fragment),xs=d(),J=r("p"),Is=n("This is the configuration class to store the configuration of a "),Ut=r("a"),Es=n("MobileNetV2Model"),Ps=n(`. It is used to instantiate a
MobileNetV2 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 MobileNetV2
`),ot=r("a"),zs=n("google/mobilenet_v2_1.0_224"),Cs=n(" architecture."),Fs=d(),Q=r("p"),Ss=n("Configuration objects inherit from "),Ht=r("a"),ks=n("PretrainedConfig"),As=n(` and can be used to control the model outputs. Read the
documentation from `),Bt=r("a"),js=n("PretrainedConfig"),Ls=n(" for more information."),Ds=d(),v(pe.$$.fragment),Nr=d(),X=r("h2"),he=r("a"),ko=r("span"),v(rt.$$.fragment),Os=d(),Ao=r("span"),qs=n("MobileNetV2FeatureExtractor"),Mr=d(),q=r("div"),v(at.$$.fragment),Rs=d(),fe=r("div"),v(st.$$.fragment),Ws=d(),jo=r("p"),Us=n("Preprocess an image or batch of images."),Hs=d(),ge=r("div"),v(nt.$$.fragment),Bs=d(),it=r("p"),Gs=n("Converts the output of "),Gt=r("a"),Ys=n("MobileNetV2ForSemanticSegmentation"),Zs=n(` into semantic segmentation maps. Only supports
PyTorch.`),$r=d(),K=r("h2"),ue=r("a"),Lo=r("span"),v(lt.$$.fragment),Js=d(),Do=r("span"),Qs=n("MobileNetV2ImageProcessor"),Tr=d(),z=r("div"),v(ct.$$.fragment),Xs=d(),Oo=r("p"),Ks=n("Constructs a MobileNetV2 image processor."),en=d(),_e=r("div"),v(dt.$$.fragment),tn=d(),qo=r("p"),on=n("Preprocess an image or batch of images."),rn=d(),be=r("div"),v(mt.$$.fragment),an=d(),pt=r("p"),sn=n("Converts the output of "),Yt=r("a"),nn=n("MobileNetV2ForSemanticSegmentation"),ln=n(` into semantic segmentation maps. Only supports
PyTorch.`),Vr=d(),ee=r("h2"),ve=r("a"),Ro=r("span"),v(ht.$$.fragment),cn=d(),Wo=r("span"),dn=n("MobileNetV2Model"),xr=d(),R=r("div"),v(ft.$$.fragment),mn=d(),gt=r("p"),pn=n(`The bare MobileNetV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=r("a"),hn=n("torch.nn.Module"),fn=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gn=d(),j=r("div"),v(_t.$$.fragment),un=d(),te=r("p"),_n=n("The "),Zt=r("a"),bn=n("MobileNetV2Model"),vn=n(" forward method, overrides the "),Uo=r("code"),wn=n("__call__"),yn=n(" special method."),Nn=d(),v(we.$$.fragment),Mn=d(),v(ye.$$.fragment),Ir=d(),oe=r("h2"),Ne=r("a"),Ho=r("span"),v(bt.$$.fragment),$n=d(),Bo=r("span"),Tn=n("MobileNetV2ForImageClassification"),Er=d(),C=r("div"),v(vt.$$.fragment),Vn=d(),Go=r("p"),xn=n(`MobileNetV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),In=d(),wt=r("p"),En=n("This model is a PyTorch "),yt=r("a"),Pn=n("torch.nn.Module"),zn=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cn=d(),L=r("div"),v(Nt.$$.fragment),Fn=d(),re=r("p"),Sn=n("The "),Jt=r("a"),kn=n("MobileNetV2ForImageClassification"),An=n(" forward method, overrides the "),Yo=r("code"),jn=n("__call__"),Ln=n(" special method."),Dn=d(),v(Me.$$.fragment),On=d(),v($e.$$.fragment),Pr=d(),ae=r("h2"),Te=r("a"),Zo=r("span"),v(Mt.$$.fragment),qn=d(),Jo=r("span"),Rn=n("MobileNetV2ForSemanticSegmentation"),zr=d(),F=r("div"),v($t.$$.fragment),Wn=d(),Qo=r("p"),Un=n("MobileNetV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),Hn=d(),Tt=r("p"),Bn=n("This model is a PyTorch "),Vt=r("a"),Gn=n("torch.nn.Module"),Yn=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Zn=d(),D=r("div"),v(xt.$$.fragment),Jn=d(),se=r("p"),Qn=n("The "),Qt=r("a"),Xn=n("MobileNetV2ForSemanticSegmentation"),Kn=n(" forward method, overrides the "),Xo=r("code"),ei=n("__call__"),ti=n(" special method."),oi=d(),v(Ve.$$.fragment),ri=d(),v(xe.$$.fragment),this.h()},l(t){const p=Dl('[data-svelte="svelte-1phssyn"]',document.head);f=a(p,"META",{name:!0,content:!0}),p.forEach(o),T=m(t),_=a(t,"H1",{class:!0});var It=s(_);g=a(It,"A",{id:!0,class:!0,href:!0});var Ko=s(g);b=a(Ko,"SPAN",{});var er=s(b);w(c.$$.fragment,er),er.forEach(o),Ko.forEach(o),u=m(It),I=a(It,"SPAN",{});var tr=s(I);aa=i(tr,"MobileNet V2"),tr.forEach(o),It.forEach(o),sr=m(t),H=a(t,"H2",{class:!0});var Et=s(H);ie=a(Et,"A",{id:!0,class:!0,href:!0});var or=s(ie);io=a(or,"SPAN",{});var rr=s(io);w(je.$$.fragment,rr),rr.forEach(o),or.forEach(o),sa=m(Et),lo=a(Et,"SPAN",{});var si=s(lo);na=i(si,"Overview"),si.forEach(o),Et.forEach(o),nr=m(t),le=a(t,"P",{});var Fr=s(le);ia=i(Fr,"The MobileNet model was proposed in "),Le=a(Fr,"A",{href:!0,rel:!0});var ni=s(Le);la=i(ni,"MobileNetV2: Inverted Residuals and Linear Bottlenecks"),ni.forEach(o),ca=i(Fr," by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen."),Fr.forEach(o),ir=m(t),zt=a(t,"P",{});var ii=s(zt);da=i(ii,"The abstract from the paper is the following:"),ii.forEach(o),lr=m(t),Ct=a(t,"P",{});var li=s(Ct);co=a(li,"EM",{});var ci=s(co);ma=i(ci,"In this paper we describe a new mobile architecture, MobileNetV2, that improves the state of the art performance of mobile models on multiple tasks and benchmarks as well as across a spectrum of different model sizes. We also describe efficient ways of applying these mobile models to object detection in a novel framework we call SSDLite. Additionally, we demonstrate how to build mobile semantic segmentation models through a reduced form of DeepLabv3 which we call Mobile DeepLabv3."),ci.forEach(o),li.forEach(o),cr=m(t),Ft=a(t,"P",{});var di=s(Ft);mo=a(di,"EM",{});var mi=s(mo);pa=i(mi,"The MobileNetV2 architecture is based on an inverted residual structure where the input and output of the residual block are thin bottleneck layers opposite to traditional residual models which use expanded representations in the input an MobileNetV2 uses lightweight depthwise convolutions to filter features in the intermediate expansion layer. Additionally, we find that it is important to remove non-linearities in the narrow layers in order to maintain representational power. We demonstrate that this improves performance and provide an intuition that led to this design. Finally, our approach allows decoupling of the input/output domains from the expressiveness of the transformation, which provides a convenient framework for further analysis. We measure our performance on Imagenet classification, COCO object detection, VOC image segmentation. We evaluate the trade-offs between accuracy, and number of operations measured by multiply-adds (MAdd), as well as the number of parameters."),mi.forEach(o),di.forEach(o),dr=m(t),St=a(t,"P",{});var pi=s(St);ha=i(pi,"Tips:"),pi.forEach(o),mr=m(t),x=a(t,"UL",{});var O=s(x);po=a(O,"LI",{});var hi=s(po);E=a(hi,"P",{});var U=s(E);fa=i(U,"The checkpoints are named "),ce=a(U,"STRONG",{});var ar=s(ce);ga=i(ar,"mobilenet_v2_"),ho=a(ar,"EM",{});var fi=s(ho);ua=i(fi,"depth"),fi.forEach(o),_a=i(ar,"_"),fo=a(ar,"EM",{});var gi=s(fo);ba=i(gi,"size"),gi.forEach(o),ar.forEach(o),va=i(U,", for example "),go=a(U,"STRONG",{});var ui=s(go);wa=i(ui,"mobilenet_v2_1.0_224"),ui.forEach(o),ya=i(U,", where "),uo=a(U,"STRONG",{});var _i=s(uo);Na=i(_i,"1.0"),_i.forEach(o),Ma=i(U," is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),_o=a(U,"STRONG",{});var bi=s(_o);$a=i(bi,"224"),bi.forEach(o),Ta=i(U," is the resolution of the input images the model was trained on."),U.forEach(o),hi.forEach(o),Va=m(O),bo=a(O,"LI",{});var vi=s(bo);vo=a(vi,"P",{});var wi=s(vo);xa=i(wi,"Even though the checkpoint is trained on images of specific size, the model will work on images of any size. The smallest supported image size is 32x32."),wi.forEach(o),vi.forEach(o),Ia=m(O),wo=a(O,"LI",{});var yi=s(wo);De=a(yi,"P",{});var Sr=s(De);Ea=i(Sr,"One can use "),kt=a(Sr,"A",{href:!0});var Ni=s(kt);Pa=i(Ni,"MobileNetV2ImageProcessor"),Ni.forEach(o),za=i(Sr," to prepare images for the model."),Sr.forEach(o),yi.forEach(o),Ca=m(O),yo=a(O,"LI",{});var Mi=s(yo);Oe=a(Mi,"P",{});var kr=s(Oe);Fa=i(kr,"The available image classification checkpoints are pre-trained on "),qe=a(kr,"A",{href:!0,rel:!0});var $i=s(qe);Sa=i($i,"ImageNet-1k"),$i.forEach(o),ka=i(kr," (also referred to as ILSVRC 2012, a collection of 1.3 million images and 1,000 classes). However, the model predicts 1001 classes: the 1000 classes from ImageNet plus an extra \u201Cbackground\u201D class (index 0)."),kr.forEach(o),Mi.forEach(o),Aa=m(O),No=a(O,"LI",{});var Ti=s(No);B=a(Ti,"P",{});var Xt=s(B);ja=i(Xt,"The segmentation model uses a "),Re=a(Xt,"A",{href:!0,rel:!0});var Vi=s(Re);La=i(Vi,"DeepLabV3+"),Vi.forEach(o),Da=i(Xt," head. The available semantic segmentation checkpoints are pre-trained on "),We=a(Xt,"A",{href:!0,rel:!0});var xi=s(We);Oa=i(xi,"PASCAL VOC"),xi.forEach(o),qa=i(Xt,"."),Xt.forEach(o),Ti.forEach(o),Ra=m(O),Mo=a(O,"LI",{});var Ii=s(Mo);G=a(Ii,"P",{});var Kt=s(G);Wa=i(Kt,"The original TensorFlow checkpoints use different padding rules than PyTorch, requiring the model to determine the padding amount at inference time, since this depends on the input image size. To use native PyTorch padding behavior, create a "),At=a(Kt,"A",{href:!0});var Ei=s(At);Ua=i(Ei,"MobileNetV2Config"),Ei.forEach(o),Ha=i(Kt," with "),$o=a(Kt,"CODE",{});var Pi=s($o);Ba=i(Pi,"tf_padding = False"),Pi.forEach(o),Ga=i(Kt,"."),Kt.forEach(o),Ii.forEach(o),O.forEach(o),pr=m(t),jt=a(t,"P",{});var zi=s(jt);Ya=i(zi,"Unsupported features:"),zi.forEach(o),hr=m(t),k=a(t,"UL",{});var Ie=s(k);To=a(Ie,"LI",{});var Ci=s(To);Ue=a(Ci,"P",{});var Ar=s(Ue);Za=i(Ar,"The "),Lt=a(Ar,"A",{href:!0});var Fi=s(Lt);Ja=i(Fi,"MobileNetV2Model"),Fi.forEach(o),Qa=i(Ar," outputs a globally pooled version of the last hidden state. In the original model it is possible to use an average pooling layer with a fixed 7x7 window and stride 1 instead of global pooling. For inputs that are larger than the recommended image size, this gives a pooled output that is larger than 1x1. The Hugging Face implementation does not support this."),Ar.forEach(o),Ci.forEach(o),Xa=m(Ie),Vo=a(Ie,"LI",{});var Si=s(Vo);xo=a(Si,"P",{});var ki=s(xo);Ka=i(ki,"The original TensorFlow checkpoints include quantized models. We do not support these models as they include additional \u201CFakeQuantization\u201D operations to unquantize the weights."),ki.forEach(o),Si.forEach(o),es=m(Ie),Io=a(Ie,"LI",{});var Ai=s(Io);He=a(Ai,"P",{});var jr=s(He);ts=i(jr,"It\u2019s common to extract the output from the expansion layers at indices 10 and 13, as well as the output from the final 1x1 convolution layer, for downstream purposes. Using "),Eo=a(jr,"CODE",{});var ji=s(Eo);os=i(ji,"output_hidden_states=True"),ji.forEach(o),rs=i(jr," returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),jr.forEach(o),Ai.forEach(o),as=m(Ie),Po=a(Ie,"LI",{});var Li=s(Po);Be=a(Li,"P",{});var Lr=s(Be);ss=i(Lr,"The DeepLabV3+ segmentation head does not use the final convolution layer from the backbone, but this layer gets computed anyway. There is currently no way to tell "),Dt=a(Lr,"A",{href:!0});var Di=s(Dt);ns=i(Di,"MobileNetV2Model"),Di.forEach(o),is=i(Lr," up to which layer it should run."),Lr.forEach(o),Li.forEach(o),Ie.forEach(o),fr=m(t),A=a(t,"P",{});var Ee=s(A);ls=i(Ee,"This model was contributed by "),Ge=a(Ee,"A",{href:!0,rel:!0});var Oi=s(Ge);cs=i(Oi,"matthijs"),Oi.forEach(o),ds=i(Ee,". The original code and weights can be found "),Ye=a(Ee,"A",{href:!0,rel:!0});var qi=s(Ye);ms=i(qi,"here for the main model"),qi.forEach(o),ps=i(Ee," and "),Ze=a(Ee,"A",{href:!0,rel:!0});var Ri=s(Ze);hs=i(Ri,"here for DeepLabV3+"),Ri.forEach(o),fs=i(Ee,"."),Ee.forEach(o),gr=m(t),Y=a(t,"H2",{class:!0});var Dr=s(Y);de=a(Dr,"A",{id:!0,class:!0,href:!0});var Wi=s(de);zo=a(Wi,"SPAN",{});var Ui=s(zo);w(Je.$$.fragment,Ui),Ui.forEach(o),Wi.forEach(o),gs=m(Dr),Co=a(Dr,"SPAN",{});var Hi=s(Co);us=i(Hi,"Resources"),Hi.forEach(o),Dr.forEach(o),ur=m(t),Ot=a(t,"P",{});var Bi=s(Ot);_s=i(Bi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV2."),Bi.forEach(o),_r=m(t),w(Qe.$$.fragment,t),br=m(t),qt=a(t,"UL",{});var Gi=s(qt);W=a(Gi,"LI",{});var Pt=s(W);Rt=a(Pt,"A",{href:!0});var Yi=s(Rt);bs=i(Yi,"MobileNetV2ForImageClassification"),Yi.forEach(o),vs=i(Pt," is supported by this "),Xe=a(Pt,"A",{href:!0,rel:!0});var Zi=s(Xe);ws=i(Zi,"example script"),Zi.forEach(o),ys=i(Pt," and "),Ke=a(Pt,"A",{href:!0,rel:!0});var Ji=s(Ke);Ns=i(Ji,"notebook"),Ji.forEach(o),Ms=i(Pt,"."),Pt.forEach(o),Gi.forEach(o),vr=m(t),Wt=a(t,"P",{});var Qi=s(Wt);$s=i(Qi,"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."),Qi.forEach(o),wr=m(t),Z=a(t,"H2",{class:!0});var Or=s(Z);me=a(Or,"A",{id:!0,class:!0,href:!0});var Xi=s(me);Fo=a(Xi,"SPAN",{});var Ki=s(Fo);w(et.$$.fragment,Ki),Ki.forEach(o),Xi.forEach(o),Ts=m(Or),So=a(Or,"SPAN",{});var el=s(So);Vs=i(el,"MobileNetV2Config"),el.forEach(o),Or.forEach(o),yr=m(t),P=a(t,"DIV",{class:!0});var Pe=s(P);w(tt.$$.fragment,Pe),xs=m(Pe),J=a(Pe,"P",{});var eo=s(J);Is=i(eo,"This is the configuration class to store the configuration of a "),Ut=a(eo,"A",{href:!0});var tl=s(Ut);Es=i(tl,"MobileNetV2Model"),tl.forEach(o),Ps=i(eo,`. It is used to instantiate a
MobileNetV2 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 MobileNetV2
`),ot=a(eo,"A",{href:!0,rel:!0});var ol=s(ot);zs=i(ol,"google/mobilenet_v2_1.0_224"),ol.forEach(o),Cs=i(eo," architecture."),eo.forEach(o),Fs=m(Pe),Q=a(Pe,"P",{});var to=s(Q);Ss=i(to,"Configuration objects inherit from "),Ht=a(to,"A",{href:!0});var rl=s(Ht);ks=i(rl,"PretrainedConfig"),rl.forEach(o),As=i(to,` and can be used to control the model outputs. Read the
documentation from `),Bt=a(to,"A",{href:!0});var al=s(Bt);js=i(al,"PretrainedConfig"),al.forEach(o),Ls=i(to," for more information."),to.forEach(o),Ds=m(Pe),w(pe.$$.fragment,Pe),Pe.forEach(o),Nr=m(t),X=a(t,"H2",{class:!0});var qr=s(X);he=a(qr,"A",{id:!0,class:!0,href:!0});var sl=s(he);ko=a(sl,"SPAN",{});var nl=s(ko);w(rt.$$.fragment,nl),nl.forEach(o),sl.forEach(o),Os=m(qr),Ao=a(qr,"SPAN",{});var il=s(Ao);qs=i(il,"MobileNetV2FeatureExtractor"),il.forEach(o),qr.forEach(o),Mr=m(t),q=a(t,"DIV",{class:!0});var oo=s(q);w(at.$$.fragment,oo),Rs=m(oo),fe=a(oo,"DIV",{class:!0});var Rr=s(fe);w(st.$$.fragment,Rr),Ws=m(Rr),jo=a(Rr,"P",{});var ll=s(jo);Us=i(ll,"Preprocess an image or batch of images."),ll.forEach(o),Rr.forEach(o),Hs=m(oo),ge=a(oo,"DIV",{class:!0});var Wr=s(ge);w(nt.$$.fragment,Wr),Bs=m(Wr),it=a(Wr,"P",{});var Ur=s(it);Gs=i(Ur,"Converts the output of "),Gt=a(Ur,"A",{href:!0});var cl=s(Gt);Ys=i(cl,"MobileNetV2ForSemanticSegmentation"),cl.forEach(o),Zs=i(Ur,` into semantic segmentation maps. Only supports
PyTorch.`),Ur.forEach(o),Wr.forEach(o),oo.forEach(o),$r=m(t),K=a(t,"H2",{class:!0});var Hr=s(K);ue=a(Hr,"A",{id:!0,class:!0,href:!0});var dl=s(ue);Lo=a(dl,"SPAN",{});var ml=s(Lo);w(lt.$$.fragment,ml),ml.forEach(o),dl.forEach(o),Js=m(Hr),Do=a(Hr,"SPAN",{});var pl=s(Do);Qs=i(pl,"MobileNetV2ImageProcessor"),pl.forEach(o),Hr.forEach(o),Tr=m(t),z=a(t,"DIV",{class:!0});var ze=s(z);w(ct.$$.fragment,ze),Xs=m(ze),Oo=a(ze,"P",{});var hl=s(Oo);Ks=i(hl,"Constructs a MobileNetV2 image processor."),hl.forEach(o),en=m(ze),_e=a(ze,"DIV",{class:!0});var Br=s(_e);w(dt.$$.fragment,Br),tn=m(Br),qo=a(Br,"P",{});var fl=s(qo);on=i(fl,"Preprocess an image or batch of images."),fl.forEach(o),Br.forEach(o),rn=m(ze),be=a(ze,"DIV",{class:!0});var Gr=s(be);w(mt.$$.fragment,Gr),an=m(Gr),pt=a(Gr,"P",{});var Yr=s(pt);sn=i(Yr,"Converts the output of "),Yt=a(Yr,"A",{href:!0});var gl=s(Yt);nn=i(gl,"MobileNetV2ForSemanticSegmentation"),gl.forEach(o),ln=i(Yr,` into semantic segmentation maps. Only supports
PyTorch.`),Yr.forEach(o),Gr.forEach(o),ze.forEach(o),Vr=m(t),ee=a(t,"H2",{class:!0});var Zr=s(ee);ve=a(Zr,"A",{id:!0,class:!0,href:!0});var ul=s(ve);Ro=a(ul,"SPAN",{});var _l=s(Ro);w(ht.$$.fragment,_l),_l.forEach(o),ul.forEach(o),cn=m(Zr),Wo=a(Zr,"SPAN",{});var bl=s(Wo);dn=i(bl,"MobileNetV2Model"),bl.forEach(o),Zr.forEach(o),xr=m(t),R=a(t,"DIV",{class:!0});var ro=s(R);w(ft.$$.fragment,ro),mn=m(ro),gt=a(ro,"P",{});var Jr=s(gt);pn=i(Jr,`The bare MobileNetV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=a(Jr,"A",{href:!0,rel:!0});var vl=s(ut);hn=i(vl,"torch.nn.Module"),vl.forEach(o),fn=i(Jr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jr.forEach(o),gn=m(ro),j=a(ro,"DIV",{class:!0});var Ce=s(j);w(_t.$$.fragment,Ce),un=m(Ce),te=a(Ce,"P",{});var ao=s(te);_n=i(ao,"The "),Zt=a(ao,"A",{href:!0});var wl=s(Zt);bn=i(wl,"MobileNetV2Model"),wl.forEach(o),vn=i(ao," forward method, overrides the "),Uo=a(ao,"CODE",{});var yl=s(Uo);wn=i(yl,"__call__"),yl.forEach(o),yn=i(ao," special method."),ao.forEach(o),Nn=m(Ce),w(we.$$.fragment,Ce),Mn=m(Ce),w(ye.$$.fragment,Ce),Ce.forEach(o),ro.forEach(o),Ir=m(t),oe=a(t,"H2",{class:!0});var Qr=s(oe);Ne=a(Qr,"A",{id:!0,class:!0,href:!0});var Nl=s(Ne);Ho=a(Nl,"SPAN",{});var Ml=s(Ho);w(bt.$$.fragment,Ml),Ml.forEach(o),Nl.forEach(o),$n=m(Qr),Bo=a(Qr,"SPAN",{});var $l=s(Bo);Tn=i($l,"MobileNetV2ForImageClassification"),$l.forEach(o),Qr.forEach(o),Er=m(t),C=a(t,"DIV",{class:!0});var Fe=s(C);w(vt.$$.fragment,Fe),Vn=m(Fe),Go=a(Fe,"P",{});var Tl=s(Go);xn=i(Tl,`MobileNetV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Tl.forEach(o),In=m(Fe),wt=a(Fe,"P",{});var Xr=s(wt);En=i(Xr,"This model is a PyTorch "),yt=a(Xr,"A",{href:!0,rel:!0});var Vl=s(yt);Pn=i(Vl,"torch.nn.Module"),Vl.forEach(o),zn=i(Xr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xr.forEach(o),Cn=m(Fe),L=a(Fe,"DIV",{class:!0});var Se=s(L);w(Nt.$$.fragment,Se),Fn=m(Se),re=a(Se,"P",{});var so=s(re);Sn=i(so,"The "),Jt=a(so,"A",{href:!0});var xl=s(Jt);kn=i(xl,"MobileNetV2ForImageClassification"),xl.forEach(o),An=i(so," forward method, overrides the "),Yo=a(so,"CODE",{});var Il=s(Yo);jn=i(Il,"__call__"),Il.forEach(o),Ln=i(so," special method."),so.forEach(o),Dn=m(Se),w(Me.$$.fragment,Se),On=m(Se),w($e.$$.fragment,Se),Se.forEach(o),Fe.forEach(o),Pr=m(t),ae=a(t,"H2",{class:!0});var Kr=s(ae);Te=a(Kr,"A",{id:!0,class:!0,href:!0});var El=s(Te);Zo=a(El,"SPAN",{});var Pl=s(Zo);w(Mt.$$.fragment,Pl),Pl.forEach(o),El.forEach(o),qn=m(Kr),Jo=a(Kr,"SPAN",{});var zl=s(Jo);Rn=i(zl,"MobileNetV2ForSemanticSegmentation"),zl.forEach(o),Kr.forEach(o),zr=m(t),F=a(t,"DIV",{class:!0});var ke=s(F);w($t.$$.fragment,ke),Wn=m(ke),Qo=a(ke,"P",{});var Cl=s(Qo);Un=i(Cl,"MobileNetV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),Cl.forEach(o),Hn=m(ke),Tt=a(ke,"P",{});var ea=s(Tt);Bn=i(ea,"This model is a PyTorch "),Vt=a(ea,"A",{href:!0,rel:!0});var Fl=s(Vt);Gn=i(Fl,"torch.nn.Module"),Fl.forEach(o),Yn=i(ea,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ea.forEach(o),Zn=m(ke),D=a(ke,"DIV",{class:!0});var Ae=s(D);w(xt.$$.fragment,Ae),Jn=m(Ae),se=a(Ae,"P",{});var no=s(se);Qn=i(no,"The "),Qt=a(no,"A",{href:!0});var Sl=s(Qt);Xn=i(Sl,"MobileNetV2ForSemanticSegmentation"),Sl.forEach(o),Kn=i(no," forward method, overrides the "),Xo=a(no,"CODE",{});var kl=s(Xo);ei=i(kl,"__call__"),kl.forEach(o),ti=i(no," special method."),no.forEach(o),oi=m(Ae),w(Ve.$$.fragment,Ae),ri=m(Ae),w(xe.$$.fragment,Ae),Ae.forEach(o),ke.forEach(o),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(Jl)),l(g,"id","mobilenet-v2"),l(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"),l(g,"href","#mobilenet-v2"),l(_,"class","relative group"),l(ie,"id","overview"),l(ie,"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"),l(ie,"href","#overview"),l(H,"class","relative group"),l(Le,"href","https://arxiv.org/abs/1801.04381"),l(Le,"rel","nofollow"),l(kt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ImageProcessor"),l(qe,"href","https://huggingface.co/datasets/imagenet-1k"),l(qe,"rel","nofollow"),l(Re,"href","https://arxiv.org/abs/1802.02611"),l(Re,"rel","nofollow"),l(We,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),l(We,"rel","nofollow"),l(At,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config"),l(Lt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(Dt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(Ge,"href","https://huggingface.co/Matthijs"),l(Ge,"rel","nofollow"),l(Ye,"href","https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet"),l(Ye,"rel","nofollow"),l(Ze,"href","https://github.com/tensorflow/models/tree/master/research/deeplab"),l(Ze,"rel","nofollow"),l(de,"id","resources"),l(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"),l(de,"href","#resources"),l(Y,"class","relative group"),l(Rt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForImageClassification"),l(Xe,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),l(Xe,"rel","nofollow"),l(Ke,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),l(Ke,"rel","nofollow"),l(me,"id","transformers.MobileNetV2Config"),l(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"),l(me,"href","#transformers.MobileNetV2Config"),l(Z,"class","relative group"),l(Ut,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(ot,"href","https://huggingface.co/google/mobilenet_v2_1.0_224"),l(ot,"rel","nofollow"),l(Ht,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(Bt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(he,"id","transformers.MobileNetV2FeatureExtractor"),l(he,"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"),l(he,"href","#transformers.MobileNetV2FeatureExtractor"),l(X,"class","relative group"),l(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Gt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"id","transformers.MobileNetV2ImageProcessor"),l(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"),l(ue,"href","#transformers.MobileNetV2ImageProcessor"),l(K,"class","relative group"),l(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Yt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation"),l(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"id","transformers.MobileNetV2Model"),l(ve,"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"),l(ve,"href","#transformers.MobileNetV2Model"),l(ee,"class","relative group"),l(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ut,"rel","nofollow"),l(Zt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ne,"id","transformers.MobileNetV2ForImageClassification"),l(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"),l(Ne,"href","#transformers.MobileNetV2ForImageClassification"),l(oe,"class","relative group"),l(yt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(yt,"rel","nofollow"),l(Jt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForImageClassification"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Te,"id","transformers.MobileNetV2ForSemanticSegmentation"),l(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"),l(Te,"href","#transformers.MobileNetV2ForSemanticSegmentation"),l(ae,"class","relative group"),l(Vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Vt,"rel","nofollow"),l(Qt,"href","/docs/transformers/main/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,f),h(t,T,p),h(t,_,p),e(_,g),e(g,b),y(c,b,null),e(_,u),e(_,I),e(I,aa),h(t,sr,p),h(t,H,p),e(H,ie),e(ie,io),y(je,io,null),e(H,sa),e(H,lo),e(lo,na),h(t,nr,p),h(t,le,p),e(le,ia),e(le,Le),e(Le,la),e(le,ca),h(t,ir,p),h(t,zt,p),e(zt,da),h(t,lr,p),h(t,Ct,p),e(Ct,co),e(co,ma),h(t,cr,p),h(t,Ft,p),e(Ft,mo),e(mo,pa),h(t,dr,p),h(t,St,p),e(St,ha),h(t,mr,p),h(t,x,p),e(x,po),e(po,E),e(E,fa),e(E,ce),e(ce,ga),e(ce,ho),e(ho,ua),e(ce,_a),e(ce,fo),e(fo,ba),e(E,va),e(E,go),e(go,wa),e(E,ya),e(E,uo),e(uo,Na),e(E,Ma),e(E,_o),e(_o,$a),e(E,Ta),e(x,Va),e(x,bo),e(bo,vo),e(vo,xa),e(x,Ia),e(x,wo),e(wo,De),e(De,Ea),e(De,kt),e(kt,Pa),e(De,za),e(x,Ca),e(x,yo),e(yo,Oe),e(Oe,Fa),e(Oe,qe),e(qe,Sa),e(Oe,ka),e(x,Aa),e(x,No),e(No,B),e(B,ja),e(B,Re),e(Re,La),e(B,Da),e(B,We),e(We,Oa),e(B,qa),e(x,Ra),e(x,Mo),e(Mo,G),e(G,Wa),e(G,At),e(At,Ua),e(G,Ha),e(G,$o),e($o,Ba),e(G,Ga),h(t,pr,p),h(t,jt,p),e(jt,Ya),h(t,hr,p),h(t,k,p),e(k,To),e(To,Ue),e(Ue,Za),e(Ue,Lt),e(Lt,Ja),e(Ue,Qa),e(k,Xa),e(k,Vo),e(Vo,xo),e(xo,Ka),e(k,es),e(k,Io),e(Io,He),e(He,ts),e(He,Eo),e(Eo,os),e(He,rs),e(k,as),e(k,Po),e(Po,Be),e(Be,ss),e(Be,Dt),e(Dt,ns),e(Be,is),h(t,fr,p),h(t,A,p),e(A,ls),e(A,Ge),e(Ge,cs),e(A,ds),e(A,Ye),e(Ye,ms),e(A,ps),e(A,Ze),e(Ze,hs),e(A,fs),h(t,gr,p),h(t,Y,p),e(Y,de),e(de,zo),y(Je,zo,null),e(Y,gs),e(Y,Co),e(Co,us),h(t,ur,p),h(t,Ot,p),e(Ot,_s),h(t,_r,p),y(Qe,t,p),h(t,br,p),h(t,qt,p),e(qt,W),e(W,Rt),e(Rt,bs),e(W,vs),e(W,Xe),e(Xe,ws),e(W,ys),e(W,Ke),e(Ke,Ns),e(W,Ms),h(t,vr,p),h(t,Wt,p),e(Wt,$s),h(t,wr,p),h(t,Z,p),e(Z,me),e(me,Fo),y(et,Fo,null),e(Z,Ts),e(Z,So),e(So,Vs),h(t,yr,p),h(t,P,p),y(tt,P,null),e(P,xs),e(P,J),e(J,Is),e(J,Ut),e(Ut,Es),e(J,Ps),e(J,ot),e(ot,zs),e(J,Cs),e(P,Fs),e(P,Q),e(Q,Ss),e(Q,Ht),e(Ht,ks),e(Q,As),e(Q,Bt),e(Bt,js),e(Q,Ls),e(P,Ds),y(pe,P,null),h(t,Nr,p),h(t,X,p),e(X,he),e(he,ko),y(rt,ko,null),e(X,Os),e(X,Ao),e(Ao,qs),h(t,Mr,p),h(t,q,p),y(at,q,null),e(q,Rs),e(q,fe),y(st,fe,null),e(fe,Ws),e(fe,jo),e(jo,Us),e(q,Hs),e(q,ge),y(nt,ge,null),e(ge,Bs),e(ge,it),e(it,Gs),e(it,Gt),e(Gt,Ys),e(it,Zs),h(t,$r,p),h(t,K,p),e(K,ue),e(ue,Lo),y(lt,Lo,null),e(K,Js),e(K,Do),e(Do,Qs),h(t,Tr,p),h(t,z,p),y(ct,z,null),e(z,Xs),e(z,Oo),e(Oo,Ks),e(z,en),e(z,_e),y(dt,_e,null),e(_e,tn),e(_e,qo),e(qo,on),e(z,rn),e(z,be),y(mt,be,null),e(be,an),e(be,pt),e(pt,sn),e(pt,Yt),e(Yt,nn),e(pt,ln),h(t,Vr,p),h(t,ee,p),e(ee,ve),e(ve,Ro),y(ht,Ro,null),e(ee,cn),e(ee,Wo),e(Wo,dn),h(t,xr,p),h(t,R,p),y(ft,R,null),e(R,mn),e(R,gt),e(gt,pn),e(gt,ut),e(ut,hn),e(gt,fn),e(R,gn),e(R,j),y(_t,j,null),e(j,un),e(j,te),e(te,_n),e(te,Zt),e(Zt,bn),e(te,vn),e(te,Uo),e(Uo,wn),e(te,yn),e(j,Nn),y(we,j,null),e(j,Mn),y(ye,j,null),h(t,Ir,p),h(t,oe,p),e(oe,Ne),e(Ne,Ho),y(bt,Ho,null),e(oe,$n),e(oe,Bo),e(Bo,Tn),h(t,Er,p),h(t,C,p),y(vt,C,null),e(C,Vn),e(C,Go),e(Go,xn),e(C,In),e(C,wt),e(wt,En),e(wt,yt),e(yt,Pn),e(wt,zn),e(C,Cn),e(C,L),y(Nt,L,null),e(L,Fn),e(L,re),e(re,Sn),e(re,Jt),e(Jt,kn),e(re,An),e(re,Yo),e(Yo,jn),e(re,Ln),e(L,Dn),y(Me,L,null),e(L,On),y($e,L,null),h(t,Pr,p),h(t,ae,p),e(ae,Te),e(Te,Zo),y(Mt,Zo,null),e(ae,qn),e(ae,Jo),e(Jo,Rn),h(t,zr,p),h(t,F,p),y($t,F,null),e(F,Wn),e(F,Qo),e(Qo,Un),e(F,Hn),e(F,Tt),e(Tt,Bn),e(Tt,Vt),e(Vt,Gn),e(Tt,Yn),e(F,Zn),e(F,D),y(xt,D,null),e(D,Jn),e(D,se),e(se,Qn),e(se,Qt),e(Qt,Xn),e(se,Kn),e(se,Xo),e(Xo,ei),e(se,ti),e(D,oi),y(Ve,D,null),e(D,ri),y(xe,D,null),Cr=!0},p(t,[p]){const It={};p&2&&(It.$$scope={dirty:p,ctx:t}),pe.$set(It);const Ko={};p&2&&(Ko.$$scope={dirty:p,ctx:t}),we.$set(Ko);const er={};p&2&&(er.$$scope={dirty:p,ctx:t}),ye.$set(er);const tr={};p&2&&(tr.$$scope={dirty:p,ctx:t}),Me.$set(tr);const Et={};p&2&&(Et.$$scope={dirty:p,ctx:t}),$e.$set(Et);const or={};p&2&&(or.$$scope={dirty:p,ctx:t}),Ve.$set(or);const rr={};p&2&&(rr.$$scope={dirty:p,ctx:t}),xe.$set(rr)},i(t){Cr||(N(c.$$.fragment,t),N(je.$$.fragment,t),N(Je.$$.fragment,t),N(Qe.$$.fragment,t),N(et.$$.fragment,t),N(tt.$$.fragment,t),N(pe.$$.fragment,t),N(rt.$$.fragment,t),N(at.$$.fragment,t),N(st.$$.fragment,t),N(nt.$$.fragment,t),N(lt.$$.fragment,t),N(ct.$$.fragment,t),N(dt.$$.fragment,t),N(mt.$$.fragment,t),N(ht.$$.fragment,t),N(ft.$$.fragment,t),N(_t.$$.fragment,t),N(we.$$.fragment,t),N(ye.$$.fragment,t),N(bt.$$.fragment,t),N(vt.$$.fragment,t),N(Nt.$$.fragment,t),N(Me.$$.fragment,t),N($e.$$.fragment,t),N(Mt.$$.fragment,t),N($t.$$.fragment,t),N(xt.$$.fragment,t),N(Ve.$$.fragment,t),N(xe.$$.fragment,t),Cr=!0)},o(t){M(c.$$.fragment,t),M(je.$$.fragment,t),M(Je.$$.fragment,t),M(Qe.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),M(pe.$$.fragment,t),M(rt.$$.fragment,t),M(at.$$.fragment,t),M(st.$$.fragment,t),M(nt.$$.fragment,t),M(lt.$$.fragment,t),M(ct.$$.fragment,t),M(dt.$$.fragment,t),M(mt.$$.fragment,t),M(ht.$$.fragment,t),M(ft.$$.fragment,t),M(_t.$$.fragment,t),M(we.$$.fragment,t),M(ye.$$.fragment,t),M(bt.$$.fragment,t),M(vt.$$.fragment,t),M(Nt.$$.fragment,t),M(Me.$$.fragment,t),M($e.$$.fragment,t),M(Mt.$$.fragment,t),M($t.$$.fragment,t),M(xt.$$.fragment,t),M(Ve.$$.fragment,t),M(xe.$$.fragment,t),Cr=!1},d(t){o(f),t&&o(T),t&&o(_),$(c),t&&o(sr),t&&o(H),$(je),t&&o(nr),t&&o(le),t&&o(ir),t&&o(zt),t&&o(lr),t&&o(Ct),t&&o(cr),t&&o(Ft),t&&o(dr),t&&o(St),t&&o(mr),t&&o(x),t&&o(pr),t&&o(jt),t&&o(hr),t&&o(k),t&&o(fr),t&&o(A),t&&o(gr),t&&o(Y),$(Je),t&&o(ur),t&&o(Ot),t&&o(_r),$(Qe,t),t&&o(br),t&&o(qt),t&&o(vr),t&&o(Wt),t&&o(wr),t&&o(Z),$(et),t&&o(yr),t&&o(P),$(tt),$(pe),t&&o(Nr),t&&o(X),$(rt),t&&o(Mr),t&&o(q),$(at),$(st),$(nt),t&&o($r),t&&o(K),$(lt),t&&o(Tr),t&&o(z),$(ct),$(dt),$(mt),t&&o(Vr),t&&o(ee),$(ht),t&&o(xr),t&&o(R),$(ft),$(_t),$(we),$(ye),t&&o(Ir),t&&o(oe),$(bt),t&&o(Er),t&&o(C),$(vt),$(Nt),$(Me),$($e),t&&o(Pr),t&&o(ae),$(Mt),t&&o(zr),t&&o(F),$($t),$(xt),$(Ve),$(xe)}}}const Jl={local:"mobilenet-v2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.MobileNetV2Config",title:"MobileNetV2Config"},{local:"transformers.MobileNetV2FeatureExtractor",title:"MobileNetV2FeatureExtractor"},{local:"transformers.MobileNetV2ImageProcessor",title:"MobileNetV2ImageProcessor"},{local:"transformers.MobileNetV2Model",title:"MobileNetV2Model"},{local:"transformers.MobileNetV2ForImageClassification",title:"MobileNetV2ForImageClassification"},{local:"transformers.MobileNetV2ForSemanticSegmentation",title:"MobileNetV2ForSemanticSegmentation"}],title:"MobileNet V2"};function Ql(V){return Ol(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sc extends Al{constructor(f){super();jl(this,f,Ql,Zl,Ll,{})}}export{sc as default,Jl as metadata};
