All Projects → yinguobing → Cnn Facial Landmark

yinguobing / Cnn Facial Landmark

Licence: mit
Training code for facial landmark detection based on deep convolutional neural network.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cnn Facial Landmark

Pytorch convlstm
convolutional lstm implementation in pytorch
Stars: ✭ 126 (-75.58%)
Mutual labels:  deep-neural-networks, cnn
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (-68.41%)
Mutual labels:  deep-neural-networks, cnn
Adnet
Attention-guided CNN for image denoising(Neural Networks,2020)
Stars: ✭ 135 (-73.84%)
Mutual labels:  deep-neural-networks, cnn
Robust Lane Detection
Stars: ✭ 110 (-78.68%)
Mutual labels:  deep-neural-networks, cnn
Yolo V2 Pytorch
YOLO for object detection tasks
Stars: ✭ 302 (-41.47%)
Mutual labels:  deep-neural-networks, cnn
Lenet 5
PyTorch implementation of LeNet-5 with live visualization
Stars: ✭ 122 (-76.36%)
Mutual labels:  deep-neural-networks, cnn
Tf Adnet Tracking
Deep Object Tracking Implementation in Tensorflow for 'Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning(CVPR 2017)'
Stars: ✭ 162 (-68.6%)
Mutual labels:  deep-neural-networks, cnn
Dltk
Deep Learning Toolkit for Medical Image Analysis
Stars: ✭ 1,249 (+142.05%)
Mutual labels:  deep-neural-networks, cnn
Hierarchical Attention Networks Pytorch
Hierarchical Attention Networks for document classification
Stars: ✭ 239 (-53.68%)
Mutual labels:  deep-neural-networks, cnn
Lcnn
LCNN: End-to-End Wireframe Parsing
Stars: ✭ 234 (-54.65%)
Mutual labels:  deep-neural-networks, cnn
Models
DLTK Model Zoo
Stars: ✭ 101 (-80.43%)
Mutual labels:  deep-neural-networks, cnn
Rmdl
RMDL: Random Multimodel Deep Learning for Classification
Stars: ✭ 375 (-27.33%)
Mutual labels:  deep-neural-networks, cnn
Pytorch Learners Tutorial
PyTorch tutorial for learners
Stars: ✭ 97 (-81.2%)
Mutual labels:  deep-neural-networks, cnn
Hyperdensenet
This repository contains the code of HyperDenseNet, a hyper-densely connected CNN to segment medical images in multi-modal image scenarios.
Stars: ✭ 124 (-75.97%)
Mutual labels:  deep-neural-networks, cnn
Cfsrcnn
Coarse-to-Fine CNN for Image Super-Resolution (IEEE Transactions on Multimedia,2020)
Stars: ✭ 84 (-83.72%)
Mutual labels:  deep-neural-networks, cnn
Livianet
This repository contains the code of LiviaNET, a 3D fully convolutional neural network that was employed in our work: "3D fully convolutional networks for subcortical segmentation in MRI: A large-scale study"
Stars: ✭ 143 (-72.29%)
Mutual labels:  deep-neural-networks, cnn
Gtsrb
Convolutional Neural Network for German Traffic Sign Recognition Benchmark
Stars: ✭ 65 (-87.4%)
Mutual labels:  deep-neural-networks, cnn
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-85.08%)
Mutual labels:  deep-neural-networks, cnn
Pyconv
Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition (https://arxiv.org/pdf/2006.11538.pdf)
Stars: ✭ 231 (-55.23%)
Mutual labels:  deep-neural-networks, cnn
Real Time Gesrec
Real-time Hand Gesture Recognition with PyTorch on EgoGesture, NvGesture, Jester, Kinetics and UCF101
Stars: ✭ 339 (-34.3%)
Mutual labels:  deep-neural-networks, cnn

cnn-facial-landmark

Facial landmarks detection based on convolution neural network.

Here is a sample gif showing the detection result.

The model is build with TensorFlow, and training code is provided so you can train your own model with your own datasets. The companion tutorial is also available, which includes background, dataset, preprocessing, model architecture, training and deployment. I tried my best to make them simple and easy to understand for beginners. Feel free to open issues when you are stuck or have some wonderful ideas to share.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

TensorFlow OpenCV Numpy

Installing

Just git clone this repo and you are good to go.

# From your favorite development directory
git clone https://github.com/yinguobing/cnn-facial-landmark.git

Train & evaluate

The following command shows how to train the model for 10 epochs.

# From the repo's root directory
python3 landmark.py \
    --train_record=train.record \
    --val_record=validation.record \
    --batch_size=32 \
    --epochs=10

Training and testing files are required to be stored as TensorFlow Record files. You can generate them by yourself, or checkout the branch features/tfrecord-marks-68 in this repository: face-mesh-generator.

git clone https://github.com/yinguobing/face-mesh-generator.git
git checkout features/tfrecord-marks-68

Export

For PC/Cloud applications

TensorFlow's SavedModel is recommended and is the default option. Use the argument --export_only to save the model.

# From the repo's root directory
python3 landmark.py --export_only=True

For Mobile/Embedded/IoT devices

These devices tend to have constrained resource and TensorFlow Lite is most suitable for this situation. However this is beyond the scope of this project. But don't worry, you will find a more comprehensive project in the next section.

Where to go next?

Once you have accomplished all the applications above, it's a good time to move on to a more advanced repo with following features:

  • Support multiple public dataset: WFLW, IBUG, etc.
  • Advanced model architecture: HRNet v2
  • Data augmentation: randomly scale/rotate/flip
  • Model optimization: quantization, pruning

Watch this demo video: HRNet Facial Landmark Detection (bilibili)

And build a better one: https://github.com/yinguobing/facial-landmark-detection-hrnet

Authors

Yin Guobing (尹国冰) - yinguobing

License

GitHub

Acknowledgments

  • The TensorFlow team for their comprehensive tutorial.
  • The iBUG team for their public dataset.

Changelog

Update 2021-03-09

A preprocessing layer was added and new model weights provided.

Update 2020-06-20

Making Keras the default way of building models.

Update 2019-08-08

A new input function is added to export the model to take raw tensor input. Use the --raw_input argument in the exporting command. This is useful if you want to "freeze" the model later.

For those who are interested in inference with frozen model on image/video/webcam, there is a lightweight module here:https://github.com/yinguobing/butterfly, check it out.

Update 2019-06-24

Good news! The code is updated. Issue #11 #13 #38 #45 and many others have been resolved. No more key error x in training, and exporting model looks fine now.

Update 2019-05-22

Thanks for your patience. I have managed to updated the repo that is used to extract face annotations and generate TFRecord file. Some bugs have been fixed and some minimal sample files have been added. Check it out here and here.

The training part(this repo) is about to be updated. I'm working on it.

Update 2019-04-22

This repository now has 199 github stars that is totally beyond my expectation. Whoever you are, wherever you are from and whichever language you speak, I want to say "Thank you!" to you 199 github friends for your interest.

Human facial landmark detection is easy to get hands on but also hard enough to demonstrates the power of deep neural networks, that is the reason I chose for my learning project. Even I had tried my best to keep a exhaustive record that turned into this repository and the companion tutorial, they are still sloppy and confusing in some parts.

The code is published a year ago and during this time a lot things have changed. TensorFlow 2.0 is coming and the exported model seems not working in the latest release of tf1.13. I think it's better to make this project up to date and keep being beneficial to the community.

I've got a full time job which costs nearly 12 hours(including traffic time) in my daily life, but I will try my best to keep the pace.

Feel free to open issues so that we can discuss in detail.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].