# MAEAD **Repository Path**: yin_xj/maead ## Basic Information - **Project Name**: MAEAD - **Description**: 本科毕设,202112-202205 - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2022-04-18 - **Last Updated**: 2023-07-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 项目地址 https://gitee.com/yin_xj/maead 可能仍会有更新,登录gitee获取最新代码 # 联系方式 yinxj2000@qq.com # 以往的一些实验记录 比较杂乱(有的命名也很随意),包括多个版本之前的代码的实验,还有一些实验不包含在内 https://www.kaggle.com/code/xxxj24/maedraem https://www.kaggle.com/code/xxxj24/mae-screw https://www.kaggle.com/code/xxxj24/maeadfinetune https://www.kaggle.com/code/yinxj24/maeadfinetune https://www.kaggle.com/code/yinxj24/maeadft https://www.kaggle.com/code/yin24tj/maeadtrain https://www.kaggle.com/code/yin24tj/maefinetune # 代码快速上手 可以直接在kaggle上使用代码 https://www.kaggle.com/code/yin24tj/maead-all ,已经配置好数据、环境,注册kaggle、使用手机号验证后即可使用GPU运行。 ## 或者 先安装timm==0.4.5 ```python !pip install timm==0.4.5 ``` ### finetuneMAE 运行示例: ```python !python finetuneMAE.py --data_path='/kaggle/input/mvtecad-mvtec-anomaly-detection/mvtec_anomaly_detection/transistor/train/good' --model_name='mae_transistor_1000' ``` 至少需要配置数据目录--data_path和模型名称--model_name,其他可调参数见代码 ### finetunetest 运行示例: ```python !python finetunetest.py --model_path='mae_transistor_1000.pth' --image_path='/kaggle/input/mvtecad-mvtec-anomaly-detection/mvtec_anomaly_detection/transistor/test/cut_lead/000.png' ``` 至少需要配置微调模型位置--model_path和单张测试图片的位置--image_path,其他可调参数见代码 ### trainMAEAD 运行示例: ```python !python trainMAEAD.py --mae_model='mae_transistor_1000.pth' --obj_name='transistor' --data_path='/kaggle/input/mvtecad-mvtec-anomaly-detection/mvtec_anomaly_detection/' --anomaly_source_path='/kaggle/input/describable-textures-dataset-dtd/dtd/images/' ``` 至少需要配置微调模型位置--mae_model、运行的类别--obj_name、训练数据位置--data_path和异常源图像位置--anomaly_source_path,其他可调参数见代码 ### testMAEAD 运行示例: ```python !python testMAEAD.py --base_model_name='DRAEM_test_0.0001_500_bs8' --obj_name='transistor' ``` 至少需要配置基类模型名称--base_model_name和运行的类别--obj_name,其他可调参数见代码