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.4k stars 615 forks source link

Fix normalization #2130

Open alexriedel1 opened 3 weeks ago

alexriedel1 commented 3 weeks ago

๐Ÿ“ Description

Fixes: https://github.com/openvinotoolkit/anomalib/discussions/2122#discussioncomment-9740488 and https://github.com/openvinotoolkit/anomalib/issues/2027 and https://github.com/openvinotoolkit/anomalib/issues/2139#issue-2352819822

The normalization metrics are resetted before every validation. Is there any flaw in this logic or does it makes sense, so that models that have very different anomaly map and pred score magnitudes during training epochs are optimally normalized.

โœจ Changes

Select what type of change your PR is:

โœ… Checklist

Before you submit your pull request, please make sure you have completed the following steps:

For more information about code review checklists, see the Code Review Checklist.