InCTRL icon indicating copy to clipboard operation
InCTRL copied to clipboard

About self-built dataset

Open yoho131 opened this issue 1 year ago • 3 comments

First of all, thank you to the author for such excellent work! When I tried to run your code on my self-built dataset, it was missing the Few-shot Normal Samples and Pre-train Models. So, is there a way to make them?

yoho131 avatar Sep 09 '24 06:09 yoho131

Hi, thanks for your attention to this work. If you want to evaluate our model on your self-built dataset, you should first split the training and test datasets by following the form of MVTecAD, where the training set only contains the normal samples and the test set includes both normal and abnormal samples.

Then using our gen_val_json.py to generate JSON files and the few-shot normal samples are randomly extracted from the training set.

Diana1026 avatar Sep 19 '24 07:09 Diana1026

I have run gen_train_json.py and gen_val_json.py on my custom dataset to obtain the four JSON files shown in Figure 1. However, how can I obtain the Few-shot Normal Samples and Pre-train Models required in Step 3 and Step 4? image image

yoho131 avatar Sep 20 '24 05:09 yoho131

Hello, after running main.py, I obtained the following ten .pyth files. However, when I tried to execute test.py on my custom dataset, I found that the Few-shot Normal Samples mentioned in Step 3 are still missing (.pt files). image

yoho131 avatar Sep 20 '24 09:09 yoho131

Hi, you can write a script to randomly select the few-shot samples from training set and save the image features after your own image transformation. The dimensions of image features should be aligned with the input of the visual encoder.

Diana1026 avatar Nov 02 '24 11:11 Diana1026