Fine-tunes a ResNet50 (pretrained on imagenet) network by training on WikiArt images labeled with eight art composition attributes. Used with https://github.com/hollygrimm/cyclegan-keras-art-attrs to generate art.
Please read the accompanying blog post: https://hollygrimm.com/acan_final
- keras
- scikit-learn
- pillow
- Select Deep Learning AMI (Ubuntu) Version 13.0
- Instance Type
GPU Compute
such as p2.xlarge - 125GB sda1
Connect to instance, copy contents of acan-aws-setup.sh to file in /home/ubuntu and run:
vi acan-aws-setup.sh
chmod +x acan-aws-setup.sh
./aws-setup.sh
download test.tgz and train.tgz from https://github.com/zo7/painter-by-numbers/releases/tag/data-v1.0
cd data
tar -xvf test.tgz
tar -xvf train.tgz
Example attribute data has been supplied for four examples in all_domain.csv. For best results, modify all_domain.csv and label more images with attributes.
base_lr
: float learning rate default is 1e-04optimizer
: eitheradam
oradagrad
batch_size
: integer batch size appropriate for your GPU size- 30 for 8GB GPU
nb_epoch
: integer number of epochsvalidation_split
: float split training and validation set
source activate tensorflow_p36
cd art-composition-cnn/
python main.py -c input_params.json
source activate tensorflow_p36
cd art-composition-cnn/experiments/
tensorboard --logdir=.
Update weights_path with selected hdf5 from training:
vi input_params_for_inference.json
Run inference:
python
import main
main.infer()
cd tests
python art_composition_cnn_tests.py