原理介绍
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/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站