import{s as Dt,o as Et,n as Lt}from"../chunks/scheduler.9bc65507.js";import{S as Wt,i as qt,g as r,s as a,u as g,A as St,h as o,f as n,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.f3d04bd2.js";import{C as Rt}from"../chunks/CodeBlock.48618ec2.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>}`}}),{c(){p=r("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&&(n(p),n(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,k,j,Ie,Y,Ye,le,_t="ImageProcessingMixin",ke,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.33.3/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.33.3/en/main_classes/image_processor#transformers.ImageProcessingMixin.from_pretrained">from_pretrained()</a> class method.`,Be,B,J,$e,K,tt,ge,xt="BatchFeature",Ne,b,O,nt,he,wt='Holds the output of the <a href="/docs/transformers/v4.33.3/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad">pad()</a> and feature extractor specific <code>__call__</code> methods.',rt,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,N,E,Me,ne,ct,ve,Tt="BaseImageProcessor",ze,I,re,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.33.3/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[str, bool, 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.33.3/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.33.3/src/transformers/image_processing_utils.py#L92",returnDescription:`
<p>A image processor of type <a
  href="/docs/transformers/v4.33.3/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.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/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.33.3/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.33.3/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.33.3/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.33.3/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.33.3/src/transformers/feature_extraction_utils.py#L188",returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),ne=new Ae({}),re=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.33.3/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.33.3/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.33.3/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.33.3/src/transformers/image_processing_utils.py#L551",returnDescription:`
