import{s as Dt,o as Et,n as Lt}from"../chunks/scheduler.9bc65507.js";import{S as Wt,i as qt,g as n,s as a,u as g,A as St,h as o,f as r,c as s,j as l,v as h,y as f,k as i,o as t,a as d,w as u,d as _,t as v,x as y}from"../chunks/index.78c82d43.js";import{D as P}from"../chunks/Docstring.4e7352e2.js";import{C as Rt}from"../chunks/CodeBlock.73e038be.js";import{I as Ae}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Xt}from"../chunks/ExampleCodeBlock.872b014d.js";function At(Ce){let p,X="Examples:",M,$,x;return $=new Rt({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(){p=n("p"),p.textContent=X,M=a(),g($.$$.fragment)},l(m){p=o(m,"P",{"data-svelte-h":!0}),f(p)!=="svelte-kvfsh7"&&(p.textContent=X),M=s(m),h($.$$.fragment,m)},m(m,U){d(m,p,U),d(m,M,U),u($,m,U),x=!0},p:Lt,i(m){x||(_($.$$.fragment,m),x=!0)},o(m){v($.$$.fragment,m),x=!1},d(m){m&&(r(p),r(M)),y($,m)}}}function Vt(Ce){let p,X,M,$,x,m,U,A,Ve,ce,ft="Image Processor",Pe,V,ut="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.",Ue,B,j,Ie,Y,Ye,le,_t="ImageProcessingMixin",Be,w,H,He,me,vt=`This is an image processor mixin used to provide saving/loading functionality for sequential and image feature
extractors.`,Ge,T,G,Qe,de,yt='Instantiate a type of <a href="/docs/transformers/v4.34.0/en/main_classes/image_processor#transformers.ImageProcessingMixin">ImageProcessingMixin</a> from an image processor.',Ke,Z,Oe,z,Q,et,pe,bt=`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/v4.34.0/en/main_classes/image_processor#transformers.ImageProcessingMixin.from_pretrained">from_pretrained()</a> class method.`,Ne,N,J,$e,K,tt,ge,xt="BatchFeature",ke,b,O,rt,he,wt='Holds the output of the <a href="/docs/transformers/v4.34.0/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad">pad()</a> and feature extractor specific <code>__call__</code> methods.',nt,fe,It="This class is derived from a python dictionary and can be used as a dictionary.",ot,F,ee,at,ue,$t="Convert the inner content to tensors.",st,D,te,it,_e,Mt=`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>.`,je,k,E,Me,re,ct,ve,Tt="BaseImageProcessor",Ze,I,ne,lt,L,oe,mt,ye,Ct=`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.`,dt,W,ae,pt,be,Pt="Normalize an image. image = (image - image_mean) / image_std.",gt,q,se,ht,xe,Ut="Rescale an image by a scale factor. image = image * scale.",ze,Te,Je;return A=new Ae({}),Y=new Ae({}),H=new P({props:{name:"class transformers.ImageProcessingMixin",anchor:"transformers.ImageProcessingMixin",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/image_processing_utils.py#L68"}}),G=new P({props:{name:"from_pretrained",anchor:"transformers.ImageProcessingMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[bool, str, NoneType] = 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. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a image processor file saved using the
<a href="/docs/transformers/v4.34.0/en/main_classes/image_processor#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.`,name:"force_download"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received file. Attempts to resume the download if such a file
exists.`,name:"resume_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/v4.34.0/src/transformers/image_processing_utils.py#L92",returnDescription:`
<p>A image processor of type <a
  href="/docs/transformers/v4.34.0/en/main_classes/image_processor#transformers.ImageProcessingMixin"
>ImageProcessingMixin</a>.</p>
`}}),Z=new Xt({props:{anchor:"transformers.ImageProcessingMixin.from_pretrained.example",$$slots:{default:[At]},$$scope:{ctx:Ce}}}),Q=new P({props:{name:"save_pretrained",anchor:"transformers.ImageProcessingMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{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/v4.34.0/en/main_classes/processors#transformers.ProcessorMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/image_processing_utils.py#L206"}}),K=new Ae({}),O=new P({props:{name:"class transformers.BatchFeature",anchor:"transformers.BatchFeature",parameters:[{name:"data",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"tensor_type",val:": typing.Union[NoneType, str, transformers.utils.generic.TensorType] = None"}],parametersDescription:[{anchor:"transformers.BatchFeature.data",description:`<strong>data</strong> (<code>dict</code>) &#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/v4.34.0/src/transformers/feature_extraction_utils.py#L61"}}),ee=new P({props:{name:"convert_to_tensors",anchor:"transformers.BatchFeature.convert_to_tensors",parameters:[{name:"tensor_type",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"}],parametersDescription:[{anchor:"transformers.BatchFeature.convert_to_tensors.tensor_type",description:`<strong>tensor_type</strong> (<code>str</code> or <a href="/docs/transformers/v4.34.0/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/v4.34.0/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/v4.34.0/src/transformers/feature_extraction_utils.py#L115"}}),te=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/v4.34.0/src/transformers/feature_extraction_utils.py#L188",returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),re=new Ae({}),ne=new P({props:{name:"class transformers.image_processing_utils.BaseImageProcessor",anchor:"transformers.image_processing_utils.BaseImageProcessor",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/image_processing_utils.py#L540"}}),oe=new P({props:{name:"center_crop",anchor:"transformers.image_processing_utils.BaseImageProcessor.center_crop",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Dict[str, int]"},{name:"data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.image_processing_utils.BaseImageProcessor.center_crop.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to center crop.`,name:"image"},{anchor:"transformers.image_processing_utils.BaseImageProcessor.center_crop.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image.`,name:"size"},{anchor:"transformers.image_processing_utils.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.image_processing_utils.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/v4.34.0/src/transformers/image_processing_utils.py#L620"}}),ae=new P({props:{name:"normalize",anchor:"transformers.image_processing_utils.BaseImageProcessor.normalize",parameters:[{name:"image",val:": ndarray"},{name:"mean",val:": typing.Union[float, typing.Iterable[float]]"},{name:"std",val:": typing.Union[float, typing.Iterable[float]]"},{name:"data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.image_processing_utils.BaseImageProcessor.normalize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to normalize.`,name:"image"},{anchor:"transformers.image_processing_utils.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.image_processing_utils.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.image_processing_utils.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.image_processing_utils.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/v4.34.0/src/transformers/image_processing_utils.py#L583",returnDescription:`
<p>The normalized image.</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),se=new P({props:{name:"rescale",anchor:"transformers.image_processing_utils.BaseImageProcessor.rescale",parameters:[{name:"image",val:": ndarray"},{name:"scale",val:": float"},{name:"data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.image_processing_utils.BaseImageProcessor.rescale.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to rescale.`,name:"image"},{anchor:"transformers.image_processing_utils.BaseImageProcessor.rescale.scale",description:`<strong>scale</strong> (<code>float</code>) &#x2014;
The scaling factor to rescale pixel values by.`,name:"scale"},{anchor:"transformers.image_processing_utils.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.image_processing_utils.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/v4.34.0/src/transformers/image_processing_utils.py#L551",returnDescription:`
<p>The rescaled image.</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),{c(){p=n("meta"),X=a(),M=n("p"),$=a(),x=n("h1"),m=n("a"),U=n("span"),g(A.$$.fragment),Ve=a(),ce=n("span"),ce.textContent=ft,Pe=a(),V=n("p"),V.textContent=ut,Ue=a(),B=n("h2"),j=n("a"),Ie=n("span"),g(Y.$$.fragment),Ye=a(),le=n("span"),le.textContent=_t,Be=a(),w=n("div"),g(H.$$.fragment),He=a(),me=n("p"),me.textContent=vt,Ge=a(),T=n("div"),g(G.$$.fragment),Qe=a(),de=n("p"),de.innerHTML=yt,Ke=a(),g(Z.$$.fragment),Oe=a(),z=n("div"),g(Q.$$.fragment),et=a(),pe=n("p"),pe.innerHTML=bt,Ne=a(),N=n("h2"),J=n("a"),$e=n("span"),g(K.$$.fragment),tt=a(),ge=n("span"),ge.textContent=xt,ke=a(),b=n("div"),g(O.$$.fragment),rt=a(),he=n("p"),he.innerHTML=wt,nt=a(),fe=n("p"),fe.textContent=It,ot=a(),F=n("div"),g(ee.$$.fragment),at=a(),ue=n("p"),ue.textContent=$t,st=a(),D=n("div"),g(te.$$.fragment),it=a(),_e=n("p"),_e.innerHTML=Mt,je=a(),k=n("h2"),E=n("a"),Me=n("span"),g(re.$$.fragment),ct=a(),ve=n("span"),ve.textContent=Tt,Ze=a(),I=n("div"),g(ne.$$.fragment),lt=a(),L=n("div"),g(oe.$$.fragment),mt=a(),ye=n("p"),ye.innerHTML=Ct,dt=a(),W=n("div"),g(ae.$$.fragment),pt=a(),be=n("p"),be.textContent=Pt,gt=a(),q=n("div"),g(se.$$.fragment),ht=a(),xe=n("p"),xe.textContent=Ut,ze=a(),Te=n("p"),this.h()},l(e){const c=St("svelte-1phssyn",document.head);p=o(c,"META",{name:!0,content:!0}),c.forEach(r),X=s(e),M=o(e,"P",{}),l(M).forEach(r),$=s(e),x=o(e,"H1",{class:!0});var ie=l(x);m=o(ie,"A",{id:!0,class:!0,href:!0});var Bt=l(m);U=o(Bt,"SPAN",{});var Nt=l(U);h(A.$$.fragment,Nt),Nt.forEach(r),Bt.forEach(r),Ve=s(ie),ce=o(ie,"SPAN",{"data-svelte-h":!0}),f(ce)!=="svelte-qbhthy"&&(ce.textContent=ft),ie.forEach(r),Pe=s(e),V=o(e,"P",{"data-svelte-h":!0}),f(V)!=="svelte-l9ii3n"&&(V.textContent=ut),Ue=s(e),B=o(e,"H2",{class:!0});var Fe=l(B);j=o(Fe,"A",{id:!0,class:!0,href:!0});var kt=l(j);Ie=o(kt,"SPAN",{});var jt=l(Ie);h(Y.$$.fragment,jt),jt.forEach(r),kt.forEach(r),Ye=s(Fe),le=o(Fe,"SPAN",{"data-svelte-h":!0}),f(le)!=="svelte-17ev80o"&&(le.textContent=_t),Fe.forEach(r),Be=s(e),w=o(e,"DIV",{class:!0});var S=l(w);h(H.$$.fragment,S),He=s(S),me=o(S,"P",{"data-svelte-h":!0}),f(me)!=="svelte-16ht4m3"&&(me.textContent=vt),Ge=s(S),T=o(S,"DIV",{class:!0});var we=l(T);h(G.$$.fragment,we),Qe=s(we),de=o(we,"P",{"data-svelte-h":!0}),f(de)!=="svelte-1amjolx"&&(de.innerHTML=yt),Ke=s(we),h(Z.$$.fragment,we),we.forEach(r),Oe=s(S),z=o(S,"DIV",{class:!0});var De=l(z);h(Q.$$.fragment,De),et=s(De),pe=o(De,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-1u8y5vo"&&(pe.innerHTML=bt),De.forEach(r),S.forEach(r),Ne=s(e),N=o(e,"H2",{class:!0});var Ee=l(N);J=o(Ee,"A",{id:!0,class:!0,href:!0});var Zt=l(J);$e=o(Zt,"SPAN",{});var zt=l($e);h(K.$$.fragment,zt),zt.forEach(r),Zt.forEach(r),tt=s(Ee),ge=o(Ee,"SPAN",{"data-svelte-h":!0}),f(ge)!=="svelte-1ntv8h3"&&(ge.textContent=xt),Ee.forEach(r),ke=s(e),b=o(e,"DIV",{class:!0});var C=l(b);h(O.$$.fragment,C),rt=s(C),he=o(C,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1hjzny0"&&(he.innerHTML=wt),nt=s(C),fe=o(C,"P",{"data-svelte-h":!0}),f(fe)!=="svelte-saqdtk"&&(fe.textContent=It),ot=s(C),F=o(C,"DIV",{class:!0});var Le=l(F);h(ee.$$.fragment,Le),at=s(Le),ue=o(Le,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-pxfh9u"&&(ue.textContent=$t),Le.forEach(r),st=s(C),D=o(C,"DIV",{class:!0});var We=l(D);h(te.$$.fragment,We),it=s(We),_e=o(We,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-d0cfhs"&&(_e.innerHTML=Mt),We.forEach(r),C.forEach(r),je=s(e),k=o(e,"H2",{class:!0});var qe=l(k);E=o(qe,"A",{id:!0,class:!0,href:!0});var Jt=l(E);Me=o(Jt,"SPAN",{});var Ft=l(Me);h(re.$$.fragment,Ft),Ft.forEach(r),Jt.forEach(r),ct=s(qe),ve=o(qe,"SPAN",{"data-svelte-h":!0}),f(ve)!=="svelte-1xvin0v"&&(ve.textContent=Tt),qe.forEach(r),Ze=s(e),I=o(e,"DIV",{class:!0});var R=l(I);h(ne.$$.fragment,R),lt=s(R),L=o(R,"DIV",{class:!0});var Se=l(L);h(oe.$$.fragment,Se),mt=s(Se),ye=o(Se,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-193kiu8"&&(ye.innerHTML=Ct),Se.forEach(r),dt=s(R),W=o(R,"DIV",{class:!0});var Re=l(W);h(ae.$$.fragment,Re),pt=s(Re),be=o(Re,"P",{"data-svelte-h":!0}),f(be)!=="svelte-1e5okex"&&(be.textContent=Pt),Re.forEach(r),gt=s(R),q=o(R,"DIV",{class:!0});var Xe=l(q);h(se.$$.fragment,Xe),ht=s(Xe),xe=o(Xe,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-qun0mt"&&(xe.textContent=Ut),Xe.forEach(r),R.forEach(r),ze=s(e),Te=o(e,"P",{}),l(Te).forEach(r),this.h()},h(){i(p,"name","hf:doc:metadata"),i(p,"content",JSON.stringify(Yt)),i(m,"id","image-processor"),i(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(m,"href","#image-processor"),i(x,"class","relative group"),i(j,"id","transformers.ImageProcessingMixin"),i(j,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(j,"href","#transformers.ImageProcessingMixin"),i(B,"class","relative group"),i(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(J,"id","transformers.BatchFeature"),i(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(J,"href","#transformers.BatchFeature"),i(N,"class","relative group"),i(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(E,"id","transformers.image_processing_utils.BaseImageProcessor"),i(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(E,"href","#transformers.image_processing_utils.BaseImageProcessor"),i(k,"class","relative group"),i(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(I,"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,c){t(document.head,p),d(e,X,c),d(e,M,c),d(e,$,c),d(e,x,c),t(x,m),t(m,U),u(A,U,null),t(x,Ve),t(x,ce),d(e,Pe,c),d(e,V,c),d(e,Ue,c),d(e,B,c),t(B,j),t(j,Ie),u(Y,Ie,null),t(B,Ye),t(B,le),d(e,Be,c),d(e,w,c),u(H,w,null),t(w,He),t(w,me),t(w,Ge),t(w,T),u(G,T,null),t(T,Qe),t(T,de),t(T,Ke),u(Z,T,null),t(w,Oe),t(w,z),u(Q,z,null),t(z,et),t(z,pe),d(e,Ne,c),d(e,N,c),t(N,J),t(J,$e),u(K,$e,null),t(N,tt),t(N,ge),d(e,ke,c),d(e,b,c),u(O,b,null),t(b,rt),t(b,he),t(b,nt),t(b,fe),t(b,ot),t(b,F),u(ee,F,null),t(F,at),t(F,ue),t(b,st),t(b,D),u(te,D,null),t(D,it),t(D,_e),d(e,je,c),d(e,k,c),t(k,E),t(E,Me),u(re,Me,null),t(k,ct),t(k,ve),d(e,Ze,c),d(e,I,c),u(ne,I,null),t(I,lt),t(I,L),u(oe,L,null),t(L,mt),t(L,ye),t(I,dt),t(I,W),u(ae,W,null),t(W,pt),t(W,be),t(I,gt),t(I,q),u(se,q,null),t(q,ht),t(q,xe),d(e,ze,c),d(e,Te,c),Je=!0},p(e,[c]){const ie={};c&2&&(ie.$$scope={dirty:c,ctx:e}),Z.$set(ie)},i(e){Je||(_(A.$$.fragment,e),_(Y.$$.fragment,e),_(H.$$.fragment,e),_(G.$$.fragment,e),_(Z.$$.fragment,e),_(Q.$$.fragment,e),_(K.$$.fragment,e),_(O.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(re.$$.fragment,e),_(ne.$$.fragment,e),_(oe.$$.fragment,e),_(ae.$$.fragment,e),_(se.$$.fragment,e),Je=!0)},o(e){v(A.$$.fragment,e),v(Y.$$.fragment,e),v(H.$$.fragment,e),v(G.$$.fragment,e),v(Z.$$.fragment,e),v(Q.$$.fragment,e),v(K.$$.fragment,e),v(O.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),v(re.$$.fragment,e),v(ne.$$.fragment,e),v(oe.$$.fragment,e),v(ae.$$.fragment,e),v(se.$$.fragment,e),Je=!1},d(e){e&&(r(X),r(M),r($),r(x),r(Pe),r(V),r(Ue),r(B),r(Be),r(w),r(Ne),r(N),r(ke),r(b),r(je),r(k),r(Ze),r(I),r(ze),r(Te)),r(p),y(A),y(Y),y(H),y(G),y(Z),y(Q),y(K),y(O),y(ee),y(te),y(re),y(ne),y(oe),y(ae),y(se)}}}const Yt={local:"image-processor",sections:[{local:"transformers.ImageProcessingMixin",title:"ImageProcessingMixin"},{local:"transformers.BatchFeature",title:"BatchFeature"},{local:"transformers.image_processing_utils.BaseImageProcessor",title:"BaseImageProcessor"}],title:"Image Processor"};function Ht(Ce){return Et(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rr extends Wt{constructor(p){super(),qt(this,p,Ht,Vt,Dt,{})}}export{rr as component};
