热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

FaceDetectionwiththeFasterR-CNN(基于FasterRCNN的人脸检测)

1.GitHubhttps:github.complayerkkface-py-faster-rcnn2.RequirementsRequirements:sof

1. GitHub

https://github.com/playerkk/face-py-faster-rcnn

2. Requirements

Requirements: software

Requirements 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

  1. Clone the face Faster R-CNN repository
    git clone –recursive https://github.com/playerkk/face-py-faster-rcnn.git

  2. Build the Cython modules
    cd $FRCN_ROOT/lib
    make

  3. Build Caffe and pycaffe
    cd $FRCN_ROOT/caffe-fast-rcnn
    make -j8 && make pycaffe

  4. 下载预先训练好的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

  5. 下载测试数据
    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. 自己训练模型
  1. Download pre-computed Faster R-CNN detectors
    cd $FRCN_ROOT
    ./data/scripts/fetch_faster_rcnn_models.sh

  2. 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/

  3. Download the (http://jianghz.me/files/wider_face_train_annot.txt) and put it under the WIDER directory.

  4. Create symlinks for the WIDER dataset
    cd FRCNROOT/datalns WIDER WIDER

  5. Follow the next sections to download pre-trained ImageNet models
    cd $FRCN_ROOT
    ./data/scripts/fetch_imagenet_models.sh

  6. 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

  7. 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


推荐阅读
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • golang常用库:配置文件解析库/管理工具viper使用
    golang常用库:配置文件解析库管理工具-viper使用-一、viper简介viper配置管理解析库,是由大神SteveFrancia开发,他在google领导着golang的 ... [详细]
  • 扫描线三巨头 hdu1928hdu 1255  hdu 1542 [POJ 1151]
    学习链接:http:blog.csdn.netlwt36articledetails48908031学习扫描线主要学习的是一种扫描的思想,后期可以求解很 ... [详细]
  • 在macOS环境下使用Electron Builder进行应用打包时遇到签名验证失败的问题,具体表现为签名后spctl命令检测到应用程序未通过公证(Notarization)。本文将详细探讨该问题的原因及解决方案。 ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • ImmutableX Poised to Pioneer Web3 Gaming Revolution
    ImmutableX is set to spearhead the evolution of Web3 gaming, with its innovative technologies and strategic partnerships driving significant advancements in the industry. ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • PyCharm下载与安装指南
    本文详细介绍如何从官方渠道下载并安装PyCharm集成开发环境(IDE),涵盖Windows、macOS和Linux系统,同时提供详细的安装步骤及配置建议。 ... [详细]
  • 资源推荐 | TensorFlow官方中文教程助力英语非母语者学习
    来源:机器之心。本文详细介绍了TensorFlow官方提供的中文版教程和指南,帮助开发者更好地理解和应用这一强大的开源机器学习平台。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 技术分享:从动态网站提取站点密钥的解决方案
    本文探讨了如何从动态网站中提取站点密钥,特别是针对验证码(reCAPTCHA)的处理方法。通过结合Selenium和requests库,提供了详细的代码示例和优化建议。 ... [详细]
  • 探讨如何高效使用FastJSON进行JSON数据解析,特别是从复杂嵌套结构中提取特定字段值的方法。 ... [详细]
  • 1.如何在运行状态查看源代码?查看函数的源代码,我们通常会使用IDE来完成。比如在PyCharm中,你可以Ctrl+鼠标点击进入函数的源代码。那如果没有IDE呢?当我们想使用一个函 ... [详细]
  • 本文深入探讨了 Java 中的 Serializable 接口,解释了其实现机制、用途及注意事项,帮助开发者更好地理解和使用序列化功能。 ... [详细]
  • UNP 第9章:主机名与地址转换
    本章探讨了用于在主机名和数值地址之间进行转换的函数,如gethostbyname和gethostbyaddr。此外,还介绍了getservbyname和getservbyport函数,用于在服务器名和端口号之间进行转换。 ... [详细]
author-avatar
球之音_970
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有