<p>The rescaled image.</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),{c(){p=r("meta"),X=a(),M=r("p"),$=a(),x=r("h1"),m=r("a"),U=r("span"),g(A.$$.fragment),Ve=a(),ce=r("span"),ce.textContent=ft,Pe=a(),V=r("p"),V.textContent=ut,Ue=a(),k=r("h2"),j=r("a"),Ie=r("span"),g(Y.$$.fragment),Ye=a(),le=r("span"),le.textContent=_t,ke=a(),w=r("div"),g(H.$$.fragment),He=a(),me=r("p"),me.textContent=vt,Ge=a(),T=r("div"),g(G.$$.fragment),Qe=a(),de=r("p"),de.innerHTML=yt,Ke=a(),g(z.$$.fragment),Oe=a(),Z=r("div"),g(Q.$$.fragment),et=a(),pe=r("p"),pe.innerHTML=bt,Be=a(),B=r("h2"),J=r("a"),$e=r("span"),g(K.$$.fragment),tt=a(),ge=r("span"),ge.textContent=xt,Ne=a(),b=r("div"),g(O.$$.fragment),nt=a(),he=r("p"),he.innerHTML=wt,rt=a(),fe=r("p"),fe.textContent=It,ot=a(),F=r("div"),g(ee.$$.fragment),at=a(),ue=r("p"),ue.textContent=$t,st=a(),D=r("div"),g(te.$$.fragment),it=a(),_e=r("p"),_e.innerHTML=Mt,je=a(),N=r("h2"),E=r("a"),Me=r("span"),g(ne.$$.fragment),ct=a(),ve=r("span"),ve.textContent=Tt,ze=a(),I=r("div"),g(re.$$.fragment),lt=a(),L=r("div"),g(oe.$$.fragment),mt=a(),ye=r("p"),ye.innerHTML=Ct,dt=a(),W=r("div"),g(ae.$$.fragment),pt=a(),be=r("p"),be.textContent=Pt,gt=a(),q=r("div"),g(se.$$.fragment),ht=a(),xe=r("p"),xe.textContent=Ut,Ze=a(),Te=r("p"),this.h()},l(e){const c=St("svelte-1phssyn",document.head);p=o(c,"META",{name:!0,content:!0}),c.forEach(n),X=s(e),M=o(e,"P",{}),l(M).forEach(n),$=s(e),x=o(e,"H1",{class:!0});var ie=l(x);m=o(ie,"A",{id:!0,class:!0,href:!0});var kt=l(m);U=o(kt,"SPAN",{});var Bt=l(U);h(A.$$.fragment,Bt),Bt.forEach(n),kt.forEach(n),Ve=s(ie),ce=o(ie,"SPAN",{"data-svelte-h":!0}),f(ce)!=="svelte-qbhthy"&&(ce.textContent=ft),ie.forEach(n),Pe=s(e),V=o(e,"P",{"data-svelte-h":!0}),f(V)!=="svelte-l9ii3n"&&(V.textContent=ut),Ue=s(e),k=o(e,"H2",{class:!0});var Fe=l(k);j=o(Fe,"A",{id:!0,class:!0,href:!0});var Nt=l(j);Ie=o(Nt,"SPAN",{});var jt=l(Ie);h(Y.$$.fragment,jt),jt.forEach(n),Nt.forEach(n),Ye=s(Fe),le=o(Fe,"SPAN",{"data-svelte-h":!0}),f(le)!=="svelte-17ev80o"&&(le.textContent=_t),Fe.forEach(n),ke=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-175f5d9"&&(de.innerHTML=yt),Ke=s(we),h(z.$$.fragment,we),we.forEach(n),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-y7z2kk"&&(pe.innerHTML=bt),De.forEach(n),S.forEach(n),Be=s(e),B=o(e,"H2",{class:!0});var Ee=l(B);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(n),zt.forEach(n),tt=s(Ee),ge=o(Ee,"SPAN",{"data-svelte-h":!0}),f(ge)!=="svelte-1ntv8h3"&&(ge.textContent=xt),Ee.forEach(n),Ne=s(e),b=o(e,"DIV",{class:!0});var C=l(b);h(O.$$.fragment,C),nt=s(C),he=o(C,"P",{"data-svelte-h":!0}),f(he)!=="svelte-uw0t00"&&(he.innerHTML=wt),rt=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(n),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(n),C.forEach(n),je=s(e),N=o(e,"H2",{class:!0});var qe=l(N);E=o(qe,"A",{id:!0,class:!0,href:!0});var Jt=l(E);Me=o(Jt,"SPAN",{});var Ft=l(Me);h(ne.$$.fragment,Ft),Ft.forEach(n),Jt.forEach(n),ct=s(qe),ve=o(qe,"SPAN",{"data-svelte-h":!0}),f(ve)!=="svelte-1xvin0v"&&(ve.textContent=Tt),qe.forEach(n),ze=s(e),I=o(e,"DIV",{class:!0});var R=l(I);h(re.$$.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(n),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(n),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(n),R.forEach(n),Ze=s(e),Te=o(e,"P",{}),l(Te).forEach(n),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(k,"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(B,"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(N,"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,k,c),t(k,j),t(j,Ie),u(Y,Ie,null),t(k,Ye),t(k,le),d(e,ke,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,Be,c),d(e,B,c),t(B,J),t(J,$e),u(K,$e,null),t(B,tt),t(B,ge),d(e,Ne,c),d(e,b,c),u(O,b,null),t(b,nt),t(b,he),t(b,rt),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,N,c),t(N,E),t(E,Me),u(ne,Me,null),t(N,ct),t(N,ve),d(e,ze,c),d(e,I,c),u(re,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),_(ne.$$.fragment,e),_(re.$$.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(ne.$$.fragment,e),v(re.$$.fragment,e),v(oe.$$.fragment,e),v(ae.$$.fragment,e),v(se.$$.fragment,e),Je=!1},d(e){e&&(n(X),n(M),n($),n(x),n(Pe),n(V),n(Ue),n(k),n(ke),n(w),n(Be),n(B),n(Ne),n(b),n(je),n(N),n(ze),n(I),n(Ze),n(Te)),n(p),y(A),y(Y),y(H),y(G),y(z),y(Q),y(K),y(O),y(ee),y(te),y(ne),y(re),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 nn extends Wt{constructor(p){super(),qt(this,p,Ht,Vt,Dt,{})}}export{nn as component};
