codecamp

TensorFlow函数:tf.image.non_max_suppression

tf.image.non_max_suppression函数

tf.image.non_max_suppression(
    boxes,
    scores,
    max_output_size,
    iou_threshold=0.5,
    name=None
)

定义在:tensorflow/python/ops/image_ops_impl.py.

请参阅指南:图像操作>图像使用边框

以分数降序来选择边界框的一个子集.

修剪与先前选择的框重叠的高交集(IOU)的框.边界框以[y1,x1,y2,x2]的形式提供,其中(y1,x1)和(y2,x2)是任何对角线盒对角点的坐标,坐标可以作为标准化提供(即位于区间[0,1])或绝对.请注意,该算法对原点在坐标系中的位置是不可知的.请注意,该算法对坐标系的正交变换和平移不变;因此坐标系的平移或反射导致算法选择相同的框.此操作的输出是一组整数索引, 用于表示选定框的边界框的输入集合.然后,可以使用tf.gather操作获取与所选索引对应的边界框坐标,例如:selected_indices = tf.image.non_max_suppression(boxes,scores,max_output_size,iou_threshold)selected_boxes = tf.gather(boxes,selected_indices)

参数:

  • boxes:形状为[num_boxes, 4]的二维浮点型Tensor.
  • scores:形状为[num_boxes]的一维浮点型Tensor,表示与每个框(每行框)对应的单个分数.
  • max_output_size:一个标量整数Tensor,表示通过非最大抑制选择的框的最大数量.
  • iou_threshold:一种浮点数,表示判断框是否相对于IOU重叠太多的阈值.
  • name:操作的名称(可选).

返回:

  • selected_indices:形状为[M]的一维整数Tensor,表示从box张量中选择的指数,其中M <= max_output_size.
TensorFlow函数:tf.image.is_jpeg
TensorFlow函数:tf.image.pad_to_bounding_box
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }