hq-deng / RD4AD

Anomaly Detection via Reverse Distillation from One-Class Embedding
MIT License
174 stars 31 forks source link

How to calculate the predicted mask ? #25

Open arkerman opened 1 year ago

arkerman commented 1 year ago

After calculating the heat map, how to convert map to mask( Foreground is 1, background is 0 )?

anomaly_map, _ = cal_anomaly_map(inputs, outputs, img.shape[-1], amap_mode='mul')
anomaly_map = gaussian_filter(anomaly_map, sigma=4)

What needs to be done after Gaussian filtering to achieve the mask? Any suggestions will be appreciated !