原理介绍
一文读懂Faster RCNN - 知乎
step1:环境的配置(python3.6+torch == 1.2.0)
conda activate
conda create -n detection python=3.6 -y
conda activate detection
在配置环境的过程中遇到的第一个问题就是 Found conflicts! Looking for incompatible packages.(包含conda卸载)
解决方案:https://blog.csdn.net/ACGTexplorer/article/details/126812909?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-126812909-blog-126671235.pc_relevant_3mothn_strategy_and_data_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-126812909-blog-126671235.pc_relevant_3mothn_strategy_and_data_recovery&utm_relevant_inddex=2https://blog.csdn.net/ACGTexplorer/article/details/126812909?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-1-126812909-blog-126671235.pc_relevant_3mothn_strategy_and_data_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-1-126812909-blog-126671235.pc_relevant_3mothn_strategy_and_data_recovery&utm_relevant_index=2第二个问题就是镜像源的问题 需要重新修改下.condarc文件(一般在根目录下但是被隐藏)
解决方案:
https://blog.csdn.net/qq_41897154/article/details/117708305https://blog.csdn.net/qq_41897154/article/details/117708305step 2:就是根据requirements.txt增加相应的包
pip install scipy==1.2.1
pip install numpy==1.17.0
pip install matplotlib==3.1.2
pip install opencv_python==4.1.2.30
pip install torch==1.2.0
pip install torchvision==0.4.0
pip install tqdm==4.60.0
pip install Pillow==8.2.0
pip install h5py==2.10.0
step 3 准备数据集
训练前需要下载好VOC07+12的数据集,解压后放在根目录
修改voc_annotation.py里面的annotation_mode=2,运行voc_annotation.py生成根目录下的2007_train.txt和2007_val.txt。
step 4 训练
因为之前的up主给了权重,所以直接修改了下路径(感谢)
step 5 测试
python predict.py
这个时候会要求输入图像文件(文件地址不需要双引号和单引号)
B站
https://www.bilibili.com/video/BV1BK41157Vs/?spm_id_from=333.337.search-card.all.click&vd_source=05634adffb53eebfbb68d00540a8aff7