Home

Awesome

Code for "Unsupervised Discovery of Object Landmarks as Structural Representations"

Project page: http://www.ytzhang.net/projects/lmdis-rep/

The code works with TensorFlow 1.7 (but not higher than 1.7) and Python 3.6 (or higher).

Please email Yuting Zhang if any of the download links are broken.

Paper

Yuting Zhang, Yijie Guo, Yixin Jin, Yijun Luo, Zhiyuan He, Honglak Lee, "Unsupervised Discovery of Object Landmarks as Structural Representations," IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. [arxiv]

What are included

For experiment on CelebA and AFLW dataset

Data to download

For all the links, <u>please copy the link and paste it in a new window to download</u>. (Direct clicking the link may not work due to GitHub's way to handle links with redirection)

Pretrained Models to download

For all the links, <u>please copy the link and paste it in a new window to download</u>. (Direct clicking the link may not work due to GitHub's way to handle links with redirection)

The pretrained models for CelebA dataset can be obtained via this link, which detect 10 or 30 landmarks on the image.

The pretrained models for AFLW dataset can be obtained via this link, which detect 10 or 30 landmarks on the image.

The pretrained models for AFLW dataset can be obtained via this link, which detect 10 or 20 landmarks on the image.

Running ./download_celeba.sh, ./download_aflw.sh and ./download_cat.sh will automatically download pretrained models and data for experiment on each dataset. The pretrained model will be saved in pretrained_results/celeba_10, pretrained_results/celeba_30, pretrained_results/aflw_10, pretrained_results/aflw_30, pretrained_results/cat_10, pretrained_results/cat_20 . And the data will be saved in data/celeba_data, data/aflw_data, data/aflw_images, data/cat_data, data/cat_images. Note that you should download the CelebA data by yourself into data/celeba_images

Data and Model for Human3.6M

Google Drive: link

Demo on CelebA image samples using pre-trained model (quick demo)

You can run a quick demo on CelebA images.

To perform detection on other human face images, you can just put the images you are interested in into the demo/input folder, and rerun ./one_step_test_celeba_demo.sh to see the detected landmarks on these images in demo/output folder.

Training

Evaluation

In one_step_test_celeba.sh, one_step_test_aflw.sh and one_step_test_cat.sh, you can specify SPECIFIC_MODEL_DIR as the path of folder saving the trained checkpoint, and SNAPSHOT_ITER as the number of snapshot step you would like to test. If the snaphot step is not specified, the script automatically test on the lastest checkpoint.

Visualization

In vis folder, call the matlab function vppAutoKeypointImageRecon(result_path, step, sample_ids, save_to_file, type_ids)

result_path is the folder saving training results, step is the training step you want to test on (the step must be saved in corresponding test.snapshot folder), samples_ids is the id of test samples you are interested in, save_to_file is whether you would like to save the visualization figures, type_ids is 'data-encoded' or 'recon-encoded'.

For example, vppAutoKeypointImageRecon('../results/celeba_10/', 220000, 1:20, false, 'data-encoded') will visualize the discovered keypoints on test images 1~20 in test dataset.

Remarks