Retinaface inference
0. 本机
Ubuntu 18.04
gcc version 7.5.0
CUDA Driver Version / Runtime Version 11.2 / 10.2
Nvidia Driver Versioin 460.32.03
Anaconda3
1. 环境配置
- 安装 python 3.6
- 安装 pytorch 1.7.1
$ conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
- 安装 pip
$ sudo apt install python3-pip
- 安装 pycocotools
$ pip install pycocotools
- 安装 opencv
$ conda install opencv
2. 使用Retinaface进行预测
- 模型路径:(在test.py中要改,line78)
./Retinaface-master/weights/Resnet50_Final.pth
- 测试集路径:(在 test.py 中要改,line101)
./Retinaface-master/Retina_data/test
- 测试结果路径:(在 test.py 中要改,line102)
./Retinaface-master/Retina_data/test_result
- 模型测试:
$ cd ./Retinaface-master
$ python test.py
- 输出结果:使用红色线框标记异常,并提供confidence score。没有红框的图像表示没检出。可以在 test.py 中改显示框的threshold(line29)
版权声明:本文为weixin_42427947原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。