جریان تنسور:: عملیات:: NonMaxSuppressionV2
#include <image_ops.h>
حریصانه زیرمجموعه ای از جعبه های محدود کننده را به ترتیب امتیاز نزولی انتخاب می کند.
خلاصه
هرس کردن جعبه هایی که دارای تقاطع بالای اتحاد (IOU) هستند با جعبه های انتخاب شده قبلی همپوشانی دارند. جعبه های مرزی به صورت [y1، x1، y2، x2] عرضه می شوند، که در آن (y1، x1) و (y2، x2) مختصات هر جفت مورب گوشه های جعبه هستند و مختصات را می توان به صورت نرمال ارائه کرد (یعنی خوابیده در فاصله [0، 1]) یا مطلق. توجه داشته باشید که این الگوریتم نسبت به جایی که مبدأ در سیستم مختصات است آگنوستیک است. توجه داشته باشید که این الگوریتم نسبت به تبدیل های متعامد و ترجمه های سیستم مختصات ثابت است. بنابراین ترجمه یا بازتاب سیستم مختصات منجر به انتخاب کادرهای مشابه توسط الگوریتم می شود.
خروجی این عملیات مجموعه ای از اعداد صحیح است که در مجموعه ورودی جعبه های مرزی نمایانگر جعبه های انتخاب شده اند. سپس مختصات جعبه مرزی مربوط به شاخص های انتخاب شده را می توان با استفاده از tf.gather operation
به دست آورد. به عنوان مثال:
select_indices = tf.image.non_max_suppression_v2( کادرها، امتیازات، حداکثر_اندازه_خروجی، iou_threshold) selected_boxes = tf.gather(جعبه ها، شاخص_های انتخاب شده)
استدلال ها:
- scope: یک شی Scope
- جعبهها: یک تانسور شناور دو بعدی با شکل
[num_boxes, 4]
. - امتیازها: یک تانسور شناور یک بعدی با شکل
[num_boxes]
که نشان دهنده یک امتیاز واحد مربوط به هر جعبه (هر ردیف از جعبه ها) است. - max_output_size: یک تانسور عدد صحیح اسکالر که نشان دهنده حداکثر تعداد کادرهایی است که باید با سرکوب غیر حداکثر انتخاب شوند.
- iou_threshold: یک تانسور شناور 0-D که آستانه ای را برای تصمیم گیری در مورد همپوشانی بیش از حد جعبه ها نسبت به IOU نشان می دهد.
برمیگرداند:
-
Output
: یک تانسور عدد صحیح یک بعدی به شکل [M]
که نمایانگر شاخص های انتخاب شده از تانسور جعبه است، که در آن M <= max_output_size
.
صفات عمومی
عملیات
Operation operation
انتخاب_شاخص ها
::tensorflow::Output selected_indices
توابع عمومی
NonMaxSuppressionV2
NonMaxSuppressionV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold
)
گره
::tensorflow::Node * node() const
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# tensorflow::ops::NonMaxSuppressionV2 Class Reference\n\ntensorflow::ops::NonMaxSuppressionV2\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 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. Note that this algorithm 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.\n\nThe 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:\n\nselected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold) selected_boxes = tf.gather(boxes, selected_indices)\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/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\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M \u003c= max_output_size`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [NonMaxSuppressionV2](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aa344ba54e3c8ecdf351160841d620b90)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` boxes, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` iou_threshold)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aa5c9890c89f51ea289a417dc96e5155e) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [selected_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1abd7f6df70942924aba1f37d144c96bf6) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1a74b7fd12711f34637858a5695ed0c654)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1a204a073b24bbf63d20c616abcf020a48)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aaf3f8cdfaf63a67e5f7afdc2eb714271)`() const ` | ` ` ` ` |\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\nPublic functions\n----------------\n\n### NonMaxSuppressionV2\n\n```gdscript\n NonMaxSuppressionV2(\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)\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```"]]