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

plot_segmentation_images wrong logic? #94

Open
MarcSaghir opened this issue Jan 8, 2024 · 2 comments
Open

plot_segmentation_images wrong logic? #94

MarcSaghir opened this issue Jan 8, 2024 · 2 comments

Comments

@MarcSaghir
Copy link

MarcSaghir commented Jan 8, 2024

Hello,
I was just trying to predict on a single image using patchcore. However when i wanted to plot the predictions, it told me that in patchcore.utils in the function plot_segmentation_images the variable mask was referenced before assignment. Having read the code, it seems as if you dont provide mask paths to the function, it will never initialize the variable mask due to the indentation of line 62("else:\n mask = np.zeros_like_image"). This is weird since above that line there are efforts made to catch the case that someone doesnt provide a mask. Can anybody from the team(or elsewhere) please comment if this is a logical flaw or if there is something I am not seeing.

Thank you in advance!

Edit:
I just saw this also affects the later plotting of the images because the axes in line 68 have the range of 2 + int(masks_provided), yet there is always axes[2] referenced, regardless of the provided masks

@wyweather
Copy link

Hello, have you solved this problem? How should I do to make predictions on a graph

@MarcSaghir
Copy link
Author

Hey. A workaround for me was inserting "else: \n mask = np.zeros_like(image)" in line 63, so that when you want to predict wihtout a mask, it gives a empty mask as default.

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

No branches or pull requests

2 participants