You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.5 KiB

Use pyenv and poetry to set up virtualenv and run:

pyenv shell
poetry install

Turn numbered svgs into usable arrays:

python --dataset_dir datasets/naam6/

Train algorithm: (save often, as we'll use the intermediate steps)

poetry shell
#sketch_rnn_train --log_root=models/naam6 --data_dir=datasets/naam6 --hparams="data_set=[diede.npz,blokletters.npz],dec_model=layer_norm,dec_rnn_size=450,enc_model=layer_norm,enc_rnn_size=300,save_every=50,grad_clip=1.0,use_recurrent_dropout=0,conditional=True,num_steps=5000"
sketch_rnn_train --log_root=models/naam6 --data_dir=datasets/naam6 --hparams="data_set=[diede.npz,blokletters.npz,pleun.npz],dec_model=layer_norm,dec_rnn_size=450,enc_model=layer_norm,enc_rnn_size=300,save_every=50,grad_clip=1.0,use_recurrent_dropout=0,conditional=True,num_steps=5000"

Generate a card:

python --data_dir datasets/naam4 --model_dir models/naam4 --max_checkpoint_factor .8 --columns 5 --rows 13 --create_grid --last_is_target --last_in_group --target_sample 202 --output_file generated/cards/card-99x190-1.svg

generate a3 poster:

python --data_dir datasets/naam4 --model_dir models/naam4 --max_checkpoint_factor .8 --columns 15 --rows 28 --last_is_target --last_in_group --target_sample 202 --output_file generated/poster1.svg --width 297mm --height 420mm --page_margin 110
set was trained for too many iterations in order to generate a nice card (~half of the card looks already smooth), by lowering this factor, we use eg. only the first 80% (.8) iteration
Drawings that consist of mulitple strokes are split over paths, which are split over a given number of groups (see nr_of_paths)
Last item (bottom right) is not generated but hand picked from the dataset (see target_sample)
Puts the last drawing in a separate group

naam4: strokes & blokletters: 101-360 strokes only: 101-259