Buckets:
| import{s as en,o as tn,n as wr}from"../chunks/scheduler.bdbef820.js";import{S as rn,i as nn,g as a,s as n,r as p,A as on,h as s,f as r,c as o,j as v,u as g,x as b,k as x,y as t,a as m,v as f,d as h,t as u,w as _}from"../chunks/index.33f81d56.js";import{T as an}from"../chunks/Tip.34194030.js";import{D as w}from"../chunks/Docstring.64554317.js";import{C as Kr}from"../chunks/CodeBlock.362b34a4.js";import{E as Or}from"../chunks/ExampleCodeBlock.4f2252c6.js";import{H as $r,E as sn}from"../chunks/EditOnGithub.a9246e21.js";function mn(R){let d,C="Examples:",I,$,M;return $=new Kr({props:{code:"JTIzJTIwV2UlMjBjYW4ndCUyMGluc3RhbnRpYXRlJTIwZGlyZWN0bHklMjB0aGUlMjBiYXNlJTIwY2xhc3MlMjAqSW1hZ2VQcm9jZXNzaW5nTWl4aW4qJTIwc28lMjBsZXQncyUyMHNob3clMjB0aGUlMjBleGFtcGxlcyUyMG9uJTIwYSUwQSUyMyUyMGRlcml2ZWQlMjBjbGFzcyUzQSUyMCpDTElQSW1hZ2VQcm9jZXNzb3IqJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQ0xJUEltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIlMEEpJTIwJTIwJTIzJTIwRG93bmxvYWQlMjBpbWFnZV9wcm9jZXNzaW5nX2NvbmZpZyUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiUwQSklMjAlMjAlMjMlMjBFLmcuJTIwaW1hZ2UlMjBwcm9jZXNzb3IlMjAob3IlMjBtb2RlbCklMjB3YXMlMjBzYXZlZCUyMHVzaW5nJTIwKnNhdmVfcHJldHJhaW5lZCgnLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRicpKiUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRnByZXByb2Nlc3Nvcl9jb25maWcuanNvbiUyMiklMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBDTElQSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiUyQyUyMGRvX25vcm1hbGl6ZSUzREZhbHNlJTJDJTIwZm9vJTNERmFsc2UlMEEpJTBBYXNzZXJ0JTIwaW1hZ2VfcHJvY2Vzc29yLmRvX25vcm1hbGl6ZSUyMGlzJTIwRmFsc2UlMEFpbWFnZV9wcm9jZXNzb3IlMkMlMjB1bnVzZWRfa3dhcmdzJTIwJTNEJTIwQ0xJUEltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIlMkMlMjBkb19ub3JtYWxpemUlM0RGYWxzZSUyQyUyMGZvbyUzREZhbHNlJTJDJTIwcmV0dXJuX3VudXNlZF9rd2FyZ3MlM0RUcnVlJTBBKSUwQWFzc2VydCUyMGltYWdlX3Byb2Nlc3Nvci5kb19ub3JtYWxpemUlMjBpcyUyMEZhbHNlJTBBYXNzZXJ0JTIwdW51c2VkX2t3YXJncyUyMCUzRCUzRCUyMCU3QiUyMmZvbyUyMiUzQSUyMEZhbHNlJTdE",highlighted:`<span class="hljs-comment"># We can't instantiate directly the base class *ImageProcessingMixin* so let's show the examples on a</span> | |
| <span class="hljs-comment"># derived class: *CLIPImageProcessor*</span> | |
| image_processor = CLIPImageProcessor.from_pretrained( | |
| <span class="hljs-string">"openai/clip-vit-base-patch32"</span> | |
| ) <span class="hljs-comment"># Download image_processing_config from huggingface.co and cache.</span> | |
| image_processor = CLIPImageProcessor.from_pretrained( | |
| <span class="hljs-string">"./test/saved_model/"</span> | |
| ) <span class="hljs-comment"># E.g. image processor (or model) was saved using *save_pretrained('./test/saved_model/')*</span> | |
| image_processor = CLIPImageProcessor.from_pretrained(<span class="hljs-string">"./test/saved_model/preprocessor_config.json"</span>) | |
| image_processor = CLIPImageProcessor.from_pretrained( | |
| <span class="hljs-string">"openai/clip-vit-base-patch32"</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">"openai/clip-vit-base-patch32"</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">"foo"</span>: <span class="hljs-literal">False</span>}`,wrap:!1}}),{c(){d=a("p"),d.textContent=C,I=n(),p($.$$.fragment)},l(c){d=s(c,"P",{"data-svelte-h":!0}),b(d)!=="svelte-kvfsh7"&&(d.textContent=C),I=o(c),g($.$$.fragment,c)},m(c,T){m(c,d,T),m(c,I,T),f($,c,T),M=!0},p:wr,i(c){M||(h($.$$.fragment,c),M=!0)},o(c){u($.$$.fragment,c),M=!1},d(c){c&&(r(d),r(I)),_($,c)}}}function cn(R){let d,C="Examples:",I,$,M;return $=new Kr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUwQSUwQWltYWdlJTIwcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwaW1hZ2UlMjBwcm9jZXNzb3IlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQWltYWdlJTIwcHJvY2Vzc29yLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBpbWFnZSUyMHByb2Nlc3NvciUyMHRvJTIwYW4lMjBvcmdhbml6YXRpb24lMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQWltYWdlJTIwcHJvY2Vzc29yLnB1c2hfdG9faHViKCUyMmh1Z2dpbmdmYWNlJTJGbXktZmluZXR1bmVkLWJlcnQlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor | |
| image processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"google-bert/bert-base-cased"</span>) | |
| <span class="hljs-comment"># Push the image processor to your namespace with the name "my-finetuned-bert".</span> | |
| image processor.push_to_hub(<span class="hljs-string">"my-finetuned-bert"</span>) | |
| <span class="hljs-comment"># Push the image processor to an organization with the name "my-finetuned-bert".</span> | |
| image processor.push_to_hub(<span class="hljs-string">"huggingface/my-finetuned-bert"</span>)`,wrap:!1}}),{c(){d=a("p"),d.textContent=C,I=n(),p($.$$.fragment)},l(c){d=s(c,"P",{"data-svelte-h":!0}),b(d)!=="svelte-kvfsh7"&&(d.textContent=C),I=o(c),g($.$$.fragment,c)},m(c,T){m(c,d,T),m(c,I,T),f($,c,T),M=!0},p:wr,i(c){M||(h($.$$.fragment,c),M=!0)},o(c){u($.$$.fragment,c),M=!1},d(c){c&&(r(d),r(I)),_($,c)}}}function dn(R){let d,C="This API is experimental and may have some slight breaking changes in the next releases.";return{c(){d=a("p"),d.textContent=C},l(I){d=s(I,"P",{"data-svelte-h":!0}),b(d)!=="svelte-15rpg4"&&(d.textContent=C)},m(I,$){m(I,d,$)},p:wr,d(I){I&&r(d)}}}function ln(R){let d,C,I,$,M,c,T,Ir=`このページには、画像プロセッサーで使用されるすべてのユーティリティー関数がリストされています。主に機能的なものです。 | |
| 画像を処理するために使用される変換。`,st,te,Mr="これらのほとんどは、ライブラリ内の画像プロセッサのコードを学習する場合にのみ役に立ちます。",it,re,mt,D,ne,kt,Pe,Tr=`Crops the <code>image</code> to the specified <code>size</code> using a center crop. Note that if the image is too small to be cropped to | |
| the size given, it will be padded (so the returned result will always be of size <code>size</code>).`,ct,P,oe,Zt,je,Cr="Converts bounding boxes from center format to corners format.",Wt,Ue,Pr=`center format: contains the coordinate for the center of the box and its width, height dimensions | |
| (center_x, center_y, width, height) | |
| corners format: contains the coodinates for the top-left and bottom-right corners of the box | |
| (top_left_x, top_left_y, bottom_right_x, bottom_right_y)`,dt,j,ae,qt,ze,jr="Converts bounding boxes from corners format to center format.",Bt,Le,Ur=`corners format: contains the coordinates for the top-left and bottom-right corners of the box | |
| (top_left_x, top_left_y, bottom_right_x, bottom_right_y) | |
| center format: contains the coordinate for the center of the box and its the width, height dimensions | |
| (center_x, center_y, width, height)`,lt,k,se,Vt,Je,zr="Converts unique ID to RGB color.",pt,U,ie,Et,Ne,Lr="Normalizes <code>image</code> using the mean and standard deviation specified by <code>mean</code> and <code>std</code>.",Ht,De,Jr="image = (image - mean) / std",gt,Z,me,Rt,ke,Nr="Pads the <code>image</code> with the specified (height, width) <code>padding</code> and <code>mode</code>.",ft,W,ce,Ft,Ze,Dr="Converts RGB color to unique ID.",ht,q,de,St,We,kr="Rescales <code>image</code> by <code>scale</code>.",ut,B,le,Xt,qe,Zr="Resizes <code>image</code> to <code>(height, width)</code> specified by <code>size</code> using the PIL library.",_t,V,pe,Yt,Be,Wr=`Converts <code>image</code> to a PIL Image. Optionally rescales it and puts the channel dimension back as the last axis if | |
| needed.`,bt,ge,yt,l,fe,Gt,Ve,qr=`This is an image processor mixin used to provide saving/loading functionality for sequential and image feature | |
| extractors.`,At,z,he,Qt,Ee,Br="Convert a single or a list of urls into the corresponding <code>PIL.Image</code> objects.",Ot,He,Vr=`If a single url is passed, the return value will be a single object. If a list is passed a list of objects is | |
| returned.`,Kt,F,ue,er,Re,Er='Instantiates a type of <a href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> from a Python dictionary of parameters.',tr,S,_e,rr,Fe,Hr=`Instantiates a image processor of type <a href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> from the path to a JSON | |
| file of parameters.`,nr,L,be,or,Se,Rr='Instantiate a type of <a href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> from an image processor.',ar,X,sr,Y,ye,ir,Xe,Fr=`From a <code>pretrained_model_name_or_path</code>, resolve to a dictionary of parameters, to be used for instantiating a | |
| image processor of type <code>~image_processor_utils.ImageProcessingMixin</code> using <code>from_dict</code>.`,mr,J,ve,cr,Ye,Sr="Upload the image processor file to the 🤗 Model Hub.",dr,G,lr,N,xe,pr,Ge,Xr=`Register this class with a given auto class. This should only be used for custom image processors as the ones | |
| in the library are already mapped with <code>AutoImageProcessor </code>.`,gr,A,fr,Q,$e,hr,Ae,Yr=`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_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin.from_pretrained">from_pretrained()</a> class method.`,ur,O,we,_r,Qe,Gr="Serializes this instance to a Python dictionary.",br,K,Ie,yr,Oe,Ar="Save this instance to a JSON file.",vr,ee,Me,xr,Ke,Qr="Serializes this instance to a JSON string.",vt,Te,xt,at,$t;return M=new $r({props:{title:"画像プロセッサ用ユーティリティ",local:"画像プロセッサ用ユーティリティ",headingTag:"h1"}}),re=new $r({props:{title:"Image Transformations",local:"transformers.image_transforms.center_crop",headingTag:"h2"}}),ne=new w({props:{name:"transformers.image_transforms.center_crop",anchor:"transformers.image_transforms.center_crop",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Tuple[int, 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:"return_numpy",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.image_transforms.center_crop.image",description:`<strong>image</strong> (<code>np.ndarray</code>) — | |
| The image to crop.`,name:"image"},{anchor:"transformers.image_transforms.center_crop.size",description:`<strong>size</strong> (<code>Tuple[int, int]</code>) — | |
| The target size for the cropped image.`,name:"size"},{anchor:"transformers.image_transforms.center_crop.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format for the output image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format. | |
| If unset, will use the inferred format of the input image.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.image_transforms.center_crop.input_data_format",description:`<strong>input_data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format for the input image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format. | |
| If unset, will use the inferred format of the input image.</li> | |
| </ul>`,name:"input_data_format"},{anchor:"transformers.image_transforms.center_crop.return_numpy",description:`<strong>return_numpy</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the cropped image as a numpy array. Used for backwards compatibility with the | |
| previous ImageFeatureExtractionMixin method.<ul> | |
| <li>Unset: will return the same type as the input image.</li> | |
| <li><code>True</code>: will return a numpy array.</li> | |
| <li><code>False</code>: will return a <code>PIL.Image.Image</code> object.</li> | |
| </ul>`,name:"return_numpy"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L419",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The cropped image.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>np.ndarray</code></p> | |
| `}}),oe=new w({props:{name:"transformers.image_transforms.center_to_corners_format",anchor:"transformers.image_transforms.center_to_corners_format",parameters:[{name:"bboxes_center",val:": TensorType"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L549"}}),ae=new w({props:{name:"transformers.image_transforms.corners_to_center_format",anchor:"transformers.image_transforms.corners_to_center_format",parameters:[{name:"bboxes_corners",val:": TensorType"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L609"}}),se=new w({props:{name:"transformers.image_transforms.id_to_rgb",anchor:"transformers.image_transforms.id_to_rgb",parameters:[{name:"id_map",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L643"}}),ie=new w({props:{name:"transformers.image_transforms.normalize",anchor:"transformers.image_transforms.normalize",parameters:[{name:"image",val:": ndarray"},{name:"mean",val:": typing.Union[float, typing.Sequence[float]]"},{name:"std",val:": typing.Union[float, typing.Sequence[float]]"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"}],parametersDescription:[{anchor:"transformers.image_transforms.normalize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) — | |
| The image to normalize.`,name:"image"},{anchor:"transformers.image_transforms.normalize.mean",description:`<strong>mean</strong> (<code>float</code> or <code>Sequence[float]</code>) — | |
| The mean to use for normalization.`,name:"mean"},{anchor:"transformers.image_transforms.normalize.std",description:`<strong>std</strong> (<code>float</code> or <code>Sequence[float]</code>) — | |
| The standard deviation to use for normalization.`,name:"std"},{anchor:"transformers.image_transforms.normalize.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the output image. If unset, will use the inferred format from the input.`,name:"data_format"},{anchor:"transformers.image_transforms.normalize.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the input image. If unset, will use the inferred format from the input.`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L358"}}),me=new w({props:{name:"transformers.image_transforms.pad",anchor:"transformers.image_transforms.pad",parameters:[{name:"image",val:": ndarray"},{name:"padding",val:": typing.Union[int, typing.Tuple[int, int], typing.Iterable[typing.Tuple[int, int]]]"},{name:"mode",val:": PaddingMode = <PaddingMode.CONSTANT: 'constant'>"},{name:"constant_values",val:": typing.Union[float, typing.Iterable[float]] = 0.0"},{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"}],parametersDescription:[{anchor:"transformers.image_transforms.pad.image",description:`<strong>image</strong> (<code>np.ndarray</code>) — | |
| The image to pad.`,name:"image"},{anchor:"transformers.image_transforms.pad.padding",description:`<strong>padding</strong> (<code>int</code> or <code>Tuple[int, int]</code> or <code>Iterable[Tuple[int, int]]</code>) — | |
| Padding to apply to the edges of the height, width axes. Can be one of three formats:<ul> | |
| <li><code>((before_height, after_height), (before_width, after_width))</code> unique pad widths for each axis.</li> | |
| <li><code>((before, after),)</code> yields same before and after pad for height and width.</li> | |
| <li><code>(pad,)</code> or int is a shortcut for before = after = pad width for all axes.</li> | |
| </ul>`,name:"padding"},{anchor:"transformers.image_transforms.pad.mode",description:`<strong>mode</strong> (<code>PaddingMode</code>) — | |
| The padding mode to use. Can be one of:<ul> | |
| <li><code>"constant"</code>: pads with a constant value.</li> | |
| <li><code>"reflect"</code>: pads with the reflection of the vector mirrored on the first and last values of the | |
| vector along each axis.</li> | |
| <li><code>"replicate"</code>: pads with the replication of the last value on the edge of the array along each axis.</li> | |
| <li><code>"symmetric"</code>: pads with the reflection of the vector mirrored along the edge of the array.</li> | |
| </ul>`,name:"mode"},{anchor:"transformers.image_transforms.pad.constant_values",description:`<strong>constant_values</strong> (<code>float</code> or <code>Iterable[float]</code>, <em>optional</em>) — | |
| The value to use for the padding if <code>mode</code> is <code>"constant"</code>.`,name:"constant_values"},{anchor:"transformers.image_transforms.pad.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format for the output image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format. | |
| If unset, will use same as the input image.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.image_transforms.pad.input_data_format",description:`<strong>input_data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format for the input image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format. | |
| If unset, will use the inferred format of the input image.</li> | |
| </ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L673",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The padded image.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>np.ndarray</code></p> | |
| `}}),ce=new w({props:{name:"transformers.image_transforms.rgb_to_id",anchor:"transformers.image_transforms.rgb_to_id",parameters:[{name:"color",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L632"}}),de=new w({props:{name:"transformers.image_transforms.rescale",anchor:"transformers.image_transforms.rescale",parameters:[{name:"image",val:": ndarray"},{name:"scale",val:": float"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"},{name:"dtype",val:": dtype = <class 'numpy.float32'>"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"}],parametersDescription:[{anchor:"transformers.image_transforms.rescale.image",description:`<strong>image</strong> (<code>np.ndarray</code>) — | |
| The image to rescale.`,name:"image"},{anchor:"transformers.image_transforms.rescale.scale",description:`<strong>scale</strong> (<code>float</code>) — | |
| The scale to use for rescaling the image.`,name:"scale"},{anchor:"transformers.image_transforms.rescale.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"},{anchor:"transformers.image_transforms.rescale.dtype",description:`<strong>dtype</strong> (<code>np.dtype</code>, <em>optional</em>, defaults to <code>np.float32</code>) — | |
| The dtype of the output image. Defaults to <code>np.float32</code>. Used for backwards compatibility with feature | |
| extractors.`,name:"dtype"},{anchor:"transformers.image_transforms.rescale.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the input image. If not provided, it will be inferred from the input image.`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L100",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> | |
| `}}),le=new w({props:{name:"transformers.image_transforms.resize",anchor:"transformers.image_transforms.resize",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Tuple[int, int]"},{name:"resample",val:": PILImageResampling = None"},{name:"reducing_gap",val:": typing.Optional[int] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = None"},{name:"return_numpy",val:": bool = True"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"}],parametersDescription:[{anchor:"transformers.image_transforms.resize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) — | |
| The image to resize.`,name:"image"},{anchor:"transformers.image_transforms.resize.size",description:`<strong>size</strong> (<code>Tuple[int, int]</code>) — | |
| The size to use for resizing the image.`,name:"size"},{anchor:"transformers.image_transforms.resize.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) — | |
| The filter to user for resampling.`,name:"resample"},{anchor:"transformers.image_transforms.resize.reducing_gap",description:`<strong>reducing_gap</strong> (<code>int</code>, <em>optional</em>) — | |
| Apply optimization by resizing the image in two steps. The bigger <code>reducing_gap</code>, the closer the result to | |
| the fair resampling. See corresponding Pillow documentation for more details.`,name:"reducing_gap"},{anchor:"transformers.image_transforms.resize.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the output image. If unset, will use the inferred format from the input.`,name:"data_format"},{anchor:"transformers.image_transforms.resize.return_numpy",description:`<strong>return_numpy</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return the resized image as a numpy array. If False a <code>PIL.Image.Image</code> object is | |
| returned.`,name:"return_numpy"},{anchor:"transformers.image_transforms.resize.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the input image. If unset, will use the inferred format from the input.`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L287",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The resized image.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>np.ndarray</code></p> | |
| `}}),pe=new w({props:{name:"transformers.image_transforms.to_pil_image",anchor:"transformers.image_transforms.to_pil_image",parameters:[{name:"image",val:": typing.Union[numpy.ndarray, ForwardRef('PIL.Image.Image'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor'), ForwardRef('jnp.ndarray')]"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"image_mode",val:": typing.Optional[str] = None"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"}],parametersDescription:[{anchor:"transformers.image_transforms.to_pil_image.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code> or <code>numpy.ndarray</code> or <code>torch.Tensor</code> or <code>tf.Tensor</code>) — | |
| The image to convert to the <code>PIL.Image</code> format.`,name:"image"},{anchor:"transformers.image_transforms.to_pil_image.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to apply the scaling factor (to make pixel values integers between 0 and 255). Will default | |
| to <code>True</code> if the image type is a floating type and casting to <code>int</code> would result in a loss of precision, | |
| and <code>False</code> otherwise.`,name:"do_rescale"},{anchor:"transformers.image_transforms.to_pil_image.image_mode",description:`<strong>image_mode</strong> (<code>str</code>, <em>optional</em>) — | |
| The mode to use for the PIL image. If unset, will use the default mode for the input image type.`,name:"image_mode"},{anchor:"transformers.image_transforms.to_pil_image.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code>, <em>optional</em>) — | |
| The channel dimension format of the input image. If unset, will use the inferred format from the input.`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_transforms.py#L165",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The converted image.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>PIL.Image.Image</code></p> | |
| `}}),ge=new $r({props:{title:"ImageProcessingMixin",local:"transformers.ImageProcessingMixin",headingTag:"h2"}}),fe=new w({props:{name:"class transformers.ImageProcessingMixin",anchor:"transformers.ImageProcessingMixin",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L72"}}),he=new w({props:{name:"fetch_images",anchor:"transformers.ImageProcessingMixin.fetch_images",parameters:[{name:"image_url_or_urls",val:": typing.Union[str, typing.List[str]]"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L532"}}),ue=new w({props:{name:"from_dict",anchor:"transformers.ImageProcessingMixin.from_dict",parameters:[{name:"image_processor_dict",val:": typing.Dict[str, typing.Any]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.from_dict.image_processor_dict",description:`<strong>image_processor_dict</strong> (<code>Dict[str, Any]</code>) — | |
| Dictionary that will be used to instantiate the image processor object. Such a dictionary can be | |
| retrieved from a pretrained checkpoint by leveraging the | |
| <a href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin.to_dict">to_dict()</a> method.`,name:"image_processor_dict"},{anchor:"transformers.ImageProcessingMixin.from_dict.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>) — | |
| Additional parameters from which to initialize the image processor object.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L395",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The image processor object instantiated from those | |
| parameters.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin" | |
| >ImageProcessingMixin</a></p> | |
| `}}),_e=new w({props:{name:"from_json_file",anchor:"transformers.ImageProcessingMixin.from_json_file",parameters:[{name:"json_file",val:": typing.Union[str, os.PathLike]"}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.from_json_file.json_file",description:`<strong>json_file</strong> (<code>str</code> or <code>os.PathLike</code>) — | |
| Path to the JSON file containing the parameters.`,name:"json_file"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L452",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The image_processor object | |
| instantiated from that JSON file.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A image processor of type <a | |
| href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin" | |
| >ImageProcessingMixin</a></p> | |
| `}}),be=new w({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>) — | |
| 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_35939/ja/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>) — | |
| 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>) — | |
| 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> — | |
| Deprecated and ignored. All downloads are now resumed by default when possible. | |
| Will be removed in v5 of Transformers.`,name:"resume_download"},{anchor:"transformers.ImageProcessingMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}.</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>) — | |
| 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>"main"</code>) — | |
| 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_35939/src/transformers/image_processing_base.py#L99",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A image processor of type <a | |
| href="/docs/transformers/pr_35939/ja/internal/image_processing_utils#transformers.ImageProcessingMixin" | |
| >ImageProcessingMixin</a>.</p> | |
| `}}),X=new Or({props:{anchor:"transformers.ImageProcessingMixin.from_pretrained.example",$$slots:{default:[mn]},$$scope:{ctx:R}}}),ye=new w({props:{name:"get_image_processor_dict",anchor:"transformers.ImageProcessingMixin.get_image_processor_dict",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.get_image_processor_dict.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) — | |
| The identifier of the pre-trained checkpoint from which we want the dictionary of parameters.`,name:"pretrained_model_name_or_path"},{anchor:"transformers.ImageProcessingMixin.get_image_processor_dict.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>""</code>) — | |
| In case the relevant files are located inside a subfolder of the model repo on huggingface.co, you can | |
| specify the folder name here.`,name:"subfolder"},{anchor:"transformers.ImageProcessingMixin.get_image_processor_dict.image_processor_filename",description:`<strong>image_processor_filename</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"config.json"</code>) — | |
| The name of the file in the model directory to use for the image processor config.`,name:"image_processor_filename"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L274",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The dictionary(ies) that will be used to instantiate the image processor object.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[Dict, Dict]</code></p> | |
| `}}),ve=new w({props:{name:"push_to_hub",anchor:"transformers.ImageProcessingMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"revision",val:": str = None"},{name:"commit_description",val:": str = None"},{name:"tags",val:": typing.Optional[typing.List[str]] = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) — | |
| The name of the repository you want to push your image processor to. It should contain your organization name | |
| when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub. | |
| Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) — | |
| Message to commit while pushing. Will default to <code>"Upload image processor"</code>.`,name:"commit_message"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization’s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated | |
| when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code> | |
| is not specified.`,name:"token"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>"5GB"</code>) — | |
| Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard | |
| will then be each of size lower than this size. If expressed as a string, needs to be digits followed | |
| by a unit (like <code>"5MB"</code>). We default it to <code>"5GB"</code> so that users can easily load models on free-tier | |
| Google Colab instances without any CPU OOM issues.`,name:"max_shard_size"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) — | |
| Branch to push the uploaded files to.`,name:"revision"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.commit_description",description:`<strong>commit_description</strong> (<code>str</code>, <em>optional</em>) — | |
| The description of the commit that will be created`,name:"commit_description"},{anchor:"transformers.ImageProcessingMixin.push_to_hub.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) — | |
| List of tags to push on the Hub.`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/utils/hub.py#L788"}}),G=new Or({props:{anchor:"transformers.ImageProcessingMixin.push_to_hub.example",$$slots:{default:[cn]},$$scope:{ctx:R}}}),xe=new w({props:{name:"register_for_auto_class",anchor:"transformers.ImageProcessingMixin.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'AutoImageProcessor'"}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>"AutoImageProcessor "</code>) — | |
| The auto class to register this new image processor with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L506"}}),A=new an({props:{warning:!0,$$slots:{default:[dn]},$$scope:{ctx:R}}}),$e=new w({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>) — | |
| 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>) — | |
| 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>) — | |
| Additional key word arguments passed along to the <a href="/docs/transformers/pr_35939/ja/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L213"}}),we=new w({props:{name:"to_dict",anchor:"transformers.ImageProcessingMixin.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L440",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Dictionary of all the attributes that make up this image processor instance.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Dict[str, Any]</code></p> | |
| `}}),Ie=new w({props:{name:"to_json_file",anchor:"transformers.ImageProcessingMixin.to_json_file",parameters:[{name:"json_file_path",val:": typing.Union[str, os.PathLike]"}],parametersDescription:[{anchor:"transformers.ImageProcessingMixin.to_json_file.json_file_path",description:`<strong>json_file_path</strong> (<code>str</code> or <code>os.PathLike</code>) — | |
| Path to the JSON file in which this image_processor instance’s parameters will be saved.`,name:"json_file_path"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L492"}}),Me=new w({props:{name:"to_json_string",anchor:"transformers.ImageProcessingMixin.to_json_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/image_processing_base.py#L471",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>String containing all the attributes that make up this feature_extractor instance in JSON format.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>str</code></p> | |
| `}}),Te=new sn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/internal/image_processing_utils.md"}}),{c(){d=a("meta"),C=n(),I=a("p"),$=n(),p(M.$$.fragment),c=n(),T=a("p"),T.textContent=Ir,st=n(),te=a("p"),te.textContent=Mr,it=n(),p(re.$$.fragment),mt=n(),D=a("div"),p(ne.$$.fragment),kt=n(),Pe=a("p"),Pe.innerHTML=Tr,ct=n(),P=a("div"),p(oe.$$.fragment),Zt=n(),je=a("p"),je.textContent=Cr,Wt=n(),Ue=a("p"),Ue.textContent=Pr,dt=n(),j=a("div"),p(ae.$$.fragment),qt=n(),ze=a("p"),ze.textContent=jr,Bt=n(),Le=a("p"),Le.textContent=Ur,lt=n(),k=a("div"),p(se.$$.fragment),Vt=n(),Je=a("p"),Je.textContent=zr,pt=n(),U=a("div"),p(ie.$$.fragment),Et=n(),Ne=a("p"),Ne.innerHTML=Lr,Ht=n(),De=a("p"),De.textContent=Jr,gt=n(),Z=a("div"),p(me.$$.fragment),Rt=n(),ke=a("p"),ke.innerHTML=Nr,ft=n(),W=a("div"),p(ce.$$.fragment),Ft=n(),Ze=a("p"),Ze.textContent=Dr,ht=n(),q=a("div"),p(de.$$.fragment),St=n(),We=a("p"),We.innerHTML=kr,ut=n(),B=a("div"),p(le.$$.fragment),Xt=n(),qe=a("p"),qe.innerHTML=Zr,_t=n(),V=a("div"),p(pe.$$.fragment),Yt=n(),Be=a("p"),Be.innerHTML=Wr,bt=n(),p(ge.$$.fragment),yt=n(),l=a("div"),p(fe.$$.fragment),Gt=n(),Ve=a("p"),Ve.textContent=qr,At=n(),z=a("div"),p(he.$$.fragment),Qt=n(),Ee=a("p"),Ee.innerHTML=Br,Ot=n(),He=a("p"),He.textContent=Vr,Kt=n(),F=a("div"),p(ue.$$.fragment),er=n(),Re=a("p"),Re.innerHTML=Er,tr=n(),S=a("div"),p(_e.$$.fragment),rr=n(),Fe=a("p"),Fe.innerHTML=Hr,nr=n(),L=a("div"),p(be.$$.fragment),or=n(),Se=a("p"),Se.innerHTML=Rr,ar=n(),p(X.$$.fragment),sr=n(),Y=a("div"),p(ye.$$.fragment),ir=n(),Xe=a("p"),Xe.innerHTML=Fr,mr=n(),J=a("div"),p(ve.$$.fragment),cr=n(),Ye=a("p"),Ye.textContent=Sr,dr=n(),p(G.$$.fragment),lr=n(),N=a("div"),p(xe.$$.fragment),pr=n(),Ge=a("p"),Ge.innerHTML=Xr,gr=n(),p(A.$$.fragment),fr=n(),Q=a("div"),p($e.$$.fragment),hr=n(),Ae=a("p"),Ae.innerHTML=Yr,ur=n(),O=a("div"),p(we.$$.fragment),_r=n(),Qe=a("p"),Qe.textContent=Gr,br=n(),K=a("div"),p(Ie.$$.fragment),yr=n(),Oe=a("p"),Oe.textContent=Ar,vr=n(),ee=a("div"),p(Me.$$.fragment),xr=n(),Ke=a("p"),Ke.textContent=Qr,vt=n(),p(Te.$$.fragment),xt=n(),at=a("p"),this.h()},l(e){const i=on("svelte-u9bgzb",document.head);d=s(i,"META",{name:!0,content:!0}),i.forEach(r),C=o(e),I=s(e,"P",{}),v(I).forEach(r),$=o(e),g(M.$$.fragment,e),c=o(e),T=s(e,"P",{"data-svelte-h":!0}),b(T)!=="svelte-pduxms"&&(T.textContent=Ir),st=o(e),te=s(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-he934w"&&(te.textContent=Mr),it=o(e),g(re.$$.fragment,e),mt=o(e),D=s(e,"DIV",{class:!0});var Ce=v(D);g(ne.$$.fragment,Ce),kt=o(Ce),Pe=s(Ce,"P",{"data-svelte-h":!0}),b(Pe)!=="svelte-2qw57k"&&(Pe.innerHTML=Tr),Ce.forEach(r),ct=o(e),P=s(e,"DIV",{class:!0});var E=v(P);g(oe.$$.fragment,E),Zt=o(E),je=s(E,"P",{"data-svelte-h":!0}),b(je)!=="svelte-kjzox5"&&(je.textContent=Cr),Wt=o(E),Ue=s(E,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-fnusyy"&&(Ue.textContent=Pr),E.forEach(r),dt=o(e),j=s(e,"DIV",{class:!0});var H=v(j);g(ae.$$.fragment,H),qt=o(H),ze=s(H,"P",{"data-svelte-h":!0}),b(ze)!=="svelte-m5ejz9"&&(ze.textContent=jr),Bt=o(H),Le=s(H,"P",{"data-svelte-h":!0}),b(Le)!=="svelte-1isflmb"&&(Le.textContent=Ur),H.forEach(r),lt=o(e),k=s(e,"DIV",{class:!0});var wt=v(k);g(se.$$.fragment,wt),Vt=o(wt),Je=s(wt,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-19ts50v"&&(Je.textContent=zr),wt.forEach(r),pt=o(e),U=s(e,"DIV",{class:!0});var et=v(U);g(ie.$$.fragment,et),Et=o(et),Ne=s(et,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-cgeryj"&&(Ne.innerHTML=Lr),Ht=o(et),De=s(et,"P",{"data-svelte-h":!0}),b(De)!=="svelte-1vabayc"&&(De.textContent=Jr),et.forEach(r),gt=o(e),Z=s(e,"DIV",{class:!0});var It=v(Z);g(me.$$.fragment,It),Rt=o(It),ke=s(It,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-1v3jx5j"&&(ke.innerHTML=Nr),It.forEach(r),ft=o(e),W=s(e,"DIV",{class:!0});var Mt=v(W);g(ce.$$.fragment,Mt),Ft=o(Mt),Ze=s(Mt,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-78trhr"&&(Ze.textContent=Dr),Mt.forEach(r),ht=o(e),q=s(e,"DIV",{class:!0});var Tt=v(q);g(de.$$.fragment,Tt),St=o(Tt),We=s(Tt,"P",{"data-svelte-h":!0}),b(We)!=="svelte-skn2h6"&&(We.innerHTML=kr),Tt.forEach(r),ut=o(e),B=s(e,"DIV",{class:!0});var Ct=v(B);g(le.$$.fragment,Ct),Xt=o(Ct),qe=s(Ct,"P",{"data-svelte-h":!0}),b(qe)!=="svelte-avham3"&&(qe.innerHTML=Zr),Ct.forEach(r),_t=o(e),V=s(e,"DIV",{class:!0});var Pt=v(V);g(pe.$$.fragment,Pt),Yt=o(Pt),Be=s(Pt,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-e557ju"&&(Be.innerHTML=Wr),Pt.forEach(r),bt=o(e),g(ge.$$.fragment,e),yt=o(e),l=s(e,"DIV",{class:!0});var y=v(l);g(fe.$$.fragment,y),Gt=o(y),Ve=s(y,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-16ht4m3"&&(Ve.textContent=qr),At=o(y),z=s(y,"DIV",{class:!0});var tt=v(z);g(he.$$.fragment,tt),Qt=o(tt),Ee=s(tt,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-2773v6"&&(Ee.innerHTML=Br),Ot=o(tt),He=s(tt,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1q8uymn"&&(He.textContent=Vr),tt.forEach(r),Kt=o(y),F=s(y,"DIV",{class:!0});var jt=v(F);g(ue.$$.fragment,jt),er=o(jt),Re=s(jt,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-h2qadb"&&(Re.innerHTML=Er),jt.forEach(r),tr=o(y),S=s(y,"DIV",{class:!0});var Ut=v(S);g(_e.$$.fragment,Ut),rr=o(Ut),Fe=s(Ut,"P",{"data-svelte-h":!0}),b(Fe)!=="svelte-10p8f73"&&(Fe.innerHTML=Hr),Ut.forEach(r),nr=o(y),L=s(y,"DIV",{class:!0});var rt=v(L);g(be.$$.fragment,rt),or=o(rt),Se=s(rt,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-155m3w0"&&(Se.innerHTML=Rr),ar=o(rt),g(X.$$.fragment,rt),rt.forEach(r),sr=o(y),Y=s(y,"DIV",{class:!0});var zt=v(Y);g(ye.$$.fragment,zt),ir=o(zt),Xe=s(zt,"P",{"data-svelte-h":!0}),b(Xe)!=="svelte-d2g2ab"&&(Xe.innerHTML=Fr),zt.forEach(r),mr=o(y),J=s(y,"DIV",{class:!0});var nt=v(J);g(ve.$$.fragment,nt),cr=o(nt),Ye=s(nt,"P",{"data-svelte-h":!0}),b(Ye)!=="svelte-1qlyz3u"&&(Ye.textContent=Sr),dr=o(nt),g(G.$$.fragment,nt),nt.forEach(r),lr=o(y),N=s(y,"DIV",{class:!0});var ot=v(N);g(xe.$$.fragment,ot),pr=o(ot),Ge=s(ot,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-ofyqve"&&(Ge.innerHTML=Xr),gr=o(ot),g(A.$$.fragment,ot),ot.forEach(r),fr=o(y),Q=s(y,"DIV",{class:!0});var Lt=v(Q);g($e.$$.fragment,Lt),hr=o(Lt),Ae=s(Lt,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-1oh1odb"&&(Ae.innerHTML=Yr),Lt.forEach(r),ur=o(y),O=s(y,"DIV",{class:!0});var Jt=v(O);g(we.$$.fragment,Jt),_r=o(Jt),Qe=s(Jt,"P",{"data-svelte-h":!0}),b(Qe)!=="svelte-1ww3wqq"&&(Qe.textContent=Gr),Jt.forEach(r),br=o(y),K=s(y,"DIV",{class:!0});var Nt=v(K);g(Ie.$$.fragment,Nt),yr=o(Nt),Oe=s(Nt,"P",{"data-svelte-h":!0}),b(Oe)!=="svelte-1g70y32"&&(Oe.textContent=Ar),Nt.forEach(r),vr=o(y),ee=s(y,"DIV",{class:!0});var Dt=v(ee);g(Me.$$.fragment,Dt),xr=o(Dt),Ke=s(Dt,"P",{"data-svelte-h":!0}),b(Ke)!=="svelte-5ayq1f"&&(Ke.textContent=Qr),Dt.forEach(r),y.forEach(r),vt=o(e),g(Te.$$.fragment,e),xt=o(e),at=s(e,"P",{}),v(at).forEach(r),this.h()},h(){x(d,"name","hf:doc:metadata"),x(d,"content",pn),x(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(l,"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,i){t(document.head,d),m(e,C,i),m(e,I,i),m(e,$,i),f(M,e,i),m(e,c,i),m(e,T,i),m(e,st,i),m(e,te,i),m(e,it,i),f(re,e,i),m(e,mt,i),m(e,D,i),f(ne,D,null),t(D,kt),t(D,Pe),m(e,ct,i),m(e,P,i),f(oe,P,null),t(P,Zt),t(P,je),t(P,Wt),t(P,Ue),m(e,dt,i),m(e,j,i),f(ae,j,null),t(j,qt),t(j,ze),t(j,Bt),t(j,Le),m(e,lt,i),m(e,k,i),f(se,k,null),t(k,Vt),t(k,Je),m(e,pt,i),m(e,U,i),f(ie,U,null),t(U,Et),t(U,Ne),t(U,Ht),t(U,De),m(e,gt,i),m(e,Z,i),f(me,Z,null),t(Z,Rt),t(Z,ke),m(e,ft,i),m(e,W,i),f(ce,W,null),t(W,Ft),t(W,Ze),m(e,ht,i),m(e,q,i),f(de,q,null),t(q,St),t(q,We),m(e,ut,i),m(e,B,i),f(le,B,null),t(B,Xt),t(B,qe),m(e,_t,i),m(e,V,i),f(pe,V,null),t(V,Yt),t(V,Be),m(e,bt,i),f(ge,e,i),m(e,yt,i),m(e,l,i),f(fe,l,null),t(l,Gt),t(l,Ve),t(l,At),t(l,z),f(he,z,null),t(z,Qt),t(z,Ee),t(z,Ot),t(z,He),t(l,Kt),t(l,F),f(ue,F,null),t(F,er),t(F,Re),t(l,tr),t(l,S),f(_e,S,null),t(S,rr),t(S,Fe),t(l,nr),t(l,L),f(be,L,null),t(L,or),t(L,Se),t(L,ar),f(X,L,null),t(l,sr),t(l,Y),f(ye,Y,null),t(Y,ir),t(Y,Xe),t(l,mr),t(l,J),f(ve,J,null),t(J,cr),t(J,Ye),t(J,dr),f(G,J,null),t(l,lr),t(l,N),f(xe,N,null),t(N,pr),t(N,Ge),t(N,gr),f(A,N,null),t(l,fr),t(l,Q),f($e,Q,null),t(Q,hr),t(Q,Ae),t(l,ur),t(l,O),f(we,O,null),t(O,_r),t(O,Qe),t(l,br),t(l,K),f(Ie,K,null),t(K,yr),t(K,Oe),t(l,vr),t(l,ee),f(Me,ee,null),t(ee,xr),t(ee,Ke),m(e,vt,i),f(Te,e,i),m(e,xt,i),m(e,at,i),$t=!0},p(e,[i]){const Ce={};i&2&&(Ce.$$scope={dirty:i,ctx:e}),X.$set(Ce);const E={};i&2&&(E.$$scope={dirty:i,ctx:e}),G.$set(E);const H={};i&2&&(H.$$scope={dirty:i,ctx:e}),A.$set(H)},i(e){$t||(h(M.$$.fragment,e),h(re.$$.fragment,e),h(ne.$$.fragment,e),h(oe.$$.fragment,e),h(ae.$$.fragment,e),h(se.$$.fragment,e),h(ie.$$.fragment,e),h(me.$$.fragment,e),h(ce.$$.fragment,e),h(de.$$.fragment,e),h(le.$$.fragment,e),h(pe.$$.fragment,e),h(ge.$$.fragment,e),h(fe.$$.fragment,e),h(he.$$.fragment,e),h(ue.$$.fragment,e),h(_e.$$.fragment,e),h(be.$$.fragment,e),h(X.$$.fragment,e),h(ye.$$.fragment,e),h(ve.$$.fragment,e),h(G.$$.fragment,e),h(xe.$$.fragment,e),h(A.$$.fragment,e),h($e.$$.fragment,e),h(we.$$.fragment,e),h(Ie.$$.fragment,e),h(Me.$$.fragment,e),h(Te.$$.fragment,e),$t=!0)},o(e){u(M.$$.fragment,e),u(re.$$.fragment,e),u(ne.$$.fragment,e),u(oe.$$.fragment,e),u(ae.$$.fragment,e),u(se.$$.fragment,e),u(ie.$$.fragment,e),u(me.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(le.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(X.$$.fragment,e),u(ye.$$.fragment,e),u(ve.$$.fragment,e),u(G.$$.fragment,e),u(xe.$$.fragment,e),u(A.$$.fragment,e),u($e.$$.fragment,e),u(we.$$.fragment,e),u(Ie.$$.fragment,e),u(Me.$$.fragment,e),u(Te.$$.fragment,e),$t=!1},d(e){e&&(r(C),r(I),r($),r(c),r(T),r(st),r(te),r(it),r(mt),r(D),r(ct),r(P),r(dt),r(j),r(lt),r(k),r(pt),r(U),r(gt),r(Z),r(ft),r(W),r(ht),r(q),r(ut),r(B),r(_t),r(V),r(bt),r(yt),r(l),r(vt),r(xt),r(at)),r(d),_(M,e),_(re,e),_(ne),_(oe),_(ae),_(se),_(ie),_(me),_(ce),_(de),_(le),_(pe),_(ge,e),_(fe),_(he),_(ue),_(_e),_(be),_(X),_(ye),_(ve),_(G),_(xe),_(A),_($e),_(we),_(Ie),_(Me),_(Te,e)}}}const pn='{"title":"画像プロセッサ用ユーティリティ","local":"画像プロセッサ用ユーティリティ","sections":[{"title":"Image Transformations","local":"transformers.image_transforms.center_crop","sections":[],"depth":2},{"title":"ImageProcessingMixin","local":"transformers.ImageProcessingMixin","sections":[],"depth":2}],"depth":1}';function gn(R){return tn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xn extends rn{constructor(d){super(),nn(this,d,gn,ln,en,{})}}export{xn as component}; | |
Xet Storage Details
- Size:
- 57.9 kB
- Xet hash:
- eb7e99879dac9d4a7e3b8b29f85cc98f1212f62e706b0d30e347e64e628dfb7c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.