人脸识别5.1- insightface人脸检测模型训练实战笔记

1、 insightface/ detection / scrfd模型训练

1.0、数据集

数据集下载说明:https://github.com/deepinsight/insightface/tree/master/detection/datasets

官方下载目录:http://shuoyang1213.me/WIDERFACE/
在这里插入图片描述
标签下载:https://gitee.com/link?target=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1UW3KoApOhusyqSHX96yEDRYiNkd3Iv3Z%2Fview%3Fusp%3Dsharing

飞桨数据集和标签整体打包下载:https://aistudio.baidu.com/aistudio/datasetdetail/157445

1.1、安装

1.1.0、虚拟环境安装

Linux-Centos7下安装Anaconda,conda 安装虚拟环境,cuda,cudnn

1.1.1、pytorch安装

不同的cuda版本用不同的安装方式,查找历史版本:pytorch安装参考

pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
import torch
print(torch.__version__)  # '1.7.0'
print(torch.version.cuda)  # 10.2
torch.cuda.is_available() # False

1.1.2、mmcv安装

mmcv安装参考和cuda以及pytorch相匹配:https://mmcv.readthedocs.io/en/latest/get_started/installation.html

pip install -U openmim
mim install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html
pip install mmdet -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html

1.1.3、整体编译安装

git clone https://gitee.com/AI-Mart/insightface.git
cd insightface/detection/scrfd
或者
cd /data/mart/face_insightface/insightface/detection/scrfd
pip install -r requirements/build.txt
pip install -v -e .  # or "python setup.py develop"
pip install scipy

1.2、训练

python ./tools/train.py ./configs/scrfd/scrfd_1g.py --gpus=1
nohup python ./tools/train.py ./configs/scrfd/scrfd_1g.py --gpus=1 2>&1 &
tail -f nohup.out

猜你喜欢

转载自blog.csdn.net/qq_15821487/article/details/125991510