This respository includes a Caffe implementation of FAN that achieves state-of-the-art performance on CelebA and LFWA face attribute benchmark.
If this code is helpful for your research, please cite the following paper:
@article{he2018harnessing,
title={Harnessing Synthesized Abstraction Images to Improve Facial Attribute Recognition.},
author={Keke He, Yanwei Fu, Wuhao Zhang, Chengjie Wang, Yu-Gang Jiang, Feiyue Huang, Xiangyang Xue},
journal={Proceedings of the Twenty-Seventh International Joint Conference on
Artificial Intelligence, {IJCAI-18}},
pages={733-740}
year={2018}
}
Our method leverages facial parts locations for better attribute prediction. A facial abstraction is generated by a Generative Adversarial Network (GAN). Then a dual-path facial attribute network is built which accepts inputs from original images and absraction images.
- Caffe
- Linux
- NVIDIA GPU + CUDA CuDNN
Clone the github repository:
git clone https://github.com/TencentYoutuResearch/FaceAttribute-FAN
cd FaceAttribute-FANPlease download the trained models from Google drive or Baidu drive, and put it into outputs folder.
To test the dual-path model,
sh demo_dual_path.shIf you want to test your own image without synthesized abstraction image, you can
sh demo_single_path.shThe name of 40 attributes can be found at Appendix
-
To train and evaluation the model on the CelebA benchmark, please download the CelebA dataset from CelebA.
-
Please download pretrained model and synthesized abstraction images of CelebA dataset from Google drive or Baidu drive.
-
Put the original CelebA and synthesized abstraction image under the data/CelebA folder, for example:
├── CelebA │ ├── img_align_celeba │ ├── img_celeba_pix2pix
cd evaluation
sh test_dual_path_celeba.shcd models/dual_path_parse_resnet
sh train.sh40 binary attributes in CelebA dataset. Output 0: without this attribute, 1: with this attribute.
| Id | Name | Name in Chinese |
|---|---|---|
| 0 | 5_o_Clock_Shadow | 短胡子 |
| 1 | Arched_Eyebrows | 弯眉毛 |
| 2 | Attractive | 有吸引力 |
| 3 | Bags_Under_Eyes | 眼袋 |
| 4 | Bald | 秃顶 |
| 5 | Bangs | 刘海 |
| 6 | Big_Lips | 厚嘴唇 |
| 7 | Big_Nose | 大鼻子 |
| 8 | Black_Hair | 黑色头发 |
| 9 | Blond_Hair | 金色头发 |
| 10 | Blurry | 模糊 |
| 11 | Brown_Hair | 棕色头发 |
| 12 | Bushy_Eyebrows | 浓眉毛 |
| 13 | Chubby | 胖的 |
| 14 | Double_Chin | 双下巴 |
| 15 | Eyeglasses | 眼镜 |
| 16 | Goatee | 山羊胡子 |
| 17 | Gray_Hair | 灰白头发 |
| 18 | Heavy_Makeup | 浓妆 |
| 19 | High_Cheekbones | 高颧骨 |
| 20 | Male | 男性 |
| 21 | Mouth_Slightly_Open | 嘴巴微张 |
| 22 | Mustache | 胡子,髭 |
| 23 | Narrow_Eyes | 小眼睛 |
| 24 | No_Beard | 没有胡子 |
| 25 | Oval_Face | 鸭蛋脸 |
| 26 | Pale_Skin | 皮肤苍白 |
| 27 | Pointy_Nose | 尖鼻子 |
| 28 | Receding_Hairline | 发际线后移 |
| 29 | Rosy_Cheeks | 红润双颊 |
| 30 | Sideburns | 连鬓胡子 |
| 31 | Smiling | 微笑 |
| 32 | Straight_Hair | 直发 |
| 33 | Wavy_Hair | 卷发 |
| 34 | Wearing_Earrings | 戴耳环 |
| 35 | Wearing_Hat | 戴帽子 |
| 36 | Wearing_Lipstick | 涂唇膏 |
| 37 | Wearing_Necklace | 戴项链 |
| 38 | Wearing_Necktie | 戴领带 |
| 39 | Young | 年轻 |
