## 安装环境 conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html pip install terminaltables pip install pycocotools ## 筛选需要检测的NG类别 python AOI_select.py --AOI_path AOI数据文件夹 ## 找到图像中白色目标框并生成对应的box和label python AOI_get_box --AOI_path AOI数据文件夹 --coco_path COCO格式文件夹 --classes_file 类别文件 ## 转换为COCO数据集 python AOI_to_coco.py --root_dir COCO格式文件夹 --save_path json标签命名(./train.json) ## 修改参数文件 configs/AD_detection/AD_dsxw_test66.py ## 单卡训练 python tools/train.py configs/AD_detection/AD_dsxw_test66.py --gpus 1 ## 多卡训练 tools/dist_train.sh configs/AD_detection/AD_dsxw_test66.py 8(GPU数量) ## 模型评估 python tools/test.py 参数文件 权重文件 --eval bbox ## 搜索最优置信度 python select_threshold.py --config_file 模型参数文件 --checkpoint_file 模型权重文件 --images_path 测试集路径(包含ok和ng两个文件夹) --test_batch_size 测试阶段的batch size大小 ## 推理结果(置信度,feature等) python get_score_csv.py --config_file 模型参数文件 --checkpoint_file 模型权重文件 --images_path 测试集路径(未标注数据) --test_batch_size 测试阶段的batch size大小 --result_path test.csv(绝对路径)