【发布时间】:2018-06-18 04:52:34
【问题描述】:
我正在尝试使用由 TensorFlow API 实现的 Faster R-CNN 的边界框来捕获裁剪后的图像。 (特别是我从tensorflow关注并定制了this tutorial)
我按照上面教程的代码如下:
for image_path in TEST_IMAGE_PATHS[0:1]:
image = Image.open(image_path)
image_np = load_image_into_numpy_array(image)
image_np_expanded = np.expand_dims(image_np, axis=0)
(_image_tensor,_boxes, scores, classes, num) = sess.run(
[image_tensor,detection_boxes, detection_scores, detection_classes, num_detections],
feed_dict={image_tensor: image_np_expanded})
test = tf.image.crop_and_resize(image=image_np_expanded,
boxes=[[0.27640104,0.2573258,0.57859987,0.7340185]],
box_ind=[0],
crop_size=[50,50])
plt.figure()
plt.imshow(image_np)
plt.figure()
plt.imshow(test[0].eval())
如您所见,裁剪后的第二张图片已损坏。边界框的值是变量 '_boxes' 的第一个值,即 "_boxes[0]"
我有什么遗漏吗?我被这个问题困住了。
【问题讨论】:
标签: tensorflow object-detection bounding-box