Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- STYLE_IMAGE=$2
- CONTENT_IMAGE=$1
- STYLE_WEIGHT=1000
- STYLE_SCALE=1
- CONTENT_WEIGHT=5
- content=$(basename ${1%.*})
- style=$(basename ${2%.*})
- OUT_DIR="/Volumes/HDD/Pictures/neurout/$content-$style/"
- mkdir -p $OUT_DIR
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -print_iter 500 \
- -image_size 256 \
- -num_iterations 1000 \
- -model_file models/nyud-fcn32s-color-heavy.caffemodel \
- -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
- -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -optimizer lbfgs \
- -output_image $OUT_DIR/X0.png \
- -tv_weight 0.00001 \
- -original_colors 0 \
- -backend cudnn \
- -init random
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -init image \
- -init_image $PREV \
- -print_iter 500 \
- -image_size 512 \
- -num_iterations 1000 \
- -model_file models/nyud-fcn32s-color-heavy.caffemodel \
- -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
- -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -optimizer lbfgs \
- -output_image $OUT_DIR/X1.png \
- -tv_weight 0.00001 \
- -original_colors 0 \
- -backend cudnn \
- -init random
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- STYLE_WEIGHT=100
- STYLE_SCALE=1
- CONTENT_WEIGHT=1
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -init image \
- -init_image $PREV \
- -print_iter 250 \
- -image_size 800 \
- -num_iterations 500 \
- -model_file models/nyud-fcn32s-color-heavy.caffemodel \
- -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
- -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
- -optimizer lbfgs \
- -output_image $OUT_DIR/X2.png \
- -tv_weight 0.00001 \
- -original_colors 0 \
- -normalize_gradients \
- -backend cudnn
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- STYLE_WEIGHT=1000
- STYLE_SCALE=1
- CONTENT_WEIGHT=0
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X3.png \
- -num_iterations 200 \
- -model_file models/nyud-fcn32s-color-heavy.caffemodel \
- -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
- -optimizer adam \
- -print_iter 50 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 1024 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X4.png \
- -num_iterations 600 \
- -model_file models/channel_pruning.caffemodel \
- -proto_file models/channel_pruning.prototxt \
- -optimizer adam \
- -print_iter 300 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 1600 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X5.png \
- -model_file models/nin_imagenet_conv.caffemodel \
- -proto_file models/train_val.prototxt \
- -num_iterations 200 \
- -content_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
- -style_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
- -optimizer adam \
- -print_iter 100 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 2550 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- STYLE_WEIGHT=1000
- STYLE_SCALE=1
- CONTENT_WEIGHT=0
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X6.png \
- -model_file models/nin_imagenet_conv.caffemodel \
- -proto_file models/train_val.prototxt \
- -num_iterations 200 \
- -content_layers relu0,relu1,relu2,relu3,relu5,relu6 \
- -style_layers relu0,relu1,relu2,relu3,relu5,relu6 \
- -optimizer adam \
- -print_iter 100 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 2700 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X7.png \
- -model_file models/nin_imagenet_conv.caffemodel \
- -proto_file models/train_val.prototxt \
- -num_iterations 200 \
- -content_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
- -style_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
- -optimizer adam \
- -print_iter 100 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 2900 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -style_weight $STYLE_WEIGHT \
- -style_scale $STYLE_SCALE \
- -content_image $CONTENT_IMAGE \
- -content_weight $CONTENT_WEIGHT \
- -output_image $OUT_DIR/X8.png \
- -model_file models/nin_imagenet_conv.caffemodel \
- -proto_file models/train_val.prototxt \
- -num_iterations 200 \
- -content_layers relu0,relu1 \
- -style_layers relu0,relu1 \
- -optimizer adam \
- -print_iter 100 \
- -tv_weight 0 \
- -backend cudnn \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 4000 \
- -original_colors 0 \
- -normalize_gradients
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- python3 ../Neural-Tools/linear-color-transfer.py \
- --target_image $PREV \
- --source_image ${STYLE_IMAGE##*,} \
- --output_image "${PREV%.*}"-hist.png
- PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
- STYLE_SCALE=0.5
- th neural_style.lua \
- -style_image $STYLE_IMAGE \
- -content_image $CONTENT_IMAGE \
- -output_image $OUT_DIR/$content-$style.png \
- -model_file models/nin_imagenet_conv.caffemodel \
- -proto_file models/train_val.prototxt \
- -num_iterations 20 \
- -content_layers relu0,relu1 \
- -style_layers relu0,relu1 \
- -optimizer adam \
- -print_iter 50 \
- -tv_weight 0 \
- -style_scale $STYLE_SCALE \
- -backend cudnn \
- -content_weight $CONTENT_WEIGHT \
- -style_weight $STYLE_WEIGHT \
- -init image \
- -init_image $PREV \
- -learning_rate 1 \
- -image_size 5000 \
- -original_colors 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement