Freelance nerd, writer, environment builder. Did Plasma Physics.

Fast Image Style Transfer

Gonna try to transfer the style of a woodcut to other images.

Training

Download COCO2014 images.

wget --progress=dot:giga -P /results/ \
  http://images.cocodataset.org/zips/val2014.zip \
  http://images.cocodataset.org/zips/test2014.zip \
  http://images.cocodataset.org/annotations/annotations_trainval2014.zip \
  http://images.cocodataset.org/annotations/image_info_test2014.zip
annotations_trainval2014.zip
image_info_test2014.zip
test2014.zip
val2014.zip
mkdir -p coco
cd coco
unzip -q 
test2014.zip
unzip -q
test2014.zip

Train (~2 hours on a P100).

cd /examples/fast_neural_style
python neural_style/neural_style.py train --dataset /coco --cuda 1 \
  --save-model-dir /results --checkpoint-model-dir /shared \
  --style-image 
FlammarionWoodcut-crop.png
\ --epochs 2 --batch-size 14 --log-interval 280 --checkpoint-interval 2000 \ --content-weight 1e5 --style-weight 1e10
epoch_2_Tue_Sep_17_05:29:12_2019_100000.0_10000000000.0.model

Style Transfer

An Antikythera Mechanism recreation.

cd /examples/fast_neural_style
python neural_style/neural_style.py eval --cuda 0 \
  --model 
Antikythera_model_front_panel_Mogi_Vicentini_2007.JPG
\ --content-image
Antikythera_model_front_panel_Mogi_Vicentini_2007.JPG
\ --output-image /results/out.jpg

Woah.

Brutalist architecture.

cd /examples/fast_neural_style
python neural_style/neural_style.py eval --cuda 0 \
  --model 
812px-NLNZ_ext_5.jpg
\ --content-image
812px-NLNZ_ext_5.jpg
\ --output-image /results/out.jpg

Gears in a printing press.

cd /examples/fast_neural_style
python neural_style/neural_style.py eval --cuda 0 \
  --model 
PIXNIO-206511-725x483.jpeg
\ --content-image
PIXNIO-206511-725x483.jpeg
\ --output-image /results/out.jpg