Replies: 6 comments
-
Hi @ss880426 , as you may already know, EfficientAD generates an anomaly map during inference using three neural network models: a teacher, a student, and an autoencoder. First, it computes the squared distance between the student's output and the teacher's output, as well as the squared distance between another part of the student's output and the autoencoder's output. Subsequently, the student-teacher map and the student-autoencoder map are generated by averaging the distance values over the channel dimension of the corresponding computed outputs. The final anomaly map is then produced by combining the two maps through quantile-based normalization. For a better understanding, you can refer to these sections of the code: |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply |
Beta Was this translation helpful? Give feedback.
-
Actually, the anomaly map will be output by the model, as you can see from this line: https://github.com/openvinotoolkit/anomalib/blob/main/src/anomalib/models/efficient_ad/torch_model.py#L357 You can try creating your own script to perform inference using the exported model. Alternatively, you may want to check out this notebook, which includes a demonstration of how to perform inference and visualize the anomaly map: If you specifically want such a color map, you can use JET colormap: https://docs.opencv.org/4.x/d3/d50/group__imgproc__colormap.html#gga9a805d8262bcbe273f16be9ea2055a65ab3f207661ddf74511b002b1acda5ec09 |
Beta Was this translation helpful? Give feedback.
-
I use train.py for training, but the default seems to be lighting instead of torch. |
Beta Was this translation helpful? Give feedback.
-
Hi @ss880426, let's start from the beginning. I assume you have something like this in your config file :) visualization:
show_images: False # show images on the screen
save_images: True # save images to the file system
log_images: True # log images to the available loggers (if any)
image_save_path: null # path to which images will be saved
mode: full # options: ["full", "simple"] where If you want to stick to using Let us know if this helps |
Beta Was this translation helpful? Give feedback.
-
I use this code to export the anomaly map separately. v1.0.0+v0.7.0-After Changed:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How does EfficientAD generate anomaly map during inference?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions