import{S as rc,i as ac,s as sc,e as r,k as d,w as v,t as n,M as nc,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 ic,L as pa}from"../../chunks/vendor-hf-doc-builder.js";import{T as wi}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ha}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ma}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as lc}from"../../chunks/PipelineTag-hf-doc-builder.js";function cc(V){let f,T,_,g,b;return g=new ha({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:pa,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 dc(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 E=s(_);g=i(E,"Module"),E.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 mc(V){let f,T,_,g,b;return g=new ha({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:pa,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 pc(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 E=s(_);g=i(E,"Module"),E.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 hc(V){let f,T,_,g,b;return g=new ha({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:pa,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 fc(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 E=s(_);g=i(E,"Module"),E.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 gc(V){let f,T,_,g,b;return g=new ha({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:pa,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 uc(V){let f,T,_,g,b,c,u,E,fa,pr,H,ie,ho,Le,ga,fo,ua,hr,le,_a,De,ba,va,fr,Ct,wa,gr,Ft,go,ya,ur,St,uo,Na,_r,kt,Ma,br,x,_o,I,$a,ce,Ta,bo,Va,xa,vo,Ea,Ia,wo,Pa,za,yo,Ca,Fa,No,Sa,ka,Aa,Mo,$o,ja,La,To,Oe,Da,At,Oa,qa,Ra,Vo,qe,Ua,Re,Wa,Ha,Ba,xo,B,Ga,Ue,Ya,Za,We,Ja,Qa,Xa,Eo,G,Ka,jt,es,ts,Io,os,rs,vr,Lt,as,wr,k,Po,He,ss,Dt,ns,is,ls,zo,Co,cs,ds,Fo,Be,ms,So,ps,hs,fs,ko,Ge,gs,Ot,us,_s,yr,A,bs,Ye,vs,ws,Ze,ys,Ns,Je,Ms,$s,Nr,Y,de,Ao,Qe,Ts,jo,Vs,Mr,qt,xs,$r,Xe,Tr,me,U,Rt,Es,Is,Ke,Ps,zs,et,Cs,Fs,Ss,Ut,ks,Wt,As,Vr,Ht,Lo,js,xr,Bt,Do,Gt,Ls,Er,Yt,Ds,Ir,Z,pe,Oo,tt,Os,qo,qs,Pr,P,ot,Rs,J,Us,Zt,Ws,Hs,rt,Bs,Gs,Ys,Q,Zs,Jt,Js,Qs,Qt,Xs,Ks,en,he,zr,X,fe,Ro,at,tn,Uo,on,Cr,q,st,rn,ge,nt,an,Wo,sn,nn,ue,it,ln,lt,cn,Xt,dn,mn,Fr,K,_e,Ho,ct,pn,Bo,hn,Sr,z,dt,fn,Go,gn,un,be,mt,_n,Yo,bn,vn,ve,pt,wn,ht,yn,Kt,Nn,Mn,kr,ee,we,Zo,ft,$n,Jo,Tn,Ar,R,gt,Vn,ut,xn,_t,En,In,Pn,j,bt,zn,te,Cn,eo,Fn,Sn,Qo,kn,An,jn,ye,Ln,Ne,jr,oe,Me,Xo,vt,Dn,Ko,On,Lr,C,wt,qn,er,Rn,Un,yt,Wn,Nt,Hn,Bn,Gn,L,Mt,Yn,re,Zn,to,Jn,Qn,tr,Xn,Kn,ei,$e,ti,Te,Dr,ae,Ve,or,$t,oi,rr,ri,Or,F,Tt,ai,ar,si,ni,Vt,ii,xt,li,ci,di,D,Et,mi,se,pi,oo,hi,fi,sr,gi,ui,_i,xe,bi,Ee,qr;return c=new ne({}),Le=new ne({}),Qe=new ne({}),Xe=new lc({props:{pipeline:"image-classification"}}),tt=new ne({}),ot=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/v4.29.0/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py#L38"}}),he=new ma({props:{anchor:"transformers.MobileNetV2Config.example",$$slots:{default:[cc]},$$scope:{ctx:V}}}),at=new ne({}),st=new S({props:{name:"class transformers.MobileNetV2FeatureExtractor",anchor:"transformers.MobileNetV2FeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v2/feature_extraction_mobilenet_v2.py#L26"}}),nt=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[str, transformers.utils.generic.TensorType, 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/v4.29.0/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L224"}}),it=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/v4.29.0/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/v4.29.0/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L335",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>
`}}),ct=new ne({}),dt=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/v4.29.0/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L50"}}),mt=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[str, transformers.utils.generic.TensorType, 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/v4.29.0/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L224"}}),pt=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/v4.29.0/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/v4.29.0/src/transformers/models/mobilenet_v2/image_processing_mobilenet_v2.py#L335",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>
`}}),ft=new ne({}),gt=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L502"}}),bt=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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/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/v4.29.0/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>
`}}),ye=new wi({props:{$$slots:{default:[dc]},$$scope:{ctx:V}}}),Ne=new ma({props:{anchor:"transformers.MobileNetV2Model.forward.example",$$slots:{default:[mc]},$$scope:{ctx:V}}}),vt=new ne({}),wt=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L622"}}),Mt=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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L638",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new wi({props:{$$slots:{default:[pc]},$$scope:{ctx:V}}}),Te=new ma({props:{anchor:"transformers.MobileNetV2ForImageClassification.forward.example",$$slots:{default:[hc]},$$scope:{ctx:V}}}),$t=new ne({}),Tt=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L781"}}),Et=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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py#L792",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new wi({props:{$$slots:{default:[fc]},$$scope:{ctx:V}}}),Ee=new ma({props:{anchor:"transformers.MobileNetV2ForSemanticSegmentation.forward.example",$$slots:{default:[gc]},$$scope:{ctx:V}}}),{c(){f=r("meta"),T=d(),_=r("h1"),g=r("a"),b=r("span"),v(c.$$.fragment),u=d(),E=r("span"),fa=n("MobileNet V2"),pr=d(),H=r("h2"),ie=r("a"),ho=r("span"),v(Le.$$.fragment),ga=d(),fo=r("span"),ua=n("Overview"),hr=d(),le=r("p"),_a=n("The MobileNet model was proposed in "),De=r("a"),ba=n("MobileNetV2: Inverted Residuals and Linear Bottlenecks"),va=n(" by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen."),fr=d(),Ct=r("p"),wa=n("The abstract from the paper is the following:"),gr=d(),Ft=r("p"),go=r("em"),ya=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."),ur=d(),St=r("p"),uo=r("em"),Na=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."),_r=d(),kt=r("p"),Ma=n("Tips:"),br=d(),x=r("ul"),_o=r("li"),I=r("p"),$a=n("The checkpoints are named "),ce=r("strong"),Ta=n("mobilenet_v2_"),bo=r("em"),Va=n("depth"),xa=n("_"),vo=r("em"),Ea=n("size"),Ia=n(", for example "),wo=r("strong"),Pa=n("mobilenet_v2_1.0_224"),za=n(", where "),yo=r("strong"),Ca=n("1.0"),Fa=n(" is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),No=r("strong"),Sa=n("224"),ka=n(" is the resolution of the input images the model was trained on."),Aa=d(),Mo=r("li"),$o=r("p"),ja=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."),La=d(),To=r("li"),Oe=r("p"),Da=n("One can use "),At=r("a"),Oa=n("MobileNetV2ImageProcessor"),qa=n(" to prepare images for the model."),Ra=d(),Vo=r("li"),qe=r("p"),Ua=n("The available image classification checkpoints are pre-trained on "),Re=r("a"),Wa=n("ImageNet-1k"),Ha=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)."),Ba=d(),xo=r("li"),B=r("p"),Ga=n("The segmentation model uses a "),Ue=r("a"),Ya=n("DeepLabV3+"),Za=n(" head. The available semantic segmentation checkpoints are pre-trained on "),We=r("a"),Ja=n("PASCAL VOC"),Qa=n("."),Xa=d(),Eo=r("li"),G=r("p"),Ka=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 "),jt=r("a"),es=n("MobileNetV2Config"),ts=n(" with "),Io=r("code"),os=n("tf_padding = False"),rs=n("."),vr=d(),Lt=r("p"),as=n("Unsupported features:"),wr=d(),k=r("ul"),Po=r("li"),He=r("p"),ss=n("The "),Dt=r("a"),ns=n("MobileNetV2Model"),is=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."),ls=d(),zo=r("li"),Co=r("p"),cs=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."),ds=d(),Fo=r("li"),Be=r("p"),ms=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 "),So=r("code"),ps=n("output_hidden_states=True"),hs=n(" returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),fs=d(),ko=r("li"),Ge=r("p"),gs=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 "),Ot=r("a"),us=n("MobileNetV2Model"),_s=n(" up to which layer it should run."),yr=d(),A=r("p"),bs=n("This model was contributed by "),Ye=r("a"),vs=n("matthijs"),ws=n(". The original code and weights can be found "),Ze=r("a"),ys=n("here for the main model"),Ns=n(" and "),Je=r("a"),Ms=n("here for DeepLabV3+"),$s=n("."),Nr=d(),Y=r("h2"),de=r("a"),Ao=r("span"),v(Qe.$$.fragment),Ts=d(),jo=r("span"),Vs=n("Resources"),Mr=d(),qt=r("p"),xs=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV2."),$r=d(),v(Xe.$$.fragment),Tr=d(),me=r("ul"),U=r("li"),Rt=r("a"),Es=n("MobileNetV2ForImageClassification"),Is=n(" is supported by this "),Ke=r("a"),Ps=n("example script"),zs=n(" and "),et=r("a"),Cs=n("notebook"),Fs=n("."),Ss=d(),Ut=r("li"),ks=n("See also: "),Wt=r("a"),As=n("Image classification task guide"),Vr=d(),Ht=r("p"),Lo=r("strong"),js=n("Semantic segmentation"),xr=d(),Bt=r("ul"),Do=r("li"),Gt=r("a"),Ls=n("Semantic segmentation task guide"),Er=d(),Yt=r("p"),Ds=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."),Ir=d(),Z=r("h2"),pe=r("a"),Oo=r("span"),v(tt.$$.fragment),Os=d(),qo=r("span"),qs=n("MobileNetV2Config"),Pr=d(),P=r("div"),v(ot.$$.fragment),Rs=d(),J=r("p"),Us=n("This is the configuration class to store the configuration of a "),Zt=r("a"),Ws=n("MobileNetV2Model"),Hs=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
`),rt=r("a"),Bs=n("google/mobilenet_v2_1.0_224"),Gs=n(" architecture."),Ys=d(),Q=r("p"),Zs=n("Configuration objects inherit from "),Jt=r("a"),Js=n("PretrainedConfig"),Qs=n(` and can be used to control the model outputs. Read the
documentation from `),Qt=r("a"),Xs=n("PretrainedConfig"),Ks=n(" for more information."),en=d(),v(he.$$.fragment),zr=d(),X=r("h2"),fe=r("a"),Ro=r("span"),v(at.$$.fragment),tn=d(),Uo=r("span"),on=n("MobileNetV2FeatureExtractor"),Cr=d(),q=r("div"),v(st.$$.fragment),rn=d(),ge=r("div"),v(nt.$$.fragment),an=d(),Wo=r("p"),sn=n("Preprocess an image or batch of images."),nn=d(),ue=r("div"),v(it.$$.fragment),ln=d(),lt=r("p"),cn=n("Converts the output of "),Xt=r("a"),dn=n("MobileNetV2ForSemanticSegmentation"),mn=n(` into semantic segmentation maps. Only supports
PyTorch.`),Fr=d(),K=r("h2"),_e=r("a"),Ho=r("span"),v(ct.$$.fragment),pn=d(),Bo=r("span"),hn=n("MobileNetV2ImageProcessor"),Sr=d(),z=r("div"),v(dt.$$.fragment),fn=d(),Go=r("p"),gn=n("Constructs a MobileNetV2 image processor."),un=d(),be=r("div"),v(mt.$$.fragment),_n=d(),Yo=r("p"),bn=n("Preprocess an image or batch of images."),vn=d(),ve=r("div"),v(pt.$$.fragment),wn=d(),ht=r("p"),yn=n("Converts the output of "),Kt=r("a"),Nn=n("MobileNetV2ForSemanticSegmentation"),Mn=n(` into semantic segmentation maps. Only supports
PyTorch.`),kr=d(),ee=r("h2"),we=r("a"),Zo=r("span"),v(ft.$$.fragment),$n=d(),Jo=r("span"),Tn=n("MobileNetV2Model"),Ar=d(),R=r("div"),v(gt.$$.fragment),Vn=d(),ut=r("p"),xn=n(`The bare MobileNetV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),_t=r("a"),En=n("torch.nn.Module"),In=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pn=d(),j=r("div"),v(bt.$$.fragment),zn=d(),te=r("p"),Cn=n("The "),eo=r("a"),Fn=n("MobileNetV2Model"),Sn=n(" forward method, overrides the "),Qo=r("code"),kn=n("__call__"),An=n(" special method."),jn=d(),v(ye.$$.fragment),Ln=d(),v(Ne.$$.fragment),jr=d(),oe=r("h2"),Me=r("a"),Xo=r("span"),v(vt.$$.fragment),Dn=d(),Ko=r("span"),On=n("MobileNetV2ForImageClassification"),Lr=d(),C=r("div"),v(wt.$$.fragment),qn=d(),er=r("p"),Rn=n(`MobileNetV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Un=d(),yt=r("p"),Wn=n("This model is a PyTorch "),Nt=r("a"),Hn=n("torch.nn.Module"),Bn=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(),L=r("div"),v(Mt.$$.fragment),Yn=d(),re=r("p"),Zn=n("The "),to=r("a"),Jn=n("MobileNetV2ForImageClassification"),Qn=n(" forward method, overrides the "),tr=r("code"),Xn=n("__call__"),Kn=n(" special method."),ei=d(),v($e.$$.fragment),ti=d(),v(Te.$$.fragment),Dr=d(),ae=r("h2"),Ve=r("a"),or=r("span"),v($t.$$.fragment),oi=d(),rr=r("span"),ri=n("MobileNetV2ForSemanticSegmentation"),Or=d(),F=r("div"),v(Tt.$$.fragment),ai=d(),ar=r("p"),si=n("MobileNetV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),ni=d(),Vt=r("p"),ii=n("This model is a PyTorch "),xt=r("a"),li=n("torch.nn.Module"),ci=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),di=d(),D=r("div"),v(Et.$$.fragment),mi=d(),se=r("p"),pi=n("The "),oo=r("a"),hi=n("MobileNetV2ForSemanticSegmentation"),fi=n(" forward method, overrides the "),sr=r("code"),gi=n("__call__"),ui=n(" special method."),_i=d(),v(xe.$$.fragment),bi=d(),v(Ee.$$.fragment),this.h()},l(t){const p=nc('[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 nr=s(g);b=a(nr,"SPAN",{});var ir=s(b);w(c.$$.fragment,ir),ir.forEach(o),nr.forEach(o),u=m(It),E=a(It,"SPAN",{});var lr=s(E);fa=i(lr,"MobileNet V2"),lr.forEach(o),It.forEach(o),pr=m(t),H=a(t,"H2",{class:!0});var Pt=s(H);ie=a(Pt,"A",{id:!0,class:!0,href:!0});var cr=s(ie);ho=a(cr,"SPAN",{});var dr=s(ho);w(Le.$$.fragment,dr),dr.forEach(o),cr.forEach(o),ga=m(Pt),fo=a(Pt,"SPAN",{});var yi=s(fo);ua=i(yi,"Overview"),yi.forEach(o),Pt.forEach(o),hr=m(t),le=a(t,"P",{});var Rr=s(le);_a=i(Rr,"The MobileNet model was proposed in "),De=a(Rr,"A",{href:!0,rel:!0});var Ni=s(De);ba=i(Ni,"MobileNetV2: Inverted Residuals and Linear Bottlenecks"),Ni.forEach(o),va=i(Rr," by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen."),Rr.forEach(o),fr=m(t),Ct=a(t,"P",{});var Mi=s(Ct);wa=i(Mi,"The abstract from the paper is the following:"),Mi.forEach(o),gr=m(t),Ft=a(t,"P",{});var $i=s(Ft);go=a($i,"EM",{});var Ti=s(go);ya=i(Ti,"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."),Ti.forEach(o),$i.forEach(o),ur=m(t),St=a(t,"P",{});var Vi=s(St);uo=a(Vi,"EM",{});var xi=s(uo);Na=i(xi,"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."),xi.forEach(o),Vi.forEach(o),_r=m(t),kt=a(t,"P",{});var Ei=s(kt);Ma=i(Ei,"Tips:"),Ei.forEach(o),br=m(t),x=a(t,"UL",{});var O=s(x);_o=a(O,"LI",{});var Ii=s(_o);I=a(Ii,"P",{});var W=s(I);$a=i(W,"The checkpoints are named "),ce=a(W,"STRONG",{});var mr=s(ce);Ta=i(mr,"mobilenet_v2_"),bo=a(mr,"EM",{});var Pi=s(bo);Va=i(Pi,"depth"),Pi.forEach(o),xa=i(mr,"_"),vo=a(mr,"EM",{});var zi=s(vo);Ea=i(zi,"size"),zi.forEach(o),mr.forEach(o),Ia=i(W,", for example "),wo=a(W,"STRONG",{});var Ci=s(wo);Pa=i(Ci,"mobilenet_v2_1.0_224"),Ci.forEach(o),za=i(W,", where "),yo=a(W,"STRONG",{});var Fi=s(yo);Ca=i(Fi,"1.0"),Fi.forEach(o),Fa=i(W," is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),No=a(W,"STRONG",{});var Si=s(No);Sa=i(Si,"224"),Si.forEach(o),ka=i(W," is the resolution of the input images the model was trained on."),W.forEach(o),Ii.forEach(o),Aa=m(O),Mo=a(O,"LI",{});var ki=s(Mo);$o=a(ki,"P",{});var Ai=s($o);ja=i(Ai,"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."),Ai.forEach(o),ki.forEach(o),La=m(O),To=a(O,"LI",{});var ji=s(To);Oe=a(ji,"P",{});var Ur=s(Oe);Da=i(Ur,"One can use "),At=a(Ur,"A",{href:!0});var Li=s(At);Oa=i(Li,"MobileNetV2ImageProcessor"),Li.forEach(o),qa=i(Ur," to prepare images for the model."),Ur.forEach(o),ji.forEach(o),Ra=m(O),Vo=a(O,"LI",{});var Di=s(Vo);qe=a(Di,"P",{});var Wr=s(qe);Ua=i(Wr,"The available image classification checkpoints are pre-trained on "),Re=a(Wr,"A",{href:!0,rel:!0});var Oi=s(Re);Wa=i(Oi,"ImageNet-1k"),Oi.forEach(o),Ha=i(Wr," (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)."),Wr.forEach(o),Di.forEach(o),Ba=m(O),xo=a(O,"LI",{});var qi=s(xo);B=a(qi,"P",{});var ro=s(B);Ga=i(ro,"The segmentation model uses a "),Ue=a(ro,"A",{href:!0,rel:!0});var Ri=s(Ue);Ya=i(Ri,"DeepLabV3+"),Ri.forEach(o),Za=i(ro," head. The available semantic segmentation checkpoints are pre-trained on "),We=a(ro,"A",{href:!0,rel:!0});var Ui=s(We);Ja=i(Ui,"PASCAL VOC"),Ui.forEach(o),Qa=i(ro,"."),ro.forEach(o),qi.forEach(o),Xa=m(O),Eo=a(O,"LI",{});var Wi=s(Eo);G=a(Wi,"P",{});var ao=s(G);Ka=i(ao,"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 "),jt=a(ao,"A",{href:!0});var Hi=s(jt);es=i(Hi,"MobileNetV2Config"),Hi.forEach(o),ts=i(ao," with "),Io=a(ao,"CODE",{});var Bi=s(Io);os=i(Bi,"tf_padding = False"),Bi.forEach(o),rs=i(ao,"."),ao.forEach(o),Wi.forEach(o),O.forEach(o),vr=m(t),Lt=a(t,"P",{});var Gi=s(Lt);as=i(Gi,"Unsupported features:"),Gi.forEach(o),wr=m(t),k=a(t,"UL",{});var Ie=s(k);Po=a(Ie,"LI",{});var Yi=s(Po);He=a(Yi,"P",{});var Hr=s(He);ss=i(Hr,"The "),Dt=a(Hr,"A",{href:!0});var Zi=s(Dt);ns=i(Zi,"MobileNetV2Model"),Zi.forEach(o),is=i(Hr," 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."),Hr.forEach(o),Yi.forEach(o),ls=m(Ie),zo=a(Ie,"LI",{});var Ji=s(zo);Co=a(Ji,"P",{});var Qi=s(Co);cs=i(Qi,"The original TensorFlow checkpoints include quantized models. We do not support these models as they include additional \u201CFakeQuantization\u201D operations to unquantize the weights."),Qi.forEach(o),Ji.forEach(o),ds=m(Ie),Fo=a(Ie,"LI",{});var Xi=s(Fo);Be=a(Xi,"P",{});var Br=s(Be);ms=i(Br,"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 "),So=a(Br,"CODE",{});var Ki=s(So);ps=i(Ki,"output_hidden_states=True"),Ki.forEach(o),hs=i(Br," returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),Br.forEach(o),Xi.forEach(o),fs=m(Ie),ko=a(Ie,"LI",{});var el=s(ko);Ge=a(el,"P",{});var Gr=s(Ge);gs=i(Gr,"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 "),Ot=a(Gr,"A",{href:!0});var tl=s(Ot);us=i(tl,"MobileNetV2Model"),tl.forEach(o),_s=i(Gr," up to which layer it should run."),Gr.forEach(o),el.forEach(o),Ie.forEach(o),yr=m(t),A=a(t,"P",{});var Pe=s(A);bs=i(Pe,"This model was contributed by "),Ye=a(Pe,"A",{href:!0,rel:!0});var ol=s(Ye);vs=i(ol,"matthijs"),ol.forEach(o),ws=i(Pe,". The original code and weights can be found "),Ze=a(Pe,"A",{href:!0,rel:!0});var rl=s(Ze);ys=i(rl,"here for the main model"),rl.forEach(o),Ns=i(Pe," and "),Je=a(Pe,"A",{href:!0,rel:!0});var al=s(Je);Ms=i(al,"here for DeepLabV3+"),al.forEach(o),$s=i(Pe,"."),Pe.forEach(o),Nr=m(t),Y=a(t,"H2",{class:!0});var Yr=s(Y);de=a(Yr,"A",{id:!0,class:!0,href:!0});var sl=s(de);Ao=a(sl,"SPAN",{});var nl=s(Ao);w(Qe.$$.fragment,nl),nl.forEach(o),sl.forEach(o),Ts=m(Yr),jo=a(Yr,"SPAN",{});var il=s(jo);Vs=i(il,"Resources"),il.forEach(o),Yr.forEach(o),Mr=m(t),qt=a(t,"P",{});var ll=s(qt);xs=i(ll,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV2."),ll.forEach(o),$r=m(t),w(Xe.$$.fragment,t),Tr=m(t),me=a(t,"UL",{});var Zr=s(me);U=a(Zr,"LI",{});var zt=s(U);Rt=a(zt,"A",{href:!0});var cl=s(Rt);Es=i(cl,"MobileNetV2ForImageClassification"),cl.forEach(o),Is=i(zt," is supported by this "),Ke=a(zt,"A",{href:!0,rel:!0});var dl=s(Ke);Ps=i(dl,"example script"),dl.forEach(o),zs=i(zt," and "),et=a(zt,"A",{href:!0,rel:!0});var ml=s(et);Cs=i(ml,"notebook"),ml.forEach(o),Fs=i(zt,"."),zt.forEach(o),Ss=m(Zr),Ut=a(Zr,"LI",{});var vi=s(Ut);ks=i(vi,"See also: "),Wt=a(vi,"A",{href:!0});var pl=s(Wt);As=i(pl,"Image classification task guide"),pl.forEach(o),vi.forEach(o),Zr.forEach(o),Vr=m(t),Ht=a(t,"P",{});var hl=s(Ht);Lo=a(hl,"STRONG",{});var fl=s(Lo);js=i(fl,"Semantic segmentation"),fl.forEach(o),hl.forEach(o),xr=m(t),Bt=a(t,"UL",{});var gl=s(Bt);Do=a(gl,"LI",{});var ul=s(Do);Gt=a(ul,"A",{href:!0});var _l=s(Gt);Ls=i(_l,"Semantic segmentation task guide"),_l.forEach(o),ul.forEach(o),gl.forEach(o),Er=m(t),Yt=a(t,"P",{});var bl=s(Yt);Ds=i(bl,"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."),bl.forEach(o),Ir=m(t),Z=a(t,"H2",{class:!0});var Jr=s(Z);pe=a(Jr,"A",{id:!0,class:!0,href:!0});var vl=s(pe);Oo=a(vl,"SPAN",{});var wl=s(Oo);w(tt.$$.fragment,wl),wl.forEach(o),vl.forEach(o),Os=m(Jr),qo=a(Jr,"SPAN",{});var yl=s(qo);qs=i(yl,"MobileNetV2Config"),yl.forEach(o),Jr.forEach(o),Pr=m(t),P=a(t,"DIV",{class:!0});var ze=s(P);w(ot.$$.fragment,ze),Rs=m(ze),J=a(ze,"P",{});var so=s(J);Us=i(so,"This is the configuration class to store the configuration of a "),Zt=a(so,"A",{href:!0});var Nl=s(Zt);Ws=i(Nl,"MobileNetV2Model"),Nl.forEach(o),Hs=i(so,`. 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
`),rt=a(so,"A",{href:!0,rel:!0});var Ml=s(rt);Bs=i(Ml,"google/mobilenet_v2_1.0_224"),Ml.forEach(o),Gs=i(so," architecture."),so.forEach(o),Ys=m(ze),Q=a(ze,"P",{});var no=s(Q);Zs=i(no,"Configuration objects inherit from "),Jt=a(no,"A",{href:!0});var $l=s(Jt);Js=i($l,"PretrainedConfig"),$l.forEach(o),Qs=i(no,` and can be used to control the model outputs. Read the
documentation from `),Qt=a(no,"A",{href:!0});var Tl=s(Qt);Xs=i(Tl,"PretrainedConfig"),Tl.forEach(o),Ks=i(no," for more information."),no.forEach(o),en=m(ze),w(he.$$.fragment,ze),ze.forEach(o),zr=m(t),X=a(t,"H2",{class:!0});var Qr=s(X);fe=a(Qr,"A",{id:!0,class:!0,href:!0});var Vl=s(fe);Ro=a(Vl,"SPAN",{});var xl=s(Ro);w(at.$$.fragment,xl),xl.forEach(o),Vl.forEach(o),tn=m(Qr),Uo=a(Qr,"SPAN",{});var El=s(Uo);on=i(El,"MobileNetV2FeatureExtractor"),El.forEach(o),Qr.forEach(o),Cr=m(t),q=a(t,"DIV",{class:!0});var io=s(q);w(st.$$.fragment,io),rn=m(io),ge=a(io,"DIV",{class:!0});var Xr=s(ge);w(nt.$$.fragment,Xr),an=m(Xr),Wo=a(Xr,"P",{});var Il=s(Wo);sn=i(Il,"Preprocess an image or batch of images."),Il.forEach(o),Xr.forEach(o),nn=m(io),ue=a(io,"DIV",{class:!0});var Kr=s(ue);w(it.$$.fragment,Kr),ln=m(Kr),lt=a(Kr,"P",{});var ea=s(lt);cn=i(ea,"Converts the output of "),Xt=a(ea,"A",{href:!0});var Pl=s(Xt);dn=i(Pl,"MobileNetV2ForSemanticSegmentation"),Pl.forEach(o),mn=i(ea,` into semantic segmentation maps. Only supports
PyTorch.`),ea.forEach(o),Kr.forEach(o),io.forEach(o),Fr=m(t),K=a(t,"H2",{class:!0});var ta=s(K);_e=a(ta,"A",{id:!0,class:!0,href:!0});var zl=s(_e);Ho=a(zl,"SPAN",{});var Cl=s(Ho);w(ct.$$.fragment,Cl),Cl.forEach(o),zl.forEach(o),pn=m(ta),Bo=a(ta,"SPAN",{});var Fl=s(Bo);hn=i(Fl,"MobileNetV2ImageProcessor"),Fl.forEach(o),ta.forEach(o),Sr=m(t),z=a(t,"DIV",{class:!0});var Ce=s(z);w(dt.$$.fragment,Ce),fn=m(Ce),Go=a(Ce,"P",{});var Sl=s(Go);gn=i(Sl,"Constructs a MobileNetV2 image processor."),Sl.forEach(o),un=m(Ce),be=a(Ce,"DIV",{class:!0});var oa=s(be);w(mt.$$.fragment,oa),_n=m(oa),Yo=a(oa,"P",{});var kl=s(Yo);bn=i(kl,"Preprocess an image or batch of images."),kl.forEach(o),oa.forEach(o),vn=m(Ce),ve=a(Ce,"DIV",{class:!0});var ra=s(ve);w(pt.$$.fragment,ra),wn=m(ra),ht=a(ra,"P",{});var aa=s(ht);yn=i(aa,"Converts the output of "),Kt=a(aa,"A",{href:!0});var Al=s(Kt);Nn=i(Al,"MobileNetV2ForSemanticSegmentation"),Al.forEach(o),Mn=i(aa,` into semantic segmentation maps. Only supports
PyTorch.`),aa.forEach(o),ra.forEach(o),Ce.forEach(o),kr=m(t),ee=a(t,"H2",{class:!0});var sa=s(ee);we=a(sa,"A",{id:!0,class:!0,href:!0});var jl=s(we);Zo=a(jl,"SPAN",{});var Ll=s(Zo);w(ft.$$.fragment,Ll),Ll.forEach(o),jl.forEach(o),$n=m(sa),Jo=a(sa,"SPAN",{});var Dl=s(Jo);Tn=i(Dl,"MobileNetV2Model"),Dl.forEach(o),sa.forEach(o),Ar=m(t),R=a(t,"DIV",{class:!0});var lo=s(R);w(gt.$$.fragment,lo),Vn=m(lo),ut=a(lo,"P",{});var na=s(ut);xn=i(na,`The bare MobileNetV2 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),_t=a(na,"A",{href:!0,rel:!0});var Ol=s(_t);En=i(Ol,"torch.nn.Module"),Ol.forEach(o),In=i(na,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),na.forEach(o),Pn=m(lo),j=a(lo,"DIV",{class:!0});var Fe=s(j);w(bt.$$.fragment,Fe),zn=m(Fe),te=a(Fe,"P",{});var co=s(te);Cn=i(co,"The "),eo=a(co,"A",{href:!0});var ql=s(eo);Fn=i(ql,"MobileNetV2Model"),ql.forEach(o),Sn=i(co," forward method, overrides the "),Qo=a(co,"CODE",{});var Rl=s(Qo);kn=i(Rl,"__call__"),Rl.forEach(o),An=i(co," special method."),co.forEach(o),jn=m(Fe),w(ye.$$.fragment,Fe),Ln=m(Fe),w(Ne.$$.fragment,Fe),Fe.forEach(o),lo.forEach(o),jr=m(t),oe=a(t,"H2",{class:!0});var ia=s(oe);Me=a(ia,"A",{id:!0,class:!0,href:!0});var Ul=s(Me);Xo=a(Ul,"SPAN",{});var Wl=s(Xo);w(vt.$$.fragment,Wl),Wl.forEach(o),Ul.forEach(o),Dn=m(ia),Ko=a(ia,"SPAN",{});var Hl=s(Ko);On=i(Hl,"MobileNetV2ForImageClassification"),Hl.forEach(o),ia.forEach(o),Lr=m(t),C=a(t,"DIV",{class:!0});var Se=s(C);w(wt.$$.fragment,Se),qn=m(Se),er=a(Se,"P",{});var Bl=s(er);Rn=i(Bl,`MobileNetV2 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Bl.forEach(o),Un=m(Se),yt=a(Se,"P",{});var la=s(yt);Wn=i(la,"This model is a PyTorch "),Nt=a(la,"A",{href:!0,rel:!0});var Gl=s(Nt);Hn=i(Gl,"torch.nn.Module"),Gl.forEach(o),Bn=i(la,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),la.forEach(o),Gn=m(Se),L=a(Se,"DIV",{class:!0});var ke=s(L);w(Mt.$$.fragment,ke),Yn=m(ke),re=a(ke,"P",{});var mo=s(re);Zn=i(mo,"The "),to=a(mo,"A",{href:!0});var Yl=s(to);Jn=i(Yl,"MobileNetV2ForImageClassification"),Yl.forEach(o),Qn=i(mo," forward method, overrides the "),tr=a(mo,"CODE",{});var Zl=s(tr);Xn=i(Zl,"__call__"),Zl.forEach(o),Kn=i(mo," special method."),mo.forEach(o),ei=m(ke),w($e.$$.fragment,ke),ti=m(ke),w(Te.$$.fragment,ke),ke.forEach(o),Se.forEach(o),Dr=m(t),ae=a(t,"H2",{class:!0});var ca=s(ae);Ve=a(ca,"A",{id:!0,class:!0,href:!0});var Jl=s(Ve);or=a(Jl,"SPAN",{});var Ql=s(or);w($t.$$.fragment,Ql),Ql.forEach(o),Jl.forEach(o),oi=m(ca),rr=a(ca,"SPAN",{});var Xl=s(rr);ri=i(Xl,"MobileNetV2ForSemanticSegmentation"),Xl.forEach(o),ca.forEach(o),Or=m(t),F=a(t,"DIV",{class:!0});var Ae=s(F);w(Tt.$$.fragment,Ae),ai=m(Ae),ar=a(Ae,"P",{});var Kl=s(ar);si=i(Kl,"MobileNetV2 model with a semantic segmentation head on top, e.g. for Pascal VOC."),Kl.forEach(o),ni=m(Ae),Vt=a(Ae,"P",{});var da=s(Vt);ii=i(da,"This model is a PyTorch "),xt=a(da,"A",{href:!0,rel:!0});var ec=s(xt);li=i(ec,"torch.nn.Module"),ec.forEach(o),ci=i(da,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),da.forEach(o),di=m(Ae),D=a(Ae,"DIV",{class:!0});var je=s(D);w(Et.$$.fragment,je),mi=m(je),se=a(je,"P",{});var po=s(se);pi=i(po,"The "),oo=a(po,"A",{href:!0});var tc=s(oo);hi=i(tc,"MobileNetV2ForSemanticSegmentation"),tc.forEach(o),fi=i(po," forward method, overrides the "),sr=a(po,"CODE",{});var oc=s(sr);gi=i(oc,"__call__"),oc.forEach(o),ui=i(po," special method."),po.forEach(o),_i=m(je),w(xe.$$.fragment,je),bi=m(je),w(Ee.$$.fragment,je),je.forEach(o),Ae.forEach(o),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(_c)),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(De,"href","https://arxiv.org/abs/1801.04381"),l(De,"rel","nofollow"),l(At,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2ImageProcessor"),l(Re,"href","https://huggingface.co/datasets/imagenet-1k"),l(Re,"rel","nofollow"),l(Ue,"href","https://arxiv.org/abs/1802.02611"),l(Ue,"rel","nofollow"),l(We,"href","http://host.robots.ox.ac.uk/pascal/VOC/"),l(We,"rel","nofollow"),l(jt,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config"),l(Dt,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(Ot,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(Ye,"href","https://huggingface.co/Matthijs"),l(Ye,"rel","nofollow"),l(Ze,"href","https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet"),l(Ze,"rel","nofollow"),l(Je,"href","https://github.com/tensorflow/models/tree/master/research/deeplab"),l(Je,"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/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForImageClassification"),l(Ke,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),l(Ke,"rel","nofollow"),l(et,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),l(et,"rel","nofollow"),l(Wt,"href","../tasks/image_classification"),l(Gt,"href","../tasks/semantic_segmentation"),l(pe,"id","transformers.MobileNetV2Config"),l(pe,"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(pe,"href","#transformers.MobileNetV2Config"),l(Z,"class","relative group"),l(Zt,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2Model"),l(rt,"href","https://huggingface.co/google/mobilenet_v2_1.0_224"),l(rt,"rel","nofollow"),l(Jt,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Qt,"href","/docs/transformers/v4.29.0/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(fe,"id","transformers.MobileNetV2FeatureExtractor"),l(fe,"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(fe,"href","#transformers.MobileNetV2FeatureExtractor"),l(X,"class","relative group"),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(Xt,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation"),l(ue,"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(_e,"id","transformers.MobileNetV2ImageProcessor"),l(_e,"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(_e,"href","#transformers.MobileNetV2ImageProcessor"),l(K,"class","relative group"),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(Kt,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v2#transformers.MobileNetV2ForSemanticSegmentation"),l(ve,"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(we,"id","transformers.MobileNetV2Model"),l(we,"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(we,"href","#transformers.MobileNetV2Model"),l(ee,"class","relative group"),l(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(_t,"rel","nofollow"),l(eo,"href","/docs/transformers/v4.29.0/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(Me,"id","transformers.MobileNetV2ForImageClassification"),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.MobileNetV2ForImageClassification"),l(oe,"class","relative group"),l(Nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Nt,"rel","nofollow"),l(to,"href","/docs/transformers/v4.29.0/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(Ve,"id","transformers.MobileNetV2ForSemanticSegmentation"),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.MobileNetV2ForSemanticSegmentation"),l(ae,"class","relative group"),l(xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(xt,"rel","nofollow"),l(oo,"href","/docs/transformers/v4.29.0/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(_,E),e(E,fa),h(t,pr,p),h(t,H,p),e(H,ie),e(ie,ho),y(Le,ho,null),e(H,ga),e(H,fo),e(fo,ua),h(t,hr,p),h(t,le,p),e(le,_a),e(le,De),e(De,ba),e(le,va),h(t,fr,p),h(t,Ct,p),e(Ct,wa),h(t,gr,p),h(t,Ft,p),e(Ft,go),e(go,ya),h(t,ur,p),h(t,St,p),e(St,uo),e(uo,Na),h(t,_r,p),h(t,kt,p),e(kt,Ma),h(t,br,p),h(t,x,p),e(x,_o),e(_o,I),e(I,$a),e(I,ce),e(ce,Ta),e(ce,bo),e(bo,Va),e(ce,xa),e(ce,vo),e(vo,Ea),e(I,Ia),e(I,wo),e(wo,Pa),e(I,za),e(I,yo),e(yo,Ca),e(I,Fa),e(I,No),e(No,Sa),e(I,ka),e(x,Aa),e(x,Mo),e(Mo,$o),e($o,ja),e(x,La),e(x,To),e(To,Oe),e(Oe,Da),e(Oe,At),e(At,Oa),e(Oe,qa),e(x,Ra),e(x,Vo),e(Vo,qe),e(qe,Ua),e(qe,Re),e(Re,Wa),e(qe,Ha),e(x,Ba),e(x,xo),e(xo,B),e(B,Ga),e(B,Ue),e(Ue,Ya),e(B,Za),e(B,We),e(We,Ja),e(B,Qa),e(x,Xa),e(x,Eo),e(Eo,G),e(G,Ka),e(G,jt),e(jt,es),e(G,ts),e(G,Io),e(Io,os),e(G,rs),h(t,vr,p),h(t,Lt,p),e(Lt,as),h(t,wr,p),h(t,k,p),e(k,Po),e(Po,He),e(He,ss),e(He,Dt),e(Dt,ns),e(He,is),e(k,ls),e(k,zo),e(zo,Co),e(Co,cs),e(k,ds),e(k,Fo),e(Fo,Be),e(Be,ms),e(Be,So),e(So,ps),e(Be,hs),e(k,fs),e(k,ko),e(ko,Ge),e(Ge,gs),e(Ge,Ot),e(Ot,us),e(Ge,_s),h(t,yr,p),h(t,A,p),e(A,bs),e(A,Ye),e(Ye,vs),e(A,ws),e(A,Ze),e(Ze,ys),e(A,Ns),e(A,Je),e(Je,Ms),e(A,$s),h(t,Nr,p),h(t,Y,p),e(Y,de),e(de,Ao),y(Qe,Ao,null),e(Y,Ts),e(Y,jo),e(jo,Vs),h(t,Mr,p),h(t,qt,p),e(qt,xs),h(t,$r,p),y(Xe,t,p),h(t,Tr,p),h(t,me,p),e(me,U),e(U,Rt),e(Rt,Es),e(U,Is),e(U,Ke),e(Ke,Ps),e(U,zs),e(U,et),e(et,Cs),e(U,Fs),e(me,Ss),e(me,Ut),e(Ut,ks),e(Ut,Wt),e(Wt,As),h(t,Vr,p),h(t,Ht,p),e(Ht,Lo),e(Lo,js),h(t,xr,p),h(t,Bt,p),e(Bt,Do),e(Do,Gt),e(Gt,Ls),h(t,Er,p),h(t,Yt,p),e(Yt,Ds),h(t,Ir,p),h(t,Z,p),e(Z,pe),e(pe,Oo),y(tt,Oo,null),e(Z,Os),e(Z,qo),e(qo,qs),h(t,Pr,p),h(t,P,p),y(ot,P,null),e(P,Rs),e(P,J),e(J,Us),e(J,Zt),e(Zt,Ws),e(J,Hs),e(J,rt),e(rt,Bs),e(J,Gs),e(P,Ys),e(P,Q),e(Q,Zs),e(Q,Jt),e(Jt,Js),e(Q,Qs),e(Q,Qt),e(Qt,Xs),e(Q,Ks),e(P,en),y(he,P,null),h(t,zr,p),h(t,X,p),e(X,fe),e(fe,Ro),y(at,Ro,null),e(X,tn),e(X,Uo),e(Uo,on),h(t,Cr,p),h(t,q,p),y(st,q,null),e(q,rn),e(q,ge),y(nt,ge,null),e(ge,an),e(ge,Wo),e(Wo,sn),e(q,nn),e(q,ue),y(it,ue,null),e(ue,ln),e(ue,lt),e(lt,cn),e(lt,Xt),e(Xt,dn),e(lt,mn),h(t,Fr,p),h(t,K,p),e(K,_e),e(_e,Ho),y(ct,Ho,null),e(K,pn),e(K,Bo),e(Bo,hn),h(t,Sr,p),h(t,z,p),y(dt,z,null),e(z,fn),e(z,Go),e(Go,gn),e(z,un),e(z,be),y(mt,be,null),e(be,_n),e(be,Yo),e(Yo,bn),e(z,vn),e(z,ve),y(pt,ve,null),e(ve,wn),e(ve,ht),e(ht,yn),e(ht,Kt),e(Kt,Nn),e(ht,Mn),h(t,kr,p),h(t,ee,p),e(ee,we),e(we,Zo),y(ft,Zo,null),e(ee,$n),e(ee,Jo),e(Jo,Tn),h(t,Ar,p),h(t,R,p),y(gt,R,null),e(R,Vn),e(R,ut),e(ut,xn),e(ut,_t),e(_t,En),e(ut,In),e(R,Pn),e(R,j),y(bt,j,null),e(j,zn),e(j,te),e(te,Cn),e(te,eo),e(eo,Fn),e(te,Sn),e(te,Qo),e(Qo,kn),e(te,An),e(j,jn),y(ye,j,null),e(j,Ln),y(Ne,j,null),h(t,jr,p),h(t,oe,p),e(oe,Me),e(Me,Xo),y(vt,Xo,null),e(oe,Dn),e(oe,Ko),e(Ko,On),h(t,Lr,p),h(t,C,p),y(wt,C,null),e(C,qn),e(C,er),e(er,Rn),e(C,Un),e(C,yt),e(yt,Wn),e(yt,Nt),e(Nt,Hn),e(yt,Bn),e(C,Gn),e(C,L),y(Mt,L,null),e(L,Yn),e(L,re),e(re,Zn),e(re,to),e(to,Jn),e(re,Qn),e(re,tr),e(tr,Xn),e(re,Kn),e(L,ei),y($e,L,null),e(L,ti),y(Te,L,null),h(t,Dr,p),h(t,ae,p),e(ae,Ve),e(Ve,or),y($t,or,null),e(ae,oi),e(ae,rr),e(rr,ri),h(t,Or,p),h(t,F,p),y(Tt,F,null),e(F,ai),e(F,ar),e(ar,si),e(F,ni),e(F,Vt),e(Vt,ii),e(Vt,xt),e(xt,li),e(Vt,ci),e(F,di),e(F,D),y(Et,D,null),e(D,mi),e(D,se),e(se,pi),e(se,oo),e(oo,hi),e(se,fi),e(se,sr),e(sr,gi),e(se,ui),e(D,_i),y(xe,D,null),e(D,bi),y(Ee,D,null),qr=!0},p(t,[p]){const It={};p&2&&(It.$$scope={dirty:p,ctx:t}),he.$set(It);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:t}),ye.$set(nr);const ir={};p&2&&(ir.$$scope={dirty:p,ctx:t}),Ne.$set(ir);const lr={};p&2&&(lr.$$scope={dirty:p,ctx:t}),$e.$set(lr);const Pt={};p&2&&(Pt.$$scope={dirty:p,ctx:t}),Te.$set(Pt);const cr={};p&2&&(cr.$$scope={dirty:p,ctx:t}),xe.$set(cr);const dr={};p&2&&(dr.$$scope={dirty:p,ctx:t}),Ee.$set(dr)},i(t){qr||(N(c.$$.fragment,t),N(Le.$$.fragment,t),N(Qe.$$.fragment,t),N(Xe.$$.fragment,t),N(tt.$$.fragment,t),N(ot.$$.fragment,t),N(he.$$.fragment,t),N(at.$$.fragment,t),N(st.$$.fragment,t),N(nt.$$.fragment,t),N(it.$$.fragment,t),N(ct.$$.fragment,t),N(dt.$$.fragment,t),N(mt.$$.fragment,t),N(pt.$$.fragment,t),N(ft.$$.fragment,t),N(gt.$$.fragment,t),N(bt.$$.fragment,t),N(ye.$$.fragment,t),N(Ne.$$.fragment,t),N(vt.$$.fragment,t),N(wt.$$.fragment,t),N(Mt.$$.fragment,t),N($e.$$.fragment,t),N(Te.$$.fragment,t),N($t.$$.fragment,t),N(Tt.$$.fragment,t),N(Et.$$.fragment,t),N(xe.$$.fragment,t),N(Ee.$$.fragment,t),qr=!0)},o(t){M(c.$$.fragment,t),M(Le.$$.fragment,t),M(Qe.$$.fragment,t),M(Xe.$$.fragment,t),M(tt.$$.fragment,t),M(ot.$$.fragment,t),M(he.$$.fragment,t),M(at.$$.fragment,t),M(st.$$.fragment,t),M(nt.$$.fragment,t),M(it.$$.fragment,t),M(ct.$$.fragment,t),M(dt.$$.fragment,t),M(mt.$$.fragment,t),M(pt.$$.fragment,t),M(ft.$$.fragment,t),M(gt.$$.fragment,t),M(bt.$$.fragment,t),M(ye.$$.fragment,t),M(Ne.$$.fragment,t),M(vt.$$.fragment,t),M(wt.$$.fragment,t),M(Mt.$$.fragment,t),M($e.$$.fragment,t),M(Te.$$.fragment,t),M($t.$$.fragment,t),M(Tt.$$.fragment,t),M(Et.$$.fragment,t),M(xe.$$.fragment,t),M(Ee.$$.fragment,t),qr=!1},d(t){o(f),t&&o(T),t&&o(_),$(c),t&&o(pr),t&&o(H),$(Le),t&&o(hr),t&&o(le),t&&o(fr),t&&o(Ct),t&&o(gr),t&&o(Ft),t&&o(ur),t&&o(St),t&&o(_r),t&&o(kt),t&&o(br),t&&o(x),t&&o(vr),t&&o(Lt),t&&o(wr),t&&o(k),t&&o(yr),t&&o(A),t&&o(Nr),t&&o(Y),$(Qe),t&&o(Mr),t&&o(qt),t&&o($r),$(Xe,t),t&&o(Tr),t&&o(me),t&&o(Vr),t&&o(Ht),t&&o(xr),t&&o(Bt),t&&o(Er),t&&o(Yt),t&&o(Ir),t&&o(Z),$(tt),t&&o(Pr),t&&o(P),$(ot),$(he),t&&o(zr),t&&o(X),$(at),t&&o(Cr),t&&o(q),$(st),$(nt),$(it),t&&o(Fr),t&&o(K),$(ct),t&&o(Sr),t&&o(z),$(dt),$(mt),$(pt),t&&o(kr),t&&o(ee),$(ft),t&&o(Ar),t&&o(R),$(gt),$(bt),$(ye),$(Ne),t&&o(jr),t&&o(oe),$(vt),t&&o(Lr),t&&o(C),$(wt),$(Mt),$($e),$(Te),t&&o(Dr),t&&o(ae),$($t),t&&o(Or),t&&o(F),$(Tt),$(Et),$(xe),$(Ee)}}}const _c={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 bc(V){return ic(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vc extends rc{constructor(f){super();ac(this,f,bc,uc,sc,{})}}export{Vc as default,_c as metadata};
