-
Notifications
You must be signed in to change notification settings - Fork 836
β¨ feat(post-processing): Add MEBin post processor from AnomalyNCD #3030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
β¨ feat(post-processing): Add MEBin post processor from AnomalyNCD #3030
Conversation
β¦chCore, Padim, Dfkde (open-edge-platform#2913) * refactor patchcore, use list instead of cat * typo in patchcore Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> * padim model to now use cat instead of list Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> * dfm and padim update cat to list Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> * add dfkde cat to list changes Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> * change assert from memory bank to list size, fix pre-commit issues Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> --------- Signed-off-by: Alfie Roddan <51797647+alfieroddan@users.noreply.github.com> Signed-off-by: StarPlatinum7 <2732981250@qq.com>
Signed-off-by: StarPlatinum7 <2732981250@qq.com>
Signed-off-by: StarPlatinum7 <2732981250@qq.com>
Signed-off-by: StarPlatinum7 <2732981250@qq.com>
β¦#2920) * added histogram of anomaly scores * Update src/anomalib/metrics/anomaly_score_distribution.py Co-authored-by: Samet Akcay <samet.akcay@intel.com> Signed-off-by: Aimira Baitieva <63813435+abc-125@users.noreply.github.com> * Update anomaly_score_distribution.py * Update anomaly_score_distribution.py * Fixed pre-commit checks --------- Signed-off-by: Aimira Baitieva <63813435+abc-125@users.noreply.github.com> Co-authored-by: Samet Akcay <samet.akcay@intel.com> Signed-off-by: StarPlatinum7 <2732981250@qq.com>
* added pg and pb metrics * fixed typos * Update __init__.py * Update __init__.py - removed duplicate * Update pg_pb.py * Fixed pre-commit checks --------- Co-authored-by: Samet Akcay <samet.akcay@intel.com> Co-authored-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com> Signed-off-by: StarPlatinum7 <2732981250@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thanks to @StarPlatinum7 for the contribution. |
|
PS : I am yet to fully test this as a post processor with an with anomalib model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thanks for your reviewοΌThis strategy is proposed in AnomalyNCD (CVPR2025).And I have test mebin as a post processor like this: |
β¦check if implementation matches author's implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Example: | ||
| >>> from anomalib.post_processing import MEBinPostProcessor | ||
| >>> from anomalib.data import InferenceBatch | ||
| >>> import torch |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate 'Example:' label on consecutive lines. Remove one of the duplicate labels.
| Example: | |
| >>> from anomalib.post_processing import MEBinPostProcessor | |
| >>> from anomalib.data import InferenceBatch | |
| >>> import torch | |
| >>> from anomalib.post_processing import MEBinPostProcessor | |
| >>> from anomalib.data import InferenceBatch | |
| >>> import torch | |
| >>> import torch |
| Stable Interval: A continuous threshold range in which the number of connected components remains constant, | ||
| and the length of the threshold range is greater than or equal to the given length threshold | ||
| (min_interval_len). |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The docstring contains a 'Stable Interval' definition that appears to be part of the description rather than a separate section. Consider integrating this into the main description or using a Note/Warning block for clarity.
| Stable Interval: A continuous threshold range in which the number of connected components remains constant, | |
| and the length of the threshold range is greater than or equal to the given length threshold | |
| (min_interval_len). | |
| A "stable interval" is defined as a continuous threshold range in which the number of connected components remains constant, | |
| and the length of the threshold range is greater than or equal to the given minimum interval length (`min_interval_len`). |
| (min_interval_len). | ||
|
|
||
| Args: | ||
| anomaly_num_sequence (list): Sequence of connected component counts |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hint 'list' is not specific. Should be 'list[int]' to match the actual usage.
| anomaly_num_sequence (list): Sequence of connected component counts | |
| anomaly_num_sequence (list[int]): Sequence of connected component counts |
|
You can resolve the conflict by replacing the file tests/unit/post_processing/test_mebin_post_processor.py with the following code: |
π Description
This is based on #2928
I have closed that PR and started this new one with additional changes.
β¨ 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.