import{s as Qt,o as Ot,n as Je}from"../chunks/scheduler.25b97de1.js";import{S as Kt,i as eo,g as l,s,r as f,A as to,h as c,f as o,c as a,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.d9030fc9.js";import{T as At}from"../chunks/Tip.baa67368.js";import{D as R}from"../chunks/Docstring.e257edda.js";import{C as It}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Ct}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as oo}from"../chunks/PipelineTag.5f100392.js";import{H as J,E as no}from"../chunks/EditOnGithub.91d95064.js";function so(N){let r,y="Example:",m,p,v;return p=new It({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(){r=l("p"),r.textContent=y,m=s(),f(p.$$.fragment)},l(i){r=c(i,"P",{"data-svelte-h":!0}),M(r)!=="svelte-11lpom8"&&(r.textContent=y),m=a(i),g(p.$$.fragment,i)},m(i,T){n(i,r,T),n(i,m,T),h(p,i,T),v=!0},p:Je,i(i){v||(u(p.$$.fragment,i),v=!0)},o(i){_(p.$$.fragment,i),v=!1},d(i){i&&(o(r),o(m)),b(p,i)}}}function ao(N){let r,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(){r=l("p"),r.innerHTML=y},l(m){r=c(m,"P",{"data-svelte-h":!0}),M(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(m,p){n(m,r,p)},p:Je,d(m){m&&o(r)}}}function ro(N){let r,y="Example:",m,p,v;return p=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZU5ldFYxTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZW5ldF92MV8xLjBfMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlTmV0VjFNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlbmV0X3YxXzEuMF8yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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>, trust_remote_code=<span class="hljs-literal">True</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(){r=l("p"),r.textContent=y,m=s(),f(p.$$.fragment)},l(i){r=c(i,"P",{"data-svelte-h":!0}),M(r)!=="svelte-11lpom8"&&(r.textContent=y),m=a(i),g(p.$$.fragment,i)},m(i,T){n(i,r,T),n(i,m,T),h(p,i,T),v=!0},p:Je,i(i){v||(u(p.$$.fragment,i),v=!0)},o(i){_(p.$$.fragment,i),v=!1},d(i){i&&(o(r),o(m)),b(p,i)}}}function io(N){let r,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(){r=l("p"),r.innerHTML=y},l(m){r=c(m,"P",{"data-svelte-h":!0}),M(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(m,p){n(m,r,p)},p:Je,d(m){m&&o(r)}}}function lo(N){let r,y="Example:",m,p,v;return p=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME1vYmlsZU5ldFYxRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlbmV0X3YxXzEuMF8yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVOZXRWMUZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZW5ldF92MV8xLjBfMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",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>, trust_remote_code=<span class="hljs-literal">True</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(){r=l("p"),r.textContent=y,m=s(),f(p.$$.fragment)},l(i){r=c(i,"P",{"data-svelte-h":!0}),M(r)!=="svelte-11lpom8"&&(r.textContent=y),m=a(i),g(p.$$.fragment,i)},m(i,T){n(i,r,T),n(i,m,T),h(p,i,T),v=!0},p:Je,i(i){v||(u(p.$$.fragment,i),v=!0)},o(i){_(p.$$.fragment,i),v=!1},d(i){i&&(o(r),o(m)),b(p,i)}}}function co(N){let r,y,m,p,v,i,T,Pe,H,zt='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.',Ze,X,jt="The abstract from the paper is the following:",Ee,Y,Ut="<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>",ke,A,Ft='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>.',Le,Q,Ge,O,Wt='<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/pr_27818/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/pr_27818/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config">MobileNetV1Config</a> with <code>tf_padding = False</code>.</p></li>',Be,K,Rt="Unsupported features:",Se,ee,Jt='<li><p>The <a href="/docs/transformers/pr_27818/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>',qe,te,De,oe,Pt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with MobileNetV1.",He,ne,Xe,se,Zt='<li><a href="/docs/transformers/pr_27818/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>',Ye,ae,Et="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,Qe,$,ie,ct,we,kt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_27818/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.`,dt,Ne,Lt=`Configuration objects inherit from <a href="/docs/transformers/pr_27818/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/pr_27818/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,mt,P,Oe,le,Ke,F,ce,pt,Z,de,ft,xe,Gt="Preprocess an image or batch of images.",et,me,tt,C,pe,gt,Ve,Bt="Constructs a MobileNetV1 image processor.",ht,E,fe,ut,Ce,St="Preprocess an image or batch of images.",ot,ge,nt,I,he,_t,Ie,qt=`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.`,bt,x,ue,Mt,ze,Dt='The <a href="/docs/transformers/pr_27818/en/model_doc/mobilenet_v1#transformers.MobileNetV1Model">MobileNetV1Model</a> forward method, overrides the <code>__call__</code> special method.',vt,k,yt,L,st,_e,at,w,be,Tt,je,Ht=`MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,$t,Ue,Xt=`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.`,wt,V,Me,Nt,Fe,Yt='The <a href="/docs/transformers/pr_27818/en/model_doc/mobilenet_v1#transformers.MobileNetV1ForImageClassification">MobileNetV1ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',xt,G,Vt,B,rt,ve,it,Re,lt;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 oo({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/vr_27818/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py#L30"}}),P=new Ct({props:{anchor:"transformers.MobileNetV1Config.example",$$slots:{default:[so]},$$scope:{ctx:N}}}),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/vr_27818/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/vr_27818/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/vr_27818/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/vr_27818/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/pr_27818/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/pr_27818/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/vr_27818/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L290"}}),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/pr_27818/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_27818/en/model_doc/levit#transformers.LevitFeatureExtractor.__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/pr_27818/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_27818/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L348",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/pr_27818/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 At({props:{$$slots:{default:[ao]},$$scope:{ctx:N}}}),L=new Ct({props:{anchor:"transformers.MobileNetV1Model.forward.example",$$slots:{default:[ro]},$$scope:{ctx:N}}}),_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/pr_27818/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/pr_27818/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/vr_27818/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L397"}}),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/pr_27818/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_27818/en/model_doc/levit#transformers.LevitFeatureExtractor.__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/pr_27818/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/vr_27818/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py#L420",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_27818/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/pr_27818/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/pr_27818/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new At({props:{$$slots:{default:[io]},$$scope:{ctx:N}}}),B=new Ct({props:{anchor:"transformers.MobileNetV1ForImageClassification.forward.example",$$slots:{default:[lo]},$$scope:{ctx:N}}}),ve=new no({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/mobilenet_v1.md"}}),{c(){r=l("meta"),y=s(),m=l("p"),p=s(),f(v.$$.fragment),i=s(),f(T.$$.fragment),Pe=s(),H=l("p"),H.innerHTML=zt,Ze=s(),X=l("p"),X.textContent=jt,Ee=s(),Y=l("p"),Y.innerHTML=Ut,ke=s(),A=l("p"),A.innerHTML=Ft,Le=s(),f(Q.$$.fragment),Ge=s(),O=l("ul"),O.innerHTML=Wt,Be=s(),K=l("p"),K.textContent=Rt,Se=s(),ee=l("ul"),ee.innerHTML=Jt,qe=s(),f(te.$$.fragment),De=s(),oe=l("p"),oe.textContent=Pt,He=s(),f(ne.$$.fragment),Xe=s(),se=l("ul"),se.innerHTML=Zt,Ye=s(),ae=l("p"),ae.textContent=Et,Ae=s(),f(re.$$.fragment),Qe=s(),$=l("div"),f(ie.$$.fragment),ct=s(),we=l("p"),we.innerHTML=kt,dt=s(),Ne=l("p"),Ne.innerHTML=Lt,mt=s(),f(P.$$.fragment),Oe=s(),f(le.$$.fragment),Ke=s(),F=l("div"),f(ce.$$.fragment),pt=s(),Z=l("div"),f(de.$$.fragment),ft=s(),xe=l("p"),xe.textContent=Gt,et=s(),f(me.$$.fragment),tt=s(),C=l("div"),f(pe.$$.fragment),gt=s(),Ve=l("p"),Ve.textContent=Bt,ht=s(),E=l("div"),f(fe.$$.fragment),ut=s(),Ce=l("p"),Ce.textContent=St,ot=s(),f(ge.$$.fragment),nt=s(),I=l("div"),f(he.$$.fragment),_t=s(),Ie=l("p"),Ie.innerHTML=qt,bt=s(),x=l("div"),f(ue.$$.fragment),Mt=s(),ze=l("p"),ze.innerHTML=Dt,vt=s(),f(k.$$.fragment),yt=s(),f(L.$$.fragment),st=s(),f(_e.$$.fragment),at=s(),w=l("div"),f(be.$$.fragment),Tt=s(),je=l("p"),je.textContent=Ht,$t=s(),Ue=l("p"),Ue.innerHTML=Xt,wt=s(),V=l("div"),f(Me.$$.fragment),Nt=s(),Fe=l("p"),Fe.innerHTML=Yt,xt=s(),f(G.$$.fragment),Vt=s(),f(B.$$.fragment),rt=s(),f(ve.$$.fragment),it=s(),Re=l("p"),this.h()},l(e){const t=to("svelte-u9bgzb",document.head);r=c(t,"META",{name:!0,content:!0}),t.forEach(o),y=a(e),m=c(e,"P",{}),j(m).forEach(o),p=a(e),g(v.$$.fragment,e),i=a(e),g(T.$$.fragment,e),Pe=a(e),H=c(e,"P",{"data-svelte-h":!0}),M(H)!=="svelte-1ix7v64"&&(H.innerHTML=zt),Ze=a(e),X=c(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-vfdo9a"&&(X.textContent=jt),Ee=a(e),Y=c(e,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-16h2ls5"&&(Y.innerHTML=Ut),ke=a(e),A=c(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-ny7mpp"&&(A.innerHTML=Ft),Le=a(e),g(Q.$$.fragment,e),Ge=a(e),O=c(e,"UL",{"data-svelte-h":!0}),M(O)!=="svelte-12o8k7c"&&(O.innerHTML=Wt),Be=a(e),K=c(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-3u9dfs"&&(K.textContent=Rt),Se=a(e),ee=c(e,"UL",{"data-svelte-h":!0}),M(ee)!=="svelte-iyuxnf"&&(ee.innerHTML=Jt),qe=a(e),g(te.$$.fragment,e),De=a(e),oe=c(e,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-f1ymhf"&&(oe.textContent=Pt),He=a(e),g(ne.$$.fragment,e),Xe=a(e),se=c(e,"UL",{"data-svelte-h":!0}),M(se)!=="svelte-thyb0c"&&(se.innerHTML=Zt),Ye=a(e),ae=c(e,"P",{"data-svelte-h":!0}),M(ae)!=="svelte-1xesile"&&(ae.textContent=Et),Ae=a(e),g(re.$$.fragment,e),Qe=a(e),$=c(e,"DIV",{class:!0});var z=j($);g(ie.$$.fragment,z),ct=a(z),we=c(z,"P",{"data-svelte-h":!0}),M(we)!=="svelte-l549ey"&&(we.innerHTML=kt),dt=a(z),Ne=c(z,"P",{"data-svelte-h":!0}),M(Ne)!=="svelte-veiqq3"&&(Ne.innerHTML=Lt),mt=a(z),g(P.$$.fragment,z),z.forEach(o),Oe=a(e),g(le.$$.fragment,e),Ke=a(e),F=c(e,"DIV",{class:!0});var ye=j(F);g(ce.$$.fragment,ye),pt=a(ye),Z=c(ye,"DIV",{class:!0});var Te=j(Z);g(de.$$.fragment,Te),ft=a(Te),xe=c(Te,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-1x3yxsa"&&(xe.textContent=Gt),Te.forEach(o),ye.forEach(o),et=a(e),g(me.$$.fragment,e),tt=a(e),C=c(e,"DIV",{class:!0});var W=j(C);g(pe.$$.fragment,W),gt=a(W),Ve=c(W,"P",{"data-svelte-h":!0}),M(Ve)!=="svelte-gnj3q"&&(Ve.textContent=Bt),ht=a(W),E=c(W,"DIV",{class:!0});var $e=j(E);g(fe.$$.fragment,$e),ut=a($e),Ce=c($e,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-1x3yxsa"&&(Ce.textContent=St),$e.forEach(o),W.forEach(o),ot=a(e),g(ge.$$.fragment,e),nt=a(e),I=c(e,"DIV",{class:!0});var We=j(I);g(he.$$.fragment,We),_t=a(We),Ie=c(We,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-1r1qhio"&&(Ie.innerHTML=qt),bt=a(We),x=c(We,"DIV",{class:!0});var S=j(x);g(ue.$$.fragment,S),Mt=a(S),ze=c(S,"P",{"data-svelte-h":!0}),M(ze)!=="svelte-5bqwnk"&&(ze.innerHTML=Dt),vt=a(S),g(k.$$.fragment,S),yt=a(S),g(L.$$.fragment,S),S.forEach(o),We.forEach(o),st=a(e),g(_e.$$.fragment,e),at=a(e),w=c(e,"DIV",{class:!0});var q=j(w);g(be.$$.fragment,q),Tt=a(q),je=c(q,"P",{"data-svelte-h":!0}),M(je)!=="svelte-1iywrls"&&(je.textContent=Ht),$t=a(q),Ue=c(q,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-1gjh92c"&&(Ue.innerHTML=Xt),wt=a(q),V=c(q,"DIV",{class:!0});var D=j(V);g(Me.$$.fragment,D),Nt=a(D),Fe=c(D,"P",{"data-svelte-h":!0}),M(Fe)!=="svelte-1uoh0a6"&&(Fe.innerHTML=Yt),xt=a(D),g(G.$$.fragment,D),Vt=a(D),g(B.$$.fragment,D),D.forEach(o),q.forEach(o),rt=a(e),g(ve.$$.fragment,e),it=a(e),Re=c(e,"P",{}),j(Re).forEach(o),this.h()},h(){U(r,"name","hf:doc:metadata"),U(r,"content",mo),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(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(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(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(w,"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,r),n(e,y,t),n(e,m,t),n(e,p,t),h(v,e,t),n(e,i,t),h(T,e,t),n(e,Pe,t),n(e,H,t),n(e,Ze,t),n(e,X,t),n(e,Ee,t),n(e,Y,t),n(e,ke,t),n(e,A,t),n(e,Le,t),h(Q,e,t),n(e,Ge,t),n(e,O,t),n(e,Be,t),n(e,K,t),n(e,Se,t),n(e,ee,t),n(e,qe,t),h(te,e,t),n(e,De,t),n(e,oe,t),n(e,He,t),h(ne,e,t),n(e,Xe,t),n(e,se,t),n(e,Ye,t),n(e,ae,t),n(e,Ae,t),h(re,e,t),n(e,Qe,t),n(e,$,t),h(ie,$,null),d($,ct),d($,we),d($,dt),d($,Ne),d($,mt),h(P,$,null),n(e,Oe,t),h(le,e,t),n(e,Ke,t),n(e,F,t),h(ce,F,null),d(F,pt),d(F,Z),h(de,Z,null),d(Z,ft),d(Z,xe),n(e,et,t),h(me,e,t),n(e,tt,t),n(e,C,t),h(pe,C,null),d(C,gt),d(C,Ve),d(C,ht),d(C,E),h(fe,E,null),d(E,ut),d(E,Ce),n(e,ot,t),h(ge,e,t),n(e,nt,t),n(e,I,t),h(he,I,null),d(I,_t),d(I,Ie),d(I,bt),d(I,x),h(ue,x,null),d(x,Mt),d(x,ze),d(x,vt),h(k,x,null),d(x,yt),h(L,x,null),n(e,st,t),h(_e,e,t),n(e,at,t),n(e,w,t),h(be,w,null),d(w,Tt),d(w,je),d(w,$t),d(w,Ue),d(w,wt),d(w,V),h(Me,V,null),d(V,Nt),d(V,Fe),d(V,xt),h(G,V,null),d(V,Vt),h(B,V,null),n(e,rt,t),h(ve,e,t),n(e,it,t),n(e,Re,t),lt=!0},p(e,[t]){const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),P.$set(z);const ye={};t&2&&(ye.$$scope={dirty:t,ctx:e}),k.$set(ye);const Te={};t&2&&(Te.$$scope={dirty:t,ctx:e}),L.$set(Te);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),G.$set(W);const $e={};t&2&&($e.$$scope={dirty:t,ctx:e}),B.$set($e)},i(e){lt||(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(G.$$.fragment,e),u(B.$$.fragment,e),u(ve.$$.fragment,e),lt=!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),_(G.$$.fragment,e),_(B.$$.fragment,e),_(ve.$$.fragment,e),lt=!1},d(e){e&&(o(y),o(m),o(p),o(i),o(Pe),o(H),o(Ze),o(X),o(Ee),o(Y),o(ke),o(A),o(Le),o(Ge),o(O),o(Be),o(K),o(Se),o(ee),o(qe),o(De),o(oe),o(He),o(Xe),o(se),o(Ye),o(ae),o(Ae),o(Qe),o($),o(Oe),o(Ke),o(F),o(et),o(tt),o(C),o(ot),o(nt),o(I),o(st),o(at),o(w),o(rt),o(it),o(Re)),o(r),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(G),b(B),b(ve,e)}}}const mo='{"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 po(N){return Ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yo extends Kt{constructor(r){super(),eo(this,r,po,co,Qt,{})}}export{yo as component};
