Face Detection with the Faster R-CNN (基于Faster RCNN的人脸检测)
2017-03-26 15:23
525 查看
1. GitHub
https://github.com/playerkk/face-py-faster-rcnn
2. Requirements
Requirements: softwareRequirements for caffe and pycaffe (see: Caffe installation instructions) Python packages you might not have: cython, python-opencv, easydict
Requirements: hardware
For training smaller networks (ZF, VGG_CNN_M_1024) a good GPU (e.g., Titan, K20, K40, ...) with at least 3G of memory suffices For training Fast R-CNN with VGG16, you'll need a K40 (~11G of memory) For training the end-to-end version of Faster R-CNN with VGG16, 3G of GPU memory is sufficient (using CUDNN)
3. Installation
Clone the face Faster R-CNN repositorygit clone –recursive https://github.com/playerkk/face-py-faster-rcnn.git
Build the Cython modules
cd $FRCN_ROOT/lib
make
Build Caffe and pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn
make -j8 && make pycaffe
下载预先训练好的VGG模型
A pre-trained face detection model trained on the WIDER training set is available here.
http://supermoe.cs.umass.edu/%7Ehzjiang/data/vgg16_faster_rcnn_iter_80000.caffemodel
放置目录:
$FRCN_ROOT/output/faster_rcnn_end2end/train/vgg16_faster_rcnn_iter_80000.caffemodel
下载测试数据
http://vis-www.cs.umass.edu/fddb/index.html 下载FDDB数据库放入$FRCN_ROOT/data目录:
包括:
FDDB
FDDB/FDDB-folds
FDDB/originalPics
4.Test the trained model
python ./tools/run_face_detection_on_fddb.py –gpu=0运行完成后显示:
十组图片,每检测完11张图片显示完成度 XX%
在run_face_detection_on_fddb.py 添加保存图片的命令
# for j in xrange(dets.shape[0]): 下面添加以下代码 p1 = (int(dets[j, 0]), int(dets[j, 1])) p2 = (int(dets[j, 0] + dets[j, 2]), int(dets[j, 1] + dets[j, 3])) cv2.rectangle(im, p1, p2, (0, 0, 255)) cv2.imwrite("/home/dl/faceBox.jpg", im)
效果:
5. 自己训练模型
Download pre-computed Faster R-CNN detectorscd $FRCN_ROOT
./data/scripts/fetch_faster_rcnn_models.sh
Download the WIDER face dataset. Extract all files into one directory named WIDER
http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/
WIDER/
WIDER/WIDER_train/
WIDER/WIDER_val/
Download the (http://jianghz.me/files/wider_face_train_annot.txt) and put it under the WIDER directory.
Create symlinks for the WIDER dataset
cd FRCNROOT/dataln−sWIDER WIDER
Follow the next sections to download pre-trained ImageNet models
cd $FRCN_ROOT
./data/scripts/fetch_imagenet_models.sh
To train a Faster R-CNN face detector using the approximate joint training method, use experiments/scripts/faster_rcnn_end2end.sh. Output is written underneath $FRCN_ROOT/output.
cd FRCN_ROOT
cd FRCN_ROOT
./experiments/scripts/faster_rcnn_end2end.sh [GPU_ID] [NET] wider [–set …]
eg:
./experiments/scripts/faster_rcnn_end2end.sh 0 VGG16 wider
Trained Fast R-CNN networks are saved under: (GTX980训练了10多个小时)
output/ experiment directory / dataset name /
6. 遇到的问题
http://blog.csdn.net/zengdong_1991/article/details/51614315相关文章推荐
- 【深度学习:目标检测】 Face Detection with the Faster R-CNN(数据集标注对比研究报告 )
- Face Detection with the Faster R-CNN
- Face Detection with the Faster R-CNN(数据集标注对比研究报告 )
- Improving Multiview Face Detection with Multi-Task Deep Convolutional Neural Networks 基于深度学习的人脸检测算法
- Face Detection with the Faster R-CNN(数据集标注对比研究报告 )
- Face Detection with the Faster R-CNN
- 快速多尺度人脸检测2--Multi-Scale Fully Convolutional Network for Face Detection in the Wild
- 人脸检测--Face Detection with End-to-End Integration of a ConvNet and a 3D Model
- 使用滑动窗口进行人脸检测 Face detection with a sliding window
- 【论文笔记】Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- 人脸检测——Faster R-CNN
- 【CV论文阅读】Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks----论文笔记
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- 论文笔记:Faster R-CNN:Towards Real-Time Object Detection with Region Proposal Networks
- 人脸检测“Joint Cascade Face Detection and Alignment”
- 行人检测 Is Faster R-CNN Doing Well for Pedestrian Detection?
- 【目标检测】Object Detection Faster RCNN算法解析
- 【Deep Learning】Review:Faster R-CNN- TowardsReal-Time Object Detection with Region Proposal Networks
- Faster R-CNN:Towards Real-Time Object Detection with Region Proposal Networks