summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--neural_style.py8
-rw-r--r--stylize_image.sh3
2 files changed, 6 insertions, 5 deletions
diff --git a/neural_style.py b/neural_style.py
index 2f9673f..b62de21 100644
--- a/neural_style.py
+++ b/neural_style.py
@@ -203,9 +203,9 @@ def parse_args():
args = parser.parse_args()
# normalize weights
- args.style_layer_weights = norm(args.style_layer_weights)
- args.content_layer_weights = norm(args.content_layer_weights)
- args.style_imgs_weights = norm(args.style_imgs_weights)
+ args.style_layer_weights = normalize(args.style_layer_weights)
+ args.content_layer_weights = normalize(args.content_layer_weights)
+ args.style_imgs_weights = normalize(args.style_imgs_weights)
# create directories for output
if args.video:
@@ -534,7 +534,7 @@ def read_weights_file(path):
weights = np.dstack([vals.astype(np.float32)] * 3)
return weights
-def norm(weights):
+def normalize(weights):
return [float(i)/sum(weights) for i in weights]
def maybe_make_directory(dir_path):
diff --git a/stylize_image.sh b/stylize_image.sh
index 7c6f021..20e4ae9 100644
--- a/stylize_image.sh
+++ b/stylize_image.sh
@@ -40,4 +40,5 @@ python neural_style.py \
--content_img_dir "${content_dir}" \
--style_imgs "${style_filename}" \
--style_imgs_dir "${style_dir}" \
---device "${device}"; \ No newline at end of file
+--device "${device}" \
+--verbose; \ No newline at end of file