tf.raw_ops.GenerateBoundingBoxProposals
Этот оператор генерирует области интереса (Region of Interests) из заданных прямоугольных областей (bbox_deltas), закодированных относительно якорей (anchors) в соответствии с уравнением 2 в arXiv:1506.01497
tf.raw_ops.GenerateBoundingBoxProposals(
scores,
bbox_deltas,
image_info,
anchors,
nms_threshold,
pre_nms_topn,
min_size,
post_nms_topn=300,
name=None
)
The op selects top `pre_nms_topn` scoring boxes, decodes them with respect to anchors, applies non-maximal suppression on overlapping boxes with higher than `nms_threshold` intersection-over-union (iou) value, discarding boxes where shorter side is less than `min_size`. Inputs: `scores`: A 4D tensor of shape [Batch, Height, Width, Num Anchors] containing the scores per anchor at given position `bbox_deltas`: is a tensor of shape [Batch, Height, Width, 4 x Num Anchors] boxes encoded to each anchor `anchors`: A 1D tensor of shape [4 x Num Anchors], representing the anchors. Outputs: `rois`: output RoIs, a 3D tensor of shape [Batch, post_nms_topn, 4], padded by 0 if less than post_nms_topn candidates found. `roi_probabilities`: probability scores of each roi in 'rois', a 2D tensor of shape [Batch,post_nms_topn], padded with 0 if needed, sorted by scores.
| Аргументы | |
|---|---|
scores | A Tensor типа float32. Четырёхмерный тензор с плавающей точкой формы [num_images, height, width, num_achors], содержащий оценки прямоугольных областей для заданных якорей, может быть неотсортированным. |
bbox_deltas | A Tensor типа float32. Четырёхмерный тензор с плавающей точкой формы [num_images, height, width, 4 x num_anchors]. Кодирование прямоугольных областей относительно каждого якоря. Координаты задаются в формате [dy, dx, dh, dw]. |
image_info | A Tensor типа float32. Двухмерный тензор с плавающей точкой формы [num_images, 5], содержащий информацию об изображении: Высота, Ширина, Масштаб. |
anchors | A Tensor типа float32. Двухмерный тензор с плавающей точкой формы [num_anchors, 4], описывающий прямоугольные области якорей. Области задаются в формате [y1, x1, y2, x2]. |
nms_threshold | A Tensor типа float32. Скалярный тензор с плавающей точкой для порога не-максимального подавления. |
pre_nms_topn | A Tensor типа int32. Скалярный целочисленный тензор для количества прямоугольных областей с наибольшими оценками, которые будут использованы в качестве входных данных. |
min_size | A Tensor типа float32. Скалярный тензор с плавающей точкой. Любая область, имеющая меньший размер, чем min_size, будет отброшена. |
post_nms_topn | Необязательный int. По умолчанию 300. Целое число. Максимальное количество областей интереса в выводе. |
name | Имя операции (необязательно). |
| Возвращаемые значения | |
|---|---|
Кортеж объектов Tensor (rois, roi_probabilities). | |
rois | A Tensor типа float32. |
roi_probabilities | A Tensor типа float32. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/raw_ops/GenerateBoundingBoxProposals