为什么plt.show()无法在屏幕上显示图片

时间:2019-01-28 13:12:34

标签: python tensorflow pycharm object-detection

plt.show()不起作用。我想看我识别物体的图片,但是它没有出现在屏幕上

这是我的新手,因为我之前无法尝试任何事情,我想尝试正在调查的事情

 for image_path in TEST_IMAGE_PATHS:
  image = Image.open(image_path)

  image_np = load_image_into_numpy_array(image)

  image_np_expanded = np.expand_dims(image_np, axis=0)  

  output_dict = run_inference_for_single_image(image_np, detection_graph)
  vis_util.visualize_boxes_and_labels_on_image_array(
  image_np,
  output_dict['detection_boxes'],
  output_dict['detection_classes'],
  output_dict['detection_scores'],
  category_index,
  instance_masks=output_dict.get('detection_masks'),
  use_normalized_coordinates=True,
  line_thickness=8)

 plt.figure(figsize=IMAGE_SIZE)
 plt.imshow(image_np)
 plt.show()

程序似乎运行顺利,但屏幕未显示图像 最后一行无效的代码,请帮助我

0 个答案:

没有答案
相关问题