Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
aliran tensor:: operasi:: Penekanan NonMax
#include <image_ops.h>
Dengan rakus memilih subset kotak pembatas dalam urutan skor yang menurun.
Ringkasan
memangkas kotak-kotak yang memiliki interseksi-over-union (IOU) tinggi yang tumpang tindih dengan kotak-kotak yang dipilih sebelumnya. Kotak pembatas diberikan sebagai [y1, x1, y2, x2], di mana (y1, x1) dan (y2, x2) adalah koordinat dari setiap pasangan sudut kotak diagonal dan koordinat dapat diberikan sebagai dinormalisasi (yaitu, terletak di interval [0, 1]) atau absolut. Perhatikan bahwa algoritma ini tidak tergantung pada titik asal dalam sistem koordinat. Perhatikan bahwa algoritma ini tidak berubah terhadap transformasi ortogonal dan terjemahan sistem koordinat; sehingga penerjemahan atau refleksi dari sistem koordinat menghasilkan kotak yang sama yang dipilih oleh algoritma. Output dari operasi ini adalah sekumpulan bilangan bulat yang diindeks ke dalam kumpulan input kotak pembatas yang mewakili kotak yang dipilih. Koordinat kotak pembatas yang sesuai dengan indeks yang dipilih kemudian dapat diperoleh dengan menggunakan tf.gather operation
. Misalnya: indeks_yang dipilih = tf.image.non_max_suppression( kotak, skor, max_output_size, iou_threshold) kotak_yang dipilih = tf.gather(kotak, indeks_yang dipilih)
Argumen:
- ruang lingkup: Objek Lingkup
- kotak: Tensor float 2-D dengan bentuk
[num_boxes, 4]
. - skor: Tensor float 1-D berbentuk
[num_boxes]
yang mewakili satu skor yang sesuai dengan setiap kotak (setiap baris kotak). - max_output_size: Tensor bilangan bulat skalar yang mewakili jumlah maksimum kotak yang akan dipilih dengan penekanan non maksimal.
Atribut opsional (lihat Attrs
):
- iou_threshold: Float yang mewakili ambang batas untuk memutuskan apakah kotak terlalu banyak tumpang tindih sehubungan dengan IOU.
Pengembalian:
-
Output
: Tensor bilangan bulat 1-D berbentuk [M]
yang mewakili indeks yang dipilih dari kotak tensor, dengan M <= max_output_size
.
Atribut publik
Fungsi publik
simpul
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Keluaran
operator::tensorflow::Output() const
Fungsi statis publik
Ambang Batas
Attrs IouThreshold(
float x
)
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# tensorflow::ops::NonMaxSuppression Class Reference\n\ntensorflow::ops::NonMaxSuppression\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. 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( 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\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs)):\n\n- iou_threshold: A float 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| [NonMaxSuppression](#classtensorflow_1_1ops_1_1_non_max_suppression_1a9d86b1cd20b43d62327b4b497d6457d4)`(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)` ||\n| [NonMaxSuppression](#classtensorflow_1_1ops_1_1_non_max_suppression_1a1ab4c9ad2a00fb51e1dfd72bc9fc363b)`(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, const `[NonMaxSuppression::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_non_max_suppression_1a1959f5a68ba6d16064a93d86a1414712) | [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_1ad4219ad3203cc7d4d8c96f8833d367fc) | `::`[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_1a4cad107f2f05bbb87deb2241ecad5f6e)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_1af7a9dd9e033cacef4e2771bdf3998725)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_1acb3c005a4bed5fc05b4eaae70457faca)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [IouThreshold](#classtensorflow_1_1ops_1_1_non_max_suppression_1a136de54e18cc497fc70fc94659efd6ae)`(float x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::NonMaxSuppression::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs) | Optional attribute setters for [NonMaxSuppression](/versions/r2.3/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression). |\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### NonMaxSuppression\n\n```gdscript\n NonMaxSuppression(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input boxes,\n ::tensorflow::Input scores,\n ::tensorflow::Input max_output_size\n)\n``` \n\n### NonMaxSuppression\n\n```gdscript\n NonMaxSuppression(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input boxes,\n ::tensorflow::Input scores,\n ::tensorflow::Input max_output_size,\n const NonMaxSuppression::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### IouThreshold\n\n```text\nAttrs IouThreshold(\n float x\n)\n```"]]