tensorflow源码 tf.image.draw_bounding_boxes
来源:互联网 发布:吴京收入知乎 编辑:程序博客网 时间:2024/06/03 07:29
____tz_zs源码学习
在一批图像上绘制边框。
draw_bounding_boxes( images, boxes, name=None)images:是 [batch, height, width, depth] 形状的四维矩阵,数据类型为 float32、half 中的一种,第一个值batch是因为处理的是一组图片。
boxes: 形状 [batch, num_bounding_boxes, 4] 的三维矩阵, num_bounding_boxes 是标注框的数量,标注框由四个数字标示 [y_min, x_min, y_max, x_max],数组类型为float32。例如:tf.constant([[[0.05, 0.05, 0.9, 0.7], [0.35, 0.47, 0.5, 0.56]]]) shape 为 [1,2,4] 表示一张图片中的两个标注框;tf.constant([[[ 0. 0. 1. 1.]]]) 的 shape 为 [1,1,4]表示一张图片中的一个标注框
name:操作的名称(可选)。
return: 返回加入了标注框的图像,与输入的 images 有相同的类型和形状。
官网地址: https://www.tensorflow.org/api_docs/python/tf/image/draw_bounding_boxes
源码:
tensorflow/python/ops/gen_image_ops.py
def draw_bounding_boxes(images, boxes, name=None): r"""Draw bounding boxes on a batch of images. Outputs a copy of `images` but draws on top of the pixels zero or more bounding boxes specified by the locations in `boxes`. The coordinates of the each bounding box in `boxes` are encoded as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and height of the underlying image. For example, if an image is 100 x 200 pixels and the bounding box is `[0.1, 0.2, 0.5, 0.9]`, the bottom-left and upper-right coordinates of the bounding box will be `(10, 40)` to `(50, 180)`. Parts of the bounding box may fall outside the image. Args: images: A `Tensor`. Must be one of the following types: `float32`, `half`. 4-D with shape `[batch, height, width, depth]`. A batch of images. boxes: A `Tensor` of type `float32`. 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding boxes. name: A name for the operation (optional). Returns: A `Tensor`. Has the same type as `images`. 4-D with the same shape as `images`. The batch of input images with bounding boxes drawn on the images. """ result = _op_def_lib.apply_op("DrawBoundingBoxes", images=images, boxes=boxes, name=name) return result
阅读全文
0 0
- tensorflow源码 tf.image.draw_bounding_boxes
- tensorflow源码 tf.image.sample_distorted_bounding_box
- tensorflow源码 tf.nn.softmax_cross_entropy_with_logits & tf.nn.sparse_softmax_cross_entropy_with_log
- tensorflow tf.python_io模块源码阅读
- [TensorFlow 学习笔记-08]tf.pad函数源码解析
- TensorFlow 使用——tf.image.extract_glimpse(input, size, iffsets, centered, normalized)
- tf.image.flip
- tensorflow + tf.transposs
- Tensorflow:tf.train.SyncReplicasOptimizer
- Tensorflow系列:tf.random_normal
- tensorflow tf.concat操作
- 【Tensorflow】tf.placeholder函数
- 【Tensorflow】tf.reshape 函数
- 【Tensorflow】tf.argmax函数
- TensorFlow. tf.reduce_mean
- 【TensorFlow】tf.scatter_update()
- tensorflow: tf.reshape探究
- tensorflow: tf.assign探究
- 全面升级Android面试之Binder面试题集
- 计算机网络:
- 获取局域网内在线主机名及IP地址源码
- ActiveMQ的Java代码
- 类库依赖关系的陷阱,HP 打印机驱动安装程序运行出错
- tensorflow源码 tf.image.draw_bounding_boxes
- 自动禁用并启用所有网络连接源码
- hdu—自动AC机(c++)
- Test.2
- 车牌识别算法嵌入在摄像机中的硬件
- Test.3
- 2的次方计算器源码
- 电商网站必备 简单版轮播图库
- 洛谷 P2668 斗地主