Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: NonMaxSuppressionWithOverlaps
#include <image_ops.h>
Tham lam chọn một tập hợp con các hộp giới hạn theo thứ tự điểm giảm dần.
Bản tóm tắt
cắt bỏ các hộp có phần chồng chéo cao với các hộp đã chọn trước đó. Các hộp giới hạn có số điểm nhỏ hơn score_threshold
sẽ bị xóa. Các giá trị chồng lấp N-x-n được cung cấp dưới dạng ma trận vuông, cho phép xác định tiêu chí chồng chéo tùy chỉnh (ví dụ: giao nhau trên hợp, giao nhau trên diện tích, v.v.).
Đầu ra của thao tác này là một tập hợp các số nguyên được lập chỉ mục vào tập hợp đầu vào của các hộp giới hạn đại diện cho các hộp đã chọn. Sau đó, tọa độ hộp giới hạn tương ứng với các chỉ số đã chọn có thể được lấy bằng cách sử dụng tf.gather operation
. Ví dụ:
selected_indices = tf.image.non_max_suppression_with_overlaps(chồng chéo, điểm số, kích thước tối đa, ngưỡng_chồng chéo, ngưỡng_điểm) selected_boxes = tf.gather(hộp, chỉ số đã chọn)
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- chồng lấp: Một tensor float 2-D có hình dạng
[num_boxes, num_boxes]
biểu thị các giá trị chồng chéo hộp n-by-n. - điểm số: Một tenxơ float 1-D có hình dạng
[num_boxes]
biểu thị một điểm duy nhất tương ứng với mỗi hộp (mỗi hàng hộp). - max_output_size: Một tenxơ số nguyên vô hướng biểu thị số lượng hộp tối đa được chọn bằng cách triệt tiêu không tối đa.
- chồng_threshold: Một tenxơ float 0-D biểu thị ngưỡng để quyết định xem các hộp có chồng lên nhau hay không.
- Score_threshold: Một tenxơ float 0-D biểu thị ngưỡng quyết định thời điểm loại bỏ các hộp dựa trên điểm số.
Trả về:
-
Output
: Một tenxơ số nguyên 1-D có hình dạng [M]
biểu thị các chỉ số đã chọn từ tenxơ của hộp, trong đó M <= max_output_size
.
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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```"]]