Closed mojtaba-nafez closed 7 months ago
I have also encountered this behavior. My suspicion is that they specified mode="test"
to use normal and abnormal images during training (many Anomaly Detection datasets have only normal images in the training set but normal and abnormal in the test set).
Hi, I believe this point has already been clarified in the paper. We fine-tune AnomalyCLIP using an auxiliary dataset and then test it on other datasets in zero-shot manner. Regarding the decision to set the test mode during training, this is because the MVTec dataset does not provide anomaly samples in its training dataset for fine-tuning AnomalyCLIP.
I've encountered an issue in the paper's code regarding the training approach for the anomaly detector on the MVTec AD dataset. The problem lies in the train.py script at line 35 where the Dataset object for training is created without specifying mode="train":
train_data = Dataset(root=args.train_data_path, transform=preprocess, target_transform=target_transform, dataset_name=args.dataset)
This oversight leads to two critical problems:
Could this be revised to ensure the correct dataset partitioning and training setup?