Repository navigation
Fix/patchcore piadm regression - #178
Merged
Merged
Conversation
PatchCore pixel maps are cosine distances, so thresholding them with the image-level threshold gave empty or full-image masks. For PatchCore, classify by image score and build the mask from a per-image min-max normalized map with a relative cutoff (patchcore_loc_rel, default 0.60). PaDiM behavior is unchanged.
PatchCore pixel maps are cosine distances, so thresholding them with the image-level threshold gave empty or full-image masks. For PatchCore, classify by image score and build the mask from a per-image min-max normalized map with a relative cutoff (patchcore_loc_rel, default 0.60). PaDiM behavior is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issue
Fixes #
📝 Description
detect.py: the pixel score map (cosine distance, ~0–0.5) was thresholded with the image-levelconfig.thresh, giving an empty or full-image mask.image_scores >= thresh), and the pixel mask comes from a per-image min-max normalized map with a relative cutoff (patchcore_loc_rel, default0.60).🔄 Type of Change
🧪 Hardware & Matrix Testing
I have successfully built and tested this code using
uvon:anomavision[cpu](Standard/Edge)anomavision[cu121](CUDA 12.1)anomavision[cu124](CUDA 12.4)anomavision[cu118](CUDA 11.8)Host OS used for testing:
✅ Developer Checklist
uv run pytestand all unit tests pass locally.pyproject.toml, I have runuv lock --python 3.10and committed the updateduv.lockfile.📸 Screenshots / Visual Proof (Optional)
Attach before/after
batch_0_img_0.pngfor PatchCore (before: no contours or a full-image highlight, after: localized region).