Coder Social home page Coder Social logo

hhy5277 / tiny_faces_in_tensorflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cydonia999/tiny_faces_in_tensorflow

0.0 1.0 0.0 4.05 MB

A Tensorflow Tiny Face Detector, implementing "Finding Tiny Faces"

Home Page: https://arxiv.org/abs/1612.04402

License: MIT License

Python 100.00%

tiny_faces_in_tensorflow's Introduction

Tiny Face Detector in TensorFlow

A TensorFlow port(inference only) of Tiny Face Detector from authors' MatConvNet codes[1].

Requirements

Codes are written in Python. At first install Anaconda. Then install OpenCV, TensorFlow.

Usage

Converting a pretrained model

matconvnet_hr101_to_pickle reads weights of the MatConvNet pretrained model and write back to a pickle file which is used in a TensorFlow model as initial weights.

  1. Download a ResNet101-based pretrained model(hr_res101.mat) from the authors' repo.

  2. Convert the model to a pickle file by:

python matconvnet_hr101_to_pickle.py 
        --matlab_model_path /path/to/pretrained_model 
        --weight_file_path  /path/to/pickle_file

Tesing Tiny Face Detector in TensorFlow

  1. Prepare images in a directory.

  2. tiny_face_eval.py reads images one by one from the image directory and write images to an output directory with bounding boxes of detected faces.

python tiny_face_eval.py
  --weight_file_path /path/to/pickle_file
  --data_dir /path/to/input_image_directory
  --output_dir /path/to/output_directory

Neural network diagram

This(pdf) is a network diagram of the ResNet101-based model used here for an input image(height: 1150, width: 2048, channel: 3).

Examples

Though this model is developed to detect tiny faces, I apply this to several types of images including 'faces' as experiments.

selfie with many people

This is the same image as one in the authors' repo[1].

selfie

Original image

selfie of celebrities

selfie

Original image

selfie of "celebrities"

Homer and "Meryl Streep" are missed.

selfie

Original image

zombies

selfie

Original image

monkeys

selfie

Original image

dogs

selfie

Original image

cats

selfie

Original image

figure1 from a paper[2]

selfie

figure8 from a paper[2].

Facebook's face detector failed to detect these faces(as of the paper publication date[14 Feb 2016]).

selfie

figure3 from a paper[2]

selfie

figure6 from a paper[2]

selfie

Acknowledgments

Disclaimer

Codes are tested only on CPUs, not GPUs.

References

  1. Hu, Peiyun and Ramanan, Deva, Finding Tiny Faces, The IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2017). project page, arXiv

  2. Michael J. Wilber, Vitaly Shmatikov, Serge Belongie, Can we still avoid automatic face detection, 2016. arXiv

tiny_faces_in_tensorflow's People

Contributors

cydonia999 avatar

Watchers

 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.