컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: NonMaxSuppressionV5
#include <image_ops.h>
점수의 내림차순으로 경계 상자의 하위 집합을 탐욕스럽게 선택합니다.
요약
IOU(Intersection-Over-Union)가 높은 상자가 이전에 선택한 상자와 겹치는 부분을 제거합니다. 점수가 score_threshold
보다 작은 경계 상자가 제거됩니다. 경계 상자는 [y1, x1, y2, x2]로 제공됩니다. 여기서 (y1, x1) 및 (y2, x2)는 상자 모서리의 대각선 쌍의 좌표이며 좌표는 정규화된 대로 제공될 수 있습니다(예: 간격 [0, 1]) 또는 절대값. 이 알고리즘은 좌표계의 원점이 어디에 있는지에 영향을 받지 않으며 더 일반적으로는 좌표계의 직교 변환 및 변환에 불변합니다. 따라서 좌표계를 변환하거나 반영하면 알고리즘에 의해 동일한 상자가 선택됩니다. 이 작업의 출력은 선택한 상자를 나타내는 경계 상자의 입력 컬렉션을 인덱싱하는 정수 집합입니다. 선택한 인덱스에 해당하는 경계 상자 좌표는 tf.gather operation
사용하여 얻을 수 있습니다. 예: selected_indices = tf.image.non_max_suppression_v2(boxs, Score, max_output_size, iou_threshold, Score_threshold) selected_boxes = tf.gather(boxes, selected_indices) 이 작업은 Soft-NMS(가우시안 가중치 사용) 모드도 지원합니다(Bodla 외 참조) , https://arxiv.org/abs/1704.04503 ) 여기서 상자는 직접 잘라내는 대신 다른 겹치는 상자의 점수를 줄입니다. 이 Soft-NMS 모드를 활성화하려면 soft_nms_sigma
매개변수를 0보다 크게 설정하십시오.
인수:
- 범위: 범위 개체
- 상자:
[num_boxes, 4]
모양의 2차원 부동 텐서. - 점수: 각 상자(상자의 각 행)에 해당하는 단일 점수를 나타내는
[num_boxes]
모양의 1차원 부동 소수점 텐서입니다. - max_output_size: 최대가 아닌 억제로 선택할 최대 상자 수를 나타내는 스칼라 정수 텐서.
- iou_threshold: IOU와 관련하여 상자가 너무 많이 겹치는지 여부를 결정하기 위한 임계값을 나타내는 0-D 부동 텐서입니다.
- Score_threshold: 점수에 따라 상자를 제거할 시기를 결정하기 위한 임계값을 나타내는 0-D 부동 텐서입니다.
- Soft_nms_sigma: Soft NMS의 시그마 매개변수를 나타내는 0-D 부동 텐서; Bodla 등(참조 : https://arxiv.org/abs/1704.04503 )을 참조하세요.
soft_nms_sigma=0.0
(기본값)이면 표준(하드) NMS로 대체됩니다.
선택적 속성( Attrs
참조):
- pad_to_max_output_size: true인 경우
selected_indices
출력이 max_output_size
길이가 되도록 채워집니다. 기본값은 거짓입니다.
보고:
-
Output
selected_indices: 상자 텐서에서 선택된 인덱스를 나타내는 [M]
모양의 1차원 정수 텐서(여기서 M <= max_output_size
. -
Output
selected_scores: 각 선택된 상자에 대한 해당 점수를 나타내는 [M]
모양의 1차원 부동 소수점 텐서(여기서 M <= max_output_size
. 점수는 Soft NMS를 사용할 때(즉, soft_nms_sigma>0
인 경우) 해당 입력 점수와만 다릅니다. -
Output
valid_outputs: selected_indices
의 유효한 요소 수를 나타내는 0-D 정수 텐서. 유효한 요소가 먼저 나타납니다.
생성자와 소멸자 |
---|
NonMaxSuppressionV5 (const :: tensorflow::Scope & scope, :: tensorflow::Input boxes, :: tensorflow::Input scores, :: tensorflow::Input max_output_size, :: tensorflow::Input iou_threshold, :: tensorflow::Input score_threshold, :: tensorflow::Input soft_nms_sigma)
|
NonMaxSuppressionV5 (const :: tensorflow::Scope & scope, :: tensorflow::Input boxes, :: tensorflow::Input scores, :: tensorflow::Input max_output_size, :: tensorflow::Input iou_threshold, :: tensorflow::Input score_threshold, :: tensorflow::Input soft_nms_sigma, const NonMaxSuppressionV5::Attrs & attrs) |
공개 속성
공공 기능
공개 정적 함수
PadToMaxOutputSize
Attrs PadToMaxOutputSize(
bool x
)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# tensorflow::ops::NonMaxSuppressionV5 Class Reference\n\ntensorflow::ops::NonMaxSuppressionV5\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) This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. Bodla et al, \u003chttps://arxiv.org/abs/1704.04503\u003e) where boxes reduce the score of other overlapping boxes instead of directly causing them to be pruned. To enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be larger than 0.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/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- soft_nms_sigma: A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et al (c.f. \u003chttps://arxiv.org/abs/1704.04503\u003e). When `soft_nms_sigma=0.0` (which is default), we fall back to standard (hard) NMS.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_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.2/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.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) selected_scores: A 1-D float tensor of shape `[M]` representing the corresponding scores for each selected box, where `M \u003c= max_output_size`. Scores only differ from corresponding input scores when using Soft NMS (i.e. when `soft_nms_sigma\u003e0`)\n- [Output](/versions/r2.2/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| [NonMaxSuppressionV5](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a58f80a7976cd835a7edb22cdfbe9d52e)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` boxes, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` iou_threshold, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` score_threshold, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` soft_nms_sigma)` ||\n| [NonMaxSuppressionV5](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a01252b578e820021a7bd241b40164251)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` boxes, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scores, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max_output_size, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` iou_threshold, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` score_threshold, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` soft_nms_sigma, const `[NonMaxSuppressionV5::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1aa96dc249a5c111b383bada5507ebf994) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [selected_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a7c287739ff4978fb784b56224b054b21) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [selected_scores](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1ab66338bc87549958c2b63ba5fd795530) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [valid_outputs](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a4099ccdeda03b3fc9290a7391e811ace) | `::`[tensorflow::Output](/versions/r2.2/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_v5_1a6f6209fd08cfd3bd97ba74954009db05)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::NonMaxSuppressionV5::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/non-max-suppression-v5/attrs) | Optional attribute setters for [NonMaxSuppressionV5](/versions/r2.2/api_docs/cc/class/tensorflow/ops/non-max-suppression-v5#classtensorflow_1_1ops_1_1_non_max_suppression_v5). |\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### selected_scores\n\n```scdoc\n::tensorflow::Output selected_scores\n``` \n\n### valid_outputs\n\n```scdoc\n::tensorflow::Output valid_outputs\n``` \n\nPublic functions\n----------------\n\n### NonMaxSuppressionV5\n\n```gdscript\n NonMaxSuppressionV5(\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 ::tensorflow::Input soft_nms_sigma\n)\n``` \n\n### NonMaxSuppressionV5\n\n```gdscript\n NonMaxSuppressionV5(\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 ::tensorflow::Input soft_nms_sigma,\n const NonMaxSuppressionV5::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### PadToMaxOutputSize\n\n```text\nAttrs PadToMaxOutputSize(\n bool x\n)\n```"]]