コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::オーバーラップありの非最大抑制
#include <image_ops.h>
スコアの降順で境界ボックスのサブセットを貪欲に選択します。
まとめ
以前に選択したボックスと重複する部分が多いボックスを削除します。スコアがscore_threshold
未満の境界ボックスは削除されます。 N 行 n 列のオーバーラップ値は正方行列として提供され、カスタムのオーバーラップ基準 (和集合上の交差、エリア上の交差など) を定義できます。
この操作の出力は、選択されたボックスを表す境界ボックスの入力コレクションにインデックスを付ける整数のセットです。選択したインデックスに対応する境界ボックスの座標は、 tf.gather operation
を使用して取得できます。例えば:
selected_indices = tf.image.non_max_suppression_with_overlaps( オーバーラップ, スコア, 最大出力サイズ, オーバーラップ閾値, スコア閾値) selected_boxes = tf.gather(ボックス, selected_indices)
引数:
- スコープ:スコープオブジェクト
- オーバーラップ: n 行 n 列のボックスのオーバーラップ値を表す形状
[num_boxes, num_boxes]
の 2 次元浮動小数点テンソル。 - スコア: 各ボックス (ボックスの各行) に対応する単一のスコアを表す、形状
[num_boxes]
の 1 次元浮動小数点テンソル。 - max_output_size: 非最大抑制によって選択されるボックスの最大数を表すスカラー整数テンソル。
- overlap_threshold: ボックスもオーバーラップするかどうかを決定するためのしきい値を表す 0 次元浮動小数点テンソル。
- core_threshold: スコアに基づいてボックスをいつ削除するかを決定するためのしきい値を表す 0 次元の浮動小数点テンソル。
戻り値:
-
Output
: ボックス テンソルから選択されたインデックスを表す形状[M]
の 1 次元整数テンソル ( M <= max_output_size
。
パブリック属性
公共機能
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# tensorflow::ops::NonMaxSuppressionWithOverlaps Class Reference\n\ntensorflow::ops::NonMaxSuppressionWithOverlaps\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 overlaps with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. N-by-n overlap values are supplied as square matrix, which allows for defining a custom overlap criterium (eg. intersection over union, intersection over area, etc.).\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_with_overlaps( overlaps, scores, max_output_size, overlap_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices)\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- overlaps: A 2-D float tensor of shape `[num_boxes, num_boxes]` representing the n-by-n box overlap values.\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- overlap_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too.\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\nReturns:\n\n- [Output](/versions/r1.15/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| [NonMaxSuppressionWithOverlaps](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1af965488437d8cbc7c79e1c36eca2abb3)`(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)` overlaps, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` overlap_threshold, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` score_threshold)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a2f05b95bdafce0c5fc4a8269b35709e3) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [selected_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1ab9ac497f027b7104d8ba5463a5a487ca) | `::`[tensorflow::Output](/versions/r1.15/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_with_overlaps_1a77c8843216c117ea9cc2597027f4a20e)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a46f0366220ce965998602e5248c93070)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a636de2d3e1a950d52efadd9bff02eb59)`() 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### NonMaxSuppressionWithOverlaps\n\n```gdscript\n NonMaxSuppressionWithOverlaps(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input overlaps,\n ::tensorflow::Input scores,\n ::tensorflow::Input max_output_size,\n ::tensorflow::Input overlap_threshold,\n ::tensorflow::Input score_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```"]]