संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: क्षेत्र का आकार बदलें
#include <image_ops.h>
क्षेत्र प्रक्षेप का उपयोग करके images
size
बदलें।
सारांश
इनपुट छवियां विभिन्न प्रकार की हो सकती हैं लेकिन आउटपुट छवियां हमेशा फ्लोट होती हैं।
सीमित संख्यात्मक परिशुद्धता के कारण आउटपुट छवि के लिए पिक्सेल मानों की सीमा इनपुट छवि की सीमा से थोड़ी भिन्न हो सकती है। आउटपुट रेंज की गारंटी के लिए, उदाहरण के लिए [0.0, 1.0]
, आउटपुट पर tf.clip_by_value
लागू करें।
प्रत्येक आउटपुट पिक्सेल की गणना पहले पिक्सेल के फ़ुटप्रिंट को इनपुट टेंसर में परिवर्तित करके और फिर फ़ुटप्रिंट को प्रतिच्छेद करने वाले पिक्सेल का औसत करके की जाती है। औसत में एक इनपुट पिक्सेल का योगदान उसके क्षेत्र के उस अंश से भारित होता है जो पदचिह्न को काटता है। यह OpenCV के INTER_AREA के समान है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- छवियां: आकार के साथ 4-डी
[batch, height, width, channels]
। - आकार: = 2 तत्वों का 1-डी int32 टेंसर :
new_height, new_width
। छवियों के लिए नया आकार.
वैकल्पिक विशेषताएँ (देखें Attrs
):
- संरेखित_कोनों: यदि सत्य है, तो इनपुट और आउटपुट टेंसर के 4 कोने वाले पिक्सेल के केंद्र संरेखित होते हैं, जिससे कोने वाले पिक्सेल पर मान संरक्षित होते हैं। डिफ़ॉल्ट से असत्य.
रिटर्न:
-
Output
: आकार के साथ 4-डी [batch, new_height, new_width, channels]
।
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
सार्वजनिक स्थैतिक कार्य
संरेखित कोने
Attrs AlignCorners(
bool x
)
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::ResizeArea Class Reference\n\ntensorflow::ops::ResizeArea\n===========================\n\n`#include \u003cimage_ops.h\u003e`\n\nResize `images` to `size` using area interpolation.\n\nSummary\n-------\n\n[Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input) images can be of different types but output images are always float.\n\nThe range of pixel values for the output image might be slightly different from the range for the input image because of limited numerical precision. To guarantee an output range, for example `[0.0, 1.0]`, apply `tf.clip_by_value` to the output.\n\nEach output pixel is computed by first transforming the pixel's footprint into the input tensor and then averaging the pixels that intersect the footprint. An input pixel's contribution to the average is weighted by the fraction of its area that intersects the footprint. This is the same as OpenCV's INTER_AREA.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- images: 4-D with shape `[batch, height, width, channels]`.\n- size: = A 1-D int32 [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs)):\n\n- align_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 4-D with shape `[batch, new_height, new_width, channels]`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ResizeArea](#classtensorflow_1_1ops_1_1_resize_area_1a48c3b130fbd05acaed9512549485f012)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` images, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size)` ||\n| [ResizeArea](#classtensorflow_1_1ops_1_1_resize_area_1ac1b5d48c5c77399d5198780d905281d7)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` images, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, const `[ResizeArea::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_resize_area_1a5cb2a40837fb9d975e2ca454469e5cac) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [resized_images](#classtensorflow_1_1ops_1_1_resize_area_1a64b25c97b7028b2b4c93978f2e957ad4) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_resize_area_1abdc62a6906daefaa326cda016f8fbb0c)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resize_area_1a6e7fba9df05a54b4e0de2d079fa03403)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resize_area_1a15a700424a492dfe07a1777ddc6146bd)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [AlignCorners](#classtensorflow_1_1ops_1_1_resize_area_1ae8ffc21c407e98bddb149275984ed3cf)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ResizeArea::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/resize-area/attrs) | Optional attribute setters for [ResizeArea](/versions/r2.1/api_docs/cc/class/tensorflow/ops/resize-area#classtensorflow_1_1ops_1_1_resize_area). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### resized_images\n\n```scdoc\n::tensorflow::Output resized_images\n``` \n\nPublic functions\n----------------\n\n### ResizeArea\n\n```gdscript\n ResizeArea(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input images,\n ::tensorflow::Input size\n)\n``` \n\n### ResizeArea\n\n```gdscript\n ResizeArea(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input images,\n ::tensorflow::Input size,\n const ResizeArea::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### AlignCorners\n\n```text\nAttrs AlignCorners(\n bool x\n)\n```"]]