संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: नॉनमैक्ससप्रेशनV4
#include <image_ops.h>
लालच से स्कोर के घटते क्रम में बाउंडिंग बॉक्स का एक सबसेट चुनता है।
सारांश
पहले से चयनित बक्सों के साथ उच्च इंटरसेक्शन-ओवर-यूनियन (आईओयू) ओवरलैप वाले बक्सों को छांटना। score_threshold
से कम स्कोर वाले बाउंडिंग बॉक्स हटा दिए जाते हैं। बाउंडिंग बॉक्स को [y1, x1, y2, x2] के रूप में आपूर्ति की जाती है, जहां (y1, x1) और (y2, x2) बॉक्स कोनों की किसी भी विकर्ण जोड़ी के निर्देशांक हैं और निर्देशांक को सामान्यीकृत (यानी, झूठ बोलते हुए) के रूप में प्रदान किया जा सकता है अंतराल [0, 1]) या पूर्ण। ध्यान दें कि यह एल्गोरिदम इस बात से अज्ञेयवादी है कि मूल समन्वय प्रणाली में कहां है और आमतौर पर समन्वय प्रणाली के ऑर्थोगोनल परिवर्तनों और अनुवादों के लिए अपरिवर्तनीय है; इस प्रकार समन्वय प्रणाली के अनुवाद या प्रतिबिंब के परिणामस्वरूप एल्गोरिदम द्वारा समान बक्से का चयन किया जाता है। इस ऑपरेशन का आउटपुट चयनित बॉक्स का प्रतिनिधित्व करने वाले बाउंडिंग बॉक्स के इनपुट संग्रह में अनुक्रमित पूर्णांकों का एक सेट है। चयनित सूचकांकों के अनुरूप बाउंडिंग बॉक्स निर्देशांक tf.gather operation
उपयोग करके प्राप्त किए जा सकते हैं। उदाहरण के लिए: चयनित_सूचकांक = tf.image.non_max_suppression_v2( बॉक्स, स्कोर, अधिकतम_आउटपुट_आकार, iou_threshold, स्कोर_थ्रेशोल्ड) चयनित_बॉक्स = tf.gather(बॉक्स, चयनित_सूचकांक)
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- बक्से: आकार का एक 2-डी फ्लोट टेंसर
[num_boxes, 4]
। - स्कोर: आकार का एक 1-डी फ्लोट टेंसर
[num_boxes]
प्रत्येक बॉक्स (बॉक्स की प्रत्येक पंक्ति) के अनुरूप एकल स्कोर का प्रतिनिधित्व करता है। - max_output_size: एक अदिश पूर्णांक टेंसर, जो गैर-अधिकतम दमन द्वारा चुने जाने वाले बक्सों की अधिकतम संख्या का प्रतिनिधित्व करता है।
- iou_threshold: एक 0-डी फ्लोट टेंसर यह तय करने के लिए सीमा का प्रतिनिधित्व करता है कि बॉक्स IOU के संबंध में बहुत अधिक ओवरलैप करते हैं या नहीं।
- स्कोर_थ्रेसहोल्ड: 0-डी फ्लोट टेंसर स्कोर के आधार पर बक्से को हटाने का निर्णय लेने के लिए सीमा का प्रतिनिधित्व करता है।
वैकल्पिक विशेषताएँ (देखें Attrs
):
- पैड_टू_मैक्स_आउटपुट_साइज़: यदि सत्य है, तो आउटपुट
selected_indices
की लंबाई max_output_size
है। डिफ़ॉल्ट से असत्य.
रिटर्न:
-
Output
चयनित_सूचकांक: आकार का एक 1-डी पूर्णांक टेंसर [M]
बॉक्स टेंसर से चयनित सूचकांकों का प्रतिनिधित्व करता है, जहां M <= max_output_size
। -
Output
वैध_आउटपुट: एक 0-डी पूर्णांक टेंसर selected_indices
में वैध तत्वों की संख्या का प्रतिनिधित्व करता है, जिसमें वैध तत्व पहले दिखाई देते हैं।
निर्माता और विध्वंसक |
---|
NonMaxSuppressionV4 (const :: tensorflow::Scope & scope, :: tensorflow::Input boxes, :: tensorflow::Input scores, :: tensorflow::Input max_output_size, :: tensorflow::Input iou_threshold, :: tensorflow::Input score_threshold)
|
NonMaxSuppressionV4 (const :: tensorflow::Scope & scope, :: tensorflow::Input boxes, :: tensorflow::Input scores, :: tensorflow::Input max_output_size, :: tensorflow::Input iou_threshold, :: tensorflow::Input score_threshold, const NonMaxSuppressionV4::Attrs & attrs) |
सार्वजनिक गुण
सार्वजनिक समारोह
सार्वजनिक स्थैतिक कार्य
PadToMaxOutputSize
Attrs PadToMaxOutputSize(
bool 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::NonMaxSuppressionV4 Class Reference\n\ntensorflow::ops::NonMaxSuppressionV4\n====================================\n\n`#include \u003cimage_ops.h\u003e`\n\nGreedily selects a subset of bounding boxes in descending order of score,.\n\nSummary\n-------\n\npruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. Bounding boxes are supplied as \\[y1, x1, y2, x2\\], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval \\[0, 1\\]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices)\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- boxes: A 2-D float tensor of shape `[num_boxes, 4]`.\n- scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).\n- max_output_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.\n- iou_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.\n- score_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs)):\n\n- pad_to_max_output_size: If true, the output `selected_indices` is padded to be of length `max_output_size`. 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) selected_indices: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M \u003c= max_output_size`.\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) valid_outputs: A 0-D integer tensor representing the number of valid elements in `selected_indices`, with the valid elements appearing first.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [NonMaxSuppressionV4](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1ac241f89469a7188f8d9b5c0daa2441f4)`(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)` boxes, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` iou_threshold, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` score_threshold)` ||\n| [NonMaxSuppressionV4](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1afc8c9e7cedb3678900fa3bcf995aee11)`(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)` boxes, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` iou_threshold, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` score_threshold, const `[NonMaxSuppressionV4::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a68c64a50fa3dd5b983f6e09e61b92eab) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [selected_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a3f301cbbf0cd3b82a64c243b1e357fa6) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [valid_outputs](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a47653a5cde7a40dd1801dfc699e2f429) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PadToMaxOutputSize](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a67d61f68bcfca71cdf3f27c979f2ecd2)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::NonMaxSuppressionV4::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v4/attrs) | Optional attribute setters for [NonMaxSuppressionV4](/versions/r2.1/api_docs/cc/class/tensorflow/ops/non-max-suppression-v4#classtensorflow_1_1ops_1_1_non_max_suppression_v4). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### selected_indices\n\n```scdoc\n::tensorflow::Output selected_indices\n``` \n\n### valid_outputs\n\n```scdoc\n::tensorflow::Output valid_outputs\n``` \n\nPublic functions\n----------------\n\n### NonMaxSuppressionV4\n\n```gdscript\n NonMaxSuppressionV4(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input boxes,\n ::tensorflow::Input scores,\n ::tensorflow::Input max_output_size,\n ::tensorflow::Input iou_threshold,\n ::tensorflow::Input score_threshold\n)\n``` \n\n### NonMaxSuppressionV4\n\n```gdscript\n NonMaxSuppressionV4(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input boxes,\n ::tensorflow::Input scores,\n ::tensorflow::Input max_output_size,\n ::tensorflow::Input iou_threshold,\n ::tensorflow::Input score_threshold,\n const NonMaxSuppressionV4::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### PadToMaxOutputSize\n\n```text\nAttrs PadToMaxOutputSize(\n bool x\n)\n```"]]