1

When I use plt.show(block=False) to disable blocking of code figure is not responding.

def visualize_detections(
    image, boxes, classes, scores, figsize=(7, 7), linewidth=1, color=[0, 0, 1]
):
    """Visualize Detections"""
    image = np.array(image, dtype=np.uint8)
    plt.figure(figsize=figsize)
    plt.axis("off")
    plt.imshow(image)
    plt.show(block=False)

    
def close_visualization():
    sleep(5)
    plt.close()




visualise_detections()
close_visualisation()
  • 1
    not sure what you mean by "not responding", but youre not passing an image into `visualize_detections()` – Simon Jan 03 '22 at 15:52
  • You could try to replace `plt.show()` by `plt.pause(5)`. The exact behavior depends on the environment and backend used. – JohanC Jan 03 '22 at 16:00

0 Answers0