Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Training code for facial landmark detection based on deep convolutional neural network.
| Date | Stars |
|---|---|
| 2026-07-24 | 645 |
| 2026-07-25 | 645 |
| 2026-07-28 | 645 |
| 2026-07-30 | 645 |
| 2026-07-31 | 645 |
| 2026-08-06 | 645 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 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](https://yinguobing.com/facial-landmark-localization-by-deep-learning-background/), 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



### Installing
Just git clone this repo and you are good to go.
```bash
# 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.
```bash
# 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](https://github.com/yinguobing/face-mesh-generator).
```bash
git clone https://github.com/yinguobing/face-mesh-generator.git
git checkout features/tfrecord-marks-68
```
## Export
### For PC/Cloud applications
TensorFlow's [SavedModel](https://www.tensorflow.org/guide/saved_model) is recommended and is the default option. Use the argument `--export_only` to save the model.
```bash
# 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)](https://www.bilibili.com/video/BV1Vy4y1C79p/)
And build a better one: https://github.com/yinguobing/facial-landmark-detection-hrnet
## Authors
Yin Guobing (尹国冰) - [yinguobing](https://github.com/yinguobing/)

## License

## 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 trainingExcerpt of 5,530 characters
Read on GitHub107
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:4aebfea670fd037d, topic:tensorflow