Git Product home page Git Product logo

deep-head-pose-lite's Introduction

Hopenet-lite

A lite-version hopenet for head pose estimation with PyTorch

Note

Hopenet-lite uses unofficial-implement ShuffleNetV2 as backbone network, and now the lastest PyTorch contains official ShuffleNetV2 with various width. If you are seeking for stable performance, please use official implementation and re-train hopenet-lite! I have uploaded the lastest hopenet-lite model with official ShuffleNetV2 from Pytorch torchvision (Please refer to the "Update" part)
'''
import torchvision.models as models
shufflenet = models.shufflenet_v2_x1_0(pretrained=True)
...
https://pytorch.org/docs/stable/torchvision/models.html#classification

Doc.

The project is based on natanielruiz's excellent work named Hopenet.

The link: https://github.com/natanielruiz/deep-head-pose

You can run the network on CPU (i7-8700 six cores) with 35 FPS or GPU (RTX 2070) with 130 FPS

If you used natanielruiz's code in your project, then do not need to change anything except the nueral network you used. At the same time, please refer to the training code of natanielruiz's project for training your own model (if you need)

Here is a trick that affects the accuracy of model: when you get a face's box by any face detectors, cropping a proper face image as the input that may generate better results.

'''
import hopenetlite_v2
net = hopenetlite_v2.HopeNetLite()
saved_state_dict = torch.load('hopenet_lite_6MB.pkl', map_location="cpu")
net.load_state_dict(saved_state_dict, strict=False)
net.eval()
'''

The Pre-trained model in "model" folder, but the model is not very robust to image quality, we will release more robust model in the future.

Thanks for natanielruiz's excellent work again.

Update

Hi, guys, I finally have time to update this project...
I uploaded the lastest hopenet-lite model with official ShuffleNetV2 from Pytorch torchvision, you can use it like this:
'''
import stable_hopenetlite
pos_net = stable_hopenetlite.shufflenet_v2_x1_0()
saved_state_dict = torch.load('model/shuff_epoch_120.pkl', map_location="cpu")
pos_net.load_state_dict(saved_state_dict, strict=False)
pos_net.eval()
'''
The Pre-trained model named "shuff_epoch_120.pkl" in "model" folder. If you think my training is not perfect, you could re-train the model. Just enjoy yourself !

Here are some examples:




deep-head-pose-lite's People

Contributors

stevenyangyj avatar

Watchers

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