-
Notifications
You must be signed in to change notification settings - Fork 1
/
multires_style2content_hist_large_cp.sh
186 lines (146 loc) · 7.65 KB
/
multires_style2content_hist_large_cp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# The channel prunning can be donwloaded via:
# wget https://github.com/yihui-he/channel-pruning/releases/download/channel_pruning_5x/channel_pruning.caffemodel
# wget https://github.com/yihui-he/channel-pruning/releases/download/channel_pruning_5x/channel_pruning.prototxt
# Or you can get the PyTorch model from: https://github.com/ProGamerGov/neural-style-pt/wiki/Other-Models
INTERPRETER=python3 # Replace with 'th' for neural_style.lua or 'python' for python 2
SCRIPT=neural_style.py # Replace with 'neural_style.lua' for the original neural-style
NEURAL_STYLE=$INTERPRETER
NEURAL_STYLE+=" "
NEURAL_STYLE+=$SCRIPT
# Uncomment if using pip package
#NEURAL_STYLE=neural-style
PRUNED_MODEL="-model_file models/channel_pruning"
# PRUNED_MODEL="$PRUNED_MODEL" # Uncomment for neural_style.lua
# Histogram Matching from style image to content image
python linear-color-transfer.py --target_image $CONTENT_IMAGE --source_image $STYLE_IMAGE --output_image content_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image \
-tv_weight 0 -seed 876 -save_iter 500 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-output_image out1.png \
-image_size 640 \
-num_iterations 1500
python linear-color-transfer.py --target_image out1.png --source_image $STYLE_IMAGE --output_image out1_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out1_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 500 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-output_image out2.png \
-image_size 768 \
-num_iterations 1000
python linear-color-transfer.py --target_image out2.png --source_image $STYLE_IMAGE --output_image out2_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out2_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-image_size 1024 \
-num_iterations 500 \
-output_image out3.png \
python linear-color-transfer.py --target_image out3.png --source_image $STYLE_IMAGE --output_image out3_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out3_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-image_size 1152 \
-num_iterations 200 \
-output_image out4.png \
python linear-color-transfer.py --target_image out4.png --source_image $STYLE_IMAGE --output_image out4_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out4_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-image_size 1536 \
-num_iterations 200 \
-output_image out5.png \
python linear-color-transfer.py --target_image out5.png --source_image $STYLE_IMAGE --output_image out5_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out5_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image -backend cudnn -cudnn_autotune \
-image_size 1664 \
-num_iterations 200 \
-output_image out6.png \
python linear-color-transfer.py --target_image out6.png --source_image $STYLE_IMAGE --output_image out6_hist_colored_pca.png
# Use the channel pruning model in this step if the image dimensions are too large
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out6_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 100 -print_iter 50 -init image -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 1920 \
-num_iterations 200 \
-output_image out7.png
python linear-color-transfer.py --target_image out7.png --source_image $STYLE_IMAGE --output_image out7_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out7_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 2048 \
-num_iterations 200 \
-output_image out8.png
python linear-color-transfer.py --target_image out8.png --source_image $STYLE_IMAGE --output_image out8_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out8_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 2432 \
-num_iterations 200 \
-output_image out9.png
python linear-color-transfer.py --target_image out9.png --source_image $STYLE_IMAGE --output_image out9_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out9_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 2560 \
-num_iterations 200 \
-output_image out10.png
python linear-color-transfer.py --target_image out10.png --source_image $STYLE_IMAGE --output_image out10_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out10_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 2816 \
-num_iterations 200 \
-output_image out11.png
python linear-color-transfer.py --target_image out11.png --source_image $STYLE_IMAGE --output_image out11_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out11_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 2944 \
-num_iterations 200 \
-output_image out12.png
python linear-color-transfer.py --target_image out12.png --source_image $STYLE_IMAGE --output_image out12_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out12_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 3328 \
-num_iterations 200 \
-output_image out13.png
python linear-color-transfer.py --target_image out13.png --source_image $STYLE_IMAGE --output_image out13_hist_colored_pca.png
$NEURAL_STYLE \
-content_image content_colored_pca.png \
-style_image $STYLE_IMAGE \
-init image -init_image out13_hist_colored_pca.png \
-tv_weight 0 -seed 876 -save_iter 0 -print_iter 50 -init image $PRUNED_MODEL -backend cudnn -cudnn_autotune -optimizer adam \
-image_size 3400 \
-num_iterations 200 \
-output_image out14.png
python linear-color-transfer.py --target_image out14.png --source_image $STYLE_IMAGE --output_image out14_hist_colored_pca.png
# Luminance Transfer from histogram matched content image, to the final output
python lum-transfer.py --output_lum2 out12.png --cp_mode lum2 --output_image out12_final.png --org_content content_colored_pca.png
# Luminance Transfer from unmodified content image, to the final output
python lum-transfer.py --output_lum2 out12.png --cp_mode lum2 --output_image out12_final_2.png --org_content $CONTENT_IMAGE