reference:
https://github.com/ChiCheng123/SRN
0. Environment
ubuntu16.04
python3.6
torch==0.4.1 # (cuda90) @ https://download.pytorch.org/whl/cu90/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.3.3
numpy==1.19.4
opencv-python==4.4.0.46
Pillow==8.0.1
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.3.1
scipy==1.2.0
six==1.15.0
torchvision==0.2.2
tqdm==4.19.9
cffi
Cython
ipython
1. Preparation
1.1 Environmental preparation
run:
cd srn/extensions
sh build_ext.sh
1.2 Data preparation
From the content of image_list.txt in the directory, you can find that the tested images are directly placed under data/images, that is, after downloading the widerface data, just copy the images in val directly.
http://shuoyang1213.me/WIDERFACE/
Directory Structure:
data
images
data/images/0--Parade/0_Parade_Parade_0_72.jpg
1.3 Model preparation
https://drive.google.com/drive/folders/1T4Qt99SdM7c8G4ZuC1igensY0bZdEETF
https://pan.baidu.com/s/1ambmu1Bu6Oi7zTcEnigFyg(6fba)
Put the model under model.
2. Modify
Add a sentence to line86 to prevent insufficient GPU memory (the content in the corresponding for loop should be indented 4 spaces back accordingly):
with torch.no_grad():
3. Test
The test probably needs 7-8G video memory.
cd tools
sh ./val.sh
The directory structure of the generated files after the test is as follows:
tools
results_dir
21--Festival
21_Festival_Festival_21_254.txt
The content is displayed as follows:
4. Evaluation
Copy these files in Pytorch_Retinaface/widerface_evaluate to the SRN/tools directory.
Refer to https://blog.csdn.net/qq_35975447/article/details/109447929 :
cd ./tools
python setup.py build_ext --inplace
vim evaluation.py
# line 187-188
parser.add_argument('-p', '--pred', default="./results_dir/")
parser.add_argument('-g', '--gt', default='./widerface_eval/ground_truth/')
python evaluation.py
reference
1. Reproduce Pytorch_Retinaface (Pytorch version)
3.Selective Refinement Network for High Performance Face Detection(官方文章)