cool-xuan / msflow

The official code for "MSFlow: Multi-Scale Normalizing Flows for Unsupervised Anomaly Detection"
Other
51 stars 8 forks source link

About visualization for anomaly score maps #5

Open EricaHattman opened 11 months ago

EricaHattman commented 11 months ago

Could you please advise on how to implement the visualization for anomaly score maps in the paper? Or may I get this part of code if is possible?

cool-xuan commented 9 months ago

The visualization code is simple via matplotlib. There are only two lines of code are required:

plt.imshow(img)
plt.imshow(anomaly_score_map, cmap='jet', alpha = 0.4)

where img refers to the input image of the product, and anomaly_score_map is the predicted score.

EricaHattman commented 9 months ago

Thanks for your reply, it helps me a lot!^_^

oahnah commented 9 months ago

Thanks for your reply, it helps me a lot!^_^ How is visualization implemented specifically? I don't know where the code should be placed. T_T

cool-xuan commented 7 months ago

@oahnah The visualization code works after getting the anomaly score map. In our code, anomaly_score_map is calculated here. Particularly, anomaly_score_map_mul is the better choice for human visualization.