How to create a mask from the anomaly heat maps ? #1231
-
What is the motivation for this task?I need to generate a separate mask map, because the generation of a separate mask map can facilitate the completion of my subsequent downstream tasks. Describe the solution you'd likeFirst of all, my input data set is a self-built data set, so there are only normal images and abnormal images, but no mask map. Many thanks to anomalib for supporting such a task. However, it is a pity that in the output process, there is only the output of the relevant heat map, but not the output of the mask map. How can the corresponding mask map be output separately and ensure that the size of the mask map is consistent with the original input image. Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello. I'm not sure if this is supported with the code as-is, since you are treating the problem as classification but want segmentation results. Maybe the others can help. In any case, you can get mask from heatmap by doing |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your reply. |
Beta Was this translation helpful? Give feedback.
Hello. I'm not sure if this is supported with the code as-is, since you are treating the problem as classification but want segmentation results. Maybe the others can help.
I believe that in your situation, there are models that could work, the ones that don't do any optimization, like PaDiM, but even there without GT mask you have hardly any way of telling how good the result is, and additionally some model smight not really work well if you don't train for the task of segmentation.
In any case, you can get mask from heatmap by doing
heat_map > threshold
, where threshold is, I believe, 0.5 if your heatmaps are normalized or you can get pixel_threshold from trainer.