Giter Site home page Giter Site logo

hopenet's Introduction

Hopenet



**Hopenet**是一个准确且易于使用的头部姿势估计网络。 在300W-LP数据集上对模型进行了训练,并在具有良好定性性能的真实数据上进行了测试。

有关方法和定量结果的详细信息,请检查CVPR会议论文paper.



### Install
conda create -n deep-head-pose python=3.6
conda activate deep-head-pose 
pip install -r requirements.txt

Datasets

数据集下载网址

下载300W-LP数据集以及AFLW2000-3D数据集来重现实验操作

Train & Test

由于dataloader需要读取txt文件中的图片路径,先要通过代码提取出所有数据的路径,在更改好数据集路径后运行文件路径提取:

python code/dataset_300W.py
# Or
python code/dataset_AFLW.py

训练模型可以通过运行bash code/train_<model>.sh实现,注意要指定数据集所在的路径,或者通过命令行进行训练:

python code/train_hopenet.py --data_dir PATH_OF_DATASET --filename_list LIST_FILE --dataset TYPE_OF_DATASET --lr LEARN_RATE --alpha ALPHA --gpu GPU_ID --num_epochs NUM_EPOCH --batch_size BATCH_SIZE 

训练模型后需要进行测试,可以参考code/test_<model>.sh,注意提取的snapshot的路径,通过命令行进行测试:

python test_hopenet.py --data_dir PATH_OF_DATASET --filename_list LIST_FILE --dataset TYPE_OF_DATASET --snapshot <SNAPSHOT_PATH>/<PKL_FILENAME>.pkl --gpu GPU_ID

使用dlib人脸检测在视频上进行测试(头部中心会跳动):

python code/test_on_video_dlib.py --snapshot PATH_OF_SNAPSHOT --face_model PATH_OF_DLIB_MODEL --video PATH_OF_VIDEO --output_string STRING_TO_APPEND_TO_OUTPUT --n_frames N_OF_FRAMES_TO_PROCESS --fps FPS_OF_SOURCE_VIDEO

也可以在单张图片上进行测试,作为我们实验结果展示的补充手段,方便进行快速的查看:

python code/test_on_image.py --snapshot PATH_OF_SNAPSHOT --input PATH_OF_IMAGE --out_dir PATH_OF_OUTPUT_DIR

Pre-trained models

官方的预训练模型的链接如下:

300W-LP, alpha 1

300W-LP, alpha 2

300W-LP, alpha 1, robust to image quality

我们进行实验,下面将展示从头开始训练出来的最好的模型以及对上述官方模型中的300W-LP, alpha 1进行再训练优化后的最好结果:

300W-LP,lr1e-5, alpha1,epoch5

300W-LP,lr1e-6,alpha1,epoch5,pretrained

Cite

如果你应用Hopennet且觉得非常有效,请在使用处标明:

@InProceedings{Ruiz_2018_CVPR_Workshops,
author = {Ruiz, Nataniel and Chong, Eunji and Rehg, James M.},
title = {Fine-Grained Head Pose Estimation Without Keypoints},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2018}
}

Nataniel Ruiz, Eunji Chong, James M. Rehg

Georgia Institute of Technology

hopenet's People

Contributors

counterfactualsimulation avatar icegreenlhd avatar natanielruiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hopenet's Issues

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.