Giter Site home page Giter Site logo

perfectworld0415 / mtcnn_facedetection_tensorrt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pkuzhou/mtcnn_facedetection_tensorrt

0.0 0.0 0.0 13.82 MB

MTCNN C++ implementation with NVIDIA TensorRT Inference accelerator SDK

C++ 77.86% Makefile 20.42% CMake 1.72%

mtcnn_facedetection_tensorrt's Introduction

blob# MTCNN_TensorRT

MTCNN Face detection algorithm's C++ implementation with NVIDIA TensorRT Inference acceleration SDK.

This repository is based on https://github.com/AlphaQi/MTCNN-light.git

Notations

2018/11/14: I have ported most of the computing to GPU using OpenCV CUDA warper and CUDA kernels wrote by myself. See branch all_gpu for more details, note that you need opencv 3.0+ built with CUDA support to run the projects. The speed is about 5-10 times faster on my GTX1080 GPU than master branch.

2018/10/2: Good news! Now you can run the whole MTCNN using TenorRT 3.0 or 4.0!

I adopt the original models from offical project https://github.com/kpzhang93/MTCNN_face_detection_alignment and do the following modifications: Considering TensorRT don't support PRelu layer, which is widely used in MTCNN, one solution is to add Plugin Layer (costome layer) but experiments show that this method breaks the CBR process in TensorRT and is very slow. I use Relu layer, Scale layer and ElementWise addition Layer to replace Prelu (as illustrated below), which only adds a bit of computation and won't affect CBR process, the weights of scale layers derive from original Prelu layers.

modification

Required environments

  1. OpenCV (on ubuntu just run sudo apt-get install libopencv-dev to install opencv)
  2. CUDA 9.0
  3. TensorRT 3.04 or TensorRT 4.16 (I only test these two versions)
  4. Cmake >=3.5
  5. A digital camera to run camera test.

Build

  1. Replace the tensorrt and cuda path in CMakeLists.txt
  2. Configure the detection parameters in mtcnn.cpp (min face size, the nms thresholds , etc)
  3. Choose the running modes (camera test or single image test)
  4. cmake .
  5. make -j
  6. ./main

Results

The result will be like this in single image test mode:

single

Speed

On my computer with nvidia-gt730 grapic card (its performance is very very poor) and intel i5 6500 cpu, when the min face-size is set to 60 pixels, the above image costs 20 to 30ms.

TODO

Inplement the whole processing using GPU computing.

mtcnn_facedetection_tensorrt's People

Contributors

pkuzhou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.