import{S as oi,i as ti,s as ri,e as r,k as m,w as v,t as n,M as ai,c as a,d as t,m as p,a as s,x as y,h as i,b as l,G as e,g as f,y as w,q as N,o as M,B as $,v as si,L as Fs}from"../../chunks/vendor-hf-doc-builder.js";import{T as ei}from"../../chunks/Tip-hf-doc-builder.js";import{D as ee}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ks}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Me}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Cs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ni}from"../../chunks/PipelineTag-hf-doc-builder.js";function ii(P){let h,T,_,g,b;return g=new ks({props:{code:`from transformers import MobileNetV1Config, MobileNetV1Model

# Initializing a "mobilenet_v1_1.0_224" style configuration
configuration = MobileNetV1Config()

# Initializing a model from the "mobilenet_v1_1.0_224" style configuration
model = MobileNetV1Model(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> MobileNetV1Config, MobileNetV1Model

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

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

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

image_processor = AutoImageProcessor.from_pretrained("google/mobilenet_v1_1.0_224")
model = MobileNetV1Model.from_pretrained("google/mobilenet_v1_1.0_224")

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

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

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileNetV1Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

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

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

image_processor = AutoImageProcessor.from_pretrained("google/mobilenet_v1_1.0_224")
model = MobileNetV1ForImageClassification.from_pretrained("google/mobilenet_v1_1.0_224")

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

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

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, MobileNetV1ForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){h=r("p"),T=n("Example:"),_=m(),v(g.$$.fragment)},l(c){h=a(c,"P",{});var u=s(h);T=i(u,"Example:"),u.forEach(t),_=p(c),y(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,T),f(c,_,u),w(g,c,u),b=!0},p:Fs,i(c){b||(N(g.$$.fragment,c),b=!0)},o(c){M(g.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),$(g,c)}}}function pi(P){let h,T,_,g,b,c,u,k,mr,Nt,q,oe,Co,$e,pr,Fo,fr,Mt,te,hr,Te,gr,ur,$t,no,_r,Tt,io,ko,br,It,lo,vr,Et,I,Ao,E,yr,re,wr,jo,Nr,Mr,Lo,$r,Tr,Do,Ir,Er,Ro,Vr,xr,So,Pr,zr,Cr,qo,Oo,Fr,kr,Wo,Ie,Ar,co,jr,Lr,Dr,Uo,Ee,Rr,Ve,Sr,qr,Or,Ho,O,Wr,mo,Ur,Hr,Bo,Br,Gr,Vt,po,Yr,xt,z,Go,xe,Jr,fo,Kr,Qr,Xr,Yo,Pe,Zr,Jo,ea,oa,ta,Ko,Qo,ra,aa,Xo,ze,sa,Zo,na,ia,Pt,L,la,Ce,ca,da,Fe,ma,pa,zt,W,ae,et,ke,fa,ot,ha,Ct,ho,ga,Ft,Ae,kt,se,D,go,ua,_a,je,ba,va,Le,ya,wa,Na,uo,Ma,_o,$a,At,bo,Ta,jt,U,ne,tt,De,Ia,rt,Ea,Lt,V,Re,Va,H,xa,vo,Pa,za,Se,Ca,Fa,ka,B,Aa,yo,ja,La,wo,Da,Ra,Sa,ie,Dt,G,le,at,qe,qa,st,Oa,Rt,Y,Oe,Wa,ce,We,Ua,nt,Ha,St,J,de,it,Ue,Ba,lt,Ga,qt,A,He,Ya,ct,Ja,Ka,me,Be,Qa,dt,Xa,Ot,K,pe,mt,Ge,Za,pt,es,Wt,j,Ye,os,Je,ts,Ke,rs,as,ss,C,Qe,ns,Q,is,No,ls,cs,ft,ds,ms,ps,fe,fs,he,Ut,X,ge,ht,Xe,hs,gt,gs,Ht,x,Ze,us,ut,_s,bs,eo,vs,oo,ys,ws,Ns,F,to,Ms,Z,$s,Mo,Ts,Is,_t,Es,Vs,xs,ue,Ps,_e,Bt;return c=new Me({}),$e=new Me({}),ke=new Me({}),Ae=new ni({props:{pipeline:"image-classification"}}),De=new Me({}),Re=new ee({props:{name:"class transformers.MobileNetV1Config",anchor:"transformers.MobileNetV1Config",parameters:[{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"depth_multiplier",val:" = 1.0"},{name:"min_depth",val:" = 8"},{name:"hidden_act",val:" = 'relu6'"},{name:"tf_padding",val:" = True"},{name:"classifier_dropout_prob",val:" = 0.999"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 0.001"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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.MobileNetV1Config.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py#L36"}}),ie=new Cs({props:{anchor:"transformers.MobileNetV1Config.example",$$slots:{default:[ii]},$$scope:{ctx:P}}}),qe=new Me({}),Oe=new ee({props:{name:"class transformers.MobileNetV1FeatureExtractor",anchor:"transformers.MobileNetV1FeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/feature_extraction_mobilenet_v1.py#L26"}}),We=new ee({props:{name:"preprocess",anchor:"transformers.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.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.MobileNetV1FeatureExtractor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L218"}}),Ue=new Me({}),He=new ee({props:{name:"class transformers.MobileNetV1ImageProcessor",anchor:"transformers.MobileNetV1ImageProcessor",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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L46"}}),Be=new ee({props:{name:"preprocess",anchor:"transformers.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.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.MobileNetV1ImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L218"}}),Ge=new Me({}),Ye=new ee({props:{name:"class transformers.MobileNetV1Model",anchor:"transformers.MobileNetV1Model",parameters:[{name:"config",val:": MobileNetV1Config"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.MobileNetV1Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config">MobileNetV1Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L301"}}),Qe=new ee({props:{name:"forward",anchor:"transformers.MobileNetV1Model.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.MobileNetV1Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileNetV1ImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileNetV1Model.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.MobileNetV1Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L355",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config"
>MobileNetV1Config</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>
`}}),fe=new ei({props:{$$slots:{default:[li]},$$scope:{ctx:P}}}),he=new Cs({props:{anchor:"transformers.MobileNetV1Model.forward.example",$$slots:{default:[ci]},$$scope:{ctx:P}}}),Xe=new Me({}),Ze=new ee({props:{name:"class transformers.MobileNetV1ForImageClassification",anchor:"transformers.MobileNetV1ForImageClassification",parameters:[{name:"config",val:": MobileNetV1Config"}],parametersDescription:[{anchor:"transformers.MobileNetV1ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config">MobileNetV1Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L411"}}),to=new ee({props:{name:"forward",anchor:"transformers.MobileNetV1ForImageClassification.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.MobileNetV1ForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">MobileNetV1ImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.MobileNetV1ForImageClassification.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.MobileNetV1ForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileNetV1ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss). If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L427",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config"
>MobileNetV1Config</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new ei({props:{$$slots:{default:[di]},$$scope:{ctx:P}}}),_e=new Cs({props:{anchor:"transformers.MobileNetV1ForImageClassification.forward.example",$$slots:{default:[mi]},$$scope:{ctx:P}}}),{c(){h=r("meta"),T=m(),_=r("h1"),g=r("a"),b=r("span"),v(c.$$.fragment),u=m(),k=r("span"),mr=n("MobileNet V1"),Nt=m(),q=r("h2"),oe=r("a"),Co=r("span"),v($e.$$.fragment),pr=m(),Fo=r("span"),fr=n("Overview"),Mt=m(),te=r("p"),hr=n("The MobileNet model was proposed in "),Te=r("a"),gr=n("MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications"),ur=n(" by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam."),$t=m(),no=r("p"),_r=n("The abstract from the paper is the following:"),Tt=m(),io=r("p"),ko=r("em"),br=n("We present a class of efficient models called MobileNets for mobile and embedded vision applications. MobileNets are based on a streamlined architecture that uses depth-wise separable convolutions to build light weight deep neural networks. We introduce two simple global hyper-parameters that efficiently trade off between latency and accuracy. These hyper-parameters allow the model builder to choose the right sized model for their application based on the constraints of the problem. We present extensive experiments on resource and accuracy tradeoffs and show strong performance compared to other popular models on ImageNet classification. We then demonstrate the effectiveness of MobileNets across a wide range of applications and use cases including object detection, finegrain classification, face attributes and large scale geo-localization."),It=m(),lo=r("p"),vr=n("Tips:"),Et=m(),I=r("ul"),Ao=r("li"),E=r("p"),yr=n("The checkpoints are named "),re=r("strong"),wr=n("mobilenet_v1_"),jo=r("em"),Nr=n("depth"),Mr=n("_"),Lo=r("em"),$r=n("size"),Tr=n(", for example "),Do=r("strong"),Ir=n("mobilenet_v1_1.0_224"),Er=n(", where "),Ro=r("strong"),Vr=n("1.0"),xr=n(" is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),So=r("strong"),Pr=n("224"),zr=n(" is the resolution of the input images the model was trained on."),Cr=m(),qo=r("li"),Oo=r("p"),Fr=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."),kr=m(),Wo=r("li"),Ie=r("p"),Ar=n("One can use "),co=r("a"),jr=n("MobileNetV1ImageProcessor"),Lr=n(" to prepare images for the model."),Dr=m(),Uo=r("li"),Ee=r("p"),Rr=n("The available image classification checkpoints are pre-trained on "),Ve=r("a"),Sr=n("ImageNet-1k"),qr=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)."),Or=m(),Ho=r("li"),O=r("p"),Wr=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 "),mo=r("a"),Ur=n("MobileNetV1Config"),Hr=n(" with "),Bo=r("code"),Br=n("tf_padding = False"),Gr=n("."),Vt=m(),po=r("p"),Yr=n("Unsupported features:"),xt=m(),z=r("ul"),Go=r("li"),xe=r("p"),Jr=n("The "),fo=r("a"),Kr=n("MobileNetV1Model"),Qr=n(" outputs a globally pooled version of the last hidden state. In the original model it is possible to use a 7x7 average pooling layer with stride 2 instead of global pooling. For larger inputs, this gives a pooled output that is larger than 1x1 pixel. The HuggingFace implementation does not support this."),Xr=m(),Yo=r("li"),Pe=r("p"),Zr=n("It is currently not possible to specify an "),Jo=r("code"),ea=n("output_stride"),oa=n(". For smaller output strides, the original model invokes dilated convolution to prevent the spatial resolution from being reduced further. The output stride of the HuggingFace model is always 32."),ta=m(),Ko=r("li"),Qo=r("p"),ra=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."),aa=m(),Xo=r("li"),ze=r("p"),sa=n("It\u2019s common to extract the output from the pointwise layers at indices 5, 11, 12, 13 for downstream purposes. Using "),Zo=r("code"),na=n("output_hidden_states=True"),ia=n(" returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),Pt=m(),L=r("p"),la=n("This model was contributed by "),Ce=r("a"),ca=n("matthijs"),da=n(". The original code and weights can be found "),Fe=r("a"),ma=n("here"),pa=n("."),zt=m(),W=r("h2"),ae=r("a"),et=r("span"),v(ke.$$.fragment),fa=m(),ot=r("span"),ha=n("Resources"),Ct=m(),ho=r("p"),ga=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV1."),Ft=m(),v(Ae.$$.fragment),kt=m(),se=r("ul"),D=r("li"),go=r("a"),ua=n("MobileNetV1ForImageClassification"),_a=n(" is supported by this "),je=r("a"),ba=n("example script"),va=n(" and "),Le=r("a"),ya=n("notebook"),wa=n("."),Na=m(),uo=r("li"),Ma=n("See also: "),_o=r("a"),$a=n("Image classification task guide"),At=m(),bo=r("p"),Ta=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),jt=m(),U=r("h2"),ne=r("a"),tt=r("span"),v(De.$$.fragment),Ia=m(),rt=r("span"),Ea=n("MobileNetV1Config"),Lt=m(),V=r("div"),v(Re.$$.fragment),Va=m(),H=r("p"),xa=n("This is the configuration class to store the configuration of a "),vo=r("a"),Pa=n("MobileNetV1Model"),za=n(`. It is used to instantiate a
MobileNetV1 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 MobileNetV1
`),Se=r("a"),Ca=n("google/mobilenet_v1_1.0_224"),Fa=n(" architecture."),ka=m(),B=r("p"),Aa=n("Configuration objects inherit from "),yo=r("a"),ja=n("PretrainedConfig"),La=n(` and can be used to control the model outputs. Read the
documentation from `),wo=r("a"),Da=n("PretrainedConfig"),Ra=n(" for more information."),Sa=m(),v(ie.$$.fragment),Dt=m(),G=r("h2"),le=r("a"),at=r("span"),v(qe.$$.fragment),qa=m(),st=r("span"),Oa=n("MobileNetV1FeatureExtractor"),Rt=m(),Y=r("div"),v(Oe.$$.fragment),Wa=m(),ce=r("div"),v(We.$$.fragment),Ua=m(),nt=r("p"),Ha=n("Preprocess an image or batch of images."),St=m(),J=r("h2"),de=r("a"),it=r("span"),v(Ue.$$.fragment),Ba=m(),lt=r("span"),Ga=n("MobileNetV1ImageProcessor"),qt=m(),A=r("div"),v(He.$$.fragment),Ya=m(),ct=r("p"),Ja=n("Constructs a MobileNetV1 image processor."),Ka=m(),me=r("div"),v(Be.$$.fragment),Qa=m(),dt=r("p"),Xa=n("Preprocess an image or batch of images."),Ot=m(),K=r("h2"),pe=r("a"),mt=r("span"),v(Ge.$$.fragment),Za=m(),pt=r("span"),es=n("MobileNetV1Model"),Wt=m(),j=r("div"),v(Ye.$$.fragment),os=m(),Je=r("p"),ts=n(`The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ke=r("a"),rs=n("torch.nn.Module"),as=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ss=m(),C=r("div"),v(Qe.$$.fragment),ns=m(),Q=r("p"),is=n("The "),No=r("a"),ls=n("MobileNetV1Model"),cs=n(" forward method, overrides the "),ft=r("code"),ds=n("__call__"),ms=n(" special method."),ps=m(),v(fe.$$.fragment),fs=m(),v(he.$$.fragment),Ut=m(),X=r("h2"),ge=r("a"),ht=r("span"),v(Xe.$$.fragment),hs=m(),gt=r("span"),gs=n("MobileNetV1ForImageClassification"),Ht=m(),x=r("div"),v(Ze.$$.fragment),us=m(),ut=r("p"),_s=n(`MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),bs=m(),eo=r("p"),vs=n("This model is a PyTorch "),oo=r("a"),ys=n("torch.nn.Module"),ws=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ns=m(),F=r("div"),v(to.$$.fragment),Ms=m(),Z=r("p"),$s=n("The "),Mo=r("a"),Ts=n("MobileNetV1ForImageClassification"),Is=n(" forward method, overrides the "),_t=r("code"),Es=n("__call__"),Vs=n(" special method."),xs=m(),v(ue.$$.fragment),Ps=m(),v(_e.$$.fragment),this.h()},l(o){const d=ai('[data-svelte="svelte-1phssyn"]',document.head);h=a(d,"META",{name:!0,content:!0}),d.forEach(t),T=p(o),_=a(o,"H1",{class:!0});var ro=s(_);g=a(ro,"A",{id:!0,class:!0,href:!0});var bt=s(g);b=a(bt,"SPAN",{});var vt=s(b);y(c.$$.fragment,vt),vt.forEach(t),bt.forEach(t),u=p(ro),k=a(ro,"SPAN",{});var yt=s(k);mr=i(yt,"MobileNet V1"),yt.forEach(t),ro.forEach(t),Nt=p(o),q=a(o,"H2",{class:!0});var ao=s(q);oe=a(ao,"A",{id:!0,class:!0,href:!0});var As=s(oe);Co=a(As,"SPAN",{});var js=s(Co);y($e.$$.fragment,js),js.forEach(t),As.forEach(t),pr=p(ao),Fo=a(ao,"SPAN",{});var Ls=s(Fo);fr=i(Ls,"Overview"),Ls.forEach(t),ao.forEach(t),Mt=p(o),te=a(o,"P",{});var Gt=s(te);hr=i(Gt,"The MobileNet model was proposed in "),Te=a(Gt,"A",{href:!0,rel:!0});var Ds=s(Te);gr=i(Ds,"MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications"),Ds.forEach(t),ur=i(Gt," by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam."),Gt.forEach(t),$t=p(o),no=a(o,"P",{});var Rs=s(no);_r=i(Rs,"The abstract from the paper is the following:"),Rs.forEach(t),Tt=p(o),io=a(o,"P",{});var Ss=s(io);ko=a(Ss,"EM",{});var qs=s(ko);br=i(qs,"We present a class of efficient models called MobileNets for mobile and embedded vision applications. MobileNets are based on a streamlined architecture that uses depth-wise separable convolutions to build light weight deep neural networks. We introduce two simple global hyper-parameters that efficiently trade off between latency and accuracy. These hyper-parameters allow the model builder to choose the right sized model for their application based on the constraints of the problem. We present extensive experiments on resource and accuracy tradeoffs and show strong performance compared to other popular models on ImageNet classification. We then demonstrate the effectiveness of MobileNets across a wide range of applications and use cases including object detection, finegrain classification, face attributes and large scale geo-localization."),qs.forEach(t),Ss.forEach(t),It=p(o),lo=a(o,"P",{});var Os=s(lo);vr=i(Os,"Tips:"),Os.forEach(t),Et=p(o),I=a(o,"UL",{});var R=s(I);Ao=a(R,"LI",{});var Ws=s(Ao);E=a(Ws,"P",{});var S=s(E);yr=i(S,"The checkpoints are named "),re=a(S,"STRONG",{});var wt=s(re);wr=i(wt,"mobilenet_v1_"),jo=a(wt,"EM",{});var Us=s(jo);Nr=i(Us,"depth"),Us.forEach(t),Mr=i(wt,"_"),Lo=a(wt,"EM",{});var Hs=s(Lo);$r=i(Hs,"size"),Hs.forEach(t),wt.forEach(t),Tr=i(S,", for example "),Do=a(S,"STRONG",{});var Bs=s(Do);Ir=i(Bs,"mobilenet_v1_1.0_224"),Bs.forEach(t),Er=i(S,", where "),Ro=a(S,"STRONG",{});var Gs=s(Ro);Vr=i(Gs,"1.0"),Gs.forEach(t),xr=i(S," is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),So=a(S,"STRONG",{});var Ys=s(So);Pr=i(Ys,"224"),Ys.forEach(t),zr=i(S," is the resolution of the input images the model was trained on."),S.forEach(t),Ws.forEach(t),Cr=p(R),qo=a(R,"LI",{});var Js=s(qo);Oo=a(Js,"P",{});var Ks=s(Oo);Fr=i(Ks,"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."),Ks.forEach(t),Js.forEach(t),kr=p(R),Wo=a(R,"LI",{});var Qs=s(Wo);Ie=a(Qs,"P",{});var Yt=s(Ie);Ar=i(Yt,"One can use "),co=a(Yt,"A",{href:!0});var Xs=s(co);jr=i(Xs,"MobileNetV1ImageProcessor"),Xs.forEach(t),Lr=i(Yt," to prepare images for the model."),Yt.forEach(t),Qs.forEach(t),Dr=p(R),Uo=a(R,"LI",{});var Zs=s(Uo);Ee=a(Zs,"P",{});var Jt=s(Ee);Rr=i(Jt,"The available image classification checkpoints are pre-trained on "),Ve=a(Jt,"A",{href:!0,rel:!0});var en=s(Ve);Sr=i(en,"ImageNet-1k"),en.forEach(t),qr=i(Jt," (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)."),Jt.forEach(t),Zs.forEach(t),Or=p(R),Ho=a(R,"LI",{});var on=s(Ho);O=a(on,"P",{});var $o=s(O);Wr=i($o,"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 "),mo=a($o,"A",{href:!0});var tn=s(mo);Ur=i(tn,"MobileNetV1Config"),tn.forEach(t),Hr=i($o," with "),Bo=a($o,"CODE",{});var rn=s(Bo);Br=i(rn,"tf_padding = False"),rn.forEach(t),Gr=i($o,"."),$o.forEach(t),on.forEach(t),R.forEach(t),Vt=p(o),po=a(o,"P",{});var an=s(po);Yr=i(an,"Unsupported features:"),an.forEach(t),xt=p(o),z=a(o,"UL",{});var be=s(z);Go=a(be,"LI",{});var sn=s(Go);xe=a(sn,"P",{});var Kt=s(xe);Jr=i(Kt,"The "),fo=a(Kt,"A",{href:!0});var nn=s(fo);Kr=i(nn,"MobileNetV1Model"),nn.forEach(t),Qr=i(Kt," outputs a globally pooled version of the last hidden state. In the original model it is possible to use a 7x7 average pooling layer with stride 2 instead of global pooling. For larger inputs, this gives a pooled output that is larger than 1x1 pixel. The HuggingFace implementation does not support this."),Kt.forEach(t),sn.forEach(t),Xr=p(be),Yo=a(be,"LI",{});var ln=s(Yo);Pe=a(ln,"P",{});var Qt=s(Pe);Zr=i(Qt,"It is currently not possible to specify an "),Jo=a(Qt,"CODE",{});var cn=s(Jo);ea=i(cn,"output_stride"),cn.forEach(t),oa=i(Qt,". For smaller output strides, the original model invokes dilated convolution to prevent the spatial resolution from being reduced further. The output stride of the HuggingFace model is always 32."),Qt.forEach(t),ln.forEach(t),ta=p(be),Ko=a(be,"LI",{});var dn=s(Ko);Qo=a(dn,"P",{});var mn=s(Qo);ra=i(mn,"The original TensorFlow checkpoints include quantized models. We do not support these models as they include additional \u201CFakeQuantization\u201D operations to unquantize the weights."),mn.forEach(t),dn.forEach(t),aa=p(be),Xo=a(be,"LI",{});var pn=s(Xo);ze=a(pn,"P",{});var Xt=s(ze);sa=i(Xt,"It\u2019s common to extract the output from the pointwise layers at indices 5, 11, 12, 13 for downstream purposes. Using "),Zo=a(Xt,"CODE",{});var fn=s(Zo);na=i(fn,"output_hidden_states=True"),fn.forEach(t),ia=i(Xt," returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),Xt.forEach(t),pn.forEach(t),be.forEach(t),Pt=p(o),L=a(o,"P",{});var To=s(L);la=i(To,"This model was contributed by "),Ce=a(To,"A",{href:!0,rel:!0});var hn=s(Ce);ca=i(hn,"matthijs"),hn.forEach(t),da=i(To,". The original code and weights can be found "),Fe=a(To,"A",{href:!0,rel:!0});var gn=s(Fe);ma=i(gn,"here"),gn.forEach(t),pa=i(To,"."),To.forEach(t),zt=p(o),W=a(o,"H2",{class:!0});var Zt=s(W);ae=a(Zt,"A",{id:!0,class:!0,href:!0});var un=s(ae);et=a(un,"SPAN",{});var _n=s(et);y(ke.$$.fragment,_n),_n.forEach(t),un.forEach(t),fa=p(Zt),ot=a(Zt,"SPAN",{});var bn=s(ot);ha=i(bn,"Resources"),bn.forEach(t),Zt.forEach(t),Ct=p(o),ho=a(o,"P",{});var vn=s(ho);ga=i(vn,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with MobileNetV1."),vn.forEach(t),Ft=p(o),y(Ae.$$.fragment,o),kt=p(o),se=a(o,"UL",{});var er=s(se);D=a(er,"LI",{});var so=s(D);go=a(so,"A",{href:!0});var yn=s(go);ua=i(yn,"MobileNetV1ForImageClassification"),yn.forEach(t),_a=i(so," is supported by this "),je=a(so,"A",{href:!0,rel:!0});var wn=s(je);ba=i(wn,"example script"),wn.forEach(t),va=i(so," and "),Le=a(so,"A",{href:!0,rel:!0});var Nn=s(Le);ya=i(Nn,"notebook"),Nn.forEach(t),wa=i(so,"."),so.forEach(t),Na=p(er),uo=a(er,"LI",{});var zs=s(uo);Ma=i(zs,"See also: "),_o=a(zs,"A",{href:!0});var Mn=s(_o);$a=i(Mn,"Image classification task guide"),Mn.forEach(t),zs.forEach(t),er.forEach(t),At=p(o),bo=a(o,"P",{});var $n=s(bo);Ta=i($n,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),$n.forEach(t),jt=p(o),U=a(o,"H2",{class:!0});var or=s(U);ne=a(or,"A",{id:!0,class:!0,href:!0});var Tn=s(ne);tt=a(Tn,"SPAN",{});var In=s(tt);y(De.$$.fragment,In),In.forEach(t),Tn.forEach(t),Ia=p(or),rt=a(or,"SPAN",{});var En=s(rt);Ea=i(En,"MobileNetV1Config"),En.forEach(t),or.forEach(t),Lt=p(o),V=a(o,"DIV",{class:!0});var ve=s(V);y(Re.$$.fragment,ve),Va=p(ve),H=a(ve,"P",{});var Io=s(H);xa=i(Io,"This is the configuration class to store the configuration of a "),vo=a(Io,"A",{href:!0});var Vn=s(vo);Pa=i(Vn,"MobileNetV1Model"),Vn.forEach(t),za=i(Io,`. It is used to instantiate a
MobileNetV1 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 MobileNetV1
`),Se=a(Io,"A",{href:!0,rel:!0});var xn=s(Se);Ca=i(xn,"google/mobilenet_v1_1.0_224"),xn.forEach(t),Fa=i(Io," architecture."),Io.forEach(t),ka=p(ve),B=a(ve,"P",{});var Eo=s(B);Aa=i(Eo,"Configuration objects inherit from "),yo=a(Eo,"A",{href:!0});var Pn=s(yo);ja=i(Pn,"PretrainedConfig"),Pn.forEach(t),La=i(Eo,` and can be used to control the model outputs. Read the
documentation from `),wo=a(Eo,"A",{href:!0});var zn=s(wo);Da=i(zn,"PretrainedConfig"),zn.forEach(t),Ra=i(Eo," for more information."),Eo.forEach(t),Sa=p(ve),y(ie.$$.fragment,ve),ve.forEach(t),Dt=p(o),G=a(o,"H2",{class:!0});var tr=s(G);le=a(tr,"A",{id:!0,class:!0,href:!0});var Cn=s(le);at=a(Cn,"SPAN",{});var Fn=s(at);y(qe.$$.fragment,Fn),Fn.forEach(t),Cn.forEach(t),qa=p(tr),st=a(tr,"SPAN",{});var kn=s(st);Oa=i(kn,"MobileNetV1FeatureExtractor"),kn.forEach(t),tr.forEach(t),Rt=p(o),Y=a(o,"DIV",{class:!0});var rr=s(Y);y(Oe.$$.fragment,rr),Wa=p(rr),ce=a(rr,"DIV",{class:!0});var ar=s(ce);y(We.$$.fragment,ar),Ua=p(ar),nt=a(ar,"P",{});var An=s(nt);Ha=i(An,"Preprocess an image or batch of images."),An.forEach(t),ar.forEach(t),rr.forEach(t),St=p(o),J=a(o,"H2",{class:!0});var sr=s(J);de=a(sr,"A",{id:!0,class:!0,href:!0});var jn=s(de);it=a(jn,"SPAN",{});var Ln=s(it);y(Ue.$$.fragment,Ln),Ln.forEach(t),jn.forEach(t),Ba=p(sr),lt=a(sr,"SPAN",{});var Dn=s(lt);Ga=i(Dn,"MobileNetV1ImageProcessor"),Dn.forEach(t),sr.forEach(t),qt=p(o),A=a(o,"DIV",{class:!0});var Vo=s(A);y(He.$$.fragment,Vo),Ya=p(Vo),ct=a(Vo,"P",{});var Rn=s(ct);Ja=i(Rn,"Constructs a MobileNetV1 image processor."),Rn.forEach(t),Ka=p(Vo),me=a(Vo,"DIV",{class:!0});var nr=s(me);y(Be.$$.fragment,nr),Qa=p(nr),dt=a(nr,"P",{});var Sn=s(dt);Xa=i(Sn,"Preprocess an image or batch of images."),Sn.forEach(t),nr.forEach(t),Vo.forEach(t),Ot=p(o),K=a(o,"H2",{class:!0});var ir=s(K);pe=a(ir,"A",{id:!0,class:!0,href:!0});var qn=s(pe);mt=a(qn,"SPAN",{});var On=s(mt);y(Ge.$$.fragment,On),On.forEach(t),qn.forEach(t),Za=p(ir),pt=a(ir,"SPAN",{});var Wn=s(pt);es=i(Wn,"MobileNetV1Model"),Wn.forEach(t),ir.forEach(t),Wt=p(o),j=a(o,"DIV",{class:!0});var xo=s(j);y(Ye.$$.fragment,xo),os=p(xo),Je=a(xo,"P",{});var lr=s(Je);ts=i(lr,`The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ke=a(lr,"A",{href:!0,rel:!0});var Un=s(Ke);rs=i(Un,"torch.nn.Module"),Un.forEach(t),as=i(lr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),lr.forEach(t),ss=p(xo),C=a(xo,"DIV",{class:!0});var ye=s(C);y(Qe.$$.fragment,ye),ns=p(ye),Q=a(ye,"P",{});var Po=s(Q);is=i(Po,"The "),No=a(Po,"A",{href:!0});var Hn=s(No);ls=i(Hn,"MobileNetV1Model"),Hn.forEach(t),cs=i(Po," forward method, overrides the "),ft=a(Po,"CODE",{});var Bn=s(ft);ds=i(Bn,"__call__"),Bn.forEach(t),ms=i(Po," special method."),Po.forEach(t),ps=p(ye),y(fe.$$.fragment,ye),fs=p(ye),y(he.$$.fragment,ye),ye.forEach(t),xo.forEach(t),Ut=p(o),X=a(o,"H2",{class:!0});var cr=s(X);ge=a(cr,"A",{id:!0,class:!0,href:!0});var Gn=s(ge);ht=a(Gn,"SPAN",{});var Yn=s(ht);y(Xe.$$.fragment,Yn),Yn.forEach(t),Gn.forEach(t),hs=p(cr),gt=a(cr,"SPAN",{});var Jn=s(gt);gs=i(Jn,"MobileNetV1ForImageClassification"),Jn.forEach(t),cr.forEach(t),Ht=p(o),x=a(o,"DIV",{class:!0});var we=s(x);y(Ze.$$.fragment,we),us=p(we),ut=a(we,"P",{});var Kn=s(ut);_s=i(Kn,`MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Kn.forEach(t),bs=p(we),eo=a(we,"P",{});var dr=s(eo);vs=i(dr,"This model is a PyTorch "),oo=a(dr,"A",{href:!0,rel:!0});var Qn=s(oo);ys=i(Qn,"torch.nn.Module"),Qn.forEach(t),ws=i(dr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dr.forEach(t),Ns=p(we),F=a(we,"DIV",{class:!0});var Ne=s(F);y(to.$$.fragment,Ne),Ms=p(Ne),Z=a(Ne,"P",{});var zo=s(Z);$s=i(zo,"The "),Mo=a(zo,"A",{href:!0});var Xn=s(Mo);Ts=i(Xn,"MobileNetV1ForImageClassification"),Xn.forEach(t),Is=i(zo," forward method, overrides the "),_t=a(zo,"CODE",{});var Zn=s(_t);Es=i(Zn,"__call__"),Zn.forEach(t),Vs=i(zo," special method."),zo.forEach(t),xs=p(Ne),y(ue.$$.fragment,Ne),Ps=p(Ne),y(_e.$$.fragment,Ne),Ne.forEach(t),we.forEach(t),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(fi)),l(g,"id","mobilenet-v1"),l(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(g,"href","#mobilenet-v1"),l(_,"class","relative group"),l(oe,"id","overview"),l(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(oe,"href","#overview"),l(q,"class","relative group"),l(Te,"href","https://arxiv.org/abs/1704.04861"),l(Te,"rel","nofollow"),l(co,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1ImageProcessor"),l(Ve,"href","https://huggingface.co/datasets/imagenet-1k"),l(Ve,"rel","nofollow"),l(mo,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config"),l(fo,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(Ce,"href","https://huggingface.co/Matthijs"),l(Ce,"rel","nofollow"),l(Fe,"href","https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md"),l(Fe,"rel","nofollow"),l(ae,"id","resources"),l(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ae,"href","#resources"),l(W,"class","relative group"),l(go,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification"),l(je,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),l(je,"rel","nofollow"),l(Le,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),l(Le,"rel","nofollow"),l(_o,"href","../tasks/image_classification"),l(ne,"id","transformers.MobileNetV1Config"),l(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ne,"href","#transformers.MobileNetV1Config"),l(U,"class","relative group"),l(vo,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(Se,"href","https://huggingface.co/google/mobilenet_v1_1.0_224"),l(Se,"rel","nofollow"),l(yo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(wo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(le,"id","transformers.MobileNetV1FeatureExtractor"),l(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(le,"href","#transformers.MobileNetV1FeatureExtractor"),l(G,"class","relative group"),l(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(de,"id","transformers.MobileNetV1ImageProcessor"),l(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(de,"href","#transformers.MobileNetV1ImageProcessor"),l(J,"class","relative group"),l(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"id","transformers.MobileNetV1Model"),l(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(pe,"href","#transformers.MobileNetV1Model"),l(K,"class","relative group"),l(Ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ke,"rel","nofollow"),l(No,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"id","transformers.MobileNetV1ForImageClassification"),l(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"),l(ge,"href","#transformers.MobileNetV1ForImageClassification"),l(X,"class","relative group"),l(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oo,"rel","nofollow"),l(Mo,"href","/docs/transformers/v4.29.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"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,d){e(document.head,h),f(o,T,d),f(o,_,d),e(_,g),e(g,b),w(c,b,null),e(_,u),e(_,k),e(k,mr),f(o,Nt,d),f(o,q,d),e(q,oe),e(oe,Co),w($e,Co,null),e(q,pr),e(q,Fo),e(Fo,fr),f(o,Mt,d),f(o,te,d),e(te,hr),e(te,Te),e(Te,gr),e(te,ur),f(o,$t,d),f(o,no,d),e(no,_r),f(o,Tt,d),f(o,io,d),e(io,ko),e(ko,br),f(o,It,d),f(o,lo,d),e(lo,vr),f(o,Et,d),f(o,I,d),e(I,Ao),e(Ao,E),e(E,yr),e(E,re),e(re,wr),e(re,jo),e(jo,Nr),e(re,Mr),e(re,Lo),e(Lo,$r),e(E,Tr),e(E,Do),e(Do,Ir),e(E,Er),e(E,Ro),e(Ro,Vr),e(E,xr),e(E,So),e(So,Pr),e(E,zr),e(I,Cr),e(I,qo),e(qo,Oo),e(Oo,Fr),e(I,kr),e(I,Wo),e(Wo,Ie),e(Ie,Ar),e(Ie,co),e(co,jr),e(Ie,Lr),e(I,Dr),e(I,Uo),e(Uo,Ee),e(Ee,Rr),e(Ee,Ve),e(Ve,Sr),e(Ee,qr),e(I,Or),e(I,Ho),e(Ho,O),e(O,Wr),e(O,mo),e(mo,Ur),e(O,Hr),e(O,Bo),e(Bo,Br),e(O,Gr),f(o,Vt,d),f(o,po,d),e(po,Yr),f(o,xt,d),f(o,z,d),e(z,Go),e(Go,xe),e(xe,Jr),e(xe,fo),e(fo,Kr),e(xe,Qr),e(z,Xr),e(z,Yo),e(Yo,Pe),e(Pe,Zr),e(Pe,Jo),e(Jo,ea),e(Pe,oa),e(z,ta),e(z,Ko),e(Ko,Qo),e(Qo,ra),e(z,aa),e(z,Xo),e(Xo,ze),e(ze,sa),e(ze,Zo),e(Zo,na),e(ze,ia),f(o,Pt,d),f(o,L,d),e(L,la),e(L,Ce),e(Ce,ca),e(L,da),e(L,Fe),e(Fe,ma),e(L,pa),f(o,zt,d),f(o,W,d),e(W,ae),e(ae,et),w(ke,et,null),e(W,fa),e(W,ot),e(ot,ha),f(o,Ct,d),f(o,ho,d),e(ho,ga),f(o,Ft,d),w(Ae,o,d),f(o,kt,d),f(o,se,d),e(se,D),e(D,go),e(go,ua),e(D,_a),e(D,je),e(je,ba),e(D,va),e(D,Le),e(Le,ya),e(D,wa),e(se,Na),e(se,uo),e(uo,Ma),e(uo,_o),e(_o,$a),f(o,At,d),f(o,bo,d),e(bo,Ta),f(o,jt,d),f(o,U,d),e(U,ne),e(ne,tt),w(De,tt,null),e(U,Ia),e(U,rt),e(rt,Ea),f(o,Lt,d),f(o,V,d),w(Re,V,null),e(V,Va),e(V,H),e(H,xa),e(H,vo),e(vo,Pa),e(H,za),e(H,Se),e(Se,Ca),e(H,Fa),e(V,ka),e(V,B),e(B,Aa),e(B,yo),e(yo,ja),e(B,La),e(B,wo),e(wo,Da),e(B,Ra),e(V,Sa),w(ie,V,null),f(o,Dt,d),f(o,G,d),e(G,le),e(le,at),w(qe,at,null),e(G,qa),e(G,st),e(st,Oa),f(o,Rt,d),f(o,Y,d),w(Oe,Y,null),e(Y,Wa),e(Y,ce),w(We,ce,null),e(ce,Ua),e(ce,nt),e(nt,Ha),f(o,St,d),f(o,J,d),e(J,de),e(de,it),w(Ue,it,null),e(J,Ba),e(J,lt),e(lt,Ga),f(o,qt,d),f(o,A,d),w(He,A,null),e(A,Ya),e(A,ct),e(ct,Ja),e(A,Ka),e(A,me),w(Be,me,null),e(me,Qa),e(me,dt),e(dt,Xa),f(o,Ot,d),f(o,K,d),e(K,pe),e(pe,mt),w(Ge,mt,null),e(K,Za),e(K,pt),e(pt,es),f(o,Wt,d),f(o,j,d),w(Ye,j,null),e(j,os),e(j,Je),e(Je,ts),e(Je,Ke),e(Ke,rs),e(Je,as),e(j,ss),e(j,C),w(Qe,C,null),e(C,ns),e(C,Q),e(Q,is),e(Q,No),e(No,ls),e(Q,cs),e(Q,ft),e(ft,ds),e(Q,ms),e(C,ps),w(fe,C,null),e(C,fs),w(he,C,null),f(o,Ut,d),f(o,X,d),e(X,ge),e(ge,ht),w(Xe,ht,null),e(X,hs),e(X,gt),e(gt,gs),f(o,Ht,d),f(o,x,d),w(Ze,x,null),e(x,us),e(x,ut),e(ut,_s),e(x,bs),e(x,eo),e(eo,vs),e(eo,oo),e(oo,ys),e(eo,ws),e(x,Ns),e(x,F),w(to,F,null),e(F,Ms),e(F,Z),e(Z,$s),e(Z,Mo),e(Mo,Ts),e(Z,Is),e(Z,_t),e(_t,Es),e(Z,Vs),e(F,xs),w(ue,F,null),e(F,Ps),w(_e,F,null),Bt=!0},p(o,[d]){const ro={};d&2&&(ro.$$scope={dirty:d,ctx:o}),ie.$set(ro);const bt={};d&2&&(bt.$$scope={dirty:d,ctx:o}),fe.$set(bt);const vt={};d&2&&(vt.$$scope={dirty:d,ctx:o}),he.$set(vt);const yt={};d&2&&(yt.$$scope={dirty:d,ctx:o}),ue.$set(yt);const ao={};d&2&&(ao.$$scope={dirty:d,ctx:o}),_e.$set(ao)},i(o){Bt||(N(c.$$.fragment,o),N($e.$$.fragment,o),N(ke.$$.fragment,o),N(Ae.$$.fragment,o),N(De.$$.fragment,o),N(Re.$$.fragment,o),N(ie.$$.fragment,o),N(qe.$$.fragment,o),N(Oe.$$.fragment,o),N(We.$$.fragment,o),N(Ue.$$.fragment,o),N(He.$$.fragment,o),N(Be.$$.fragment,o),N(Ge.$$.fragment,o),N(Ye.$$.fragment,o),N(Qe.$$.fragment,o),N(fe.$$.fragment,o),N(he.$$.fragment,o),N(Xe.$$.fragment,o),N(Ze.$$.fragment,o),N(to.$$.fragment,o),N(ue.$$.fragment,o),N(_e.$$.fragment,o),Bt=!0)},o(o){M(c.$$.fragment,o),M($e.$$.fragment,o),M(ke.$$.fragment,o),M(Ae.$$.fragment,o),M(De.$$.fragment,o),M(Re.$$.fragment,o),M(ie.$$.fragment,o),M(qe.$$.fragment,o),M(Oe.$$.fragment,o),M(We.$$.fragment,o),M(Ue.$$.fragment,o),M(He.$$.fragment,o),M(Be.$$.fragment,o),M(Ge.$$.fragment,o),M(Ye.$$.fragment,o),M(Qe.$$.fragment,o),M(fe.$$.fragment,o),M(he.$$.fragment,o),M(Xe.$$.fragment,o),M(Ze.$$.fragment,o),M(to.$$.fragment,o),M(ue.$$.fragment,o),M(_e.$$.fragment,o),Bt=!1},d(o){t(h),o&&t(T),o&&t(_),$(c),o&&t(Nt),o&&t(q),$($e),o&&t(Mt),o&&t(te),o&&t($t),o&&t(no),o&&t(Tt),o&&t(io),o&&t(It),o&&t(lo),o&&t(Et),o&&t(I),o&&t(Vt),o&&t(po),o&&t(xt),o&&t(z),o&&t(Pt),o&&t(L),o&&t(zt),o&&t(W),$(ke),o&&t(Ct),o&&t(ho),o&&t(Ft),$(Ae,o),o&&t(kt),o&&t(se),o&&t(At),o&&t(bo),o&&t(jt),o&&t(U),$(De),o&&t(Lt),o&&t(V),$(Re),$(ie),o&&t(Dt),o&&t(G),$(qe),o&&t(Rt),o&&t(Y),$(Oe),$(We),o&&t(St),o&&t(J),$(Ue),o&&t(qt),o&&t(A),$(He),$(Be),o&&t(Ot),o&&t(K),$(Ge),o&&t(Wt),o&&t(j),$(Ye),$(Qe),$(fe),$(he),o&&t(Ut),o&&t(X),$(Xe),o&&t(Ht),o&&t(x),$(Ze),$(to),$(ue),$(_e)}}}const fi={local:"mobilenet-v1",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.MobileNetV1Config",title:"MobileNetV1Config"},{local:"transformers.MobileNetV1FeatureExtractor",title:"MobileNetV1FeatureExtractor"},{local:"transformers.MobileNetV1ImageProcessor",title:"MobileNetV1ImageProcessor"},{local:"transformers.MobileNetV1Model",title:"MobileNetV1Model"},{local:"transformers.MobileNetV1ForImageClassification",title:"MobileNetV1ForImageClassification"}],title:"MobileNet V1"};function hi(P){return si(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ni extends oi{constructor(h){super();ti(this,h,hi,pi,ri,{})}}export{Ni as default,fi as metadata};
