संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: डिकोडपीएनजी
#include <image_ops.h>
PNG-एन्कोडेड छवि को uint8 या uint16 टेंसर में डिकोड करें।
सारांश
एटीआर channels
डिकोड की गई छवि के लिए रंगीन चैनलों की वांछित संख्या को इंगित करता है।
स्वीकृत मान हैं:
- 0: पीएनजी-एन्कोडेड छवि में चैनलों की संख्या का उपयोग करें।
- 1: एक ग्रेस्केल छवि आउटपुट करें।
- 3: एक आरजीबी छवि आउटपुट करें।
- 4: एक आरजीबीए छवि आउटपुट करें।
यदि आवश्यक हो, तो पीएनजी-एन्कोडेड छवि को रंगीन चैनलों की अनुरोधित संख्या से मिलान करने के लिए बदल दिया जाता है।
यह ऑपरेशन जेपीईजी और गैर-एनिमेटेड जीआईएफ को डिकोड करने का भी समर्थन करता है क्योंकि इंटरफ़ेस समान है, हालांकि tf.image.decode_image
उपयोग करना अधिक आसान है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- सामग्री: 0-डी. पीएनजी-एन्कोडेड छवि।
वैकल्पिक विशेषताएँ (देखें Attrs
):
- चैनल: डिकोड की गई छवि के लिए रंगीन चैनलों की संख्या।
रिटर्न:
-
Output
: आकार [height, width, channels]
के साथ 3-डी।
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
सार्वजनिक स्थैतिक कार्य
चैनल
Attrs Channels(
int64 x
)
डीप्रकार
Attrs Dtype(
DataType x
)
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::DecodePng Class Reference\n\ntensorflow::ops::DecodePng\n==========================\n\n`#include \u003cimage_ops.h\u003e`\n\nDecode a PNG-encoded image to a uint8 or uint16 tensor.\n\nSummary\n-------\n\nThe attr `channels` indicates the desired number of color channels for the decoded image.\n\nAccepted values are:\n\n\n- 0: Use the number of channels in the PNG-encoded image.\n- 1: output a grayscale image.\n- 3: output an RGB image.\n- 4: output an RGBA image.\n\n\u003cbr /\u003e\n\nIf needed, the PNG-encoded image is transformed to match the requested number of color channels.\n\nThis op also supports decoding JPEGs and non-animated GIFs since the interface is the same, though it is cleaner to use `tf.image.decode_image`.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- contents: 0-D. The PNG-encoded image.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)):\n\n- channels: Number of color channels for the decoded image.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 3-D with shape `[height, width, channels]`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DecodePng](#classtensorflow_1_1ops_1_1_decode_png_1ab7adeeb5aa6b10893fb6063ee8d6fc87)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` contents)` ||\n| [DecodePng](#classtensorflow_1_1ops_1_1_decode_png_1aa2df55e8e1eed056df69f127ca4cba25)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` contents, const `[DecodePng::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [image](#classtensorflow_1_1ops_1_1_decode_png_1a493e0f58c502e83895b5ab8df3ed277c) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_decode_png_1ac11da6e89a194ee86e7a82442fb33ed4) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_decode_png_1adea6247b44969accb1513a6b237bd2d3)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_png_1a1449fe5081528b4cb081cb224ba20d96)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_png_1a19025343d7746c9091afcf01dbba03fd)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [Channels](#classtensorflow_1_1ops_1_1_decode_png_1ac0322c095dfd2d11bca81c46b421847a)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs) |\n| [Dtype](#classtensorflow_1_1ops_1_1_decode_png_1a656dedb17c75247c916d54efef9fb4f6)`(DataType x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::DecodePng::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/decode-png/attrs) | Optional attribute setters for [DecodePng](/versions/r1.15/api_docs/cc/class/tensorflow/ops/decode-png#classtensorflow_1_1ops_1_1_decode_png). |\n\nPublic attributes\n-----------------\n\n### image\n\n```text\n::tensorflow::Output image\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### DecodePng\n\n```gdscript\n DecodePng(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input contents\n)\n``` \n\n### DecodePng\n\n```gdscript\n DecodePng(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input contents,\n const DecodePng::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### Channels\n\n```text\nAttrs Channels(\n int64 x\n)\n``` \n\n### Dtype\n\n```carbon\nAttrs Dtype(\n DataType x\n)\n```"]]