Skip to content
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

add distinction between image and pixel threshold in postprocessor #50

Merged
merged 1 commit into from
Dec 27, 2021

Conversation

djdameln
Copy link
Contributor

Quick PR to accommodate the latest changes to the OTE normalization branch.

@@ -292,15 +292,13 @@ def post_process(self, predictions: np.ndarray, meta_data: Optional[Dict] = None
anomaly_map = np.log(anomaly_map)
anomaly_map = (anomaly_map - meta_data["pixel_mean"]) / meta_data["pixel_std"]
anomaly_map -= (meta_data["image_mean"] - meta_data["pixel_mean"]) / meta_data["pixel_std"]
if "threshold" in meta_data.keys():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why you decided to remove the if statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the threshold key is missing from the meta data, I'd rather have the code fail with an error than return the anomaly map without finishing the conversion to normalized scores (I learned the hard way).

@djdameln djdameln merged commit be07504 into development Dec 27, 2021
@djdameln djdameln deleted the refactor/dick/postprocessing-threshold branch December 27, 2021 08:16
@ikun0124 ikun0124 mentioned this pull request Dec 28, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants