- Download and extract IMDB faces and WIKI faces respectively using
python download_imdb_wiki.py
- (Optional) We have provided required IMDB-WIKI-DIR meta file
imdb_wiki.csv
to set up balanced val/test set in folder./data
. To reproduce the results in the paper, please directly use this file. You can also generate it using
python data/create_imdb_wiki.py
python data/preprocess_imdb_wiki.py
- PyTorch (>= 1.2, tested on 1.6)
- tensorboard_logger
- numpy, pandas, scipy, tqdm, matplotlib, PIL, wget
Train a vanilla model as the base model:
python train.py
Alternatively, a pretrained base model can be downloaded from here.
# preprocess gmm
python preprocess_gmm.py
python train.py \
--balanced_metric \
--bmse --imp gai --init_noise_sigma 10. --gmm gmm.pkl \
--sigma_lr 0.01 \
--retrain_fc --pretrained <path_to_base_model_ckpt> \
--lr 0.0001 --epoch 10
python train.py \
--balanced_metric \
--bmse --imp bmc --init_noise_sigma 10. \
--retrain_fc --pretrained <path_to_base_model_ckpt> \
--lr 0.0001 --epoch 10
python train.py \
--balanced_metric \
--bmse --imp bni --init_noise_sigma 10. \
--sigma_lr 0.01 \
--retrain_fc --pretrained <path_to_base_model_ckpt> \
--lr 0.0001 --epoch 10
python train.py [...evaluation model arguments...] --evaluate --resume <path_to_evaluation_ckpt>
We provide below reproduced results on IMDB-WIKI-DIR (base method Vanilla
, metric MAE
).
Model | Overall | Many-Shot | Medium-Shot | Few-Shot | Download |
---|---|---|---|---|---|
Vanilla | 13.923 | 7.323 | 15.925 | 32.778 | model |
GAI | 12.690 | 7.589 | 12.880 | 28.307 | model |
BMC | 12.654 | 7.649 | 12.689 | 28.097 | model |
BNI | 12.650 | 7.647 | 12.696 | 28.077 | model |