Giter Site home page Giter Site logo

dreadlord1984 / cnn_face_detection-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liumusicforever/cnn_face_detection

0.0 3.0 0.0 1.28 MB

Repository for "A Convolutional Neural Network Cascade for Face Detection", implemented with Python interface.

License: MIT License

Python 100.00%

cnn_face_detection-1's Introduction

CNN_Face_Detection

Repository for "A Convolutional Neural Network Cascade for Face Detection", implemented with Python interface.

About

This repo implemented the paper in python/tensorflow , providing the interface to contruct the cascade structure , including function of detection networks , calibration networks , image pyramids and non maximum supression .

Requirement

Useful Operations

  • Import Detector
# make sure detection.py is in program folder
from  detection import Detector
# given paths from both models to Detector , and It will load the model on 
# your memory (or gpu memory).
det_mod_path = 'models/det_net_<epoch num>.ckpt'
cal_mod_path = 'models/cal_net_<epoch num>.ckpt'
detector = Detector(det_mod_path,cal_mod_path)
  • Processing image pyramids
# bboxes is all bounding boxes of sliding windows , It’s include position
# and probability of face (default is -0.1)
# bboxes = [<xmin> , <ymin> , <xmax> , <ymax> , <probability>]
bboxes = detector.img_pyramids(image)
  • Non Maximum Suppression
# iou_thresh is the overlapping threshold of iou in non maximum suppression 
# In returning bboxes , function will set the box’s probability = 0.0 which have 
# been filtered.
bboxes = detector.non_max_sup(bboxes,iou_thresh = 0.5)
  • Predict the bounding boxes on detection/calibration net
# predict function will predict all the bounding boxes which probability is not 
# zero , function will set the box’s probability from prediction and return the 
# final bboxes .
# flags of net :  ‘net12’ , ‘net24’ , ‘net48’ , ‘net12_cal’ , ‘net24_cal’ , ‘net48_cal’ .
# threshold : the threshold of preditction.
bboxes = detector.predict(img,bboxes,net = 'net12',threshold = 0.9)

Results

image

Implementation Issue

12-net and 24-net is too small ?

When I was training models , finding size of 12-net and 24-net was so hard to convergence , maybe the size of network is too small to learn pattern , so I change network size of net12 and net24 to 48*48 finally. But still confuse about it !

Necessary for calibration network ?

The accuracy of the calibration almost only 0.8 , It result the calibration of bounding box after network may making mistake , and bounding box will be removed in next stage , so sometimes I have better result without calibration net.

License

MIT LICENSE

Reference

Haoxiang Li, Zhe Lin, Xiaohui Shen, Jonathan Brandt, Gang Hua ; A Convolutional Neural Network Cascade for Face Detection ; The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 5325-5334

cnn_face_detection-1's People

Contributors

liumusicforever avatar

Watchers

James Cloos avatar DL avatar  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.