天天看點

【Tensorflow】(四):tf.image.draw_bounding_boxes

tf.image.draw_bounding_boxes(

    images,

    boxes,

    name=None

)

定義于:tensorflow/python/ops/gen_image_ops.py。

在一批圖像上繪制邊界框。

輸出副本,images但在像素之上繪制由位置指定的零個或多個邊界框boxes。每個邊界框的坐标boxes編碼為[y_min, x_min, y_max, x_max]。邊界框坐标是[0.0, 1.0]相對于底層圖像的寬度和高度的浮動。

邊界框的部分可能落在圖像之外。

參數:

images:A Tensor。必須是以下類型之一:float32, half。4-D,形狀[batch, height, width, depth]。一批圖檔。

boxes:類型為float32的Tensor。3-D, 形狀[batch, num_bounding_boxes, 4]包含邊界框。

name:操作的名稱(可選)。

傳回:

Tensor:和images一樣的類型。

image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0),bbox)
           

繼續閱讀