Code Monkey home page Code Monkey logo

dan's Introduction

Single Shot Faces Detectors in TensorFlow

This repository contains the un-official reimplementation of several single shot faces detectors in TensorFlow.

Usage

  • Download WIDER Face Dataset and reorganize the directory as follows:

     WIDER Face Dataset/
        |->WIDER_train/
        |    |->images/
        |    |->...
        |->WIDER_val/
        |    |->images/
        |    |->...
        |->WIDER_test/
        |    |->images/
        |    |->...
        |->wider_face_split/
        |    |->wider_face_train.mat
        |    |->...
     '''
     WIDER_ROOT is your path of the WIDER Face Dataset.
    
  • Run the following script to generate TFRecords.

     python dataset/convert_tfrecords.py --dataset_directory=WIDER_ROOT --output_directory=./dataset/tfrecords
  • Download the pre-trained VGG-16 model (reduced-fc) from here and put them into one sub-directory named 'model' (we support SaverDef.V2 by default, the V1 version is also available for sake of compatibility).

  • Compile custom operations, run following command in directory 'cpp/Deform' and 'cpp/ExtraLib':

     mkdir build
     cd build && cmake ..
     make
  • Run the following script to start training:

     python train_dan.py (or python train_pb.py for PyramidBox, or python train_sfd.py for S³FD)
  • Run the following script to get detection results in *.txt (modify the WIDER_ROOT in 'data_dir' firstly):

     python eval_dan.py (or python eval_pb.py for PyramidBox, or python eval_sfd.py for S³FD)
  • Run the official MATLAB script for evaluation

All the codes was tested under TensorFlow 1.8, Python 3.5, Ubuntu 16.04 with CUDA 8.0. You need at least two decent GPUs for training by yourself.

Framework

The whole framework:

Low-level FPN:

Context module V2:

Context module V1:

Results

Reproduced results are list as follows:

Algorithm Easy Medium Hard
S³FD 0.933 0.923 0.848
PyramidBox 0.955 0.946 0.888
DAN 0.958 0.946 0.895
DAN-Deform 0.957 0.947 0.897

The performance of PyramidBox could be further improved by using transposed convolution in LFPN and tuning the weight of losses. While the training peroid is too long to perform more experiments.

Easy:

Medium:

Hard:

You can download the trained model of DAN from GoogleDrive.

Discussion

Welcome to join in QQ Group(758790869) for more discussion

Apache License, Version 2.0

dan's People

Contributors

hikapok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dan's Issues

执行训练脚本,出现loss为NAN情况。

您好!在执行训练脚本时,第一个step或者第二个step就出现了loss为NAN情况,通过打印tensor值发现时网络预测值出现NAN导致,请问您在训练中出现这种情况吗?如何解决呢? 目前使用的TF1.15。

cmake & make error in deform

Hi, thanks for sharing the code.

I tried to train the models with the codes provided, but encountered an error when building the "deform" library.

When I type cmake .. and make in deform/build directory, I encounter with the following error message. Could you give me some advice an how to solve the error, or what CUDA version and GPU you are using?
(I am using GTX 1080 Ti and CUDA 9.0, by the way).

Would really appreciate if you could give me some help!

1 error detected in the compilation of "/home/johnyi/Documents/DAN-master/cpp/Deform/build/deform_psroi_pooling_op_gpu.cpp1.ii".
CMake Error at cuda_compile_2_generated_deform_psroi_pooling_op_gpu.cu.o.cmake:280 (message):
Error generating file
/home/johnyi/Documents/DAN-master/cpp/Deform/build/CMakeFiles/cuda_compile_2.dir//./cuda_compile_2_generated_deform_psroi_pooling_op_gpu.cu.o

CMakeFiles/deform.dir/build.make:70: recipe for target 'CMakeFiles/cuda_compile_2.dir/cuda_compile_2_generated_deform_psroi_pooling_op_gpu.cu.o' failed
make[2]: *** [CMakeFiles/cuda_compile_2.dir/cuda_compile_2_generated_deform_psroi_pooling_op_gpu.cu.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/deform.dir/all' failed

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.