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

VisualizerCallback not showing properly predicted masks on fully defected images #138

Closed
lorenzomammana opened this issue Mar 9, 2022 · 2 comments · Fixed by #194
Closed
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@lorenzomammana
Copy link

lorenzomammana commented Mar 9, 2022

Describe the bug
When using the visualizer callback I was constantly getting empty masks on completely defected images i.e images in which the anomaly score is greater than the given threshold for each pixel.

If this happens the imshow function called at line 64 of the visualizer.py
self.axis[index].imshow(image, color_map)

Will have vmin=255 and vmax=255 resulting in an empty image which is not the correct output!

The solution is straightforward, set the vmin value to 0 and vmax value to 255 (this actually requires to also multiply the gt_mask by 255 since it's in range [0-1], maybe it's better to just check if there's only one value in the array).

p.s I guess the issue arise in the same way if the gt mask is completely white.

To Reproduce
Use 0 as F1 threshold and the VisualizerCallback on a generic training and the issue should arise.

Expected behavior
The resulting predicted mask should be completely white.

@samet-akcay
Copy link
Contributor

Similar to #139, we'll try to have a look at and address the issue at our earliest convenience.

@samet-akcay samet-akcay added the Bug Something isn't working label Mar 10, 2022
@djdameln djdameln self-assigned this Mar 23, 2022
@samet-akcay samet-akcay moved this to Todo in Anomalib Apr 4, 2022
@samet-akcay samet-akcay added this to the v0.2.7 milestone Apr 4, 2022
@samet-akcay samet-akcay moved this from Todo to 📝 To Do in Anomalib Apr 4, 2022
@samet-akcay samet-akcay moved this from 📝 To Do to 🚀 PR Created in Anomalib Apr 4, 2022
Repository owner moved this from 🚀 PR Created to Done in Anomalib Apr 5, 2022
@lorenzomammana
Copy link
Author

Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
3 participants