tf.raw_ops.GenerateBoundingBoxProposals
Этот оператор генерирует области интереса (Region of Interests) из заданных прямоугольных областей (bbox_deltas), закодированных относительно якорей в соответствии с уравнением 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. Четырёхмерный float-тензор формы [num_images, height, width, num_achors] , содержащий оценки коробок для заданных якорей, может быть неотсортированным. |
bbox_deltas | A Tensor типа float32. Четырёхмерный float-тензор формы [num_images, height, width, 4 x num_anchors]. Кодирование коробок относительно каждого якоря. Координаты задаются в формате [dy, dx, dh, dw]. |
image_info | A Tensor типа float32. Двумерный float-тензор формы [num_images, 5] , содержащий информацию о изображении: Высота, Ширина, Масштаб. |
anchors | A Tensor типа float32. Двумерный float-тензор формы [num_anchors, 4] , описывающий якорные прямоугольники. Прямоугольники отформатированы в виде [y1, x1, y2, x2]. |
nms_threshold | A Tensor типа float32. Скалярный float-тензор для порога не-максимального подавления. |
pre_nms_topn | A Tensor типа int32. Скалярный int-тензор для количества коробок с максимальной оценкой, используемых в качестве входных данных. |
min_size | A Tensor типа float32. Скалярный float-тензор. Любая коробка, размер которой меньше, чем min_size, будет отброшена. |
post_nms_topn | Необязательный int. По умолчанию 300. Целое число. Максимальное количество областей интереса в выходе. |
name | Имя операции (необязательно). |
| Возвращаемое значение | |
|---|---|
Кортеж объектов Tensor (rois, roi_probabilities). | |
rois | A Tensor типа float32. |
roi_probabilities | A Tensor типа float32. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/raw_ops/GenerateBoundingBoxProposals