import{s as At,o as Yt,n as Re}from"../chunks/scheduler.9bc65507.js";import{S as Qt,i as Ot,g as l,s as r,r as f,A as Kt,h as c,f as o,c as i,j,u as g,x as M,k as U,y as d,a as n,v as h,d as u,t as _,w as b}from"../chunks/index.707bf1b6.js";import{T as Xt}from"../chunks/Tip.c2ecdbf4.js";import{D as R}from"../chunks/Docstring.17db21ae.js";import{C as Ct}from"../chunks/CodeBlock.54a9f38d.js";import{E as xt}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as eo}from"../chunks/PipelineTag.44585822.js";import{H as J}from"../chunks/Heading.342b1fa6.js";function to(w){let s,y="Example:",m,p,v;return p=new Ct({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`,wrap:!1}}),{c(){s=l("p"),s.textContent=y,m=r(),f(p.$$.fragment)},l(a){s=c(a,"P",{"data-svelte-h":!0}),M(s)!=="svelte-11lpom8"&&(s.textContent=y),m=i(a),g(p.$$.fragment,a)},m(a,T){n(a,s,T),n(a,m,T),h(p,a,T),v=!0},p:Re,i(a){v||(u(p.$$.fragment,a),v=!0)},o(a){_(p.$$.fragment,a),v=!1},d(a){a&&(o(s),o(m)),b(p,a)}}}function oo(w){let s,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=l("p"),s.innerHTML=y},l(m){s=c(m,"P",{"data-svelte-h":!0}),M(s)!=="svelte-fincs2"&&(s.innerHTML=y)},m(m,p){n(m,s,p)},p:Re,d(m){m&&o(s)}}}function no(w){let s,y="Example:",m,p,v;return p=new Ct({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>]`,wrap:!1}}),{c(){s=l("p"),s.textContent=y,m=r(),f(p.$$.fragment)},l(a){s=c(a,"P",{"data-svelte-h":!0}),M(s)!=="svelte-11lpom8"&&(s.textContent=y),m=i(a),g(p.$$.fragment,a)},m(a,T){n(a,s,T),n(a,m,T),h(p,a,T),v=!0},p:Re,i(a){v||(u(p.$$.fragment,a),v=!0)},o(a){_(p.$$.fragment,a),v=!1},d(a){a&&(o(s),o(m)),b(p,a)}}}function so(w){let s,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=l("p"),s.innerHTML=y},l(m){s=c(m,"P",{"data-svelte-h":!0}),M(s)!=="svelte-fincs2"&&(s.innerHTML=y)},m(m,p){n(m,s,p)},p:Re,d(m){m&&o(s)}}}function ao(w){let s,y="Example:",m,p,v;return p=new Ct({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`,wrap:!1}}),{c(){s=l("p"),s.textContent=y,m=r(),f(p.$$.fragment)},l(a){s=c(a,"P",{"data-svelte-h":!0}),M(s)!=="svelte-11lpom8"&&(s.textContent=y),m=i(a),g(p.$$.fragment,a)},m(a,T){n(a,s,T),n(a,m,T),h(p,a,T),v=!0},p:Re,i(a){v||(u(p.$$.fragment,a),v=!0)},o(a){_(p.$$.fragment,a),v=!1},d(a){a&&(o(s),o(m)),b(p,a)}}}function ro(w){let s,y,m,p,v,a,T,Je,H,Vt='The MobileNet model was proposed in <a href="https://arxiv.org/abs/1704.04861" rel="nofollow">MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications</a> by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam.',Pe,X,It="The abstract from the paper is the following:",Ze,A,zt="<em>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.</em>",Ee,Y,jt='This model was contributed by <a href="https://huggingface.co/Matthijs" rel="nofollow">matthijs</a>. The original code and weights can be found <a href="https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md" rel="nofollow">here</a>.',ke,Q,Le,O,Ut='<li><p>The checkpoints are named <strong>mobilenet_v1_<em>depth</em>_<em>size</em></strong>, for example <strong>mobilenet_v1_1.0_224</strong>, where <strong>1.0</strong> is the depth multiplier (sometimes also referred to as “alpha” or the width multiplier) and <strong>224</strong> is the resolution of the input images the model was trained on.</p></li> <li><p>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.</p></li> <li><p>One can use <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1ImageProcessor">MobileNetV1ImageProcessor</a> to prepare images for the model.</p></li> <li><p>The available image classification checkpoints are pre-trained on <a href="https://huggingface.co/datasets/imagenet-1k" rel="nofollow">ImageNet-1k</a> (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 “background” class (index 0).</p></li> <li><p>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 <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config">MobileNetV1Config</a> with <code>tf_padding = False</code>.</p></li>',Be,K,Ft="Unsupported features:",Ge,ee,Wt='<li><p>The <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model">MobileNetV1Model</a> 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.</p></li> <li><p>It is currently not possible to specify an <code>output_stride</code>. 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.</p></li> <li><p>The original TensorFlow checkpoints include quantized models. We do not support these models as they include additional “FakeQuantization” operations to unquantize the weights.</p></li> <li><p>It’s common to extract the output from the pointwise layers at indices 5, 11, 12, 13 for downstream purposes. Using <code>output_hidden_states=True</code> returns the output from all intermediate layers. There is currently no way to limit this to specific layers.</p></li>',Se,te,qe,oe,Rt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with MobileNetV1.",De,ne,He,se,Jt='<li><a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification">MobileNetV1ForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',Xe,ae,Pt="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",Ae,re,Ye,$,ie,it,$e,Zt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model">MobileNetV1Model</a>. 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
<a href="https://huggingface.co/google/mobilenet_v1_1.0_224" rel="nofollow">google/mobilenet_v1_1.0_224</a> architecture.`,lt,Ne,Et=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ct,P,Qe,le,Oe,F,ce,dt,Z,de,mt,we,kt="Preprocess an image or batch of images.",Ke,me,et,V,pe,pt,xe,Lt="Constructs a MobileNetV1 image processor.",ft,E,fe,gt,Ce,Bt="Preprocess an image or batch of images.",tt,ge,ot,I,he,ht,Ve,Gt=`The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,ut,x,ue,_t,Ie,St='The <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model">MobileNetV1Model</a> forward method, overrides the <code>__call__</code> special method.',bt,k,Mt,L,nt,_e,st,N,be,vt,ze,qt=`MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,yt,je,Dt=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Tt,C,Me,$t,Ue,Ht='The <a href="/docs/transformers/main/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification">MobileNetV1ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Nt,B,wt,G,at,We,rt;return v=new J({props:{title:"MobileNet V1",local:"mobilenet-v1",headingTag:"h1"}}),T=new J({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Q=new J({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),te=new J({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ne=new eo({props:{pipeline:"image-classification"}}),re=new J({props:{title:"MobileNetV1Config",local:"transformers.MobileNetV1Config",headingTag:"h2"}}),ie=new R({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>, <em>optional</em>, 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/main/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py#L36"}}),P=new xt({props:{anchor:"transformers.MobileNetV1Config.example",$$slots:{default:[to]},$$scope:{ctx:w}}}),le=new J({props:{title:"MobileNetV1FeatureExtractor",local:"transformers.MobileNetV1FeatureExtractor",headingTag:"h2"}}),ce=new R({props:{name:"class transformers.MobileNetV1FeatureExtractor",anchor:"transformers.MobileNetV1FeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v1/feature_extraction_mobilenet_v1.py#L26"}}),de=new R({props:{name:"preprocess",anchor:"transformers.MobileNetV1FeatureExtractor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV1FeatureExtractor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,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/main/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L184"}}),me=new J({props:{title:"MobileNetV1ImageProcessor",local:"transformers.MobileNetV1ImageProcessor",headingTag:"h2"}}),pe=new R({props:{name:"class transformers.MobileNetV1ImageProcessor",anchor:"transformers.MobileNetV1ImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = 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/main/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L47"}}),fe=new R({props:{name:"preprocess",anchor:"transformers.MobileNetV1ImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileNetV1ImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,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/main/src/transformers/models/mobilenet_v1/image_processing_mobilenet_v1.py#L184"}}),ge=new J({props:{title:"MobileNetV1Model",local:"transformers.MobileNetV1Model",headingTag:"h2"}}),he=new R({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L297"}}),ue=new R({props:{name:"forward",anchor:"transformers.MobileNetV1Model.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L355",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilenet_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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),k=new Xt({props:{$$slots:{default:[oo]},$$scope:{ctx:w}}}),L=new xt({props:{anchor:"transformers.MobileNetV1Model.forward.example",$$slots:{default:[no]},$$scope:{ctx:w}}}),_e=new J({props:{title:"MobileNetV1ForImageClassification",local:"transformers.MobileNetV1ForImageClassification",headingTag:"h2"}}),be=new R({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L404"}}),Me=new R({props:{name:"forward",anchor:"transformers.MobileNetV1ForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L427",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mobilenet_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) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),B=new Xt({props:{$$slots:{default:[so]},$$scope:{ctx:w}}}),G=new xt({props:{anchor:"transformers.MobileNetV1ForImageClassification.forward.example",$$slots:{default:[ao]},$$scope:{ctx:w}}}),{c(){s=l("meta"),y=r(),m=l("p"),p=r(),f(v.$$.fragment),a=r(),f(T.$$.fragment),Je=r(),H=l("p"),H.innerHTML=Vt,Pe=r(),X=l("p"),X.textContent=It,Ze=r(),A=l("p"),A.innerHTML=zt,Ee=r(),Y=l("p"),Y.innerHTML=jt,ke=r(),f(Q.$$.fragment),Le=r(),O=l("ul"),O.innerHTML=Ut,Be=r(),K=l("p"),K.textContent=Ft,Ge=r(),ee=l("ul"),ee.innerHTML=Wt,Se=r(),f(te.$$.fragment),qe=r(),oe=l("p"),oe.textContent=Rt,De=r(),f(ne.$$.fragment),He=r(),se=l("ul"),se.innerHTML=Jt,Xe=r(),ae=l("p"),ae.textContent=Pt,Ae=r(),f(re.$$.fragment),Ye=r(),$=l("div"),f(ie.$$.fragment),it=r(),$e=l("p"),$e.innerHTML=Zt,lt=r(),Ne=l("p"),Ne.innerHTML=Et,ct=r(),f(P.$$.fragment),Qe=r(),f(le.$$.fragment),Oe=r(),F=l("div"),f(ce.$$.fragment),dt=r(),Z=l("div"),f(de.$$.fragment),mt=r(),we=l("p"),we.textContent=kt,Ke=r(),f(me.$$.fragment),et=r(),V=l("div"),f(pe.$$.fragment),pt=r(),xe=l("p"),xe.textContent=Lt,ft=r(),E=l("div"),f(fe.$$.fragment),gt=r(),Ce=l("p"),Ce.textContent=Bt,tt=r(),f(ge.$$.fragment),ot=r(),I=l("div"),f(he.$$.fragment),ht=r(),Ve=l("p"),Ve.innerHTML=Gt,ut=r(),x=l("div"),f(ue.$$.fragment),_t=r(),Ie=l("p"),Ie.innerHTML=St,bt=r(),f(k.$$.fragment),Mt=r(),f(L.$$.fragment),nt=r(),f(_e.$$.fragment),st=r(),N=l("div"),f(be.$$.fragment),vt=r(),ze=l("p"),ze.textContent=qt,yt=r(),je=l("p"),je.innerHTML=Dt,Tt=r(),C=l("div"),f(Me.$$.fragment),$t=r(),Ue=l("p"),Ue.innerHTML=Ht,Nt=r(),f(B.$$.fragment),wt=r(),f(G.$$.fragment),at=r(),We=l("p"),this.h()},l(e){const t=Kt("svelte-u9bgzb",document.head);s=c(t,"META",{name:!0,content:!0}),t.forEach(o),y=i(e),m=c(e,"P",{}),j(m).forEach(o),p=i(e),g(v.$$.fragment,e),a=i(e),g(T.$$.fragment,e),Je=i(e),H=c(e,"P",{"data-svelte-h":!0}),M(H)!=="svelte-1ix7v64"&&(H.innerHTML=Vt),Pe=i(e),X=c(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-vfdo9a"&&(X.textContent=It),Ze=i(e),A=c(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-16h2ls5"&&(A.innerHTML=zt),Ee=i(e),Y=c(e,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-ny7mpp"&&(Y.innerHTML=jt),ke=i(e),g(Q.$$.fragment,e),Le=i(e),O=c(e,"UL",{"data-svelte-h":!0}),M(O)!=="svelte-70528o"&&(O.innerHTML=Ut),Be=i(e),K=c(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-3u9dfs"&&(K.textContent=Ft),Ge=i(e),ee=c(e,"UL",{"data-svelte-h":!0}),M(ee)!=="svelte-1517n0v"&&(ee.innerHTML=Wt),Se=i(e),g(te.$$.fragment,e),qe=i(e),oe=c(e,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-f1ymhf"&&(oe.textContent=Rt),De=i(e),g(ne.$$.fragment,e),He=i(e),se=c(e,"UL",{"data-svelte-h":!0}),M(se)!=="svelte-ossqn4"&&(se.innerHTML=Jt),Xe=i(e),ae=c(e,"P",{"data-svelte-h":!0}),M(ae)!=="svelte-1xesile"&&(ae.textContent=Pt),Ae=i(e),g(re.$$.fragment,e),Ye=i(e),$=c(e,"DIV",{class:!0});var z=j($);g(ie.$$.fragment,z),it=i(z),$e=c(z,"P",{"data-svelte-h":!0}),M($e)!=="svelte-veayma"&&($e.innerHTML=Zt),lt=i(z),Ne=c(z,"P",{"data-svelte-h":!0}),M(Ne)!=="svelte-o55m63"&&(Ne.innerHTML=Et),ct=i(z),g(P.$$.fragment,z),z.forEach(o),Qe=i(e),g(le.$$.fragment,e),Oe=i(e),F=c(e,"DIV",{class:!0});var ve=j(F);g(ce.$$.fragment,ve),dt=i(ve),Z=c(ve,"DIV",{class:!0});var ye=j(Z);g(de.$$.fragment,ye),mt=i(ye),we=c(ye,"P",{"data-svelte-h":!0}),M(we)!=="svelte-1x3yxsa"&&(we.textContent=kt),ye.forEach(o),ve.forEach(o),Ke=i(e),g(me.$$.fragment,e),et=i(e),V=c(e,"DIV",{class:!0});var W=j(V);g(pe.$$.fragment,W),pt=i(W),xe=c(W,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-gnj3q"&&(xe.textContent=Lt),ft=i(W),E=c(W,"DIV",{class:!0});var Te=j(E);g(fe.$$.fragment,Te),gt=i(Te),Ce=c(Te,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-1x3yxsa"&&(Ce.textContent=Bt),Te.forEach(o),W.forEach(o),tt=i(e),g(ge.$$.fragment,e),ot=i(e),I=c(e,"DIV",{class:!0});var Fe=j(I);g(he.$$.fragment,Fe),ht=i(Fe),Ve=c(Fe,"P",{"data-svelte-h":!0}),M(Ve)!=="svelte-1r1qhio"&&(Ve.innerHTML=Gt),ut=i(Fe),x=c(Fe,"DIV",{class:!0});var S=j(x);g(ue.$$.fragment,S),_t=i(S),Ie=c(S,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-c7qr24"&&(Ie.innerHTML=St),bt=i(S),g(k.$$.fragment,S),Mt=i(S),g(L.$$.fragment,S),S.forEach(o),Fe.forEach(o),nt=i(e),g(_e.$$.fragment,e),st=i(e),N=c(e,"DIV",{class:!0});var q=j(N);g(be.$$.fragment,q),vt=i(q),ze=c(q,"P",{"data-svelte-h":!0}),M(ze)!=="svelte-1iywrls"&&(ze.textContent=qt),yt=i(q),je=c(q,"P",{"data-svelte-h":!0}),M(je)!=="svelte-1gjh92c"&&(je.innerHTML=Dt),Tt=i(q),C=c(q,"DIV",{class:!0});var D=j(C);g(Me.$$.fragment,D),$t=i(D),Ue=c(D,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-1488092"&&(Ue.innerHTML=Ht),Nt=i(D),g(B.$$.fragment,D),wt=i(D),g(G.$$.fragment,D),D.forEach(o),q.forEach(o),at=i(e),We=c(e,"P",{}),j(We).forEach(o),this.h()},h(){U(s,"name","hf:doc:metadata"),U(s,"content",io),U($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){d(document.head,s),n(e,y,t),n(e,m,t),n(e,p,t),h(v,e,t),n(e,a,t),h(T,e,t),n(e,Je,t),n(e,H,t),n(e,Pe,t),n(e,X,t),n(e,Ze,t),n(e,A,t),n(e,Ee,t),n(e,Y,t),n(e,ke,t),h(Q,e,t),n(e,Le,t),n(e,O,t),n(e,Be,t),n(e,K,t),n(e,Ge,t),n(e,ee,t),n(e,Se,t),h(te,e,t),n(e,qe,t),n(e,oe,t),n(e,De,t),h(ne,e,t),n(e,He,t),n(e,se,t),n(e,Xe,t),n(e,ae,t),n(e,Ae,t),h(re,e,t),n(e,Ye,t),n(e,$,t),h(ie,$,null),d($,it),d($,$e),d($,lt),d($,Ne),d($,ct),h(P,$,null),n(e,Qe,t),h(le,e,t),n(e,Oe,t),n(e,F,t),h(ce,F,null),d(F,dt),d(F,Z),h(de,Z,null),d(Z,mt),d(Z,we),n(e,Ke,t),h(me,e,t),n(e,et,t),n(e,V,t),h(pe,V,null),d(V,pt),d(V,xe),d(V,ft),d(V,E),h(fe,E,null),d(E,gt),d(E,Ce),n(e,tt,t),h(ge,e,t),n(e,ot,t),n(e,I,t),h(he,I,null),d(I,ht),d(I,Ve),d(I,ut),d(I,x),h(ue,x,null),d(x,_t),d(x,Ie),d(x,bt),h(k,x,null),d(x,Mt),h(L,x,null),n(e,nt,t),h(_e,e,t),n(e,st,t),n(e,N,t),h(be,N,null),d(N,vt),d(N,ze),d(N,yt),d(N,je),d(N,Tt),d(N,C),h(Me,C,null),d(C,$t),d(C,Ue),d(C,Nt),h(B,C,null),d(C,wt),h(G,C,null),n(e,at,t),n(e,We,t),rt=!0},p(e,[t]){const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),P.$set(z);const ve={};t&2&&(ve.$$scope={dirty:t,ctx:e}),k.$set(ve);const ye={};t&2&&(ye.$$scope={dirty:t,ctx:e}),L.$set(ye);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),B.$set(W);const Te={};t&2&&(Te.$$scope={dirty:t,ctx:e}),G.$set(Te)},i(e){rt||(u(v.$$.fragment,e),u(T.$$.fragment,e),u(Q.$$.fragment,e),u(te.$$.fragment,e),u(ne.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(P.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(pe.$$.fragment,e),u(fe.$$.fragment,e),u(ge.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(k.$$.fragment,e),u(L.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(Me.$$.fragment,e),u(B.$$.fragment,e),u(G.$$.fragment,e),rt=!0)},o(e){_(v.$$.fragment,e),_(T.$$.fragment,e),_(Q.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(P.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(fe.$$.fragment,e),_(ge.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(k.$$.fragment,e),_(L.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(Me.$$.fragment,e),_(B.$$.fragment,e),_(G.$$.fragment,e),rt=!1},d(e){e&&(o(y),o(m),o(p),o(a),o(Je),o(H),o(Pe),o(X),o(Ze),o(A),o(Ee),o(Y),o(ke),o(Le),o(O),o(Be),o(K),o(Ge),o(ee),o(Se),o(qe),o(oe),o(De),o(He),o(se),o(Xe),o(ae),o(Ae),o(Ye),o($),o(Qe),o(Oe),o(F),o(Ke),o(et),o(V),o(tt),o(ot),o(I),o(nt),o(st),o(N),o(at),o(We)),o(s),b(v,e),b(T,e),b(Q,e),b(te,e),b(ne,e),b(re,e),b(ie),b(P),b(le,e),b(ce),b(de),b(me,e),b(pe),b(fe),b(ge,e),b(he),b(ue),b(k),b(L),b(_e,e),b(be),b(Me),b(B),b(G)}}}const io='{"title":"MobileNet V1","local":"mobilenet-v1","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"MobileNetV1Config","local":"transformers.MobileNetV1Config","sections":[],"depth":2},{"title":"MobileNetV1FeatureExtractor","local":"transformers.MobileNetV1FeatureExtractor","sections":[],"depth":2},{"title":"MobileNetV1ImageProcessor","local":"transformers.MobileNetV1ImageProcessor","sections":[],"depth":2},{"title":"MobileNetV1Model","local":"transformers.MobileNetV1Model","sections":[],"depth":2},{"title":"MobileNetV1ForImageClassification","local":"transformers.MobileNetV1ForImageClassification","sections":[],"depth":2}],"depth":1}';function lo(w){return Yt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bo extends Qt{constructor(s){super(),Ot(this,s,lo,ro,At,{})}}export{bo as component};
