How to make a heatmap?
Hello How do I generate a heatmap in test_DRAEM.py when I predict data?
@VivizSun have do ou reslove that problem? if you solved it, please guide me!
@VivizSun @vuhungtvt142 You can get the predicted Anomaly heatmap of the image by adding the following lines after line 103 : plt.imshow(out_mask_cv) plt.title('Predicted Anomaly Heatmap') plt.show()
This should display the heatmap for the image
@hamzakhalil798 Which directory does the predicted anomaly heatmap reside in as I only get these below as the output Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480) Figure(640x480)
@Brym-Gyimah It doesn't save the heatmap , Instead displays the heatmaps. Are you running the code on jupyter or Colab? If yes use %matplotlib inline in the cell to see these figures. Or Else to save them in a directory You can use Plt.savefig("path_to_image/image_name.png") If you wanr to save heatmaps.
Eg
plt.imshow(out_mask_cv) plt.title('Predicted Anomaly Heatmap') Plt.savefig("results/image.png") plt.show()
Note: you will have to make a directory(results).
@hamzakhalil798 Hello, according to the code you provided, I have successfully generated a heatmap, but the color of the heatmap is dark purple, which is not conducive to observation. How can I modify it to change the color of the heatmap?