This is the implementation of "Masked Autoencoder".
Original paper: K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick. Masked Autoencoders Are Scalable Vision Learners. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2022. link
Please build the source file according to the procedure.
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ cd ..
- Large-scale CelebFaces Attributes (CelebA) Dataset
This is a large-scale face attributes dataset with more than 200K celebrity images, each with 40 attribute annotations.
Link: official
Please create a link for the dataset.
The following hierarchical relationships are recommended.
datasets
|--Dataset1
| |--train
| | |--image1.png
| | |--image2.bmp
| | |--image3.jpg
| |
| |--valid
| |--test
|
|--Dataset2
|--Dataset3
You should substitute the path of training data for "<training_path>", test data for "<test_path>", respectively.
The following is an example for "celebA".
$ cd datasets
$ mkdir celebA
$ cd celebA
$ ln -s <training_path> ./train
$ ln -s <test_path> ./test
$ cd ../..
Please set the shell for executable file.
$ vi scripts/train.sh
The following is an example of the training phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
#!/bin/bash
DATA='celebA'
./AE2d \
--train true \
--epochs 300 \
--dataset ${DATA} \
--size 224 \
--batch_size 16 \
--gpu_id 0 \
--nc 3
Please execute the following to start the program.
$ sh scripts/train.sh
Please set the shell for executable file.
$ vi scripts/test.sh
The following is an example of the test phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
#!/bin/bash
DATA='celebA'
./AE2d \
--test true \
--dataset ${DATA} \
--test_dir "test" \
--size 224 \
--gpu_id 0 \
--nc 3
If you want to generate image, the above settings will work.
Please execute the following to start the program.
$ sh scripts/test.sh
This code is inspired by mae.