Giter Club home page Giter Club logo

deep_headpose_tf's Introduction

Deep_headpose-tensorflow

This is a TensorFlow implementation of Fine-Grained Head Pose Estimation Without Keypoints .

Prerequisites

  1. You need a CUDA-compatible GPU to train the model.
  2. You should first download 300W-LP for head pose estimation.

Dependencies

  • TensorFlow 1.4.1
  • TF-Slim
  • Python3.6
  • Ubuntu 16.04
  • Cuda 8.0

Contents

  1. Setup_data
  2. Training
  3. Demo
  4. Models

Setup_data

Use the script python utils/data_preprocess.py to generate your own annotation file and face images from 300W-LP dataset. One row for one image;
Row format: image_file_path pitch raw roll;
Here is an example:

LFPW_image_test_0236_16_1.jpg,-83.1405049927369,-12.156124797978574,-2.719337151759615
LFPW_image_train_0095_5_2.jpg,-31.33569213834624,-8.705391993430364,19.86217644601874
...

Or you can use my annotation files 300W_LP_headpose_anno.txt under the folder data/ directly.

Training

  • Download pre-trained models and weights of backbones.The current code supports VGG16/ResNet_V1/MobileNet_Series models.

  • Pre-trained models are provided by slim, you can get the pre-trained models from Google Driver or BaiduYun Driver. Uzip and place them in the folder data/imagenet_weights. For example, for VGG16 model, you also can set up like:

    mkdir -p data/imagenet_weights
    cd data/imagenet_weights
    wget -v http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
    tar -xzvf vgg_16_2016_08_28.tar.gz
    mv vgg_16.ckpt vgg16.ckpt
    cd ../..

    For ResNet101, you can set up like:

    mkdir -p data/imagenet_weights
    cd data/imagenet_weights
    wget -v http://download.tensorflow.org/models/resnet_v1_101_2016_08_28.tar.gz
    tar -xzvf resnet_v1_101_2016_08_28.tar.gz
    mv resnet_v1_101.ckpt res101.ckpt
    cd ../..
  • Train Run python trainval_net.py to train the model.

python trainval_net.py \
    --cfg experiment/cfg/mobile.yml \
    --weight data/imagenet_weights/mobile.ckpt \
    --gpu_id 0 \
    --data_dir /home/oeasy/Downloads/dataset/head_pose/300W_LP_headpose \
    --annotation_path /home/oeasy/PycharmProjects/deep-head-pose-tf/300W_LP_headpose_anno.txt \
    --net mobile

Please see details in the script trainval_net.py. By default, trained networks are saved under:

output/[NET]/[DATASET]/default/

Test outputs are saved under:

output/[NET]/[DATASET]/default/[SNAPSHOT]/

Tensorboard information for train and validation is saved under:

tensorboard/[NET]/[DATASET]/default/
tensorboard/[NET]/[DATASET]/default_val/
  • For ckpt demo Download trained models from Models, then uzip to the folder output/, modify your path of trained model run python tools/demo.py directly.

  • For frozen graph inference Download the pb models(contained in Models) or frozen your model by yourself using script tools/convert_ckpt_to_pb.py, modify your path of trained model, then run python tools/inference.py.

Models

Under updating...

deep_headpose_tf's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.