import{S as ol,i as tl,s as rl,e as r,k as d,w as y,t as n,M as sl,c as s,d as t,m,a,x as w,h as i,b as c,G as e,g as f,y as N,q as M,o as $,B as T,v as al,L as Ar}from"../../chunks/vendor-hf-doc-builder.js";import{T as En}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as jr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nl(V){let p,v,_,g,b;return g=new Lr({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(){p=r("p"),v=n("Example:"),_=d(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var u=a(p);v=i(u,"Example:"),u.forEach(t),_=m(l),w(g.$$.fragment,l)},m(l,u){f(l,p,u),e(p,v),f(l,_,u),N(g,l,u),b=!0},p:Ar,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){$(g.$$.fragment,l),b=!1},d(l){l&&t(p),l&&t(_),T(g,l)}}}function il(V){let p,v,_,g,b;return{c(){p=r("p"),v=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(l){p=s(l,"P",{});var u=a(p);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var P=a(_);g=i(P,"Module"),P.forEach(t),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(t)},m(l,u){f(l,p,u),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&t(p)}}}function ll(V){let p,v,_,g,b;return g=new Lr({props:{code:`from transformers import MobileNetV2ImageProcessor, MobileNetV2Model
import torch
from datasets import load_dataset

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

feature_extractor = MobileNetV2ImageProcessor.from_pretrained("google/mobilenet_v2_1.0_224")
model = MobileNetV2Model.from_pretrained("google/mobilenet_v2_1.0_224")

inputs = feature_extractor(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> MobileNetV2ImageProcessor, 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>feature_extractor = MobileNetV2ImageProcessor.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 = feature_extractor(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(){p=r("p"),v=n("Example:"),_=d(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var u=a(p);v=i(u,"Example:"),u.forEach(t),_=m(l),w(g.$$.fragment,l)},m(l,u){f(l,p,u),e(p,v),f(l,_,u),N(g,l,u),b=!0},p:Ar,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){$(g.$$.fragment,l),b=!1},d(l){l&&t(p),l&&t(_),T(g,l)}}}function cl(V){let p,v,_,g,b;return{c(){p=r("p"),v=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(l){p=s(l,"P",{});var u=a(p);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var P=a(_);g=i(P,"Module"),P.forEach(t),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(t)},m(l,u){f(l,p,u),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&t(p)}}}function dl(V){let p,v,_,g,b;return g=new Lr({props:{code:`from transformers import MobileNetV2ImageProcessor, MobileNetV2ForImageClassification
import torch
from datasets import load_dataset

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

feature_extractor = MobileNetV2ImageProcessor.from_pretrained("google/mobilenet_v2_1.0_224")
model = MobileNetV2ForImageClassification.from_pretrained("google/mobilenet_v2_1.0_224")

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