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 M,q as w,o as N,B as T,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 js}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ps}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ni}from"../../chunks/PipelineTag-hf-doc-builder.js";function ii(C){let h,$,_,g,b;return g=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1vYmlsZU5ldFYxQ29uZmlnJTJDJTIwTW9iaWxlTmV0VjFNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjAlMjJtb2JpbGVuZXRfdjFfMS4wXzIyNCUyMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNb2JpbGVOZXRWMUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMCUyMm1vYmlsZW5ldF92MV8xLjBfMjI0JTIyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVOZXRWMU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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"),$=n("Example:"),_=m(),v(g.$$.fragment)},l(c){h=a(c,"P",{});var u=s(h);$=i(u,"Example:"),u.forEach(t),_=p(c),y(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,$),f(c,_,u),M(g,c,u),b=!0},p:Fs,i(c){b||(w(g.$$.fragment,c),b=!0)},o(c){N(g.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),T(g,c)}}}function li(C){let h,$,_,g,b;return{c(){h=r("p"),$=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);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var j=s(_);g=i(j,"Module"),j.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,$),e(h,_),e(_,g),e(h,b)},d(c){c&&t(h)}}}function ci(C){let h,$,_,g,b;return g=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZU5ldFYxTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZW5ldF92MV8xLjBfMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlTmV0VjFNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlbmV0X3YxXzEuMF8yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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"),$=n("Example:"),_=m(),v(g.$$.fragment)},l(c){h=a(c,"P",{});var u=s(h);$=i(u,"Example:"),u.forEach(t),_=p(c),y(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,$),f(c,_,u),M(g,c,u),b=!0},p:Fs,i(c){b||(w(g.$$.fragment,c),b=!0)},o(c){N(g.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),T(g,c)}}}function di(C){let h,$,_,g,b;return{c(){h=r("p"),$=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);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var j=s(_);g=i(j,"Module"),j.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,$),e(h,_),e(_,g),e(h,b)},d(c){c&&t(h)}}}function mi(C){let h,$,_,g,b;return g=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZU5ldFYxRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlbmV0X3YxXzEuMF8yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVOZXRWMUZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZW5ldF92MV8xLjBfMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",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"),$=n("Example:"),_=m(),v(g.$$.fragment)},l(c){h=a(c,"P",{});var u=s(h);$=i(u,"Example:"),u.forEach(t),_=p(c),y(g.$$.fragment,c)},m(c,u){f(c,h,u),e(h,$),f(c,_,u),M(g,c,u),b=!0},p:Fs,i(c){b||(w(g.$$.fragment,c),b=!0)},o(c){N(g.$$.fragment,c),b=!1},d(c){c&&t(h),c&&t(_),T(g,c)}}}function pi(C){let h,$,_,g,b,c,u,j,mr,wt,Z,oe,Po,Te,pr,Fo,fr,Nt,te,hr,$e,gr,ur,Tt,no,_r,$t,io,jo,br,It,lo,vr,Vt,I,Uo,V,yr,re,Mr,Wo,wr,Nr,Ro,Tr,$r,ko,Ir,Vr,Jo,Er,xr,Ao,Cr,zr,Pr,Zo,So,Fr,jr,Do,Ie,Ur,co,Wr,Rr,kr,Go,Ve,Jr,Ee,Ar,Zr,Sr,Lo,S,Dr,mo,Gr,Lr,Bo,Br,qr,Et,po,Or,xt,z,qo,xe,Xr,fo,Yr,Qr,Hr,Oo,Ce,Kr,Xo,ea,oa,ta,Yo,Qo,ra,aa,Ho,ze,sa,Ko,na,ia,Ct,R,la,Pe,ca,da,Fe,ma,pa,zt,D,ae,et,je,fa,ot,ha,Pt,ho,ga,Ft,Ue,jt,se,k,go,ua,_a,We,ba,va,Re,ya,Ma,wa,uo,Na,_o,Ta,Ut,bo,$a,Wt,G,ne,tt,ke,Ia,rt,Va,Rt,E,Je,Ea,L,xa,vo,Ca,za,Ae,Pa,Fa,ja,B,Ua,yo,Wa,Ra,Mo,ka,Ja,Aa,ie,kt,q,le,at,Ze,Za,st,Sa,Jt,O,Se,Da,ce,De,Ga,nt,La,At,X,de,it,Ge,Ba,lt,qa,Zt,U,Le,Oa,ct,Xa,Ya,me,Be,Qa,dt,Ha,St,Y,pe,mt,qe,Ka,pt,es,Dt,W,Oe,os,Xe,ts,Ye,rs,as,ss,P,Qe,ns,Q,is,wo,ls,cs,ft,ds,ms,ps,fe,fs,he,Gt,H,ge,ht,He,hs,gt,gs,Lt,x,Ke,us,ut,_s,bs,eo,vs,oo,ys,Ms,ws,F,to,Ns,K,Ts,No,$s,Is,_t,Vs,Es,xs,ue,Cs,_e,Bt;return c=new Ne({}),Te=new Ne({}),je=new Ne({}),Ue=new ni({props:{pipeline:"image-classification"}}),ke=new Ne({}),Je=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.32.0/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py#L36"}}),ie=new Ps({props:{anchor:"transformers.MobileNetV1Config.example",$$slots:{default:[ii]},$$scope:{ctx:C}}}),Ze=new Ne({}),Se=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.32.0/src/transformers/models/mobilenet_v1/feature_extraction_mobilenet_v1.py#L26"}}),De=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:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{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"},{anchor:"transformers.MobileNetV1FeatureExtractor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input 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><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L156"}}),Ge=new Ne({}),Le=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.32.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L44"}}),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:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{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"},{anchor:"transformers.MobileNetV1ImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input 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><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L156"}}),qe=new Ne({}),Oe=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.32.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.32.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.32.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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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.32.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.32.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.32.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:C}}}),he=new Ps({props:{anchor:"transformers.MobileNetV1Model.forward.example",$$slots:{default:[ci]},$$scope:{ctx:C}}}),He=new Ne({}),Ke=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.32.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.32.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.32.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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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.32.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.32.0/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L427",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.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.32.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.32.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:C}}}),_e=new Ps({props:{anchor:"transformers.MobileNetV1ForImageClassification.forward.example",$$slots:{default:[mi]},$$scope:{ctx:C}}}),{c(){h=r("meta"),$=m(),_=r("h1"),g=r("a"),b=r("span"),v(c.$$.fragment),u=m(),j=r("span"),mr=n("MobileNet V1"),wt=m(),Z=r("h2"),oe=r("a"),Po=r("span"),v(Te.$$.fragment),pr=m(),Fo=r("span"),fr=n("Overview"),Nt=m(),te=r("p"),hr=n("The MobileNet model was proposed in "),$e=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."),Tt=m(),no=r("p"),_r=n("The abstract from the paper is the following:"),$t=m(),io=r("p"),jo=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:"),Vt=m(),I=r("ul"),Uo=r("li"),V=r("p"),yr=n("The checkpoints are named "),re=r("strong"),Mr=n("mobilenet_v1_"),Wo=r("em"),wr=n("depth"),Nr=n("_"),Ro=r("em"),Tr=n("size"),$r=n(", for example "),ko=r("strong"),Ir=n("mobilenet_v1_1.0_224"),Vr=n(", where "),Jo=r("strong"),Er=n("1.0"),xr=n(" is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),Ao=r("strong"),Cr=n("224"),zr=n(" is the resolution of the input images the model was trained on."),Pr=m(),Zo=r("li"),So=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."),jr=m(),Do=r("li"),Ie=r("p"),Ur=n("One can use "),co=r("a"),Wr=n("MobileNetV1ImageProcessor"),Rr=n(" to prepare images for the model."),kr=m(),Go=r("li"),Ve=r("p"),Jr=n("The available image classification checkpoints are pre-trained on "),Ee=r("a"),Ar=n("ImageNet-1k"),Zr=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)."),Sr=m(),Lo=r("li"),S=r("p"),Dr=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"),Gr=n("MobileNetV1Config"),Lr=n(" with "),Bo=r("code"),Br=n("tf_padding = False"),qr=n("."),Et=m(),po=r("p"),Or=n("Unsupported features:"),xt=m(),z=r("ul"),qo=r("li"),xe=r("p"),Xr=n("The "),fo=r("a"),Yr=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."),Hr=m(),Oo=r("li"),Ce=r("p"),Kr=n("It is currently not possible to specify an "),Xo=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(),Yo=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(),Ho=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 "),Ko=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."),Ct=m(),R=r("p"),la=n("This model was contributed by "),Pe=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(),D=r("h2"),ae=r("a"),et=r("span"),v(je.$$.fragment),fa=m(),ot=r("span"),ha=n("Resources"),Pt=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(Ue.$$.fragment),jt=m(),se=r("ul"),k=r("li"),go=r("a"),ua=n("MobileNetV1ForImageClassification"),_a=n(" is supported by this "),We=r("a"),ba=n("example script"),va=n(" and "),Re=r("a"),ya=n("notebook"),Ma=n("."),wa=m(),uo=r("li"),Na=n("See also: "),_o=r("a"),Ta=n("Image classification task guide"),Ut=m(),bo=r("p"),$a=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."),Wt=m(),G=r("h2"),ne=r("a"),tt=r("span"),v(ke.$$.fragment),Ia=m(),rt=r("span"),Va=n("MobileNetV1Config"),Rt=m(),E=r("div"),v(Je.$$.fragment),Ea=m(),L=r("p"),xa=n("This is the configuration class to store the configuration of a "),vo=r("a"),Ca=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
`),Ae=r("a"),Pa=n("google/mobilenet_v1_1.0_224"),Fa=n(" architecture."),ja=m(),B=r("p"),Ua=n("Configuration objects inherit from "),yo=r("a"),Wa=n("PretrainedConfig"),Ra=n(` and can be used to control the model outputs. Read the
documentation from `),Mo=r("a"),ka=n("PretrainedConfig"),Ja=n(" for more information."),Aa=m(),v(ie.$$.fragment),kt=m(),q=r("h2"),le=r("a"),at=r("span"),v(Ze.$$.fragment),Za=m(),st=r("span"),Sa=n("MobileNetV1FeatureExtractor"),Jt=m(),O=r("div"),v(Se.$$.fragment),Da=m(),ce=r("div"),v(De.$$.fragment),Ga=m(),nt=r("p"),La=n("Preprocess an image or batch of images."),At=m(),X=r("h2"),de=r("a"),it=r("span"),v(Ge.$$.fragment),Ba=m(),lt=r("span"),qa=n("MobileNetV1ImageProcessor"),Zt=m(),U=r("div"),v(Le.$$.fragment),Oa=m(),ct=r("p"),Xa=n("Constructs a MobileNetV1 image processor."),Ya=m(),me=r("div"),v(Be.$$.fragment),Qa=m(),dt=r("p"),Ha=n("Preprocess an image or batch of images."),St=m(),Y=r("h2"),pe=r("a"),mt=r("span"),v(qe.$$.fragment),Ka=m(),pt=r("span"),es=n("MobileNetV1Model"),Dt=m(),W=r("div"),v(Oe.$$.fragment),os=m(),Xe=r("p"),ts=n(`The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ye=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(),P=r("div"),v(Qe.$$.fragment),ns=m(),Q=r("p"),is=n("The "),wo=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),Gt=m(),H=r("h2"),ge=r("a"),ht=r("span"),v(He.$$.fragment),hs=m(),gt=r("span"),gs=n("MobileNetV1ForImageClassification"),Lt=m(),x=r("div"),v(Ke.$$.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"),Ms=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ws=m(),F=r("div"),v(to.$$.fragment),Ns=m(),K=r("p"),Ts=n("The "),No=r("a"),$s=n("MobileNetV1ForImageClassification"),Is=n(" forward method, overrides the "),_t=r("code"),Vs=n("__call__"),Es=n(" special method."),xs=m(),v(ue.$$.fragment),Cs=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),$=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),j=a(ro,"SPAN",{});var yt=s(j);mr=i(yt,"MobileNet V1"),yt.forEach(t),ro.forEach(t),wt=p(o),Z=a(o,"H2",{class:!0});var ao=s(Z);oe=a(ao,"A",{id:!0,class:!0,href:!0});var Us=s(oe);Po=a(Us,"SPAN",{});var Ws=s(Po);y(Te.$$.fragment,Ws),Ws.forEach(t),Us.forEach(t),pr=p(ao),Fo=a(ao,"SPAN",{});var Rs=s(Fo);fr=i(Rs,"Overview"),Rs.forEach(t),ao.forEach(t),Nt=p(o),te=a(o,"P",{});var qt=s(te);hr=i(qt,"The MobileNet model was proposed in "),$e=a(qt,"A",{href:!0,rel:!0});var ks=s($e);gr=i(ks,"MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications"),ks.forEach(t),ur=i(qt," by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam."),qt.forEach(t),Tt=p(o),no=a(o,"P",{});var Js=s(no);_r=i(Js,"The abstract from the paper is the following:"),Js.forEach(t),$t=p(o),io=a(o,"P",{});var As=s(io);jo=a(As,"EM",{});var Zs=s(jo);br=i(Zs,"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."),Zs.forEach(t),As.forEach(t),It=p(o),lo=a(o,"P",{});var Ss=s(lo);vr=i(Ss,"Tips:"),Ss.forEach(t),Vt=p(o),I=a(o,"UL",{});var J=s(I);Uo=a(J,"LI",{});var Ds=s(Uo);V=a(Ds,"P",{});var A=s(V);yr=i(A,"The checkpoints are named "),re=a(A,"STRONG",{});var Mt=s(re);Mr=i(Mt,"mobilenet_v1_"),Wo=a(Mt,"EM",{});var Gs=s(Wo);wr=i(Gs,"depth"),Gs.forEach(t),Nr=i(Mt,"_"),Ro=a(Mt,"EM",{});var Ls=s(Ro);Tr=i(Ls,"size"),Ls.forEach(t),Mt.forEach(t),$r=i(A,", for example "),ko=a(A,"STRONG",{});var Bs=s(ko);Ir=i(Bs,"mobilenet_v1_1.0_224"),Bs.forEach(t),Vr=i(A,", where "),Jo=a(A,"STRONG",{});var qs=s(Jo);Er=i(qs,"1.0"),qs.forEach(t),xr=i(A," is the depth multiplier (sometimes also referred to as \u201Calpha\u201D or the width multiplier) and "),Ao=a(A,"STRONG",{});var Os=s(Ao);Cr=i(Os,"224"),Os.forEach(t),zr=i(A," is the resolution of the input images the model was trained on."),A.forEach(t),Ds.forEach(t),Pr=p(J),Zo=a(J,"LI",{});var Xs=s(Zo);So=a(Xs,"P",{});var Ys=s(So);Fr=i(Ys,"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."),Ys.forEach(t),Xs.forEach(t),jr=p(J),Do=a(J,"LI",{});var Qs=s(Do);Ie=a(Qs,"P",{});var Ot=s(Ie);Ur=i(Ot,"One can use "),co=a(Ot,"A",{href:!0});var Hs=s(co);Wr=i(Hs,"MobileNetV1ImageProcessor"),Hs.forEach(t),Rr=i(Ot," to prepare images for the model."),Ot.forEach(t),Qs.forEach(t),kr=p(J),Go=a(J,"LI",{});var Ks=s(Go);Ve=a(Ks,"P",{});var Xt=s(Ve);Jr=i(Xt,"The available image classification checkpoints are pre-trained on "),Ee=a(Xt,"A",{href:!0,rel:!0});var en=s(Ee);Ar=i(en,"ImageNet-1k"),en.forEach(t),Zr=i(Xt," (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)."),Xt.forEach(t),Ks.forEach(t),Sr=p(J),Lo=a(J,"LI",{});var on=s(Lo);S=a(on,"P",{});var To=s(S);Dr=i(To,"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(To,"A",{href:!0});var tn=s(mo);Gr=i(tn,"MobileNetV1Config"),tn.forEach(t),Lr=i(To," with "),Bo=a(To,"CODE",{});var rn=s(Bo);Br=i(rn,"tf_padding = False"),rn.forEach(t),qr=i(To,"."),To.forEach(t),on.forEach(t),J.forEach(t),Et=p(o),po=a(o,"P",{});var an=s(po);Or=i(an,"Unsupported features:"),an.forEach(t),xt=p(o),z=a(o,"UL",{});var be=s(z);qo=a(be,"LI",{});var sn=s(qo);xe=a(sn,"P",{});var Yt=s(xe);Xr=i(Yt,"The "),fo=a(Yt,"A",{href:!0});var nn=s(fo);Yr=i(nn,"MobileNetV1Model"),nn.forEach(t),Qr=i(Yt," 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."),Yt.forEach(t),sn.forEach(t),Hr=p(be),Oo=a(be,"LI",{});var ln=s(Oo);Ce=a(ln,"P",{});var Qt=s(Ce);Kr=i(Qt,"It is currently not possible to specify an "),Xo=a(Qt,"CODE",{});var cn=s(Xo);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),Yo=a(be,"LI",{});var dn=s(Yo);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),Ho=a(be,"LI",{});var pn=s(Ho);ze=a(pn,"P",{});var Ht=s(ze);sa=i(Ht,"It\u2019s common to extract the output from the pointwise layers at indices 5, 11, 12, 13 for downstream purposes. Using "),Ko=a(Ht,"CODE",{});var fn=s(Ko);na=i(fn,"output_hidden_states=True"),fn.forEach(t),ia=i(Ht," returns the output from all intermediate layers. There is currently no way to limit this to specific layers."),Ht.forEach(t),pn.forEach(t),be.forEach(t),Ct=p(o),R=a(o,"P",{});var $o=s(R);la=i($o,"This model was contributed by "),Pe=a($o,"A",{href:!0,rel:!0});var hn=s(Pe);ca=i(hn,"matthijs"),hn.forEach(t),da=i($o,". The original code and weights can be found "),Fe=a($o,"A",{href:!0,rel:!0});var gn=s(Fe);ma=i(gn,"here"),gn.forEach(t),pa=i($o,"."),$o.forEach(t),zt=p(o),D=a(o,"H2",{class:!0});var Kt=s(D);ae=a(Kt,"A",{id:!0,class:!0,href:!0});var un=s(ae);et=a(un,"SPAN",{});var _n=s(et);y(je.$$.fragment,_n),_n.forEach(t),un.forEach(t),fa=p(Kt),ot=a(Kt,"SPAN",{});var bn=s(ot);ha=i(bn,"Resources"),bn.forEach(t),Kt.forEach(t),Pt=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(Ue.$$.fragment,o),jt=p(o),se=a(o,"UL",{});var er=s(se);k=a(er,"LI",{});var so=s(k);go=a(so,"A",{href:!0});var yn=s(go);ua=i(yn,"MobileNetV1ForImageClassification"),yn.forEach(t),_a=i(so," is supported by this "),We=a(so,"A",{href:!0,rel:!0});var Mn=s(We);ba=i(Mn,"example script"),Mn.forEach(t),va=i(so," and "),Re=a(so,"A",{href:!0,rel:!0});var wn=s(Re);ya=i(wn,"notebook"),wn.forEach(t),Ma=i(so,"."),so.forEach(t),wa=p(er),uo=a(er,"LI",{});var zs=s(uo);Na=i(zs,"See also: "),_o=a(zs,"A",{href:!0});var Nn=s(_o);Ta=i(Nn,"Image classification task guide"),Nn.forEach(t),zs.forEach(t),er.forEach(t),Ut=p(o),bo=a(o,"P",{});var Tn=s(bo);$a=i(Tn,"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."),Tn.forEach(t),Wt=p(o),G=a(o,"H2",{class:!0});var or=s(G);ne=a(or,"A",{id:!0,class:!0,href:!0});var $n=s(ne);tt=a($n,"SPAN",{});var In=s(tt);y(ke.$$.fragment,In),In.forEach(t),$n.forEach(t),Ia=p(or),rt=a(or,"SPAN",{});var Vn=s(rt);Va=i(Vn,"MobileNetV1Config"),Vn.forEach(t),or.forEach(t),Rt=p(o),E=a(o,"DIV",{class:!0});var ve=s(E);y(Je.$$.fragment,ve),Ea=p(ve),L=a(ve,"P",{});var Io=s(L);xa=i(Io,"This is the configuration class to store the configuration of a "),vo=a(Io,"A",{href:!0});var En=s(vo);Ca=i(En,"MobileNetV1Model"),En.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
`),Ae=a(Io,"A",{href:!0,rel:!0});var xn=s(Ae);Pa=i(xn,"google/mobilenet_v1_1.0_224"),xn.forEach(t),Fa=i(Io," architecture."),Io.forEach(t),ja=p(ve),B=a(ve,"P",{});var Vo=s(B);Ua=i(Vo,"Configuration objects inherit from "),yo=a(Vo,"A",{href:!0});var Cn=s(yo);Wa=i(Cn,"PretrainedConfig"),Cn.forEach(t),Ra=i(Vo,` and can be used to control the model outputs. Read the
documentation from `),Mo=a(Vo,"A",{href:!0});var zn=s(Mo);ka=i(zn,"PretrainedConfig"),zn.forEach(t),Ja=i(Vo," for more information."),Vo.forEach(t),Aa=p(ve),y(ie.$$.fragment,ve),ve.forEach(t),kt=p(o),q=a(o,"H2",{class:!0});var tr=s(q);le=a(tr,"A",{id:!0,class:!0,href:!0});var Pn=s(le);at=a(Pn,"SPAN",{});var Fn=s(at);y(Ze.$$.fragment,Fn),Fn.forEach(t),Pn.forEach(t),Za=p(tr),st=a(tr,"SPAN",{});var jn=s(st);Sa=i(jn,"MobileNetV1FeatureExtractor"),jn.forEach(t),tr.forEach(t),Jt=p(o),O=a(o,"DIV",{class:!0});var rr=s(O);y(Se.$$.fragment,rr),Da=p(rr),ce=a(rr,"DIV",{class:!0});var ar=s(ce);y(De.$$.fragment,ar),Ga=p(ar),nt=a(ar,"P",{});var Un=s(nt);La=i(Un,"Preprocess an image or batch of images."),Un.forEach(t),ar.forEach(t),rr.forEach(t),At=p(o),X=a(o,"H2",{class:!0});var sr=s(X);de=a(sr,"A",{id:!0,class:!0,href:!0});var Wn=s(de);it=a(Wn,"SPAN",{});var Rn=s(it);y(Ge.$$.fragment,Rn),Rn.forEach(t),Wn.forEach(t),Ba=p(sr),lt=a(sr,"SPAN",{});var kn=s(lt);qa=i(kn,"MobileNetV1ImageProcessor"),kn.forEach(t),sr.forEach(t),Zt=p(o),U=a(o,"DIV",{class:!0});var Eo=s(U);y(Le.$$.fragment,Eo),Oa=p(Eo),ct=a(Eo,"P",{});var Jn=s(ct);Xa=i(Jn,"Constructs a MobileNetV1 image processor."),Jn.forEach(t),Ya=p(Eo),me=a(Eo,"DIV",{class:!0});var nr=s(me);y(Be.$$.fragment,nr),Qa=p(nr),dt=a(nr,"P",{});var An=s(dt);Ha=i(An,"Preprocess an image or batch of images."),An.forEach(t),nr.forEach(t),Eo.forEach(t),St=p(o),Y=a(o,"H2",{class:!0});var ir=s(Y);pe=a(ir,"A",{id:!0,class:!0,href:!0});var Zn=s(pe);mt=a(Zn,"SPAN",{});var Sn=s(mt);y(qe.$$.fragment,Sn),Sn.forEach(t),Zn.forEach(t),Ka=p(ir),pt=a(ir,"SPAN",{});var Dn=s(pt);es=i(Dn,"MobileNetV1Model"),Dn.forEach(t),ir.forEach(t),Dt=p(o),W=a(o,"DIV",{class:!0});var xo=s(W);y(Oe.$$.fragment,xo),os=p(xo),Xe=a(xo,"P",{});var lr=s(Xe);ts=i(lr,`The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ye=a(lr,"A",{href:!0,rel:!0});var Gn=s(Ye);rs=i(Gn,"torch.nn.Module"),Gn.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),P=a(xo,"DIV",{class:!0});var ye=s(P);y(Qe.$$.fragment,ye),ns=p(ye),Q=a(ye,"P",{});var Co=s(Q);is=i(Co,"The "),wo=a(Co,"A",{href:!0});var Ln=s(wo);ls=i(Ln,"MobileNetV1Model"),Ln.forEach(t),cs=i(Co," forward method, overrides the "),ft=a(Co,"CODE",{});var Bn=s(ft);ds=i(Bn,"__call__"),Bn.forEach(t),ms=i(Co," special method."),Co.forEach(t),ps=p(ye),y(fe.$$.fragment,ye),fs=p(ye),y(he.$$.fragment,ye),ye.forEach(t),xo.forEach(t),Gt=p(o),H=a(o,"H2",{class:!0});var cr=s(H);ge=a(cr,"A",{id:!0,class:!0,href:!0});var qn=s(ge);ht=a(qn,"SPAN",{});var On=s(ht);y(He.$$.fragment,On),On.forEach(t),qn.forEach(t),hs=p(cr),gt=a(cr,"SPAN",{});var Xn=s(gt);gs=i(Xn,"MobileNetV1ForImageClassification"),Xn.forEach(t),cr.forEach(t),Lt=p(o),x=a(o,"DIV",{class:!0});var Me=s(x);y(Ke.$$.fragment,Me),us=p(Me),ut=a(Me,"P",{});var Yn=s(ut);_s=i(Yn,`MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Yn.forEach(t),bs=p(Me),eo=a(Me,"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),Ms=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),ws=p(Me),F=a(Me,"DIV",{class:!0});var we=s(F);y(to.$$.fragment,we),Ns=p(we),K=a(we,"P",{});var zo=s(K);Ts=i(zo,"The "),No=a(zo,"A",{href:!0});var Hn=s(No);$s=i(Hn,"MobileNetV1ForImageClassification"),Hn.forEach(t),Is=i(zo," forward method, overrides the "),_t=a(zo,"CODE",{});var Kn=s(_t);Vs=i(Kn,"__call__"),Kn.forEach(t),Es=i(zo," special method."),zo.forEach(t),xs=p(we),y(ue.$$.fragment,we),Cs=p(we),y(_e.$$.fragment,we),we.forEach(t),Me.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(Z,"class","relative group"),l($e,"href","https://arxiv.org/abs/1704.04861"),l($e,"rel","nofollow"),l(co,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1ImageProcessor"),l(Ee,"href","https://huggingface.co/datasets/imagenet-1k"),l(Ee,"rel","nofollow"),l(mo,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config"),l(fo,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(Pe,"href","https://huggingface.co/Matthijs"),l(Pe,"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(D,"class","relative group"),l(go,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification"),l(We,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),l(We,"rel","nofollow"),l(Re,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),l(Re,"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(G,"class","relative group"),l(vo,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(Ae,"href","https://huggingface.co/google/mobilenet_v1_1.0_224"),l(Ae,"rel","nofollow"),l(yo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Mo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(q,"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(O,"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(X,"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(U,"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(Y,"class","relative group"),l(Ye,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ye,"rel","nofollow"),l(wo,"href","/docs/transformers/v4.32.0/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(W,"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(H,"class","relative group"),l(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oo,"rel","nofollow"),l(No,"href","/docs/transformers/v4.32.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,$,d),f(o,_,d),e(_,g),e(g,b),M(c,b,null),e(_,u),e(_,j),e(j,mr),f(o,wt,d),f(o,Z,d),e(Z,oe),e(oe,Po),M(Te,Po,null),e(Z,pr),e(Z,Fo),e(Fo,fr),f(o,Nt,d),f(o,te,d),e(te,hr),e(te,$e),e($e,gr),e(te,ur),f(o,Tt,d),f(o,no,d),e(no,_r),f(o,$t,d),f(o,io,d),e(io,jo),e(jo,br),f(o,It,d),f(o,lo,d),e(lo,vr),f(o,Vt,d),f(o,I,d),e(I,Uo),e(Uo,V),e(V,yr),e(V,re),e(re,Mr),e(re,Wo),e(Wo,wr),e(re,Nr),e(re,Ro),e(Ro,Tr),e(V,$r),e(V,ko),e(ko,Ir),e(V,Vr),e(V,Jo),e(Jo,Er),e(V,xr),e(V,Ao),e(Ao,Cr),e(V,zr),e(I,Pr),e(I,Zo),e(Zo,So),e(So,Fr),e(I,jr),e(I,Do),e(Do,Ie),e(Ie,Ur),e(Ie,co),e(co,Wr),e(Ie,Rr),e(I,kr),e(I,Go),e(Go,Ve),e(Ve,Jr),e(Ve,Ee),e(Ee,Ar),e(Ve,Zr),e(I,Sr),e(I,Lo),e(Lo,S),e(S,Dr),e(S,mo),e(mo,Gr),e(S,Lr),e(S,Bo),e(Bo,Br),e(S,qr),f(o,Et,d),f(o,po,d),e(po,Or),f(o,xt,d),f(o,z,d),e(z,qo),e(qo,xe),e(xe,Xr),e(xe,fo),e(fo,Yr),e(xe,Qr),e(z,Hr),e(z,Oo),e(Oo,Ce),e(Ce,Kr),e(Ce,Xo),e(Xo,ea),e(Ce,oa),e(z,ta),e(z,Yo),e(Yo,Qo),e(Qo,ra),e(z,aa),e(z,Ho),e(Ho,ze),e(ze,sa),e(ze,Ko),e(Ko,na),e(ze,ia),f(o,Ct,d),f(o,R,d),e(R,la),e(R,Pe),e(Pe,ca),e(R,da),e(R,Fe),e(Fe,ma),e(R,pa),f(o,zt,d),f(o,D,d),e(D,ae),e(ae,et),M(je,et,null),e(D,fa),e(D,ot),e(ot,ha),f(o,Pt,d),f(o,ho,d),e(ho,ga),f(o,Ft,d),M(Ue,o,d),f(o,jt,d),f(o,se,d),e(se,k),e(k,go),e(go,ua),e(k,_a),e(k,We),e(We,ba),e(k,va),e(k,Re),e(Re,ya),e(k,Ma),e(se,wa),e(se,uo),e(uo,Na),e(uo,_o),e(_o,Ta),f(o,Ut,d),f(o,bo,d),e(bo,$a),f(o,Wt,d),f(o,G,d),e(G,ne),e(ne,tt),M(ke,tt,null),e(G,Ia),e(G,rt),e(rt,Va),f(o,Rt,d),f(o,E,d),M(Je,E,null),e(E,Ea),e(E,L),e(L,xa),e(L,vo),e(vo,Ca),e(L,za),e(L,Ae),e(Ae,Pa),e(L,Fa),e(E,ja),e(E,B),e(B,Ua),e(B,yo),e(yo,Wa),e(B,Ra),e(B,Mo),e(Mo,ka),e(B,Ja),e(E,Aa),M(ie,E,null),f(o,kt,d),f(o,q,d),e(q,le),e(le,at),M(Ze,at,null),e(q,Za),e(q,st),e(st,Sa),f(o,Jt,d),f(o,O,d),M(Se,O,null),e(O,Da),e(O,ce),M(De,ce,null),e(ce,Ga),e(ce,nt),e(nt,La),f(o,At,d),f(o,X,d),e(X,de),e(de,it),M(Ge,it,null),e(X,Ba),e(X,lt),e(lt,qa),f(o,Zt,d),f(o,U,d),M(Le,U,null),e(U,Oa),e(U,ct),e(ct,Xa),e(U,Ya),e(U,me),M(Be,me,null),e(me,Qa),e(me,dt),e(dt,Ha),f(o,St,d),f(o,Y,d),e(Y,pe),e(pe,mt),M(qe,mt,null),e(Y,Ka),e(Y,pt),e(pt,es),f(o,Dt,d),f(o,W,d),M(Oe,W,null),e(W,os),e(W,Xe),e(Xe,ts),e(Xe,Ye),e(Ye,rs),e(Xe,as),e(W,ss),e(W,P),M(Qe,P,null),e(P,ns),e(P,Q),e(Q,is),e(Q,wo),e(wo,ls),e(Q,cs),e(Q,ft),e(ft,ds),e(Q,ms),e(P,ps),M(fe,P,null),e(P,fs),M(he,P,null),f(o,Gt,d),f(o,H,d),e(H,ge),e(ge,ht),M(He,ht,null),e(H,hs),e(H,gt),e(gt,gs),f(o,Lt,d),f(o,x,d),M(Ke,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,Ms),e(x,ws),e(x,F),M(to,F,null),e(F,Ns),e(F,K),e(K,Ts),e(K,No),e(No,$s),e(K,Is),e(K,_t),e(_t,Vs),e(K,Es),e(F,xs),M(ue,F,null),e(F,Cs),M(_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||(w(c.$$.fragment,o),w(Te.$$.fragment,o),w(je.$$.fragment,o),w(Ue.$$.fragment,o),w(ke.$$.fragment,o),w(Je.$$.fragment,o),w(ie.$$.fragment,o),w(Ze.$$.fragment,o),w(Se.$$.fragment,o),w(De.$$.fragment,o),w(Ge.$$.fragment,o),w(Le.$$.fragment,o),w(Be.$$.fragment,o),w(qe.$$.fragment,o),w(Oe.$$.fragment,o),w(Qe.$$.fragment,o),w(fe.$$.fragment,o),w(he.$$.fragment,o),w(He.$$.fragment,o),w(Ke.$$.fragment,o),w(to.$$.fragment,o),w(ue.$$.fragment,o),w(_e.$$.fragment,o),Bt=!0)},o(o){N(c.$$.fragment,o),N(Te.$$.fragment,o),N(je.$$.fragment,o),N(Ue.$$.fragment,o),N(ke.$$.fragment,o),N(Je.$$.fragment,o),N(ie.$$.fragment,o),N(Ze.$$.fragment,o),N(Se.$$.fragment,o),N(De.$$.fragment,o),N(Ge.$$.fragment,o),N(Le.$$.fragment,o),N(Be.$$.fragment,o),N(qe.$$.fragment,o),N(Oe.$$.fragment,o),N(Qe.$$.fragment,o),N(fe.$$.fragment,o),N(he.$$.fragment,o),N(He.$$.fragment,o),N(Ke.$$.fragment,o),N(to.$$.fragment,o),N(ue.$$.fragment,o),N(_e.$$.fragment,o),Bt=!1},d(o){t(h),o&&t($),o&&t(_),T(c),o&&t(wt),o&&t(Z),T(Te),o&&t(Nt),o&&t(te),o&&t(Tt),o&&t(no),o&&t($t),o&&t(io),o&&t(It),o&&t(lo),o&&t(Vt),o&&t(I),o&&t(Et),o&&t(po),o&&t(xt),o&&t(z),o&&t(Ct),o&&t(R),o&&t(zt),o&&t(D),T(je),o&&t(Pt),o&&t(ho),o&&t(Ft),T(Ue,o),o&&t(jt),o&&t(se),o&&t(Ut),o&&t(bo),o&&t(Wt),o&&t(G),T(ke),o&&t(Rt),o&&t(E),T(Je),T(ie),o&&t(kt),o&&t(q),T(Ze),o&&t(Jt),o&&t(O),T(Se),T(De),o&&t(At),o&&t(X),T(Ge),o&&t(Zt),o&&t(U),T(Le),T(Be),o&&t(St),o&&t(Y),T(qe),o&&t(Dt),o&&t(W),T(Oe),T(Qe),T(fe),T(he),o&&t(Gt),o&&t(H),T(He),o&&t(Lt),o&&t(x),T(Ke),T(to),T(ue),T(_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(C){return si(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wi extends oi{constructor(h){super();ti(this,h,hi,pi,ri,{})}}export{wi as default,fi as metadata};
