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

运行train_all_supervised_cn.sh 训练的时候报错 #4

Closed
2132660698 opened this issue Aug 31, 2023 · 2 comments
Closed

运行train_all_supervised_cn.sh 训练的时候报错 #4

2132660698 opened this issue Aug 31, 2023 · 2 comments

Comments

@2132660698
Copy link

运行train_all_supervised_cn.sh 训练的时候报错

image

应该是没有数据的原因:
data = all_supervised_with_cn.SupervisedDataset('../data/all_anomalygpt')
image

请问all_anomalygpt这个数据应该是什么格式,是把mvtec_anomaly_detection和VisA文件夹放在下面吗,谢谢!

@FantasticGNU
Copy link
Collaborator

如同在 README.md 中提到的,在该设置中我们使用了 MVTec-AD,MVTec-LOCO-AD,VisA,CrackForest 四个数据集的数据进行有监督训练以获得更好的效果,您需要把这四个数据集的数据都放到 data/all_anomalygpt 文件夹中,格式如下:

data
|--all_anomalygpt
|-----|---mvtec_anomaly_detection
|-----|-----|-- bottle
|-----|-----|-----|----- ground_truth
|-----|-----|-----|----- test
|-----|-----|-----|----- train
|-----|-----|-- cable
|-----|-----|-- ...
|-----|---mvtec_loco_anomaly_detection
|-----|-----|-- breakfast_box
|-----|-----|-----|----- ground_truth
|-----|-----|-----|----- test
|-----|-----|-----|----- train
|-----|-----|-- juice_bottle
|-----|-----|-- ...
|-----|---visa
|-----|-----|-- candle
|-----|-----|-----|----- ground_truth
|-----|-----|-----|----- test
|-----|-----|-----|----- train
|-----|-----|-- capsules
|-----|-----|-- ...
|-----|---crackforest_road
|-----|-----|---images
|-----|-----|---masks

其中对于 VisA 数据集,我们使用了其官方 github 仓库中的 prepare_data.py 文件,按照 1cls 的设置进行了预处理,使其与 MVTec 系列数据集的格式一致。
CrackForest 数据集可以从 https://github.com/cuilimeng/CrackForest-dataset 下载,然后将图像数据放到 images 文件夹中,异常分割结果图像放到 masks 文件夹中,并保持对应样本的文件名一致。

需要注意的是,train_all_supervised_cn.sh 训练得到的模型只用于我们的在线 demo 展示,论文中提到的数据结果都是在无监督训练设置下得到的。

@hexiajunu
Copy link

您好,请问您知道CrackForest 数据集的异常分割图像是怎么得到,mat和seg文件怎么转化成png文件?

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

3 participants