import{s as lt,o as dt,n as pt}from"../chunks/scheduler.25b97de1.js";import{S as gt,i as ft,g as s,s as o,r as l,A as ht,h as i,f as t,c as a,j as y,u as d,x as M,k as $,y as r,a as c,v as p,d as g,t as f,w as h}from"../chunks/index.d9030fc9.js";import{D as P}from"../chunks/Docstring.ffac8efa.js";import{C as ut}from"../chunks/CodeBlock.e6cd0d95.js";import{E as _t}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as he,E as vt}from"../chunks/EditOnGithub.91d95064.js";function bt(ue){let u,q="Examples:",C,x,I;return x=new ut({props:{code:"JTIzJTIwV2UlMjBjYW4ndCUyMGluc3RhbnRpYXRlJTIwZGlyZWN0bHklMjB0aGUlMjBiYXNlJTIwY2xhc3MlMjAqSW1hZ2VQcm9jZXNzaW5nTWl4aW4qJTIwc28lMjBsZXQncyUyMHNob3clMjB0aGUlMjBleGFtcGxlcyUyMG9uJTIwYSUwQSUyMyUyMGRlcml2ZWQlMjBjbGFzcyUzQSUyMCpDTElQSW1hZ2VQcm9jZXNzb3IqJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQ0xJUEltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIlMEEpJTIwJTIwJTIzJTIwRG93bmxvYWQlMjBpbWFnZV9wcm9jZXNzaW5nX2NvbmZpZyUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiUwQSklMjAlMjAlMjMlMjBFLmcuJTIwaW1hZ2UlMjBwcm9jZXNzb3IlMjAob3IlMjBtb2RlbCklMjB3YXMlMjBzYXZlZCUyMHVzaW5nJTIwKnNhdmVfcHJldHJhaW5lZCgnLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRicpKiUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRnByZXByb2Nlc3Nvcl9jb25maWcuanNvbiUyMiklMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBDTElQSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiUyQyUyMGRvX25vcm1hbGl6ZSUzREZhbHNlJTJDJTIwZm9vJTNERmFsc2UlMEEpJTBBYXNzZXJ0JTIwaW1hZ2VfcHJvY2Vzc29yLmRvX25vcm1hbGl6ZSUyMGlzJTIwRmFsc2UlMEFpbWFnZV9wcm9jZXNzb3IlMkMlMjB1bnVzZWRfa3dhcmdzJTIwJTNEJTIwQ0xJUEltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIlMkMlMjBkb19ub3JtYWxpemUlM0RGYWxzZSUyQyUyMGZvbyUzREZhbHNlJTJDJTIwcmV0dXJuX3VudXNlZF9rd2FyZ3MlM0RUcnVlJTBBKSUwQWFzc2VydCUyMGltYWdlX3Byb2Nlc3Nvci5kb19ub3JtYWxpemUlMjBpcyUyMEZhbHNlJTBBYXNzZXJ0JTIwdW51c2VkX2t3YXJncyUyMCUzRCUzRCUyMCU3QiUyMmZvbyUyMiUzQSUyMEZhbHNlJTdE",highlighted:`<span class="hljs-comment"># We can&#x27;t instantiate directly the base class *ImageProcessingMixin* so let&#x27;s show the examples on a</span>
<span class="hljs-comment"># derived class: *CLIPImageProcessor*</span>
image_processor = CLIPImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>
)  <span class="hljs-comment"># Download image_processing_config from huggingface.co and cache.</span>
image_processor = CLIPImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;./test/saved_model/&quot;</span>
)  <span class="hljs-comment"># E.g. image processor (or model) was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)*</span>
image_processor = CLIPImageProcessor.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/preprocessor_config.json&quot;</span>)
image_processor = CLIPImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>, do_normalize=<span class="hljs-literal">False</span>, foo=<span class="hljs-literal">False</span>
)
<span class="hljs-keyword">assert</span> image_processor.do_normalize <span class="hljs-keyword">is</span> <span class="hljs-literal">False</span>
image_processor, unused_kwargs = CLIPImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>, do_normalize=<span class="hljs-literal">False</span>, foo=<span class="hljs-literal">False</span>, return_unused_kwargs=<span class="hljs-literal">True</span>
)
<span class="hljs-keyword">assert</span> image_processor.do_normalize <span class="hljs-keyword">is</span> <span class="hljs-literal">False</span>
<span class="hljs-keyword">assert</span> unused_kwargs == {<span class="hljs-string">&quot;foo&quot;</span>: <span class="hljs-literal">False</span>}`,wrap:!1}}),{c(){u=s("p"),u.textContent=q,C=o(),l(x.$$.fragment)},l(m){u=i(m,"P",{"data-svelte-h":!0}),M(u)!=="svelte-kvfsh7"&&(u.textContent=q),C=a(m),d(x.$$.fragment,m)},m(m,w){c(m,u,w),c(m,C,w),p(x,m,w),I=!0},p:pt,i(m){I||(g(x.$$.fragment,m),I=!0)},o(m){f(x.$$.fragment,m),I=!1},d(m){m&&(t(u),t(C)),h(x,m)}}}function yt(ue){let u,q,C,x,I,m,w,Ke="An image processor is in charge of preparing input features for vision models and post processing their outputs. This includes transformations such as resizing, normalization, and conversion to PyTorch, TensorFlow, Flax and Numpy tensors. It may also include model specific post-processing such as converting logits to segmentation masks.",_e,W,ve,v,L,Fe,ne,Oe=`This is an image processor mixin used to provide saving/loading functionality for sequential and image feature
extractors.`,Je,B,E,ke,oe,et='Instantiate a type of <a href="/docs/transformers/pr_22105/en/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> from an image processor.',Ne,j,De,Z,R,qe,ae,tt=`Save an image processor object to the directory <code>save_directory</code>, so that it can be re-loaded using the
<a href="/docs/transformers/pr_22105/en/internal/image_processing_utils#transformers.ImageProcessingMixin.from_pretrained">from_pretrained()</a> class method.`,be,X,ye,_,V,We,se,rt='Holds the output of the <a href="/docs/transformers/pr_22105/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad">pad()</a> and feature extractor specific <code>__call__</code> methods.',Le,ie,nt="This class is derived from a python dictionary and can be used as a dictionary.",Ee,z,S,Re,ce,ot="Convert the inner content to tensors.",Xe,F,Y,Ve,me,at=`Send all values to device by calling <code>v.to(*args, **kwargs)</code> (PyTorch only). This should support casting in
different <code>dtypes</code> and sending the <code>BatchFeature</code> to a different <code>device</code>.`,$e,H,xe,b,A,Se,J,G,Ye,le,st=`Center crop an image to <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. If the input size is smaller than <code>crop_size</code> along
any edge, the image is padded with 0’s and then center cropped.`,He,k,Q,Ae,de,it="Normalize an image. image = (image - image_mean) / image_std.",Ge,N,K,Qe,pe,ct="Rescale an image by a scale factor. image = image * scale.",Ie,O,Me,ee,te,we,re,Te,fe,Pe;return I=new he({props:{title:"Image Processor",local:"image-processor",headingTag:"h1"}}),W=new he({props:{title:"ImageProcessingMixin",local:"transformers.ImageProcessingMixin",headingTag:"h2"}}),L=new P({props:{name:"class transformers.ImageProcessingMixin",anchor:"transformers.ImageProcessingMixin",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_base.py#L69"}}),E=new P({props:{name:"from_pretrained",anchor:"transformers.ImageProcessingMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": Union"},{name:"cache_dir",val:": Union = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": Union = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained image_processor hosted inside a model repo on
huggingface.co.</li>
<li>a path to a <em>directory</em> containing a image processor file saved using the
<a href="/docs/transformers/pr_22105/en/internal/image_processing_utils#transformers.ImageProcessingMixin.save_pretrained">save_pretrained()</a> method, e.g.,
<code>./my_model_directory/</code>.</li>
<li>a path or url to a saved image processor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model image processor should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force to (re-)download the image processor files and override the cached versions if
they exist.
resume_download &#x2014;
Deprecated and ignored. All downloads are now resumed by default when possible.
Will be removed in v5 of Transformers.`,name:"force_download"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}.</code> The proxies are used on each request.`,name:"proxies"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_base.py#L96",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A image processor of type <a
  href="/docs/transformers/pr_22105/en/internal/image_processing_utils#transformers.ImageProcessingMixin"
>ImageProcessingMixin</a>.</p>
`}}),j=new _t({props:{anchor:"transformers.ImageProcessingMixin.from_pretrained.example",$$slots:{default:[bt]},$$scope:{ctx:ue}}}),R=new P({props:{name:"save_pretrained",anchor:"transformers.ImageProcessingMixin.save_pretrained",parameters:[{name:"save_directory",val:": Union"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the image processor JSON file will be saved (will be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.ImageProcessingMixin.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.ImageProcessingMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/pr_22105/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_base.py#L210"}}),X=new he({props:{title:"BatchFeature",local:"transformers.BatchFeature",headingTag:"h2"}}),V=new P({props:{name:"class transformers.BatchFeature",anchor:"transformers.BatchFeature",parameters:[{name:"data",val:": Optional = None"},{name:"tensor_type",val:": Union = None"}],parametersDescription:[{anchor:"transformers.BatchFeature.data",description:`<strong>data</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of lists/arrays/tensors returned by the <strong>call</strong>/pad methods (&#x2018;input_values&#x2019;, &#x2018;attention_mask&#x2019;,
etc.).`,name:"data"},{anchor:"transformers.BatchFeature.tensor_type",description:`<strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) &#x2014;
You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.`,name:"tensor_type"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/feature_extraction_utils.py#L62"}}),S=new P({props:{name:"convert_to_tensors",anchor:"transformers.BatchFeature.convert_to_tensors",parameters:[{name:"tensor_type",val:": Union = None"}],parametersDescription:[{anchor:"transformers.BatchFeature.convert_to_tensors.tensor_type",description:`<strong>tensor_type</strong> (<code>str</code> or <a href="/docs/transformers/pr_22105/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
The type of tensors to use. If <code>str</code>, should be one of the values of the enum <a href="/docs/transformers/pr_22105/en/internal/file_utils#transformers.TensorType">TensorType</a>. If
<code>None</code>, no modification is done.`,name:"tensor_type"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/feature_extraction_utils.py#L175"}}),Y=new P({props:{name:"to",anchor:"transformers.BatchFeature.to",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BatchFeature.to.args",description:`<strong>args</strong> (<code>Tuple</code>) &#x2014;
Will be passed to the <code>to(...)</code> function of the tensors.`,name:"args"},{anchor:"transformers.BatchFeature.to.kwargs",description:`<strong>kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>to(...)</code> function of the tensors.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/feature_extraction_utils.py#L206",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The same instance after modification.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_22105/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),H=new he({props:{title:"BaseImageProcessor",local:"transformers.BaseImageProcessor",headingTag:"h2"}}),A=new P({props:{name:"class transformers.BaseImageProcessor",anchor:"transformers.BaseImageProcessor",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_utils.py#L35"}}),G=new P({props:{name:"center_crop",anchor:"transformers.BaseImageProcessor.center_crop",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": Dict"},{name:"data_format",val:": Union = None"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BaseImageProcessor.center_crop.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to center crop.`,name:"image"},{anchor:"transformers.BaseImageProcessor.center_crop.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image.`,name:"size"},{anchor:"transformers.BaseImageProcessor.center_crop.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format for the output image. If unset, the channel dimension format of the input
image is used. 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>
</ul>`,name:"data_format"},{anchor:"transformers.BaseImageProcessor.center_crop.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>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_utils.py#L115"}}),Q=new P({props:{name:"normalize",anchor:"transformers.BaseImageProcessor.normalize",parameters:[{name:"image",val:": ndarray"},{name:"mean",val:": Union"},{name:"std",val:": Union"},{name:"data_format",val:": Union = None"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BaseImageProcessor.normalize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to normalize.`,name:"image"},{anchor:"transformers.BaseImageProcessor.normalize.mean",description:`<strong>mean</strong> (<code>float</code> or <code>Iterable[float]</code>) &#x2014;
Image mean to use for normalization.`,name:"mean"},{anchor:"transformers.BaseImageProcessor.normalize.std",description:`<strong>std</strong> (<code>float</code> or <code>Iterable[float]</code>) &#x2014;
Image standard deviation to use for normalization.`,name:"std"},{anchor:"transformers.BaseImageProcessor.normalize.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format for the output image. If unset, the channel dimension format of the input
image is used. 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>
</ul>`,name:"data_format"},{anchor:"transformers.BaseImageProcessor.normalize.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>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_utils.py#L78",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The normalized image.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>np.ndarray</code></p>
`}}),K=new P({props:{name:"rescale",anchor:"transformers.BaseImageProcessor.rescale",parameters:[{name:"image",val:": ndarray"},{name:"scale",val:": float"},{name:"data_format",val:": Union = None"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BaseImageProcessor.rescale.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to rescale.`,name:"image"},{anchor:"transformers.BaseImageProcessor.rescale.scale",description:`<strong>scale</strong> (<code>float</code>) &#x2014;
The scaling factor to rescale pixel values by.`,name:"scale"},{anchor:"transformers.BaseImageProcessor.rescale.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format for the output image. If unset, the channel dimension format of the input
image is used. 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>
</ul>`,name:"data_format"},{anchor:"transformers.BaseImageProcessor.rescale.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>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_utils.py#L46",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The rescaled image.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>np.ndarray</code></p>
`}}),O=new he({props:{title:"BaseImageProcessorFast",local:"transformers.BaseImageProcessorFast",headingTag:"h2"}}),te=new P({props:{name:"class transformers.BaseImageProcessorFast",anchor:"transformers.BaseImageProcessorFast",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/image_processing_utils_fast.py#L46"}}),re=new vt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/main_classes/image_processor.md"}}),{c(){u=s("meta"),q=o(),C=s("p"),x=o(),l(I.$$.fragment),m=o(),w=s("p"),w.textContent=Ke,_e=o(),l(W.$$.fragment),ve=o(),v=s("div"),l(L.$$.fragment),Fe=o(),ne=s("p"),ne.textContent=Oe,Je=o(),B=s("div"),l(E.$$.fragment),ke=o(),oe=s("p"),oe.innerHTML=et,Ne=o(),l(j.$$.fragment),De=o(),Z=s("div"),l(R.$$.fragment),qe=o(),ae=s("p"),ae.innerHTML=tt,be=o(),l(X.$$.fragment),ye=o(),_=s("div"),l(V.$$.fragment),We=o(),se=s("p"),se.innerHTML=rt,Le=o(),ie=s("p"),ie.textContent=nt,Ee=o(),z=s("div"),l(S.$$.fragment),Re=o(),ce=s("p"),ce.textContent=ot,Xe=o(),F=s("div"),l(Y.$$.fragment),Ve=o(),me=s("p"),me.innerHTML=at,$e=o(),l(H.$$.fragment),xe=o(),b=s("div"),l(A.$$.fragment),Se=o(),J=s("div"),l(G.$$.fragment),Ye=o(),le=s("p"),le.innerHTML=st,He=o(),k=s("div"),l(Q.$$.fragment),Ae=o(),de=s("p"),de.textContent=it,Ge=o(),N=s("div"),l(K.$$.fragment),Qe=o(),pe=s("p"),pe.textContent=ct,Ie=o(),l(O.$$.fragment),Me=o(),ee=s("div"),l(te.$$.fragment),we=o(),l(re.$$.fragment),Te=o(),fe=s("p"),this.h()},l(e){const n=ht("svelte-u9bgzb",document.head);u=i(n,"META",{name:!0,content:!0}),n.forEach(t),q=a(e),C=i(e,"P",{}),y(C).forEach(t),x=a(e),d(I.$$.fragment,e),m=a(e),w=i(e,"P",{"data-svelte-h":!0}),M(w)!=="svelte-l9ii3n"&&(w.textContent=Ke),_e=a(e),d(W.$$.fragment,e),ve=a(e),v=i(e,"DIV",{class:!0});var T=y(v);d(L.$$.fragment,T),Fe=a(T),ne=i(T,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-16ht4m3"&&(ne.textContent=Oe),Je=a(T),B=i(T,"DIV",{class:!0});var ge=y(B);d(E.$$.fragment,ge),ke=a(ge),oe=i(ge,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-1xlszvn"&&(oe.innerHTML=et),Ne=a(ge),d(j.$$.fragment,ge),ge.forEach(t),De=a(T),Z=i(T,"DIV",{class:!0});var Ce=y(Z);d(R.$$.fragment,Ce),qe=a(Ce),ae=i(Ce,"P",{"data-svelte-h":!0}),M(ae)!=="svelte-l7q09m"&&(ae.innerHTML=tt),Ce.forEach(t),T.forEach(t),be=a(e),d(X.$$.fragment,e),ye=a(e),_=i(e,"DIV",{class:!0});var U=y(_);d(V.$$.fragment,U),We=a(U),se=i(U,"P",{"data-svelte-h":!0}),M(se)!=="svelte-1s09dyq"&&(se.innerHTML=rt),Le=a(U),ie=i(U,"P",{"data-svelte-h":!0}),M(ie)!=="svelte-saqdtk"&&(ie.textContent=nt),Ee=a(U),z=i(U,"DIV",{class:!0});var Be=y(z);d(S.$$.fragment,Be),Re=a(Be),ce=i(Be,"P",{"data-svelte-h":!0}),M(ce)!=="svelte-pxfh9u"&&(ce.textContent=ot),Be.forEach(t),Xe=a(U),F=i(U,"DIV",{class:!0});var Ue=y(F);d(Y.$$.fragment,Ue),Ve=a(Ue),me=i(Ue,"P",{"data-svelte-h":!0}),M(me)!=="svelte-d0cfhs"&&(me.innerHTML=at),Ue.forEach(t),U.forEach(t),$e=a(e),d(H.$$.fragment,e),xe=a(e),b=i(e,"DIV",{class:!0});var D=y(b);d(A.$$.fragment,D),Se=a(D),J=i(D,"DIV",{class:!0});var je=y(J);d(G.$$.fragment,je),Ye=a(je),le=i(je,"P",{"data-svelte-h":!0}),M(le)!=="svelte-193kiu8"&&(le.innerHTML=st),je.forEach(t),He=a(D),k=i(D,"DIV",{class:!0});var Ze=y(k);d(Q.$$.fragment,Ze),Ae=a(Ze),de=i(Ze,"P",{"data-svelte-h":!0}),M(de)!=="svelte-1e5okex"&&(de.textContent=it),Ze.forEach(t),Ge=a(D),N=i(D,"DIV",{class:!0});var ze=y(N);d(K.$$.fragment,ze),Qe=a(ze),pe=i(ze,"P",{"data-svelte-h":!0}),M(pe)!=="svelte-qun0mt"&&(pe.textContent=ct),ze.forEach(t),D.forEach(t),Ie=a(e),d(O.$$.fragment,e),Me=a(e),ee=i(e,"DIV",{class:!0});var mt=y(ee);d(te.$$.fragment,mt),mt.forEach(t),we=a(e),d(re.$$.fragment,e),Te=a(e),fe=i(e,"P",{}),y(fe).forEach(t),this.h()},h(){$(u,"name","hf:doc:metadata"),$(u,"content",$t),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ee,"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,n){r(document.head,u),c(e,q,n),c(e,C,n),c(e,x,n),p(I,e,n),c(e,m,n),c(e,w,n),c(e,_e,n),p(W,e,n),c(e,ve,n),c(e,v,n),p(L,v,null),r(v,Fe),r(v,ne),r(v,Je),r(v,B),p(E,B,null),r(B,ke),r(B,oe),r(B,Ne),p(j,B,null),r(v,De),r(v,Z),p(R,Z,null),r(Z,qe),r(Z,ae),c(e,be,n),p(X,e,n),c(e,ye,n),c(e,_,n),p(V,_,null),r(_,We),r(_,se),r(_,Le),r(_,ie),r(_,Ee),r(_,z),p(S,z,null),r(z,Re),r(z,ce),r(_,Xe),r(_,F),p(Y,F,null),r(F,Ve),r(F,me),c(e,$e,n),p(H,e,n),c(e,xe,n),c(e,b,n),p(A,b,null),r(b,Se),r(b,J),p(G,J,null),r(J,Ye),r(J,le),r(b,He),r(b,k),p(Q,k,null),r(k,Ae),r(k,de),r(b,Ge),r(b,N),p(K,N,null),r(N,Qe),r(N,pe),c(e,Ie,n),p(O,e,n),c(e,Me,n),c(e,ee,n),p(te,ee,null),c(e,we,n),p(re,e,n),c(e,Te,n),c(e,fe,n),Pe=!0},p(e,[n]){const T={};n&2&&(T.$$scope={dirty:n,ctx:e}),j.$set(T)},i(e){Pe||(g(I.$$.fragment,e),g(W.$$.fragment,e),g(L.$$.fragment,e),g(E.$$.fragment,e),g(j.$$.fragment,e),g(R.$$.fragment,e),g(X.$$.fragment,e),g(V.$$.fragment,e),g(S.$$.fragment,e),g(Y.$$.fragment,e),g(H.$$.fragment,e),g(A.$$.fragment,e),g(G.$$.fragment,e),g(Q.$$.fragment,e),g(K.$$.fragment,e),g(O.$$.fragment,e),g(te.$$.fragment,e),g(re.$$.fragment,e),Pe=!0)},o(e){f(I.$$.fragment,e),f(W.$$.fragment,e),f(L.$$.fragment,e),f(E.$$.fragment,e),f(j.$$.fragment,e),f(R.$$.fragment,e),f(X.$$.fragment,e),f(V.$$.fragment,e),f(S.$$.fragment,e),f(Y.$$.fragment,e),f(H.$$.fragment,e),f(A.$$.fragment,e),f(G.$$.fragment,e),f(Q.$$.fragment,e),f(K.$$.fragment,e),f(O.$$.fragment,e),f(te.$$.fragment,e),f(re.$$.fragment,e),Pe=!1},d(e){e&&(t(q),t(C),t(x),t(m),t(w),t(_e),t(ve),t(v),t(be),t(ye),t(_),t($e),t(xe),t(b),t(Ie),t(Me),t(ee),t(we),t(Te),t(fe)),t(u),h(I,e),h(W,e),h(L),h(E),h(j),h(R),h(X,e),h(V),h(S),h(Y),h(H,e),h(A),h(G),h(Q),h(K),h(O,e),h(te),h(re,e)}}}const $t='{"title":"Image Processor","local":"image-processor","sections":[{"title":"ImageProcessingMixin","local":"transformers.ImageProcessingMixin","sections":[],"depth":2},{"title":"BatchFeature","local":"transformers.BatchFeature","sections":[],"depth":2},{"title":"BaseImageProcessor","local":"transformers.BaseImageProcessor","sections":[],"depth":2},{"title":"BaseImageProcessorFast","local":"transformers.BaseImageProcessorFast","sections":[],"depth":2}],"depth":1}';function xt(ue){return dt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bt extends gt{constructor(u){super(),ft(this,u,xt,yt,lt,{})}}export{Bt as component};
