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

Are masks needed if we use classification models like dfm ? #180

Closed
MhdKAT opened this issue Mar 31, 2022 · 3 comments · Fixed by #196
Closed

Are masks needed if we use classification models like dfm ? #180

MhdKAT opened this issue Mar 31, 2022 · 3 comments · Fixed by #196
Assignees
Labels
Bug Something isn't working Data
Milestone

Comments

@MhdKAT
Copy link

MhdKAT commented Mar 31, 2022

I tried to run dfm to classify my images as anomalous/non anomalous. I made my dataset in MVTec hierarchy but I get an error when i run the train script with the error being that the trainer can't access segmentation masks. Are they mandatory when the task is to classify? Below is a the error I get.
File "C:\Users\hp\anomalib\env\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "c:\users\hp\anomalib\anomalib\data\mvtec.py", line 256, in getitem
mask = cv2.imread(mask_path, flags=0) / 255.0
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

@LukasBommes
Copy link
Contributor

LukasBommes commented Mar 31, 2022

I just got the same error when trying to run task: classification on an mvtec-like dataset (format: mvtec) without masks provided.

In my opinion, it would make most sense to fix the folder dataset to correctly deal with custom datasets that already have a train/test split (this currently does not work, see here). In that case, there would be no need to use format: mvtec for a custom dataset without masks.

@samet-akcay
Copy link
Contributor

@MhdKAT, it's the same issue that was found in folder dataset. Need to propose the same fixes to address the issue.
@LukasBommes, yes that's on our todo list, but didn't have a chance to work on it this week unfortunately.

@MhdKAT
Copy link
Author

MhdKAT commented Mar 31, 2022

I see ! Thanks for the clarification @LukasBommes, @samet-akcay.

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