Advertisement
Guest User

volta-x3-hist.sh

a guest
Aug 7th, 2018
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. STYLE_IMAGE=$2
  5. CONTENT_IMAGE=$1
  6. STYLE_WEIGHT=1000
  7. STYLE_SCALE=1
  8. CONTENT_WEIGHT=5
  9. content=$(basename ${1%.*})
  10. style=$(basename ${2%.*})
  11. OUT_DIR="/Volumes/HDD/Pictures/neurout/$content-$style/"
  12. mkdir -p $OUT_DIR
  13.  
  14. th neural_style.lua \
  15. -style_image $STYLE_IMAGE \
  16. -style_weight $STYLE_WEIGHT \
  17. -style_scale $STYLE_SCALE \
  18. -content_image $CONTENT_IMAGE \
  19. -content_weight $CONTENT_WEIGHT \
  20. -print_iter 500 \
  21. -image_size 256 \
  22. -num_iterations 1000 \
  23. -model_file models/nyud-fcn32s-color-heavy.caffemodel \
  24. -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
  25. -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  26. -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  27. -optimizer lbfgs \
  28. -output_image $OUT_DIR/X0.png \
  29. -tv_weight 0.00001 \
  30. -original_colors 0 \
  31. -backend cudnn \
  32. -init random
  33.  
  34.  
  35. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  36.  
  37. python3 ../Neural-Tools/linear-color-transfer.py \
  38. --target_image $PREV \
  39. --source_image ${STYLE_IMAGE##*,} \
  40. --output_image "${PREV%.*}"-hist.png
  41.  
  42. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  43.  
  44.  
  45. th neural_style.lua \
  46. -style_image $STYLE_IMAGE \
  47. -style_weight $STYLE_WEIGHT \
  48. -style_scale $STYLE_SCALE \
  49. -content_image $CONTENT_IMAGE \
  50. -content_weight $CONTENT_WEIGHT \
  51. -init image \
  52. -init_image $PREV \
  53. -print_iter 500 \
  54. -image_size 512 \
  55. -num_iterations 1000 \
  56. -model_file models/nyud-fcn32s-color-heavy.caffemodel \
  57. -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
  58. -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  59. -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  60. -optimizer lbfgs \
  61. -output_image $OUT_DIR/X1.png \
  62. -tv_weight 0.00001 \
  63. -original_colors 0 \
  64. -backend cudnn \
  65. -init random
  66.  
  67.  
  68. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  69.  
  70. python3 ../Neural-Tools/linear-color-transfer.py \
  71. --target_image $PREV \
  72. --source_image ${STYLE_IMAGE##*,} \
  73. --output_image "${PREV%.*}"-hist.png
  74.  
  75. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  76.  
  77. STYLE_WEIGHT=100
  78. STYLE_SCALE=1
  79. CONTENT_WEIGHT=1
  80.  
  81.  
  82. th neural_style.lua \
  83. -style_image $STYLE_IMAGE \
  84. -style_weight $STYLE_WEIGHT \
  85. -style_scale $STYLE_SCALE \
  86. -content_image $CONTENT_IMAGE \
  87. -content_weight $CONTENT_WEIGHT \
  88. -init image \
  89. -init_image $PREV \
  90. -print_iter 250 \
  91. -image_size 800 \
  92. -num_iterations 500 \
  93. -model_file models/nyud-fcn32s-color-heavy.caffemodel \
  94. -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
  95. -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  96. -style_layers relu1_1,relu2_1,relu3_1,relu4_1,relu5_1 \
  97. -optimizer lbfgs \
  98. -output_image $OUT_DIR/X2.png \
  99. -tv_weight 0.00001 \
  100. -original_colors 0 \
  101. -normalize_gradients \
  102. -backend cudnn
  103.  
  104.  
  105. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  106.  
  107. python3 ../Neural-Tools/linear-color-transfer.py \
  108. --target_image $PREV \
  109. --source_image ${STYLE_IMAGE##*,} \
  110. --output_image "${PREV%.*}"-hist.png
  111.  
  112. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  113.  
  114. STYLE_WEIGHT=1000
  115. STYLE_SCALE=1
  116. CONTENT_WEIGHT=0
  117.  
  118.  
  119. th neural_style.lua \
  120. -style_image $STYLE_IMAGE \
  121. -style_weight $STYLE_WEIGHT \
  122. -style_scale $STYLE_SCALE \
  123. -content_image $CONTENT_IMAGE \
  124. -content_weight $CONTENT_WEIGHT \
  125. -output_image $OUT_DIR/X3.png \
  126. -num_iterations 200 \
  127. -model_file models/nyud-fcn32s-color-heavy.caffemodel \
  128. -proto_file models/nyud-fcn32s-color-heavy-trainval.prototxt \
  129. -optimizer adam \
  130. -print_iter 50 \
  131. -tv_weight 0 \
  132. -backend cudnn \
  133. -init image \
  134. -init_image $PREV \
  135. -learning_rate 1 \
  136. -image_size 1024 \
  137. -original_colors 0 \
  138. -normalize_gradients
  139.  
  140.  
  141. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  142.  
  143. python3 ../Neural-Tools/linear-color-transfer.py \
  144. --target_image $PREV \
  145. --source_image ${STYLE_IMAGE##*,} \
  146. --output_image "${PREV%.*}"-hist.png
  147.  
  148. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  149.  
  150.  
  151. th neural_style.lua \
  152. -style_image $STYLE_IMAGE \
  153. -style_weight $STYLE_WEIGHT \
  154. -style_scale $STYLE_SCALE \
  155. -content_image $CONTENT_IMAGE \
  156. -content_weight $CONTENT_WEIGHT \
  157. -output_image $OUT_DIR/X4.png \
  158. -num_iterations 600 \
  159. -model_file models/channel_pruning.caffemodel \
  160. -proto_file models/channel_pruning.prototxt \
  161. -optimizer adam \
  162. -print_iter 300 \
  163. -tv_weight 0 \
  164. -backend cudnn \
  165. -init image \
  166. -init_image $PREV \
  167. -learning_rate 1 \
  168. -image_size 1600 \
  169. -original_colors 0 \
  170. -normalize_gradients
  171.  
  172.  
  173. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  174.  
  175. python3 ../Neural-Tools/linear-color-transfer.py \
  176. --target_image $PREV \
  177. --source_image ${STYLE_IMAGE##*,} \
  178. --output_image "${PREV%.*}"-hist.png
  179.  
  180. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  181.  
  182.  
  183. th neural_style.lua \
  184. -style_image $STYLE_IMAGE \
  185. -style_weight $STYLE_WEIGHT \
  186. -style_scale $STYLE_SCALE \
  187. -content_image $CONTENT_IMAGE \
  188. -content_weight $CONTENT_WEIGHT \
  189. -output_image $OUT_DIR/X5.png \
  190. -model_file models/nin_imagenet_conv.caffemodel \
  191. -proto_file models/train_val.prototxt \
  192. -num_iterations 200 \
  193. -content_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
  194. -style_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
  195. -optimizer adam \
  196. -print_iter 100 \
  197. -tv_weight 0 \
  198. -backend cudnn \
  199. -init image \
  200. -init_image $PREV \
  201. -learning_rate 1 \
  202. -image_size 2550 \
  203. -original_colors 0 \
  204. -normalize_gradients
  205.  
  206.  
  207. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  208.  
  209. python3 ../Neural-Tools/linear-color-transfer.py \
  210. --target_image $PREV \
  211. --source_image ${STYLE_IMAGE##*,} \
  212. --output_image "${PREV%.*}"-hist.png
  213.  
  214. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  215.  
  216. STYLE_WEIGHT=1000
  217. STYLE_SCALE=1
  218. CONTENT_WEIGHT=0
  219.  
  220.  
  221. th neural_style.lua \
  222. -style_image $STYLE_IMAGE \
  223. -style_weight $STYLE_WEIGHT \
  224. -style_scale $STYLE_SCALE \
  225. -content_image $CONTENT_IMAGE \
  226. -content_weight $CONTENT_WEIGHT \
  227. -output_image $OUT_DIR/X6.png \
  228. -model_file models/nin_imagenet_conv.caffemodel \
  229. -proto_file models/train_val.prototxt \
  230. -num_iterations 200 \
  231. -content_layers relu0,relu1,relu2,relu3,relu5,relu6 \
  232. -style_layers relu0,relu1,relu2,relu3,relu5,relu6 \
  233. -optimizer adam \
  234. -print_iter 100 \
  235. -tv_weight 0 \
  236. -backend cudnn \
  237. -init image \
  238. -init_image $PREV \
  239. -learning_rate 1 \
  240. -image_size 2700 \
  241. -original_colors 0 \
  242. -normalize_gradients
  243.  
  244.  
  245. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  246.  
  247. python3 ../Neural-Tools/linear-color-transfer.py \
  248. --target_image $PREV \
  249. --source_image ${STYLE_IMAGE##*,} \
  250. --output_image "${PREV%.*}"-hist.png
  251.  
  252. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  253.  
  254.  
  255. th neural_style.lua \
  256. -style_image $STYLE_IMAGE \
  257. -style_weight $STYLE_WEIGHT \
  258. -style_scale $STYLE_SCALE \
  259. -content_image $CONTENT_IMAGE \
  260. -content_weight $CONTENT_WEIGHT \
  261. -output_image $OUT_DIR/X7.png \
  262. -model_file models/nin_imagenet_conv.caffemodel \
  263. -proto_file models/train_val.prototxt \
  264. -num_iterations 200 \
  265. -content_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
  266. -style_layers relu0,relu1,relu2,relu3,relu5,relu6,relu7,relu8 \
  267. -optimizer adam \
  268. -print_iter 100 \
  269. -tv_weight 0 \
  270. -backend cudnn \
  271. -init image \
  272. -init_image $PREV \
  273. -learning_rate 1 \
  274. -image_size 2900 \
  275. -original_colors 0 \
  276. -normalize_gradients
  277.  
  278.  
  279. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  280.  
  281. python3 ../Neural-Tools/linear-color-transfer.py \
  282. --target_image $PREV \
  283. --source_image ${STYLE_IMAGE##*,} \
  284. --output_image "${PREV%.*}"-hist.png
  285.  
  286. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  287.  
  288.  
  289. th neural_style.lua \
  290. -style_image $STYLE_IMAGE \
  291. -style_weight $STYLE_WEIGHT \
  292. -style_scale $STYLE_SCALE \
  293. -content_image $CONTENT_IMAGE \
  294. -content_weight $CONTENT_WEIGHT \
  295. -output_image $OUT_DIR/X8.png \
  296. -model_file models/nin_imagenet_conv.caffemodel \
  297. -proto_file models/train_val.prototxt \
  298. -num_iterations 200 \
  299. -content_layers relu0,relu1 \
  300. -style_layers relu0,relu1 \
  301. -optimizer adam \
  302. -print_iter 100 \
  303. -tv_weight 0 \
  304. -backend cudnn \
  305. -init image \
  306. -init_image $PREV \
  307. -learning_rate 1 \
  308. -image_size 4000 \
  309. -original_colors 0 \
  310. -normalize_gradients
  311.  
  312.  
  313. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  314.  
  315. python3 ../Neural-Tools/linear-color-transfer.py \
  316. --target_image $PREV \
  317. --source_image ${STYLE_IMAGE##*,} \
  318. --output_image "${PREV%.*}"-hist.png
  319.  
  320. PREV=$OUT_DIR/$(ls -t $OUT_DIR | head -n1)
  321.  
  322. STYLE_SCALE=0.5
  323.  
  324.  
  325. th neural_style.lua \
  326. -style_image $STYLE_IMAGE \
  327. -content_image $CONTENT_IMAGE \
  328. -output_image $OUT_DIR/$content-$style.png \
  329. -model_file models/nin_imagenet_conv.caffemodel \
  330. -proto_file models/train_val.prototxt \
  331. -num_iterations 20 \
  332. -content_layers relu0,relu1 \
  333. -style_layers relu0,relu1 \
  334. -optimizer adam \
  335. -print_iter 50 \
  336. -tv_weight 0 \
  337. -style_scale $STYLE_SCALE \
  338. -backend cudnn \
  339. -content_weight $CONTENT_WEIGHT \
  340. -style_weight $STYLE_WEIGHT \
  341. -init image \
  342. -init_image $PREV \
  343. -learning_rate 1 \
  344. -image_size 5000 \
  345. -original_colors 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement