openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.82k stars 679 forks source link

where are metrics calculated? in which python file #395

Closed cyj95 closed 2 years ago

cyj95 commented 2 years ago

after anomalib fit --config ./configs/model/patchcore.yaml i got 图片

in config file,i see metrics: image_metrics:

plz help me find where are metrics calculated? in which python file

samet-akcay commented 2 years ago

@cyj95, when the training is triggered, MetricConfigurationCallback is initialized. This creates and sets the image and pixel metrics to the anomaly module. Since this is a standard procedure for all the models in this library, we store these attributes in the base AnomalyModule.

The metrics are then computed in validation_epoch_end method of the same module. Hope this helps. Let me know if you have any other questions.